@Shady: There is a 1/2 probability of getting an even number on the first roll. In the 1/2 of the cases where the first roll is odd, roll again and note that there is a 1/2 chance of getting an odd number. Etc. The probability of needing n rolls is 1/2 to the nth power.
The series is 1 + 2 * (1/2) + 3 * (1/4) + 4 * (1/8) + .... Call the infinite sum S: S = 1 + 2 * (1/2) + 3 * (1/4) + 4 * (1/8) + .... Then 1/2 S = 1 * (1/2) + 2 * (1/4) + 3 * (1/8) + ..... Subtract the two series, getting 1/2 S = 1 + 1/2 + 1/4 + 1/8 + .... So 1/2 S = 2, and S = 4. The expected number of rolls needed to that the sum is even is 4. Dave On Aug 6, 9:34 am, shady <sinv...@gmail.com> wrote: > Hi, > > A fair dice is rolled. Each time the value is noted and running sum is > maintained. What is the expected number of runs needed so that the sum is > even ? > Can anyone tell how to solve this problem ? as well as other related > problems of such sort.... -- 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.