Lectures Prepared By: Elchanan Mossel Yelena Shvets
Lectures Prepared By: Elchanan Mossel Yelena Shvets
Lectures Prepared By: Elchanan Mossel Yelena Shvets
Stat 134
FAll 2005
Berkeley
Discrete Distributions
Claim: If X is a discrete variable, then F(x) = y xP(X=y). Example: Let X be the numbers on a fair die.
1 5/6
0.2 0.15 0.1 0.05 0 0 1 2 3 4 5 6 7
Example: Let X be the number of rolls before the first six appears when rolling a fair die. X Geom(1/6), P(n)=(5/6)n-1 1/6 (for integer n)
F(x) = 1 (5/6) b x c
1
0.2
Discrete Distributions
0.15
0.1
0.05
0 0
For integer x:
20
40
60
20
40
60
Claim: if X has a continuous distribution given by a c.d.f F(x) and F is differentiable in all but finitely many points, Then the distribution has a density fX(x) = F(x).
Pf: We have F(x) = s-1x fX(t) dt So: F(x) = fX(x) at the points where F is differentiable.
-1
0 -1 0 1 2
Solution: P(X x) = P(2|U | x) = P( - x/2 U + x/2) =F(1/2 + x/2) F(1/2 x/2) = 1/2 + x/2- 1/2 + x/2 =x = F(x). So X has the same cdf as U therefore the same distribution. Question: What is the distribution of 4| |U-1/2| - 1/4| ?
Order Statistics
Let X1, X2, Xn be random variables, We can use the CDF to find the CDF of the kth largest of these X. We call this X(k), or the kth order statistic. The density for the min and max are special cases for k = 1 and k = n. If all the Xi are identical and independent, we can find the density of the order statistics
Order Statistics
P(X(k) ~ (x, x+dx)) =
P(one of the Xs in dx)* P(k-1 of the Xs below x)* P(n-k of the Xs above x)=
P(n-k of the Xs above x) (P(X > x) =1- F(x)) P(k-1 of the Xs below x) (P(X < x) = F(x))
f(k)(x) =
Def: For r,s > 0 the beta(r,s) distribution is the distribution on (0,1) with density xr-1(1-x)s-1/B(r,s) where B(r,s) = s01 xr-1(1-x)s-1 dx Claim: If (Xi)i=1n are i.i.d Unif(0,1) then X(k) has beta(k,n-k+1) distribution.
B(r,s) =
where (r) = (r-1)! For integer rs. Problem: Calculate E(X) and Var(X) for X with beta(r,s) distribution for integer r and s. Problem: For the order statistics of n i.i.d. unif(0,1) random variables, calculate E(X) and Var(X).
Question: You are working for a company that is developing an on-line casino. How can you use this sequence to simulate n rolls of a fair die? Solution: You need a new sequence of variables each with a discrete uniform distribution on 1,2,3,4,5,6. Simple idea -- break up the unit interval into 6 intervals Ak = ((k-1)/6, k/6], each of length 1/6 & let g(u) = k if u 2 Ak.
Then Xi = g(Ui) each has the desired distribution: P(Xi = k) = P(g(Ui)=k) = P(Ak) = 1/6.
Ak = (p1+p2++pk-1 , p1+p2++pk-1+pk]. The function g(u) defined in this way is a kind of an inverse of the cdf:
g(F(k)) = k for all k=1,2,3,
Question: You are working for an engineering company that wants to model failure of circuits. You may assume that a circuit has n components whose life-times have Exp(li) distribution. How can you generate n variables that would have the desired distributions?
Solution:
So we let