Challenge Questions Blog

Challenge Questions

Stop in and exercise your brain. Talk about this month's Challenge from Specs & Techs or similar puzzles.

So do you have a Challenge Question that could stump the community? Then submit the question with the "correct" answer and we'll post it. If it's really good, we may even roll it up to Specs & Techs. You'll be famous!

Answers to Challenge Questions appear by the last Tuesday of the month.

Previous in Blog: Apollo 11 Communications Log- Gimbal Lock: Newsletter Challenge (July 2015)   Next in Blog: Mars Farms: Newsletter Challenge (September 2015)
Close
Close
Close
22 comments
Rate Comments: Nested

Coin Flips for Cash: Newsletter Challenge (August 2015)

Posted August 01, 2015 12:00 AM
Pathfinder Tags: challenge question

This month's Challenge Question: Specs & Techs from IHS Engineering360:

Try this game: you flip a coin until you get a head and you win one dollar every time you flip the coin. For example if you get a heads the first time, you get one dollar; if you get a tails the first time and a head the second time, you get two dollars; and so on. What is the maximum expected dollars you can make every time you play this game?

And the answer is:

Every time you flip the coin the probability of getting heads is ½, so the probability of winning just one dollar is ½; the probability of winning two dollar is 2/4 (= ½) and so forth. Then, the expected winning is given by this series:

This is a convergent series so its sum is a finite number. You can find the value of this series using normal mathematical techniques, or you can use the following C++ program to find that the series converges to 2.0. So you will win no more than $2.00 each time you play the game.

// Solution to Challenge Question for August 2015

#include <iostream>

#include <math.h>

using namespace std;

const int MAX = 100;

int main ( ) {

int n; // n is the number of coins you end up flipping

double expectedValue = 0.0;

for (int i=1; i <= MAX; i++) expectedValue += i/pow (2,i);

cout << "\nExpected Average Value = " << expectedValue;

return 0;

}

Reply

Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Good Answers:

These comments received enough positive votes to make them "good answers".

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
3
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#1

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/01/2015 2:54 AM

There is no maximum.

Statistically it could come up tails every time, unlikely but possible.

How long could you keep playing for before you needed a break?

A sensible maximum to expect is about 3$.

Exactly where can we find this game?

Del

__________________
health warning: These posts may contain traces of nut.
Reply Good Answer (Score 3)
Guru
Engineering Fields - Electrical Engineering - Been there, done that. Engineering Fields - Control Engineering - New Member

Join Date: Dec 2008
Location: Long Island NY
Posts: 15600
Good Answers: 981
#8
In reply to #1

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/04/2015 4:31 PM

You nailed it Del. You answered precisely what they asked for. People can expect anything, regardless of the statistics.

This is another poorly phrased challenge question. The progression in the size of the pot is poorly defined, too. Does it double or increment after successive flips. There is also nothing saying that once one wins that the game is over. A TTH flip sequence can be followed by another flip of heads or tails. A TTHH flip could pay out 3$ or 8$(with a spare coin toss not part of the game), or 4$, 5$, 9$ or 24$ if the fourth head toss counts in the game.

__________________
"Don't disturb my circles." translation of Archimedes last words
Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#16
In reply to #8

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/09/2015 5:13 PM

I don't see a problem with the phrasing. It says "you flip a coin until you get a head..." so it's clear to me that when you get a head the game is over. And you get 1$ every time you flip, including the flip of heads that stops the game.

__________________
Give masochists a fair crack of the whip
Reply
Guru
Engineering Fields - Electrical Engineering - Been there, done that. Engineering Fields - Control Engineering - New Member

Join Date: Dec 2008
Location: Long Island NY
Posts: 15600
Good Answers: 981
#18
In reply to #16

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/09/2015 7:16 PM

But what if the bet into the game was 1 Italian Lire? The definition of the game is so obtuse that almost any outcome is possible.

Step right up. Step right up! Everybody is a winner.

__________________
"Don't disturb my circles." translation of Archimedes last words
Reply
Guru
Hobbies - Musician - Engineering Fields - Chemical Engineering - New Member Engineering Fields - Control Engineering - New Member Engineering Fields - Instrumentation Engineering - New Member

Join Date: Jan 2007
Location: Moses Lake, WA, USA, Thulcandra - The Silent Planet (C.S. Lewis)
Posts: 4216
Good Answers: 194
#2

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/01/2015 3:58 AM

Well, I can EXPECT any amount. That's why people gamble!

__________________
"Reason is not automatic. Those who deny it cannot be conquered by it. Do not count on them. Leave them alone." - Ayn Rand
Reply
Guru
Engineering Fields - Optical Engineering - Member Engineering Fields - Engineering Physics - Member Engineering Fields - Systems Engineering - Member

