Pattern matching probabilities and paradoxes A new variation on Penney s coin game

Transcription

1 Osaka Keidai Ronshu, Vol. 63 No. 4 November 2012 Pattern matching probabilities and paradoxes A new variation on Penney s coin game Yutaka Nishiyama Abstract This paper gives an outline of an interesting probability game related to coin arrangements discovered by Walter Penney in 1969, and explains John Conway s concept of leading numbers and his algorithm for using them to automatically calculate mutual odds of winning. I will show that Conway s elegant algorithm is correct by using average waiting times as proposed by Stanley Collings, and discuss the effect of applying the rules of this coin game to a card game instead. Keywords : Penney Ante, pattern matching, odds, non-transitive relation, Conway s Algorithm, average waiting time 1. Penney Ante One day I received an from a British acquaintance, Steve Humble. In some excitement, he told me that a magician named Derren Brown was introducing an interesting game on the television. I was a little dubious upon hearing the word magician, but after close examination I realized that the game had a mathematical background and was an interesting exercise in probability. The game is not a well known one, so I would like to introduce it to you. Assume a coin flip with equal probability of coming up heads or tails. The game is played by Players A and B each selecting a sequence of three flips, flipping the coin repeatedly, and seeing whose sequence comes up first. For example, assume that Player A selected heads-headsheads HHH and Player B selected tails-heads-heads THH. Then, assume that the coin is flipped repeatedly, resulting in a sequence like the following: HTHTHHHHTHHHTTTTHTHH The player whose sequence showed up first, HHH or THH, would be declared the winner. Both heads and tails have an equal probability of appearing. There are possible sequences of three flips, and so each sequence has a 1 in 8 chance of appearing. It would seem that both players have an equal chance of winning, regardless of the sequence chosen, but would you believe that the player who selected THH is seven times more likely to win than the player who selected HHH? 2. Non-transitive relations This problem in probability has been around for some time, but is not widely known. Walter

2 Osaka Keidai Ronshu, Vol. 63 No. 4 Penney first presented it in an article, only ten lines long, in the Journal of Recreational Mathematics in Martin Gardner later provided a more detailed description in his Mathematical Games column in the October 1974 issue of Scientific American 2. When the game is played using patterns of length 3, no matter what sequence Player A chooses, Player B can always make a winning selection. Table 1 shows the eight possible selections for Player A and the winning selection for Player B. According to the table, selecting THH in response to HHH gives 7: 1 odds of winning, selecting THH in response to HHT gives 3: 1 odds, and selecting HHT in response to HTH gives 2: 1 odds. A s choice B s choice Odds in favor of B 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 Table 1 : Odds in favor of B. Table 1 shows that THH is stronger than HHH, TTH is stronger than THH, HTT is stronger than TTH, HHT is stronger than HTT, and THH is stronger than HHT. In other words, Player A does not have a strongest selection. This relationship is shown in Fig. 1 as a looped relationship among the four inner patterns. HTH HTT TTT HHT TTH HHH THH THT Fig. 1 : Relationship between the eight patterns. Mathematically speaking, the following is referred to as a transitive relationship: If and then Rephrasing this in terms of a game, then we would have If player A beats player B and player B beats player C, then player A beats player C. But is this a true proposition? Gardner poses that this transitive relationship does not hold in the Penney Ante game, that it forms nontransitive relations 2. Such three-way relationships may be unfamiliar in the West, but they are well known in Japan, for example in the old game of rock-scissors-paper. In that game, it does not follow that because rock beats scissors and scissors beat paper that therefore rock

3 Pattern matching probabilities and paradoxesa new variation on Penney s coin game beats paper. Instead, rock loses to paper, therefore failing to uphold the transitive relationship. Similarly, transitive relationships do not hold in Penney Anteas in rock-scissors-paper, there is no best play and the second player can always win. The following rules exist for Player B s selection, based on the selection made by Player A. Assume that Player A chooses HHH. In that case, the second call is for H. Flip that selection to a T, and move it to the beginning of Player B s sequence. Next, take the first two calls in Player A s sequence, and take those as the second and third call in Player B s. Doing so results in THH for Player B, a selection that will win against Player A. Player A s third call is not considered. HHH THH Readers should confirm that each of the selections for Player B in Table 1 follow this rule. This rule for the selection by Player B based on the selection by Player A works for runs of length 3, but only for runs of length 3the same algorithm will not necessarily work for other lengths. Let us confirm the probabilities listed in Table 1. We will first calculate the probability that THH will appear before HHH. Assume that Player A selects HHH. Should that sequence appear in the first three tosses, then Player A will win. In any other situation, Player B will win. The probability that the first three tosses will come up HHH is ; thus, PTHH before HHH Player B s odds are therefore, or. Let us next calculate the probability that THH will appear before HHT. The probability of flipping HHT, or HHHT, or HHHHT is This gives the probability of HHT winning. The probability of THH winning is therefore the complementary event, and thus PTHH before HHT Player B s odds are therefore, or. Let us next calculate the probability that HHT will appear before HTH. PHHT before HTH We can ignore all initial flips of T. Taking the first flip as H, if the next flip is also H then the probability of HHT appearing is. If a T is flipped, however, the sequence is reset and must wait for the next H flip. That then is equivalent to. Shown as an equation, we have and solving for gives

