Penney's game: Difference between revisions
mNo edit summary Tags: Visual edit Mobile edit Mobile web edit |
|||
(48 intermediate revisions by 41 users not shown) | |||
Line 1: | Line 1: | ||
{{Short description|Sequence generating game between two players}} |
|||
⚫ | '''Penney's game''', named after its inventor Walter Penney, is a [[Binary numeral system|binary]] (head/tail) [[sequence]] generating game between two players |
||
[[File:Heads tails heads.jpg|thumb|upright=1.3|A possible sequence in Penney's game: heads, tails, heads]] |
|||
[[File:penney_game_graphs.svg|thumb|upright=1.3|Graphs of best responses for Penney's games of sequence lengths 3 and 4 – each sequence is dominated by the sequence pointing to it with the given probability (''italics'') or odds (normal text)<ref>{{Cite web|url=http://researchgate.net/figure/Best-response-strings-for-strings-of-length-3_tbl1_353285025|title=Best response strings for strings of length 3. | Download Scientific Diagram|accessdate=29 March 2023}}</ref>]] |
|||
⚫ | '''Penney's game''', named after its inventor Walter Penney, is a [[Binary numeral system|binary]] (head/tail) [[sequence]] generating game between two players. Player A selects a sequence of heads and tails (of length 3 or larger), and shows this sequence to player B. Player B then selects another sequence of heads and tails of the same length. Subsequently, a fair [[coin]] is tossed until either player A's or player B's sequence appears as a consecutive subsequence of the coin toss outcomes. The player whose sequence appears first wins. |
||
Provided sequences of at least length three are used, the second player (B) has an edge over the starting player (A). This is because the game is [[Nontransitive game|nontransitive]] such that for any given sequence of length three or longer one can find another sequence that has higher [[probability]] of occurring first. |
Provided sequences of at least length three are used, the second player (B) has an edge over the starting player (A). This is because the game is [[Nontransitive game|nontransitive]] such that for any given sequence of length three or longer one can find another sequence that has higher [[probability]] of occurring first. |
||
==Analysis of the three-bit game== |
==Analysis of the three-bit game== |
||
For the three-[[bit]] sequence game, the second player can |
For the three-[[bit]] sequence game, the second player can optimize their [[odds]] by choosing sequences according to: |
||
{| class="wikitable" style="text-align: center;" |
{| class="wikitable" style="text-align: center;" |
||
Line 27: | Line 30: | ||
|} |
|} |
||
An easy way to remember the sequence |
An easy way to remember the sequence is for the second player to start with the opposite of the middle choice of the first player, then follow it with the first player's first two choices. |
||
⚫ | |||
⚫ | |||
where (not-2) is the opposite of the second choice of the first player.<ref name=":0">[https://www.youtube.com/watch?v=IMsa-qBlPIE Predicting a coin toss] by [[Scam School]] (on [[YouTube]])</ref> |
|||
⚫ | |||
⚫ | An intuitive explanation for this result |
||
⚫ | |||
therefore there should be a buffalo |
|||
where (not-2) is the opposite of the second choice of the first player. |
|||
⚫ | An intuitive explanation for this result is that in any case that the sequence is not immediately the first player's choice, the chances for the first player getting their sequence-beginning, the opening two choices, are usually the chance that the second player will be getting their full sequence. So the second player will most likely "finish before" the first player. |
||
==Strategy for more than three bits== |
==Strategy for more than three bits== |
||
The optimal strategy for the first player (for any length of the sequence no less than 4) was found by J.A. Csirik (See References). It is to choose HTTTT.....TTTHH (<math>k-3</math> T's) in which case the second player's maximal odds of winning is <math> (2^{k-1}+1):(2^{k-2}+1) </math> |
The optimal strategy for the first player (for any length of the sequence no less than 4) was found by J.A. Csirik (See References). It is to choose HTTTT.....TTTHH (<math>k-3</math> T's) in which case the second player's maximal odds of winning is <math> (2^{k-1}+1):(2^{k-2}+1) </math>. |
||
==Variation with playing cards== |
==Variation with playing cards== |
||
One suggested variation on |
One suggested variation on Penney's Game uses a pack of ordinary playing cards. The Humble-Nishiyama Randomness Game follows the same format using Red and Black cards, instead of Heads and Tails.<ref>[http://plus.maths.org/content/os/issue55/features/nishiyama/index Winning Odds] by Yutaka Nishiyama and Steve Humble</ref><ref>[http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.177.1176 Humble-Nishiyama Randomness Game - A New Variation on Penney’s Coin Game] on CiteSeer</ref> The game is played as follows. At the start of a game each player decides on their three colour sequence for the whole game. The cards are then turned over one at a time and placed in a line, until one of the chosen triples appears. The winning player takes the upturned cards, having won that "trick". The game continues with the rest of the unused cards, with players collecting tricks as their triples come up, until all the cards in the pack have been used. The winner of the game is the player that has won the most tricks. An average game will consist of around 7 "tricks". As this card-based version is quite similar to multiple repetitions of the original coin game, the second player's advantage is greatly amplified. The probabilities are slightly different because the odds for each flip of a coin are [[Independence (probability theory)|independent]] while the odds of drawing a red or black card each time is dependent on previous draws. Note that HHT is a 2:1 favorite over HTH and HTT but the odds are different for BBR over BRB and BRR. |
||
Below are |
Below are approximate probabilities of the outcomes for each strategy based on computer simulations:<ref>Results are broadly in line with those in Steve Humble and Yutaka Nishiyama, Humble-Nishiyama Randomness Game ''Mathematics Today'' August 2010 p 143 - |
||
A new variation on Penney’s Coin Game [http://www.ima.org.uk/_db/_documents/Humble%20Nishiyama%20Randomness%20Game%20copy.pdf] {{Webarchive|url=https://web.archive.org/web/20150924033735/http://www.ima.org.uk/_db/_documents/Humble%20Nishiyama%20Randomness%20Game%20copy.pdf|date=24 September 2015}}</ref> |
|||
{| class="wikitable" style="text-align: center;" |
{| class="wikitable" style="text-align: center;" |
||
Line 86: | Line 90: | ||
|<u>R'''R'''</u>R || '''B'''<u>RR</u> || 7.50 to 1 |
|<u>R'''R'''</u>R || '''B'''<u>RR</u> || 7.50 to 1 |
||
|} |
|} |
||
==Variation with a Roulette wheel== |
|||
Recently Robert W. Vallin, and later Vallin and Aaron M. Montgomery, presented results with Penney's Game as it applies to (American) roulette with Players choosing Red/Black rather than Heads/Tails. In this situation the probability of the ball landing on red or black is 9/19 and the remaining 1/19 is the chance the ball lands on green for the numbers 0 and 00. There are various ways to interpret green: (1) as a "wild card" so that BGR can be read at Black, Black, Red and Black, Red, Red, (2) as a do-over, the game stops when green appears and restarts with the next spin, (3) as just itself with not extra interpretation. Results have been worked out for odds and wait times.<ref>{{cite book|author1=Jennifer Beineke|author2=Jason Rosenhouse|author3=Robert W. Vallin|title=The Mathematics of Various Entertaining Subjects: Research in Games, Graphs, Counting, and Complexity, Volume 2|date=5 September 2017|publisher=Princeton University Press|location=Princeton|isbn=9780691171920}}</ref> |
|||
==See also== |
==See also== |
||
Line 96: | Line 104: | ||
* Walter Penney, Journal of Recreational Mathematics, October 1969, p. 241. |
* Walter Penney, Journal of Recreational Mathematics, October 1969, p. 241. |
||
* [[Martin Gardner]], "Time Travel and Other Mathematical Bewilderments", W. H. Freeman, 1988. |
* [[Martin Gardner]], "Time Travel and Other Mathematical Bewilderments", W. H. Freeman, 1988. |
||
* [[L.J. Guibas]] and [[A.M. Odlyzko]], "String Overlaps, Pattern Matching, and Nontransitive Games", |
* [[L.J. Guibas]] and [[A.M. Odlyzko]], "String Overlaps, Pattern Matching, and Nontransitive Games", Journal of Combinatorial Theory, Series A. Volume 30, Issue 2, (1981), pp 183–208. |
||
* [[Elwyn R. Berlekamp]], [[John H. Conway]] and [[Richard K. Guy]], "Winning Ways for your Mathematical Plays", 2nd Edition, Volume 4, AK Peters (2004), p. 885. |
* [[Elwyn R. Berlekamp]], [[John H. Conway]] and [[Richard K. Guy]], "Winning Ways for your Mathematical Plays", 2nd Edition, Volume 4, AK Peters (2004), p. 885. |
||
* S. Humble & Y. Nishiyama, "Humble-Nishiyama Randomness Game - A New Variation on Penney's Coin Game",IMA Mathematics Today. Vol 46, No. 4, August 2010, |
* S. Humble & Y. Nishiyama, "Humble-Nishiyama Randomness Game - A New Variation on Penney's Coin Game", IMA Mathematics Today. Vol 46, No. 4, August 2010, pp 194–195. |
||
* Steve Humble & [[Yutaka Nishiyama]], [http://plus.maths.org/issue55/features/nishiyama/index.html "Winning Odds"], Plus Magazine, Issue 55, June 2010. |
* Steve Humble & [[Yutaka Nishiyama]], [http://plus.maths.org/issue55/features/nishiyama/index.html "Winning Odds"], Plus Magazine, Issue 55, June 2010. |
||
* [[Yutaka Nishiyama]], [http://www.ijpam.eu/contents/2010-59-3/10/10.pdf Pattern Matching Probabilities and Paradoxes as a New Variation on Penney’s Coin Game], International Journal of Pure and Applied Mathematics, Vol.59, No.3, 2010, 357-366. |
* [[Yutaka Nishiyama]], [http://www.ijpam.eu/contents/2010-59-3/10/10.pdf Pattern Matching Probabilities and Paradoxes as a New Variation on Penney’s Coin Game], International Journal of Pure and Applied Mathematics, Vol.59, No.3, 2010, 357-366. |
||
* [[Ed Pegg, Jr.]], [http://blog.wolfram.com/2010/11/30/how-to-win-at-coin-flipping/ "How to Win at Coin Flipping"], [http://blog.wolfram.com/ Wolfram Blog], 30 November 2010. |
* [[Ed Pegg, Jr.]], [http://blog.wolfram.com/2010/11/30/how-to-win-at-coin-flipping/ "How to Win at Coin Flipping"], [http://blog.wolfram.com/ Wolfram Blog], 30 November 2010. |
||
⚫ | |||
*[[Robert W. Vallin]] "A sequence game on a roulette wheel", The Mathematics of Very Entertaining Subjects: Research in Recreational Math, Volume II, Princeton University Press, (to be published in 2017) |
|||
* James Brofos, "A Markov Chain Analysis of a Pattern Matching Coin Game." [https://arxiv.org/abs/1406.2212 arXiv:1406.2212] (2014). |
|||
⚫ | |||
* [https://penneys.github.io/ An online simulation of Penney's game] |
|||
⚫ | |||
* [[arxiv:2006.13002|Some variants of Penney's game]] |
|||
⚫ | |||
⚫ | |||
* Play Penney's game [http://www.haverford.edu/math/cgreene/390b-00/software/CoinFlip.html against the computer] |
|||
⚫ | |||
{{DEFAULTSORT:Penney's Game}} |
{{DEFAULTSORT:Penney's Game}} |
Latest revision as of 09:22, 21 November 2023
Penney's game, named after its inventor Walter Penney, is a binary (head/tail) sequence generating game between two players. Player A selects a sequence of heads and tails (of length 3 or larger), and shows this sequence to player B. Player B then selects another sequence of heads and tails of the same length. Subsequently, a fair coin is tossed until either player A's or player B's sequence appears as a consecutive subsequence of the coin toss outcomes. The player whose sequence appears first wins.
Provided sequences of at least length three are used, the second player (B) has an edge over the starting player (A). This is because the game is nontransitive such that for any given sequence of length three or longer one can find another sequence that has higher probability of occurring first.
Analysis of the three-bit game
[edit]For the three-bit sequence game, the second player can optimize their odds by choosing sequences according to:
1st player's choice | 2nd player's choice | Odds in favour of 2nd player |
---|---|---|
HHH | THH | 7 to 1 |
HHT | THH | 3 to 1 |
HTH | HHT | 2 to 1 |
HTT | HHT | 2 to 1 |
THH | TTH | 2 to 1 |
THT | TTH | 2 to 1 |
TTH | HTT | 3 to 1 |
TTT | HTT | 7 to 1 |
An easy way to remember the sequence is for the second player to start with the opposite of the middle choice of the first player, then follow it with the first player's first two choices.
- So for the first player's choice of 1-2-3
- the second player must choose (not-2)-1-2
where (not-2) is the opposite of the second choice of the first player.
An intuitive explanation for this result is that in any case that the sequence is not immediately the first player's choice, the chances for the first player getting their sequence-beginning, the opening two choices, are usually the chance that the second player will be getting their full sequence. So the second player will most likely "finish before" the first player.
Strategy for more than three bits
[edit]The optimal strategy for the first player (for any length of the sequence no less than 4) was found by J.A. Csirik (See References). It is to choose HTTTT.....TTTHH ( T's) in which case the second player's maximal odds of winning is .
Variation with playing cards
[edit]One suggested variation on Penney's Game uses a pack of ordinary playing cards. The Humble-Nishiyama Randomness Game follows the same format using Red and Black cards, instead of Heads and Tails.[2][3] The game is played as follows. At the start of a game each player decides on their three colour sequence for the whole game. The cards are then turned over one at a time and placed in a line, until one of the chosen triples appears. The winning player takes the upturned cards, having won that "trick". The game continues with the rest of the unused cards, with players collecting tricks as their triples come up, until all the cards in the pack have been used. The winner of the game is the player that has won the most tricks. An average game will consist of around 7 "tricks". As this card-based version is quite similar to multiple repetitions of the original coin game, the second player's advantage is greatly amplified. The probabilities are slightly different because the odds for each flip of a coin are independent while the odds of drawing a red or black card each time is dependent on previous draws. Note that HHT is a 2:1 favorite over HTH and HTT but the odds are different for BBR over BRB and BRR.
Below are approximate probabilities of the outcomes for each strategy based on computer simulations:[4]
1st player's choice | 2nd player's choice | Probability 1st player wins | Probability 2nd player wins | Probability of a draw |
---|---|---|---|---|
BBB | RBB | 0.11% | 99.49% | 0.40% |
BBR | RBB | 2.62% | 93.54% | 3.84% |
BRB | BBR | 11.61% | 80.11% | 8.28% |
BRR | BBR | 5.18% | 88.29% | 6.53% |
RBB | RRB | 5.18% | 88.29% | 6.53% |
RBR | RRB | 11.61% | 80.11% | 8.28% |
RRB | BRR | 2.62% | 93.54% | 3.84% |
RRR | BRR | 0.11% | 99.49% | 0.40% |
If the game is ended after the first trick, there is a negligible chance of a draw. The odds of the second player winning in such a game appear in the table below.
1st player's choice | 2nd player's choice | Odds in favour of 2nd player |
---|---|---|
BBB | RBB | 7.50 to 1 |
BBR | RBB | 3.08 to 1 |
BRB | BBR | 1.99 to 1 |
BRR | BBR | 2.04 to 1 |
RBB | RRB | 2.04 to 1 |
RBR | RRB | 1.99 to 1 |
RRB | BRR | 3.08 to 1 |
RRR | BRR | 7.50 to 1 |
Variation with a Roulette wheel
[edit]Recently Robert W. Vallin, and later Vallin and Aaron M. Montgomery, presented results with Penney's Game as it applies to (American) roulette with Players choosing Red/Black rather than Heads/Tails. In this situation the probability of the ball landing on red or black is 9/19 and the remaining 1/19 is the chance the ball lands on green for the numbers 0 and 00. There are various ways to interpret green: (1) as a "wild card" so that BGR can be read at Black, Black, Red and Black, Red, Red, (2) as a do-over, the game stops when green appears and restarts with the next spin, (3) as just itself with not extra interpretation. Results have been worked out for odds and wait times.[5]
See also
[edit]References
[edit]- ^ "Best response strings for strings of length 3. | Download Scientific Diagram". Retrieved 29 March 2023.
- ^ Winning Odds by Yutaka Nishiyama and Steve Humble
- ^ Humble-Nishiyama Randomness Game - A New Variation on Penney’s Coin Game on CiteSeer
- ^ Results are broadly in line with those in Steve Humble and Yutaka Nishiyama, Humble-Nishiyama Randomness Game Mathematics Today August 2010 p 143 - A new variation on Penney’s Coin Game [1] Archived 24 September 2015 at the Wayback Machine
- ^ Jennifer Beineke; Jason Rosenhouse; Robert W. Vallin (5 September 2017). The Mathematics of Various Entertaining Subjects: Research in Games, Graphs, Counting, and Complexity, Volume 2. Princeton: Princeton University Press. ISBN 9780691171920.
- Walter Penney, Journal of Recreational Mathematics, October 1969, p. 241.
- Martin Gardner, "Time Travel and Other Mathematical Bewilderments", W. H. Freeman, 1988.
- L.J. Guibas and A.M. Odlyzko, "String Overlaps, Pattern Matching, and Nontransitive Games", Journal of Combinatorial Theory, Series A. Volume 30, Issue 2, (1981), pp 183–208.
- Elwyn R. Berlekamp, John H. Conway and Richard K. Guy, "Winning Ways for your Mathematical Plays", 2nd Edition, Volume 4, AK Peters (2004), p. 885.
- S. Humble & Y. Nishiyama, "Humble-Nishiyama Randomness Game - A New Variation on Penney's Coin Game", IMA Mathematics Today. Vol 46, No. 4, August 2010, pp 194–195.
- Steve Humble & Yutaka Nishiyama, "Winning Odds", Plus Magazine, Issue 55, June 2010.
- Yutaka Nishiyama, Pattern Matching Probabilities and Paradoxes as a New Variation on Penney’s Coin Game, International Journal of Pure and Applied Mathematics, Vol.59, No.3, 2010, 357-366.
- Ed Pegg, Jr., "How to Win at Coin Flipping", Wolfram Blog, 30 November 2010.
- J.A. Csirik, "Optimal strategy for the first player in the Penney ante game", Combinatorics, Probability and Computing, Volume 1, Issue 4 (1992), pp 311–321.
- Robert W. Vallin "A sequence game on a roulette wheel", The Mathematics of Very Entertaining Subjects: Research in Recreational Math, Volume II, Princeton University Press, (to be published in 2017)
- James Brofos, "A Markov Chain Analysis of a Pattern Matching Coin Game." arXiv:1406.2212 (2014).
External links
[edit]