August 29th, 2014, 8:55 am
The first one is easy so I'll leave that one out. I'll reword the second one. You toss n coins, with the aim of getting as many heads as possible. After all n coins have been tossed, you are allowed to toss one of the coins again. (Obviously you would only do that with a tail). What is the expected value of the number of heads (translated into dollars)? (However, the original wording is somewhat ambiguous -- it could mean that every coin can be tossed twice.)There are two distinct cases -- either you initially get all heads or you don't. Begin by considering the situation before retossing. The expected value given the all-heads outcome is $ n. The expected value given the not-all-heads outcome is harder to calculate. Call the expected value, given not-all-heads NTH. We have (by the first easy omitted question) 1/2^n * n + (1 - 1/2^n) * NTH = n/2. Hence NTH = (n/2 - n/2^n)/(1 - 1 / 2^n) = n * (2 ^ (n-1) - 1) / (2 ^ n - 1).However, the NTH needs to be increased by 0.5 to allow for the retoss allowance. Hence final answer = $ n / 2^n + (1 - 1/2^n) * ( n * (2 ^ (n-1) - 1) / (2 ^ n - 1) + 1/2). I won't bother to simplify this but I will check for small values of n. For n = 1, the answer should be 3/4. That checks. A much harder question than it looks. If used as an interview-brainteaser, I'd bet the majority would get this wrong. (And I'm not completely confident I haven't made an error). Easy to get right but easy to get wrong.CommodityQuant.