View
220
Download
0
Embed Size (px)
Citation preview
1
Probability
05. Continuous Random Variable
Independent random variableMean and variance
郭俊利 2009/03/30
2
ProbabilityOutline
Review Problem 2.42
Exponential random number
Normal random number
CDF(Cumulative Distribution Function)
2.7 ~ 3.3
3
ProbabilityProblem 2.42
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 X1, X2, … be the sequence of random variables thus defined, and for any n, let
(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
1.≦
Sn = X1 + X2 + … + Xn
n
4
ProbabilitySolution 2.42 (1/3)
我的翻譯 (my translation, 翻錯別打我 ):有種機率算法是計算一個 S 的面積 (S 在給定範圍 unit square 內 ) ,每次選取的點 ith 會落在 [0, 1] x [0, 1] 中 ( 並且 ith 是 uniform 且 independent) ,如果點 ith 落在 S 裡, Xi 就等於 1 ,否則 Xi = 0 ,又
(a) 計算 E[Sn] 和 var(Sn)(b) 發現 Sn 不用管 X1 ~ Xn – 1 ,可以用 Sn – 1 和 Xn 表示 Sn
(c) 可以用程式語言寫一個遞迴求 Sn ,設 Sn 是一個圓形,從 n = 1 ~ 10000 推敲出 π 值
(d) 算出符合 0 cosπ≦ x + sinπy 1 ≦ 這樣式子的所有 (x, y) 組合成的面積
Sn = X1 + X2 + … + Xn
n
5
ProbabilitySolution 2.42 (2/3)
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
My solution ( 解錯別打我 ):
6
ProbabilitySolution 2.42 (3/3)
7
ProbabilityContinuous Random Variable
Uniform (Lecture 8)
(1) PDF fX(x) = , a x≦ ≦b
(2) E[X] =
(3) var(X) =
∫fX(x) dx = 1∫x fX(x) dx = E[X]
8
ProbabilityExample 1 (PDF)
Computer’s lifetime is a random variable (unit: hour).
Five computers construct a network server
(1) A computer is down at 150th hour.(2) A computer is down before 150th hour.(3) A computer is down before 200th hour.(4) A server is crash before 700th hour.
f(x) = 0 , x 100≦ 100 / x2 , x > 100{
= P(X a) – P(X b)≧ ≧
9
ProbabilityExponential random number
f(x) = λe–λx
P(x a) =∫≧ a∞ λe–λx dx
= –e–λx | a∞ = e–λa
E[X] = 1 / λ var(X) = 1 / λ2 (E[X2] = 2 / λ2)
10
ProbabilityExample 2 (Exponential)
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)?
11
ProbabilityCumulative Distribution Function
f(x) = (x)dFxdx
p(k) = P(X k) – P(X k–1) = F(k) – F(k–1)≦ ≦
12
ProbabilityNormal random number
aμ + b
0
a2σ2
13
ProbabilityExample 3 (Normal)
Standard normal distribution N(–a) = P(Y ≦ –a) = P(Y ≧ a) = 1 – P(Y ≦ a)
N(–a) = 1 – N(a) CDF
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?
a – μσ
a – μσ