4 Osaka Keidai Ronshu, Vol. 63 No. 4 Player B s odds are therefore, or. Continuing in this manner, the individual odds for each pair can be calculated, but Conway s Algorithm provides a general solution. The following section describes that algorithm. 3. Conway s Algorithm John Conway proposed an algorithm that can be used to easily calculate the odds of Player B beating Player A. Conway introduced leading numbers as an index indicating the degree of pattern overlap. Leading numbers are also an index of the level of repetition of a given pattern within a preceding pattern, and are called Conway Numbers after their inventor. Let us now examine Conway s algorithm, taking as an example the case where Player A selected HHH, and Player B selected THH. Let us first find the Conway Number for Player A with regards to Player A s own selection. First, we place AHHH over AHHH. Next, if the HHH of the upper sequence is the same as the lower sequence, then we place a 1 over the first element and a 0 otherwise. Next, remove the leading H from the upper HHH sequence, and shift it to the left, aligning the leading elements. Then, compare the HH to the first two elements in the lower sequence, and if they are the same place a 1 above the leading element of the HH, or a 0 otherwise. Repeat this procedure through to the last element of the upper sequence, and compile the results as follows. The resulting binary number 111 is an index of the overlap of A with regards to A, and the notation for the Conway number is 111. There are a total of permutations of Conway numbers for a given pair of upper and lower sequences. The following are the Conway numbers for pairs,,, and.

6 Osaka Keidai Ronshu, Vol. 63 No Proof according to average wait time The algorithm for determining odds using Conway Numbers is indeed elegant and powerful. Let us consider precisely why one can calculate win probabilities from Conway Numbers. As elegant an algorithm as it is, Conway himself did not propose a proof in the paper in which he demonstrated it. Searching through the literature, I came across an easily understood proof that uses Stanley Collings s concept of average waiting time 3. Collings s proof is developed from three theorems. Theorem X The expected waiting time to get a given sequence of integers from the set is where stands for the corresponding Conway Number considering entirely of and and interpreted in the scale of The faces of a coin {H, T} can be mapped to {1, 2}. AHHH, BTHH is therefore mapped to A111, B211, and their Conway Numbers are,. Converting the binary numbers to decimal we have,, and doubling them we have average wait times of 14 and 8. Theorem Y Given a sequence B to start with, the expected further number of rolls required to complete or produce the A sequence is For example, given the sequence B211, because,, the average wait time for A111 to appear is Theorem Z The odds that the B sequence precedes the A sequence are given by When the average wait time of A is larger than that of B, then the difference is expressed as On the other hand, from Theorem Y we have that the average wait time for A to appear when B precedes A is Similarly, the average wait time for B to appear when A precedes B is Taking the probability of Player A winning as and the probability of Player B winning as, will occur with probability and will occur with probability and so the three terms above are related by Dividing both sides of the equation by, we obtain

