1 / 23

T i = indicator random variable of the event that i-th throw results in a tail

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 6 = 5/16 < 1/2. E[X i,j ] = ½ (consider only i<j). X=  X i,j E[X] = n(n-1) /4. 1  i<j  n.

Download Presentation

T i = indicator random variable of the event that i-th throw results in a tail

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ti = indicator random variable of the event that i-th throw results in a tail E[T] = E[T1] + … + E[T6] = 6*(1/2) = 3 P(T=3) = P(H=3) = binomial(6,3)/26 = 5/16 < 1/2

  2. E[Xi,j] = ½ (consider only i<j) X=Xi,jE[X] = n(n-1) /4 1 i<j n

  3. T = 1 + (1/2) * 0 + (1/2) * ( T + T ) T = 1 + T

  4. 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.

  5. l  m+1

  6. if B  A[m] then

  7. Reverse(a,b) for i from a to a+b do swap(A[i],A[a+b-i]); 1,….,k,k+1,….,n k,….,1,k+1,….,n k,….,1,n,….,k+1 k+1,….,n,1,….,k Rotate(k) Reverse(1,k) Reverse(k+1,n) Reverse(1,n)

  8. find the median m of A m m  m sum S 3) if S\geq C then recurse on A[n/2..n] else recurse on A[1..n/2] with C’=C-S

  9. T(n) = T(n/2) + O(n) 3) if S\geq C then recurse on A[n/2..n] else recurse on A[1..n/2] with C’=C-S

  10. Coupon collector problem n coupons to collect What is the expected number of cereal boxes that you need to buy?

  11. Coupon collector problem Assume that a dart throw is uniform in the circle. Let p be The fraction occupied by the bull’s eye. Expected number of darts needed to hit the bull’s eye ?

  12. Coupon collector problem Assume that a dart throw is uniform in the circle. Let p be The fraction occupied by the bull’s eye. Expected number of darts needed to hit the bull’s eye ? 1/p

  13. What is the expected number of boxes that I buy in k-th phase ? k-th phase = when I have k different Kinds of coupons. E[X0] = 1 … E[Xk] = ? … E[Xn-1] = n

  14. What is the expected number of boxes that I buy in k-th phase ? k-th phase = when I have k different Kinds of coupons. E[X0] = 1 … E[Xk] = n/(n-k) … E[Xn-1] = n

  15. What is the expected number of boxes that I buy in k-th phase ? k-th phase = when I have k different Kinds of coupons. n-1 n n 1 X=X0+X1+…+Xn-1 = n  = n-k k k=0 k=1 =  (n ln n)

  16. What is the expected number of boxes that I buy in k-th phase ? k-th phase = when I have k different Kinds of coupons. n-1 n n 1 X=X0+X1+…+Xn-1 = n  = n-k k k=0 k=1 = =  (n ln n) E[X]=E[X0]+…+E[Xn-1]

  17. Harmonic numers n  1 ln n  1+ln n k k=1

  18. Randomized algorithm for “median” SELECT k-th element for random x 1) =x <x >x R L 2) recurse on the appropriate part

  19. Randomized algorithm for “median” Las Vegas algorithm (never makes error, randomness only influences running time) The identity testing algorithm was Monte Carlo algorithm with 1 sided error.

  20. Markov inequality For non-negative random variable X: P(X > a.E[X]) < 1/a P(X  a.E[X])  1/a

  21. 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 ?

  22. 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) V[X] 1 P( |X-E[X]| > b.E[X] ) < * b2 E[X]2

  23. Chebychev’s inequality V[X] 1 P( |X-E[X]| > b.E[X] ) < * b2 E[X]2 P( (1-b)*E[X]  X  (1+b)*E[X] ) > V[X] 1 1 - * b2 E[X]2

More Related