Instructions: f(x) is any probability density function written in JavaScript format. That is, f(x) >= 0 for all x in the interval [a, b]. The area under the function need not be 1 since the drawings are shown to scale. The endpoints left (a) and right (b) must be finite. Press Graph to view. Examples: (1) f(x) = x*x, a = -2, and b = 2 (2) f(x) = 1, [a, b] = [0, 1] - uniform distribution (3) f(x) = Math.exp(-x), [a, b] = [0, 10] - truncated exponential |
---|