7 Pattern matching probabilities and paradoxesa new variation on Penney s coin game and Because, we have and The last equation gives the odds of Player B beating Player A, and proves Conway s algorithm. 5. Application to a card game In the preceding sections, we examined Penney s Ante using heads and tails in a coin flipping game; however, Steve Humble and I have been discussing how this might be applied to a more familiar context, such as a card game. While coin tosses give equal probabilities of heads or tails, we cannot guarantee that the probabilities are exactly 1 / 2. The situation is the same with the red / black results of a roulette table. Coin flips are also problematic in that the action of flipping a coin is somewhat difficult, and one must maintain a record of the results. We therefore turned our consideration to packs of cards. There are 52 cards in a deck, and the 26 black spades and clubs and 26 red hearts and diamonds cards can be used to substitute for the heads or tails results of a coin flip. Let B represent black cards, and R red cards, so that HHH versus THH when flipping coins could be represented as BBB versus RBB when using cards. The advantage of using cards lies in their ease of manipulation, and the fact that one does not need to keep track of results. They can also be well randomized. If all 26 red and black cards are used, then there is a 1 / 2 chance of choosing either color from the 52 total cards. The 52 cards also allow an appropriate number of trials. It is difficult to determine the end of a game that uses coin flips, but one can simply declare an end when all 52 cards are used. The only problem to consider is if they will form a game. The number of trials that can be performed with 52 cards is given by Collings s theory 3, as shown below, which states that the average wait time before sequence A or B will appear is or The average wait time before A or B appears can be given as a group As shown in Table 3, the values of differ according to matches, giving 7 for BBB versus RBB, and 16 / 3 for BRR versus BBR. Here, the average wait time refers to the number of tricks played per match. Dividing this number by the number of cards 52 therefore gives the number of trials. The theoretical values give a distribution of trials, which matches well with the statistical values we found when we tried this with actual cards 710. From Table 3 we see that the probabilities for BBB and RBB are 1 / 8 and 7 / 8, giving RBB overwhelming odds of 7: 1 in a match versus BBB. In the match RBR versus RRB, however, the odds for RRB are only 2: 1. Such odds imply no guarantee of winning in a single match.

8 Osaka Keidai Ronshu, Vol. 63 No. 4 A B Trials BBB RBB / 8 7 / BBR RBB / 4 3 / 4 13 / 2 8 BRB BBR / 3 2 / BRR BBR / 3 2 / 3 16 / RBB RRB / 3 2 / 3 16 / RBR RRB / 3 2 / RRB BRR / 4 3 / 4 13 / 2 8 RRR BRR / 8 7 / Table 3 : Average trials using a pack of cards. : Average wait times We would therefore like to perform trials to increase the odds of RRB winning. For example, in a match of three tricks, Player B will win by taking two tricks, and in a match of seven tricks Player B will win by taking four. Showing this as an equation gives us the following. Taking P RRB, over trials, the probability of an RRB win is a clear advantage for Player B over the probability for a single trial. Playing the game using cards over 79 trials, we can expect a very high probability that Player B will win. We have shown in this article that Penney s game can be applied to the use of cards, and that cards are better suited to its application than coin tosses. We would like to present this new card-based version as the Humble-Nishiyama Randomness Game, and hope that our readers will try it with a deck of cards at home. References 1 Walter Penney, 95. Penney-Ante, Journal of Recreational Mathematics, 21969, Martin Gardner, Mathematical Games, Scientific American, October 1974, 2314, Stanley Collings, Coin Sequence Probabilities and Paradoxes, Bulletin of the Institute of Mathematics and its Applications, 18, November / December 1982,

1 University of Waterloo Faculty of Mathematics Centre for Education in Mathematics and Computing Grade 7/8 Math Circles Fall 2012 Probability Probability is one of the most prominent uses of mathematics

Basics of Probability August 27 and September 1, 2009 1 Introduction A phenomena is called random if the exact outcome is uncertain. The mathematical study of randomness is called the theory of probability.

Chapter 6 1. What is the probability that a card chosen from an ordinary deck of 52 cards is an ace? 4/52. 2. What is the probability that a randomly selected integer chosen from the first 100 positive

V. RANDOM VARIABLES, PROBABILITY DISTRIBUTIONS, EXPETED VALUE A game of chance featured at an amusement park is played as follows: You pay $ to play. A penny and a nickel are flipped. You win $ if either

Bayesian Tutorial (Sheet Updated 20 March) Practice Questions (for discussing in Class) Week starting 21 March 2016 1. What is the probability that the total of two dice will be greater than 8, given that

36 Odds, Expected Value, and Conditional Probability What s the difference between probabilities and odds? To answer this question, let s consider a game that involves rolling a die. If one gets the face

Chapter 4 - Practice Problems SHORT ANSWER. Write the word or phrase that best completes each statement or answers the question. Provide an appropriate response. ) Compare the relative frequency formula

The Central Limit Theorem Part. Introduction: Let s pose the following question. Imagine you were to flip 400 coins. To each coin flip assign if the outcome is heads and 0 if the outcome is tails. Question:

33 Probability: Some Basic Terms In this and the coming sections we discuss the fundamental concepts of probability at a level at which no previous exposure to the topic is assumed. Probability has been

