Probability
Coins, Roulettes, Tests & More
By Silvana Acosta in Teasers Statistics
September 8, 2018
Some brain teasers challenges I got, my take on them, and solution! 😃
Bet Coin Flips In A Row
What is the maximum amount you are willing to pay in order to play this game?
A fair coin is tossed repeatedly until you get the first tails, at which point the game ends and you get the prize. The prize “pot” starts at 1 and doubles each time you get heads, starting in the first toss. You take the “pot” home once you reach tails.
What are the expected profits of the game? Pot gets larger every toss until I have to go home (the first T). The expected profits \(E_{p}\) are the money you get times the probability of getting it or of the outcomes:
Toss 1: \(E_{p}(1H)=0.5*2=1\)
Toss 2: \(E_{p}(2H)+E_{p}(1H,1T)=0.5*0.5*4+0.5*0.5*2=1+0.5=1.5\)
Toss 3: \(E_{p}(3H)+E_{p}(2H,1T)=0.5*0.5*0.5*8+0.5*0.5*0.5*4=1+0.5=1.5\)
Toss 4: \(E_{p}(4H)+E_{p}(3H,1T)=1/16*16+1/16*8=1+0.5=1.5\)
\(\color{purple}{\textbf{Solution}}\): Maximum amount I’d pay to enter the game is 1.5. I either win and earn 1 (payoffs double and the probability halfs), or I loose and get 0.5 when the game stops (payoffs are not doubled and on top you have to count for the loosing probability of the coin, that is, cut in half). So I expect to gain maximum 1.5.
Expected Coin Tosses
What is the expected number of flips until you get 3 heads? How many to get 3 in a row?
On average, every 2 tosses you get what you need (H). In the first two tosses you are expected to get one H, and in the second set of two tosses you are expected to get another H, so you expect to need to flip it only once more.
For the heads in a row consider the outcomes T,HT,HHT,HHH. Note that the case T involves TT, TH, etc, and analogously for all the rest. All three of them but the last one put you back to the start to keep tossing. So if \(x\) is the expected number of tosses to get HHH, with those outcomes in mind, we have:
\(x=1/2*(1+x)+1/4*(2+x)+1/8*(3+x)+1/8*(3)\) => \(x=14\)
\(\color{purple}{\textbf{Solution}}\): An expected maximum of 5 and minimum of 3 tosses are needed to get 3 heads. To get 3 heads in a row you should expect to have to toss the coin 14 times.
Unfair Coin Tosses
What is the probability of 0,1,…,6 heads after 6 tosses in a coin that has 0.3 chance of head?
So \(X\sim Binomial(n,p)\) and call \(H\) to be the success:
\(P(X=0)=\left(\begin{array}{c}6\\0\end{array}\right)0.3^{0}(1-0.3)^{6-0}=0.1176\)
\(P(X=1)=\left(\begin{array}{c}6\\1\end{array}\right)0.3^{1}(1-0.3)^{6-1}=0.3025\)
\(P(X=2)=\left(\begin{array}{c}6\\2\end{array}\right)0.3^{2}(1-0.3)^{6-2}=0.3241\)
\(\vdots\)
\(P(X=6)=\left(\begin{array}{c}6\\6\end{array}\right)0.3^{6}(1-0.3)^{6-6}=0.0007\)
\(\color{purple}{\textbf{Solution}}\): The chances of getting 6 heads is a bit more than 6 in 10.000.
Bet Coins Flip
Pay 1 to play a game with 100 fair coins that pays 10 if 60 land head and nothing if not?
Note that to consider 100 coins is equivalent to one coin with 100 flips or Bernoulli trials, as the flips are independent. For the flips \(X\sim Binomial(n,p)\) we consider the approximation \(Y\sim N(np,np(1-p))\), since \(n>20\). For our parameters we have \(Y\sim N(50,25)\). The expected profit is:
\(E(profit)=-1+10P(win)+0P(loose)=-1+10[1-P(Y<60)]\)
Given that \(Z=(Y-50)/\sqrt{25}\sim N(0,1)\) we use the table for the standard normal at 2:
\(E(profit)=-1+10[1-P(Z<\frac{60-50}{\sqrt{25}})]=-1+0.2275=-0.7725\)
\(\color{purple}{\textbf{Solution}}\): The expected net payoff is negative (a loss), so I wouldn’t pay 1 to enter this game. What I would be willing to pay (break off), is an amount that is equal or less than 0.2275.
Russian Roulette
Would you re-spin if you go second on a Russian roulette game with a gun with 2 bullets?
We are playing Russian roulette, with a standard 6-chamber revolver. I put two bullets in adjacent chambers, spin, point the gun at my head, and pull the trigger. Click. I’m still alive. It’s now your turn, and I hand the gun to you, and give you two choices. Would you rather, assuming you want to live, a) Re-spin, aim at your own head and pull the trigger; b) Do not spin, aim at your own head, and pull the trigger.
The key is that the bullets (B) are placed in adjacent chambers. The following are the possible configurations for such loaded revolver:
\(Case_1: B B - - - -\)
\(Case_2: - BB - - - -\)
\(Case_3: - - B B - -\)
\(Case_4: - - - B B -\)
\(Case_5: - - - - B B\)
\(Case_6: B - - - - B\)
Without loss of generality, assume that the first trigger pull comes from the first chamber. Given that he didn’t die, cases 1 and 6 are ruled out, so the remaining cases are 2 through 5.
If I do not spin, given that the revolver has advanced to the next chamber, I note that only in case 2 (out of 4 cases) I face certain death. So if I choose not to spin, my survival rate is 75% (1/4 of dying).
If I choose to spin, I instantly reset the probability of dying back to 2/6, setting a survival rate of 66.67%. The game “erases” itself and there are 2 out of 6 cases in which I die if pulling the trigger “from the start”.
\(\color{purple}{\textbf{Solution}}\): Choosing not to spin is clearly the smarter move, since it leaves me with a 75% chance of survival instead of 66.67% only.
False Positive in Test
What is the probability that you actually have the disease if your test results are positive?
One percent of people in the world has a given disease. The test for it is imperfect. The test has an 80% chance of showing positive if you have the disease, but if you do not have the disease, there is a 10% chance of showing a false positive.
\(P(D_{yes}|T_{+})=\frac{P(T_{+}|D_{yes})P(D_{yes})}{P(T_{+}|D_{yes})P(D_{yes})+P(T_{+}|D_{no})P(D_{no})}\)
The statement says that “One percent of people in the world have this disease”, so \(P(D_{yes})=0.01\) and \(P(D_{no})=0.99\). Then using the rest of the information given to us we compute the ratio:
\(P(D_{yes}|T_{+})=\frac{(0.8)(0.01)}{(0.8)(0.01)+(0.1)(0.99)}=\frac{(8)(1)}{(8)(1)+(1)(99)}\frac{1000}{1000}=\frac{8}{107}\)
\(\color{purple}{\textbf{Solution}}\): Given that the test came out positive, the probability that I indeed have the disease is a little bit less than 8%.
Roll Two Dice
What is the probability of one having an outcome larger than the other?
To visualize it consider a matrix with the values of dice A in rows and dice B in columns. The key is in the diagonal entries and above/below.
The probability of one dice being larger than the other, and not caring which one, is analogous to asking for the probability that the two dice are not the same. That is everything but the diagonal: (36-6)/36=5/6.
But for the probability of one specific dice (say A) taking a value larger than the other one (say B), the favorable outcomes are everything in the upper/lower matrix (so half of above): 15/36=5/12.
\(\color{purple}{\textbf{Solution}}\): The probability of either one being larger than the other are 5/6 but the probability of one specific given dice being larger than the other one are half, so 5/12.
Socks in a Drawer
How many draws in a dark room to get a matching pair if the box has 20 green and 20 blue?
Each time you pull out a sock there’s a 0.5 chance that is green and 0.5 chance that is blue. Every two withdraws, on average, you get 1 green sock (analogously for blue). If you are really lucky, after those two withdraws you already have 2 blues or 2 greens, but to be sure you should go for a third withdraw.
\(\color{purple}{\textbf{Solution}}\): You should expect to do 3 withdraws to get a pair. You might be lucky and get it in just 2 withdraws but it is not what is expected or what happens on average.
Judges Veredict
What is the probability of the court reaching the correct verdict?
There are three judges in a court, who have the following probabilities of reaching the correct verdict: Judge 1 (p), Judge 2 (p), Judge 3 (1/2). A verdict is only decided if at least two of the judges agree.
\(P(correct)=P(2correct)+P(3correct)\)
For the outcome of “2 correct” we have to consider that it could be any of them getting it right, with the remaining judge getting it wrong:
\(P(correct)=(pp(1-\frac{1}{2})+p(1-p)\frac{1}{2}+(1-p)p\frac{1}{2})+pp\frac{1}{2}\)
\(\color{purple}{\textbf{Solution}}\): Just algebra to get \(P(correct)=2p(1-p)\frac{1}{2}+2pp\frac{1}{2}=p(1-p)+pp=p\). You cannot use binomial coefficients since the judges don’t all have the same probability of correct veredict.
Rainy Weekend
What is the probability that it rains this weekend?
If it rains on Saturday with probability 60%, and it rains on Sunday with probability 20%
Assume that the event of raining on Sunday is independent of the event of raining on Saturday. Then the probability that it rains this weekend is equal to the probability that it rains on at least one day, which is equal to the complement of no rain either day:
\(1−(1−0.6)(1−0.2)=0.68 1 − ( 1 − 0.6 ) ( 1 − 0.2 ) = 0.68\)
If the two days are not independent, then the probability can range from anything from 60% (if it rains only on Sunday if it has rained on Saturday) to 80% (if it never rains on Sunday if it has not rained on Saturday, so no days raining in the weekend).
\(\color{purple}{\textbf{Solution}}\): If rain is independent between days the probability is 68% and if not, it can be anywhere between 60% and 80% chances.
Couples Wanting Boys
What ends up being the proportion of boys to girls in the country?
In a country in which people only want boys, every family continues to have children until they have a boy. If they have a girl, they have another child. If they have a boy, they stop.
You need to figure out the expected number of boys and expected number of girls. Assuming they are independent events, the pregnancies are like coin tosses and then we need to find out the expected number of heads (success=boys) and expected number of tails (failure=girls), in an experiment that consists in keeping tossing until we get heads.
Expected number of tails (girls) until you get heads (boys) in a family?
\(E(G)=1G*P(G)+2G*P(2G)+3G*P(3G)+...=1*1/2+2*1/4+3*1/8+...\)
This represents the changes or additions (always 1/2) to the current-at-the-time total or sum of number of girls, as the childbirths or total outcomes (2) are changing or adding. It can be re-written as:
\(E(G)= \sum_{i=1}^{i=\infty} i\frac{1}{2^i} = \sum_{i=0}^{i=\infty} \frac{i}{2^{(i+1)}}\)
Which due to the observation above, as well as due to algebra, for \(a=2\) is equivalent to:
\(-E(G)= \sum_{i=0}^{i=\infty} \frac{-i}{a^{(i+1)}} = \frac{d}{da} \sum_{i=0}^{i=\infty} a^{-i}\)
Using the result of convergence of a geometric sum we have that:
\(-E(G)= \frac{d}{da} \frac{1}{1-1/a} = \frac{d}{da} \frac{a}{a-1} = \frac{1(a-1) - a1}{(a-1)^{2}} = \frac{-1}{(a-1)^{2}}\), which equals -1 for \(a=2\), so one girl per family.
\(\color{purple}{\textbf{Solution}}\): Given that we expect 1 girl per family, we expect the proportion of girls to boys to be 50%-50%. So the country will end up having a balanced ratio anyways.
Balls in Two Buckets
How should you distribute colored balls to maximise your probability of winning?
You have two buckets, five red balls, and five blue balls. You can distribute the balls into the buckets any way you like, but each bucket must have at least one ball in it. I will choose one bucket at random (p=0.5) and then draw one ball from it. If the ball is blue, you win.
If I want to maximise the probability of winning in one bucket (that is, I want to take the “risk” of the guy pulling from a given bucket I chose), I could put just one blue ball in it, and no red balls.
Then for that bucket, I have 1 favorable outcome (1 blue), out of a total outcomes of 1 (only 1 ball in the bucket). So in the game with two buckets: \(P(win)=\frac{1}{2}(\frac{1}{1})+\frac{1}{2}(\frac{4}{9})=\frac{13}{18}\sim\frac{3}{4}\)
The key is to note that you cannot do anything about the 1/2 in each term. So you should focus on maximising what is in parenthesis in both terms or the likelihood of a blue in a single given bucket.
Note that the general problem having a total of N instead of 10 balls, with two types of balls to distribute in two buckets can be written as: \(P(win)=\frac{1}{2}(\frac{1}{1})+\frac{1}{2}(\frac{N/2-1}{N-1})=\frac{1}{4}(\frac{3N-4}{N-1})\overset{N\rightarrow\infty}{\rightarrow}\frac{3}{4}\).
\(\color{purple}{\textbf{Solution}}\): Each bucket has the same probability of getting picked so you should focus on taking whatever single bucket and leave a single blue ball there.