Subscribe via feed.

## Unfair coin

Posted by Chris on December 13, 2013 – 3:59 pm

A coin is biased such that the probability of throwing a H is p, where 0 < p < 1.

Two players, A and B, takes turns to throw the coin. The game ends when either the sequence HHH (then A wins) or HTH (then B wins) is thrown.

What must p be in order for the game to be fair?

(Because of the nature of the source, I expect that p = 1/2 isn’t the only answer).

This post is under “MathsChallenge” and has 14 respond so far.
If you enjoy this article, make sure you subscribe to my RSS Feed.

### 14 Responds so far- Add one»

1. 1. Chris Said：

Hi Slavy. This is a BMO question. If you think that p = 1/2 is the only solution, then I’ll delete it.

2. 2. slavy Said：

Hi, Chris. I think I solved it already, so the problem is not that trivial. Actually 1/2 is not a solution B has big advantage with it!

3. 3. Chris Said：

I hadn’t expected that. I hope this sheds some light on a statement that I read somewhere ages ago, along the lines that HHH is more likely than HTH etc., for unbiased coins. I never understood that. Maybe, this problem will reveal why.

I’m guessing that one of those nice recursive type techniques will be involved.

4. 4. slavy Said：

It’s the opposite – HTH is more likely, as I wrote inthe previous post. I’ll keep the argument for myself, since it’s a strong hint and will spoil the problem

5. 5. Chris Said：

Thanks Slavy. I believe that I’ll finally understand why HTH is more likely than HHH before the week is over. So I’m now very pleased that I put this problem up.

All the recent problems have come from the BMO site. But I’m only picking the simplest (a relative term) ones.

6. 6. Wizard of Oz Said：

I’m assuming that the game doesn’t really start until the first H is thrown.

Then the next two throws are HH, HT, TH and TT with probabilities p^2, p(1-p),(1-p)p and (1-p)^2 respectively.

For the game to be fair p^2 must equsl (1-p)p which means p = 1/2.

From the discussion in the earlier posts I’ve obviously fallen for the sucker trick somewhere!

7. 7. Chris Said：

Hi Wiz. This one is the finest quality sucker bait. You definitely don’t want to be playing with fair coins and betting on HHH.

If I haven’t goofed the handling of the potentially unlimited number of tosses, the answer is related to the golden ratio. In turn that suggests that buried deep in there, lies the Fibonacci sequence – but it’s hidden from me.

On the assumption that I haven’t goofed, I’ll say that the problem is easy to solve. Three harder extensions to the problem are: what is the average number of flips to get a winner, for A to win and for B to win?

8. 8. DP Said：

I’m with Wiz on this. I also come up with p=1/2 which slavy says isn’t a solution to the problem.

9. 9. Chris Said：

Hi DP. I agree with Slavy. 1/2 gives a substantial bias (a very simple ratio) towards HTH.

Here’s an enormous clue.

HHH A wins
HHTH B wins
HHTT restart
HTH B wins
HTT restart

I’ll let you ponder why you can ignore the restart entries.

10. 10. DP Said：

Thanks for the strong hint (or nudge). The light is now flickering a bit for me, but I’m not quite ready to attempt a solution. Maybe Wiz will sweep in and tell me before you get a chance to post the answer.

It looks like the 4 of us are about the only ones to post anything anymore, with the occasional passer-by, plus good-ol’ ragknot stopping by sometimes. It’s funny.. about 3 or 4 years ago when I first started visiting this site he was one of the main commenters here and even had some problems named after him.

11. 11. Chris Said：

Hi DP. Yeah, it’s a bit sad. I really miss Knightmare, he was (usually – but definitely not always) hopeless at problem solving, but his humour and attitude more than made up for that, as did his sofa, the lovely and forbearing Pequod. Also Karl Sharman, he had a wonderful, all British, tongue in cheek sense of humour and mischief, and an excellent ability to do voice impressions in writing. Others include (Larry) Zaux (at least one problem a day from him, plus nice humour and attitude) and [Anonymous] Cam – he does pop in once in a while though. There’s also SP, Euclid’s Brother and others whose nom-de-plume’s I’ve forgotten.

A huge problem is finding problems with a general audience appeal.

No matter how hard I search, the only ones that I find and that I’m prepared to post are maths and probability ones. There are also plenty of problems that are trivial or plain silly (man in room – grrrrr). I don’t bother with physics any more – some of the misunderstandings that people have make me want to weep (or shriek).

There are tons of logic problems where you have to pair up items from a list of statements e.g. Mrs. Brown lives in the house next to the red house – I don’t care much for them myself, I suspect that they are turned out by machines. Then there are the sweeter ones (classics really) – and most of them have been re-posted several times already. I do repost some of those.

Currently I have a new source, it’s my son. He’s aiming to do a degree in mathematics and is giving me problems from maths Olympiads. Sadly, many of those involve geometry – and so are practically impossible to deal with on this site and some are just far too difficult or uninteresting.

12. 12. Chris Said：

I forgot to comment on Ragknot. This comment started off being a long critique. But I view of the Kid Sister Rule, I’ll leave it at, he doesn’t know that he doesn’t know.

13. 13. Chris Said：

Despite my suggested use of p, I’m using h and t = 1 – h for the probabilities of tossing heads or tails.

Here are the possible tosses. I show the compulsory H first then consider all the other possible tosses. I stop as soon as there’s a winner or when we’re back to square one.

HHH win h^2
HHTH win h^2 t
HHTT restart h t^2
HTH win ht
HTT restart t^2

Having got started with the initial H,
the probability of tossing HHH is h^2
the probability of tossing HTH is h^2 t + h t
the probability of a restart is h t^2 + t^2

If we now set t = 1 – h, we get P(HHH) = h^2, P(HTH) = h – h^3 and
P(restart) = 1 – h – h^2 + h^3. If we add those together we get 1, as required.

If restarts are needed, the relative probabilities of HHH and HTH are unaffected. So we merely need to solve h^2 = h – h^3. If h ≠ 0 => h^2 – h – 1 = 0
=> h = (√5 -1)/2 ≈ 0.618034 is the only admissable answer. That number is the reciprocal of the golden ratio ≈ 1.618034.

If the coin was unbiased, we’d have got (after normalising so that someone wins) that the probability of HHH being the winning sequence is (1/4)/(1/4 + 3/8) = 2/5, and for HTH we’d get 3/5. i.e. 3/2 in favour of HTH.

14. 14. Chris Said：

If you inspected a random string of tosses with fair coins, you won’t find a bias towards HTH over HHH. That’s because we don’t, in effect, cherry pick the sequences as we do in the game. e.g. HTHHHT includes both HTH and HHH, but in the game we’d have treated that as HTH HHT and so the HHH would have been discarded. Similarly HHHTH? would have been treated as HHH TH? even though HHH and HTH appeared.

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\php_mssql.dll' - The specified module could not be found. in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\php_pdo_mssql.dll' - The specified module could not be found. in Unknown on line 0