T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + …...
-
date post
20-Dec-2015 -
Category
Documents
-
view
215 -
download
3
Transcript of T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + …...
![Page 1: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/1.jpg)
Ti = indicator random variable of the event that i-th throw results in a tailE[T] = E[T1] + … + E[T6] = 6*(1/2) = 3
P(T=3) = P(H=3) = binomial(6,3)/26 = 5/16 < 1/2
![Page 2: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/2.jpg)
E[Xi,j] = ½ (consider only i<j)
X=Xi,jE[X]n(n-1) /41 i<j n
![Page 3: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/3.jpg)
T = 1 + (1/2) * 0 + (1/2) * ( T + T )
T = 1 + T
![Page 4: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/4.jpg)
There exists c such that T(n) T(n/2)+T(n/3)+c*n.We need to show that there exists d such that T(n) d*n for all n.
Induction step:T(n) T(n/2) + T(n/3) + c*n d*n/2 + d*n/3 + c*n d*n + (c-d/6)*n d*n, taking d=6c.
![Page 5: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/5.jpg)
l m+1
![Page 6: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/6.jpg)
if B A[m] then
![Page 7: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/7.jpg)
Reverse(a,b) for i from a to a+b do swap(A[i],A[a+b-i]);
Rotate(k) Reverse(1,k) Reverse(k+1,n) Reverse(1,n)
1,….,k,k+1,….,nk,….,1,k+1,….,nk,….,1,n,….,k+1k+1,….,n,1,….,k
![Page 8: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/8.jpg)
1) find the median m of A2)
m mm
sum S3) if S\geq C then recurse on A[n/2..n] else recurse on A[1..n/2] with C’=C-S
![Page 9: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/9.jpg)
3) if S\geq C then recurse on A[n/2..n] else recurse on A[1..n/2] with C’=C-S
T(n) = T(n/2) + O(n)
![Page 10: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/10.jpg)
Coupon collector problem
n coupons to collect
What is the expected number of cereal boxes that you need to buy?
![Page 11: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/11.jpg)
Coupon collector problem
Expected number of darts needed to hit the bull’s eye ?
Assume that a dart throw is uniform inthe circle. Let p beThe fraction occupiedby the bull’s eye.
![Page 12: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/12.jpg)
Coupon collector problem
Expected number of darts needed to hit the bull’s eye ?
Assume that a dart throw is uniform inthe circle. Let p beThe fraction occupiedby the bull’s eye.
1/p
![Page 13: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/13.jpg)
What is the expected number ofboxes that I buy in k-th phase ?
k-th phase = when I have k differentKinds of coupons.
E[X0] = 1…E[Xk] = ?…E[Xn-1] = n
![Page 14: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/14.jpg)
What is the expected number ofboxes that I buy in k-th phase ?
k-th phase = when I have k differentKinds of coupons.
E[X0] = 1…E[Xk] = n/(n-k)…E[Xn-1] = n
![Page 15: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/15.jpg)
What is the expected number ofboxes that I buy in k-th phase ?
k-th phase = when I have k differentKinds of coupons.
X=X0+X1+…+Xn-1 = n nn-kk=0
n-11kk=1
n
= (n ln n)
=
![Page 16: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/16.jpg)
What is the expected number ofboxes that I buy in k-th phase ?
k-th phase = when I have k differentKinds of coupons.
X=X0+X1+…+Xn-1 = n nn-kk=0
n-11kk=1
n
= (n ln n)
=
E[X]=E[X0]+…+E[Xn-1]=
![Page 17: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/17.jpg)
Harmonic numers
1kk=1
n1+ln nln n
![Page 18: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/18.jpg)
Randomized algorithm for “median”
L R
<x =x >x
for random x
2) recurse on the appropriate part
1)
SELECT k-th element
![Page 19: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/19.jpg)
Randomized algorithm for “median”
Las Vegas algorithm
(never makes error, randomnessonly influences running time)
The identity testing algorithm wasMonte Carlo algorithm with 1 sided error.
![Page 20: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/20.jpg)
Markov inequality
P(X > a.E[X]) < 1/a
P(X a.E[X]) 1/a
For non-negative random variable X:
![Page 21: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/21.jpg)
Variance
For a random variable X:
V[ X ] = E[ (X-E[X])2 ]
What is the variance of X=the number on a (6-sided) dice ?
![Page 22: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/22.jpg)
Variance
For a random variable X:
V[ X ] = E[ (X-E[X])2 ]
Y = (X-E[X])2
P( Y > a.E[Y] ) < 1/a
P( (X-E[X])2 > a.V[X] ) < 1/a
P( (X-E[X])2 > b2.E[X]2 ) < V[X]/(b2 E[X]2)
P( |X-E[X]| > b.E[X] ) <V[X]
E[X]2 *1
b2
![Page 23: T i = indicator random variable of the event that i-th throw results in a tail E[T] = E[T 1 ] + … + E[T 6 ] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/2.](https://reader031.fdocuments.in/reader031/viewer/2022032800/56649d4b5503460f94a28095/html5/thumbnails/23.jpg)
Chebychev’s inequality
P( |X-E[X]| > b.E[X] ) <V[X]
E[X]2 *1
b2
P( (1-b)*E[X] X (1+b)*E[X] )
>V[X]
E[X]2 *1
b21 -