Join Date: Apr 2010
Location: Trantor
Posts: 5363
Good Answers: 647
#3

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/01/2015 7:35 AM

I don't give a flip. Just gimme all the cash you got!

__________________
Whiskey, women -- and astrophysics. Because sometimes a problem can't be solved with just whiskey and women.
Reply
Guru

Join Date: Apr 2010
Location: About 4000 miles from the center of the earth (+/-100 mi)
Posts: 9910
Good Answers: 1141
#4

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/03/2015 11:05 AM

What does "and so on" mean? Does the payoff double each time or increase by $1?

If it doubles, half the time you get $1, 1/4 the time you get $2, 1/8 the time you get $4, ... = 1/2 + 2*1/4 + 4*1/8 + ...

In that case, your expected return is $0.50 * (1+1+1+1...) = $infinity. I don't know if that makes sense, but it seems that is what the math says.

Reply Score 1 for Off Topic
Guru

Join Date: Mar 2007
Location: by the beach in Florida
Posts: 33392
Good Answers: 1817
#5

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/04/2015 2:17 AM

$1.66

__________________
All living things seek to control their own destiny....this is the purpose of life
Reply
Associate

Join Date: Apr 2014
Location: Erie, PA
Posts: 44
Good Answers: 1
#6

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/04/2015 9:50 AM

I don't think there is a "correct" answer. It might average $1.66, but then that wouldn't be the maximum to expect. If it's possible to flip 5 tails in a row 2% of the times the game is played, then $6.00 might be the maximum to expect. It all depends on whether it's a reasonable expectation, or approaching infinity.

Reply
Member

Join Date: Dec 2014
Posts: 6
Good Answers: 1
#7

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/04/2015 12:39 PM

"Expectation" in probability is the average outcome expected over a large number of plays. In this game, there is no limit, but the probability of reaching an additional throw reduced by 50% each throw. You are guaranteed 1 throw, or $1. Your expectation on the second throw is $1 from the first throw, and $1 times the probability that you threw a tails on the first throw, i.e., $1 + ($1 x .5)= $1.5. The is the beginning of the "geometric series", 1 + 1/2 + 1/4 + 1/8..., otherwise expressed as S = 1 + 1/2+1/2^2+1/2^3+...+1/2^n, in this case where n=>Infinity. In one of what I have always considered to be one of the most clever proofs in mathematics, this can be reduced to s = 1/(1 - 1/2) = 2. So the expected outcome over an unlimited number of throws is $2 per game.

Reply Score 1 for Good Answer
Guru

Join Date: Apr 2010
Location: About 4000 miles from the center of the earth (+/-100 mi)
Posts: 9910
Good Answers: 1141
#9
In reply to #7

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/05/2015 2:18 PM

With a Matlab run of 10 million games, the likely payout comes out to be about 25 dollars. Even with this large number of games, the effect of an occasional lucky player can greatly affect the average, and some runs averaged 50-60 dollars. Shown above are the payouts, the cumulative average payout, and a histogram of the payouts.

Reply Score 1 for Good Answer
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#10
In reply to #9

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/06/2015 2:26 AM

Great analysis BUT....

10 million games is more than anyone could ever play in a life time!

I'd like to see the results for meaningful runs of games Let's say 1 or 2 hours of play at say 5 flips a minute.

Dunno how it will effect the result, but it should be easy for you to run.

Del

__________________
health warning: These posts may contain traces of nut.
Reply
Guru

Join Date: Apr 2010
Location: About 4000 miles from the center of the earth (+/-100 mi)
Posts: 9910
Good Answers: 1141
#12
In reply to #9

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/06/2015 8:13 AM

In #9, I assumed the payout was $1, $2, $4, $8, ... (The problem statement was ambiguous). If you assume the payout is $1, $2, $3, $4, ... the it is much more defined. The expected return is

P=$1/2 + $2/4 + $3/8 + $4/16 + $5/32 .... = $2.

Reply Score 1 for Good Answer
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#15
In reply to #12

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/09/2015 5:02 PM

Agreed the problem statement was ambiguous. I think it should say "the most likely dollars you make every time you play this game?" The maximum dollars you can make is clearly infinite, though with zero probability.

In your analysis I believe you're ignoring the $1 you get even if you get heads on first throw. There's a 50% chance of getting $2 by getting heads on 2nd throw. But if you get tails on 2nd throw you're still in the game, so the most likely dollars must be > 2.

I make it 1 + (1 + 1/2 + 1/22 + 1/23 + 1/24........) = 1 + 2 = $3 for most likely score.

