wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> easy >> EASY: heads and tails
(Message started by: redpushupbra on Nov 14th, 2002, 11:50pm)

Title: EASY: heads and tails
Post by redpushupbra on Nov 14th, 2002, 11:50pm
on average, how many flips of a coin will it take to gets heads?

Title: Re: EASY: heads and tails
Post by Garzahd on Nov 15th, 2002, 10:52am
Two.

Argument 1: Linearity of expectation
With a fair coin, there's an expectation of 1/2 a head after 1 flip, so by linearity of expectation you're expected to get 1 head after 2 flips.

Argument 2: Infinite series
Probability of head on flip 1 = 1/2.
Probability of a head on flip n = 1/2n.
Average number of flips before a head = 1/2 + 2 * 1/4 + 3 * 1/8 + 4 * 1/16 + 5 * 1/32 ....
Which can be rewritten as (1/2 + 1/4 + 1/8...) + (1/4 + 1/8 + 1/16...) + (1/8 + 1/16 + 1/32...) ... = 1 + 1/2 + 1/4 + 1/8 .... = 2.

Title: Re: EASY: heads and tails
Post by william wu on Nov 15th, 2002, 11:55am
A small note for more general cases: A geometric Random Variable is characterized by the phrase "keep trying until you succeed". A good philosophy for life. When asked the expected number of trials it takes till a successful event, take the probability of success p, and reciprocate it to get 1/p as the expected number of trials. So in this case, the expected number of flips is 1/(1/2) = 2. If the question asked the expected number of rolls till rolling a 6, the answer is 1/(1/6) = 6. Intuitively this makes sense, since the lower the success probability, the more trials you must execute until you succeed.



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board