.4 Random Variable Motivation example In an opinion poll, we might decide to ask 50 people whether they agree or disagree with a certain issue. If we record a for agree and 0 for disagree, the sample space

C HAPTER 3 PROBABILITY Random Experiments I. WHAT IS PROBABILITY? The weatherman on 0 o clock news program states that there is a 20% chance that it will snow tomorrow, a 65% chance that it will rain and

MATH 10: Elementary Statistics and Probability Chapter 4: Discrete Random Variables Tony Pourmohamad Department of Mathematics De Anza College Spring 2015 Objectives By the end of this set of slides, you

1 3.1 Sample Spaces and Tree Diagrams Probability This section introduces terminology and some techniques which will eventually lead us to the basic concept of the probability of an event. The Rare Event

C Probability and Probability Distributions APPENDIX C.1 Probability A1 C.1 Probability Find the sample space of an experiment. Find the probability of an event. Sample Space of an Experiment When assigning

Introduction to the Practice of Statistics Sixth Edition Moore, McCabe Section 5.1 Homework Answers 5.9 What is wrong? Explain what is wrong in each of the following scenarios. (a) If you toss a fair coin

Chapter 4 & 5 practice set. The actual exam is not multiple choice nor does it contain like questions. MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Topic 6: September 15-20, 2011 One of the most important concepts in the theory of probability is based on the question: How do we modify the probability of an event in light of the fact that something

An event is any set of outcomes of a random experiment; that is, any subset of the sample space of the experiment. The probability of a given event is the sum of the probabilities of the outcomes in the

Probability and Statistics Random Chance A tossed penny can land either heads up or tails up. These are mutually exclusive events, i.e. if the coin lands heads up, it cannot also land tails up on the same

Chapter - Practice Problems 2 MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Find the indicated probability. 1) If you flip a coin three times, the

Thursday, October 18, 2001 Page: 1 1. Page 226 numbers 2 3. STAT 305 Solutions S has eight states Notice that the first two letters in state n +1 must match the last two letters in state n because they

Probability and Expected Value This handout provides an introduction to probability and expected value. Some of you may already be familiar with some of these topics. Probability and expected value are

Expected Value and the Game of Craps Blake Thornton Craps is a gambling game found in most casinos based on rolling two six sided dice. Most players who walk into a casino and try to play craps for the

MATH 11008: Probability Chapter 15 Definitions: experiment: is the act of making an observation or taking a measurement. outcome: one of the possible things that can occur as a result of an experiment.

How Not to Win a Million Dollars: A Counterexample to a Conjecture of L. Breiman Thomas P. Hayes arxiv:1112.0829v1 [math.pr] 5 Dec 2011 Abstract Consider a gambling game in which we are allowed to repeatedly

AMC 8 Practice Questions Example Each of the following four large congruent squares is subdivided into combinations of congruent triangles or rectangles and is partially shaded. What percent of the total

Homework Assignment #2: Answer Key Chapter 4: #3 Assuming that the current interest rate is 3 percent, compute the value of a five-year, 5 percent coupon bond with a face value of $,000. What happens if

Chapter 6 Expected Value and Variance 6.1 Expected Value of Discrete Random Variables When a large collection of numbers is assembled, as in a census, we are usually interested not in the individual numbers,

Section 4.3: Tree Diagrams and the Counting Principle It is often necessary to know the total number of outcomes in a probability experiment. The Counting Principle is a formula that allows us to determine

6.42/8.62J Mathematics for Computer Science Srini Devadas and Eric Lehman May 3, 25 Lecture otes Expected Value I The expectation or expected value of a random variable is a single number that tells you

Chapter 8 Discrete probability and the laws of chance 8.1 Introduction In this chapter we lay the groundwork for calculations and rules governing simple discrete probabilities. These steps will be essential

Section 6.2 Definition of Probability Probability is a measure of the likelihood that an event occurs. For example, if there is a 20% chance of rain tomorrow, that means that the probability that it will

Probabilities of Poker Hands with Variations Jeff Duda Acknowledgements: Brian Alspach and Yiu Poon for providing a means to check my numbers Poker is one of the many games involving the use of a 52-card

STUDENT MODULE 12.1 GAMBLING PAGE 1 Standard 12: The student will explain and evaluate the financial impact and consequences of gambling. Risky Business Simone, Paula, and Randy meet in the library every

Basic probability A probability space or event space is a set Ω together with a probability measure P on it. This means that to each subset A Ω we associate the probability P(A) = probability of A with

