Let's say A keep tossing a fair coin, until he get 2 consecutive heads, define X to be the number of tosses for this process; B keep tossing another fair coin, until he get 3 consecutive heads, define Y to be the number of the tosses for this process.

1) Calculate P{X>Y}

2) What's the expected value of X

3) What's the expected value of Y

This is probably the hardest puzzle I have ever put on my blog. Hence, I will post its solution in the post directly rather than on comment.

Solution:

1)

(Solved by me finally after 13 months :))

Make a state diagram. Let the state be (a,b) where a is the number of consecutive heads streak "A" is on currently and b is the number of consecutive heads streak "B" is on currently.

So, (0,3) (1,3) are final accepted states and (2,0) (2,1) (2,2) (2,3) are failure states. If you get tails, your contribution to the state reaches to "0"

f(State) = P(X>Y | "State" configuration initially)

f(0,0) = 1/4[f(…

found an approximate bound using wald's equation. http://en.wikipedia.org/wiki/Wald's_equation.

ReplyDeleteimagine the experiment with m=1.its known that

E(n,1)= n H(n),

where H(n)=1+1/2+1/3+....1/n

now let x1= number of draws to pick m distinct objects. After x1 draws, let x2=number of draws to pick m distinct objects, and so on till u see see all the n objects.

then E[X1]=E[X2]=...=n[1/(n)+1/(n-1)+...1/(n-m+1)]=n/[H(n)-H(n-m)]

If S is total number of draws

i.e. S=X1+X2+.......,then as per wald's equation,

E[S]=E[X1]*E(n,m).

Now, E[S]-m < E(n,1) <=E[S].

Inequality is there because last object will be drawn in the last set of m draws.so,

[H(n)+m/n]/[H(n)-H(n-m)] > E(n,m) > = H(n)/[H(n)-H(n-m)]

where H(r)=1/r+ 1/(r-1)+..1/2+1

A small corection.

ReplyDeletei wrote in previous post that

E[S]-m < E(n,1) <= E[S].

this needs to be changed to

E[S-X] < E(n,1) <= E[S].

where X is the number of draws required to pick the last group of m distinct objects. The reason is that by definition, the S draws cover all n objects and first S-X draws do not cover all n objects.

With this correction,we get

A+1 > E(n,m) >= A

where A= H(n)/[H(n)-H(n-m)]

and H(r)=1/r+ 1/(r-1)+..1/2+1.

Not entirely sure if this solution is correct - do comment :)

ReplyDeleteConsider a bit-string of length n. 1 denotes the corresponding object has already been selected, 0 denotes that it has not been selected. We need to find the expected number of turns needed for all the bits to become 1, which would be the same as the expected number of turns needed for any individual bit to become a 1.

The total number of ways in which we can have m 1's in the bit string is nCm.

Consider the i-th bit. Number of ways in which this bit is 1 is (n-1)C(m-1).

So probability that the i-th bit is 1, P(i) = (n-1)C(m-1) / nCm = m/n

If N is the expected number of turns needed for the i-th bit to be 1, N * P(i) = 1, so N = n/m

This is the same for any bit. So expected number of moves is n/m.

Sorry... the solution I posted is grossly wrong...

ReplyDeleteConsider the stage when i of the n objects have turned up. The probability that in the next draw we shall get one of the remaining (n-i) objects is (n-i)Cm/ nCm. Hence the expected number of steps required to get to get one of these (n-i) objetcs = nCm/(n-i)Cm [geometric distribution]

ReplyDeleteSo, expected number of steps required to get all objects = sum(i=1 to n-m) of [nCm/(n-i)Cm]

Can anybody tell me how to solve this? I do not understand chera's solution well.

ReplyDelete