Probability of getting an even sum in one roll is 1/2..
Thus, expected number of rolls required to get even sum is inverse of that
i.e. 2.

Alternatively, Going by basics...

Let P(x) be probability of getting Even sum in x rolls.
P(1) = 1/2....(Even)
P(2) = (1/2) * (1/2)  (Odd + Odd)
P(3) = (1/2) * (1/2) * (1/2) (Odd + Even + Odd)
P(4) = (1/2) * (1/2) * (1/2) * (1/2) (Odd + Even + Even + Odd)
& So on....

Expected number is given by Summation( X*P(x) )...i.e.
1*(1/2) + 2*(1/4) + 3*(1/8) + 4*(1/16) + ....(theoretically infinite terms)

Let this sum be S.

Thus, S = (1/2) + (2/4) + (3/8) + (4/16) + (5/32) +....

S / 2 = (1/4) + (2/8) + (3/16) + (4/32) +....

S - (S/2) = (1/2) + (2-1)/4 + (3-2)/8 + (4-3)/16 + (5-4)/32 + ....

Thus, S/2 = (1/2) + 1/4 + 1/8 + 1/16 + 1/32 + ....(theoretically infinite
terms)
R.H.S. is GP which evaluates to 1.
Thus, S = 2.
Thus, expected number of rolls required to get even sum is 2.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to