Probability 05 Continuous Random Variable n n Independent
Probability 05. Continuous Random Variable n n Independent random variable Mean and variance n 郭俊利 2009/03/30 1
Outline n Review n n Probability Problem 2. 42 Exponential random number Normal random number CDF 2. 7 ~ 3. 3 (Cumulative Distribution Function) 2
Problem 2. 42 n Probability Computational problem. Here is a probabilistic method for computing the area of given subset S of the unit square. The method uses a sequence of independent random selections of points in the unit square [0, 1] x [0, 1], according to a uniform probability law. If the ith point belongs to the subset S the value of a random variable Xi is set to 1, and otherwise it is set to 0. Let X 1, X 2, … be the sequence of random variables thus defined, and for any n, let X 1 + X 2 + … + Xn Sn = n (a) Show that E[Sn] is equal to the area of the subset S, and that var(Sn) diminishes to 0 as n increases. (b) Show that to calculate Sn, it is sufficient to know Sn-1 and Xn, so the past values of Xk, k = 1, …, n – 1, do not need to be remembered. Give a formula. (c) Write a computer program to generate Sn for n = 1, 2, …, 10000, using the computer’s random number generator, for the case where the subset S is the circle inscribed within the unit square. How can you use your program to measure experimentally the value of π? (d) Use a similar computer program to calculate approximately the area of the set of all (x, y) that lie within the unit square and satisfy 0 ≦ cosπx + sinπy 3 ≦ 1.
Solution 2. 42 n My solution (2/3) Probability (解錯別打我): S . . i=1~n = 1 ~ 40 Xi = 1 or 0 Xi is a random variable, Sn is a random variable. . . . . P(Xi = 1) = 18/40 P(Xi = 1) = Area(S) / 給定範圍 = Area(S) Area( [0, 1] x [0, 1] ) = 1 5
Solution 2. 42 (3/3) Probability 6
Continuous Random Variable Probability n Uniform (Lecture 8) ∫f. X(x) dx = 1 ∫x f. X(x) dx = E[X] PDF f. X(x) = (2) E[X] = (3) var(X) = (1) , a≦x≦b 7
Example 1 n Probability Computer’s lifetime is a random variable (unit: hour). f(x) = n (PDF) { 0 100 / x 2 , x≦ 100 , x > 100 Five computers construct a network server = P(X ≧ a) – P(X ≧ b) (1) (2) (3) (4) A A computer is down at 150 th hour. computer is down before 200 th hour. server is crash before 700 th hour. 8
Exponential random number n n Probability f(x) = λe–λx P(x ≧ a) =∫a∞ λe–λx dx = –e–λx | a∞ = e–λa E[X] = 1 / λ var(X) = 1 / λ 2 (E[X 2] = 2 / λ 2) 9
Example 2 n (Exponential) Probability The spent time of work is modeled as an exponential random variable. The average time that Xiao-Ming completes the task is 10 hours. What is the probability that Xiao-Ming has done this task early (in advance)? 10
Cumulative Distribution Function Probability d. Fx f(x) = (x) dx p(k) = P(X ≦ k) – P(X ≦ k– 1) = F(k) – F(k– 1) 11
Normal random number Probability 0 aμ + b a 2 σ2 12
Example 3 n N(–a) = P(Y ≦ –a) = P(Y ≧ a) = 1 – P(Y ≦ a) N(–a) = 1 – N(a) CDF n n Probability Standard normal distribution n n (Normal) a–μ P(X ≦ a) = P(Y ≦ σ ) = N( σ ) The annual rainfall is modeled as a normal random variable with a mean = 600 mm and a standard deviation = 200. What is the probability that this year’s rainfall will be at least 800 mm? 13
- Slides: 13