__________________
Give masochists a fair crack of the whip
Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#17
In reply to #15

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/09/2015 6:08 PM

Please ignore most of that - faulty logic . I was forgetting you're out of the game with just $1 if you get heads on 1st throw. So I agree with your $2 (and george hanson # 7)

__________________
Give masochists a fair crack of the whip
Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#19
In reply to #7

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/10/2015 8:37 AM

I'm surprised the article you linked doesn't give the general case of sum to n terms Sn when q > 1.

Sn = 1 + q + q2......qn-1 (multiplying the whole thing by a constant makes a trivial change)

Multiplying by q, q*Sn = q + q2 + q3.....qn

Subtracting, (1 - q)*Sn = 1 - qn so Sn = (1 - qn)/(1 - q)

When q < 1, q = 0 and S = 1/(1 - q)

__________________
Give masochists a fair crack of the whip
Reply
Guru
Engineering Fields - Marine Engineering - New Member

Join Date: May 2007
Location: Australia.
Posts: 1642
Good Answers: 81
#11

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/06/2015 4:13 AM

While I agree with Del the Cat's entry, (previous GA) I have noticed that the puzzle don't refer to any loss situation, plus the statement, (every time you play the game), suggesting the number of games that can be played? So I must go along with Del the Cat's entry, based on the fact that there is no loss situation, therefore only one game at a time is played. Therefore the expectation is a 50/50 situation for every time you play the game. The 50/50 situation being an average of the number of spins over at the start of each game, the larger the number of game played, the closer the average is to $3.

Reply
Member

Join Date: Nov 2009
Posts: 7
Good Answers: 1
#13

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/06/2015 12:04 PM

Other answerers have commented on the wording in this question. I'll refer to the ambiguous use of "every". What is the maximum I can (reasonably) expect to make EVERY time I play? $1. Theoretically, about half the time I will make $1, will never make less, and will frequently make more than $1 but not quite half the time, being mortal. It is clearly unreasonable to expect the latter to happen on every play.

Reply
Guru

Join Date: Mar 2009
Posts: 507
#14

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/07/2015 12:12 PM

there's no limit the number of tails the coin can fall!

the coin can fall on head, tail and rim! the statistical value the coin falls on tail is nearly 50%!

Reply
Participant

Join Date: Aug 2015
Posts: 1
#20

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/18/2015 4:41 PM

The most important words in the challenge question are "every time" and "make".

Regarding "every time": One way to interpret this is that in x number of games, what is the smallest amount you won in any one of those x games. Therefore, your expectations should be based on the number of time you plan to play.

If you only play one game, you have 100% chance of winning at least $1, a 50% chance of winning $2, and a 25% chance of winning $3 or more. Therefore, if you only plan to play one game, you could probably expect to win $2 if you are optimistic.

If you only plan to play two games, you have a 100% chance of winning a minimum of $1 for both game and a 25% chance of winning $2 for both games. Therefore, if you play two games, you have a less than 50% chance of winning more than $1 "every time".

If you play more than two games, your chance of winning more than $1 "every time" is even less.

Another interpretation is related to the meaning of "make". The fair fee to play this game is $2. This the average return based on the probability. Therefore, if you pay $2 to play, you would expect to break even. If it costs less to play, you would expect to make the difference between $2 and the fee. If it costs more than $2 to play, you would expect to lose, the difference between the fee and $2.

Jim

Reply
Participant

Join Date: Jul 2013
Posts: 2
#21

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/25/2015 1:03 PM

Maybe I'm missing something but, if I flip the coin and receive five "tails" before receiving a "heads", wouldn't I win $6?

Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#22
In reply to #21

Re: Coin Flips for Cash: Newsletter Challenge (August 2015)

08/25/2015 1:59 PM

Yes, but that's not a probable outcome. Several posters agree that it should say "the most likely dollars you make every time you play this game?" and that the answer is $2. We should be getting the "official" answer soon!

__________________
Give masochists a fair crack of the whip
Reply
Reply to Blog Entry 22 comments

Good Answers:

These comments received enough positive votes to make them "good answers".

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

Codemaster (5); DeputyDawg (1); george_hanson (1); jdretired (1); jim355 (1); kirchwey (1); LOONYLEN (1); Mikerho (1); redfred (2); Rixter (3); SolarEagle (1); Usbport (1); user-deleted-1105 (2); WilhelmHKoen (1)

Previous in Blog: Apollo 11 Communications Log- Gimbal Lock: Newsletter Challenge (July 2015)   Next in Blog: Mars Farms: Newsletter Challenge (September 2015)

Advertisement