Lesson 1: Experimental and Theoretical Probability Probability is the study of randomness. For instance, weather is random. In probability, the goal is to determine the chances of certain events happening.

Chapter 6 Expected Value and Variance 6.1 Expected Value of Discrete Random Variables When a large collection of numbers is assembled, as in a census, we are usually interested not in the individual numbers,

What does it mean for something to be random? An event is called random if the process which produces the outcome is sufficiently complicated that we are unable to predict the precise result and are instead

Sample Space, Events, and PROBABILITY In this chapter, we will study the topic of probability which is used in many different areas including insurance, science, marketing, government and many other areas.

AMS 5 CHANCE VARIABILITY The Law of Averages When tossing a fair coin the chances of tails and heads are the same: 50% and 50%. So if the coin is tossed a large number of times, the number of heads and

PROBABILITY 53 Chapter 3 PROBABILITY The theory of probabilities is simply the Science of logic quantitatively treated. C.S. PEIRCE 3. Introduction In earlier Classes, we have studied the probability as

4.3 Probability (4-3) 727 4.3 PROBABILITY In this section In the two preceding sections we were concerned with counting the number of different outcomes to an experiment. We now use those counting techniques

Discrete Math in Computer Science Homework 7 Solutions (Max Points: 80) CS 30, Winter 2016 by Prasad Jayanti 1. (10 points) Here is the famous Monty Hall Puzzle. Suppose you are on a game show, and you

-0: Problem Solving in Recreational Mathematics Homework assignment solutions Problem. An urn contains five red balls and three yellow balls. Two balls are drawn from the urn at random, without replacement.

Concept Probability and statistics Number sense Activity 9 Hey, That s Not Fair! (Or is it?) Students will use the calculator to simulate dice rolls to play two different games. They will decide if the

B. Weaver (3-Oct-25) Probability & Hypothesis Testing. PROBABILITY AND INFERENCE Probability and Hypothesis Testing The area of descriptive statistics is concerned with meaningful and efficient ways of

3. BINARY NUMBERS AND ARITHMETIC 3.1. Binary Numbers The only place in a computer where you will find the number 9 is on the keyboard. Inside the computer you will only find 0 s and 1 s. All computer memory

Decision Making Under Uncertainty Professor Peter Cramton Economics 300 Uncertainty Consumers and firms are usually uncertain about the payoffs from their choices Example 1: A farmer chooses to cultivate

Probability experiment Toss two coins Toss three coins Roll two dice Activity 1: An Experiment with 2 coins WE TOSS TWO COINS When we toss two coins at the same time, the possible outcomes are: (two Heads)

Fundamentals of Probability Introduction Probability is the likelihood that an event will occur under a set of given conditions. The probability of an event occurring has a value between 0 and 1. An impossible

Examples for Chapter 3 Probability Math 1040-1 Section 3.1 1. Draw a tree diagram for each of the following situations. State the size of the sample space. (a) You flip a coin three times. (b) You draw

AP Stats - Probability Review Multiple Choice Identify the choice that best completes the statement or answers the question. 1. I toss a penny and observe whether it lands heads up or tails up. Suppose

JANUARY TERM 2012 FUN and GAMES WITH DISCRETE MATHEMATICS Module #9 (Geometric Series and Probability) Author: Daniel Cooney Reviewer: Rachel Zax Last modified: January 4, 2012 Reading from Meyer, Mathematics

RECAP Basic Probability heory II Dr. om Ilvento FREC 408 We said the approach to establishing probabilities for events is to Define the experiment List the sample points Assign probabilities to the sample

PROBABILITY Thabisa Tikolo STATISTICS SOUTH AFRICA Probability is a topic that some educators tend to struggle with and thus avoid teaching it to learners. This is an indication that teachers are not yet

Discrete and Continuous Random Variables Summer 003 Random Variables A random variable is a rule that assigns a numerical value to each possible outcome of a probabilistic experiment. We denote a random

3 Introduction to Probability Given a fair coin, what can we expect to be the frequency of tails in a sequence of 10 coin tosses? Tossing a coin is an example of a chance experiment, namely a process which

7.1 Sample space, events, probability In this chapter, we will study the topic of probability which is used in many different areas including insurance, science, marketing, government and many other areas.

This is Basic Concepts of Probability, chapter 3 from the book Beginning Statistics (index.html) (v. 1.0). This book is licensed under a Creative Commons by-nc-sa 3.0 (http://creativecommons.org/licenses/by-nc-sa/