Twenty One or Two Hundred Thirty Nine?

Logic Level 2

Alice and Carla are playing a game often learned in elementary school known as Twenty One . The rules for the game are as follows:

  • Each player takes turns saying between 1 1 and 3 3 consecutive numbers, with the first player starting with the number 1 1 . For example, Player 1 1 could say the numbers 1 1 and 2 2 , then Player 2 2 can say " 3 3 , 4 4 , 5 5 ", then Player 1 1 can say " 6 6 " and so on.

  • The goal of the game is to get the other person to say " 21 21 ", meaning that you have to be the one to say " 20 20 ".

Carla begins to get bored with the game, so she decides to make it a little bit more challenging. The name of the new game is Two Hundred Thirty Nine , where the goal is now to get the other person to say " 239 239 ". Carla decides that she'll go first and that Alice will go second. Also, each player is now able to say up to " 6 6 " numbers per turn. Is there a way to tell which player is going to win before the game even starts?

Details and Assumptions :

  • Assume that each player plays "perfectly", meaning that if there was an optimal way of playing, both players would be playing the best that the game allows them to play.
Alice Either Player Carla

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Garrett Clarke
Jul 10, 2015

The key to the solution is to begin by looking at smaller cases and generalizing to bigger cases. Let's start by analyzing the game Twenty One.

Our goal in this game is to say the number "20". It's easy to show that no matter what Player 1 does, if Player 2 is playing perfectly it is impossible for Player 1 to win.

Consider the following strategy. Allow Player 1 to play whatever they want and have Player 2 play up to only multiples of 4 4 . For example, Player 1 says "1, 2, 3" and Player 2 says "4". Player 1 says "5, 6" and Player 2 says "7, 8". It's always possible to hit a multiple of 4 4 because the maximum number of terms each player can say is 3 3 , so if Player 1 say 1 number then Player 2 plays 3, or they can each play 2 and 2 or 3 and 1. Notice that 20 20 is a multiple of 4, so as long as Player 2 follows this method they'll win every time.

What happens we increase the length of the game? Let's let N N be the length of our game, and we'll try to analyze N = 22 N=22 , AKA the game Twenty Two. Now you want to say "21" to win. In this scenario, Player 1 will always win because the numbers we want to say are of the form 4 m + 1 4m+1 . All Player 1 has to do is say "1" and the game is already over. He plays 1, 5, 9, 13, 17, and finally 21 and Player 2 can't stop him. This should be sufficient to show that Player 2 can only win when 4 N 1 4|N-1 .

Now what happens if we increase the number of terms? Let T T be the number of terms each person can say each turn. We'll let T=4 and let N = 21 N=21 for our example. We can now guarantee that we can say every 5 5 th number, because if one person says 1 number, the other says 4, if one says 2 the other says 3, and so on. 21 21 is a multiple of 5 5 , so Player 2 will win every time. If we generalize this idea for T T terms, Player 2 can only win when ( T + 1 ) 20 (T+1)|20 , because otherwise the first number in the sequence of multiples will be a number that Player 1 can say.

Combining the conditions together, we have the following formula:

If ( T + 1 ) ( N 1 ) (T+1)|(N-1) , then Player 2 wins. Otherwise, Player 1 wins.

Finally, let's plug in our values of T T and N N to see who wins.

( 6 + 1 ) ( 239 1 ) (6+1)|(239-1)

7 238 7|238

Since 7 × 34 = 238 7\times34=238 , Player 2 will always win this game, or in this case, Alice \boxed{\text{Alice}} is the winner.

John Wyatt
Jul 15, 2015

Simple General solution

n = number each player can say per go (ie 6) N = number that causes you to loss (ie 239)

If playing perfectly winner will say every number that fit pattern (N-1)-nz (where z is an integer) , because they can then say the number 1 less than N, to force other player to say "N"

If (N-1)/n is an integer player 2 will win (else play 1 will win)

Shrimat Kapoor
Sep 26, 2018

First find the pattern in the simple game, 21 with 2 players. If you watch "Scam school" on Youtube or just know about these number games, in general there will be key flag positions that once you hit will propagate through the entire game.

In the first example, work backwards from 21 and you should notice a pattern in the positions that win or lose. E.g. 18, 19 and 20 are all winning positions because if it is my turn and the next number to be said is one of these I can say the numbers up-to 20 and my opposition is forced to say 21. 17 on the other hand is a losing position because if I have to say 17 next, I can only go up-to 19 by saying 17, 18, 19 and opposition says 20 and so I lose. So you will notice that the nth term of the losing positions has a multiplier of (k+1) where one can say "k" numbers per turn, in this case 3+1 = 4. To make the adjustment of a constant, notice that 17 is one greater than a multiple of 4, so the nth term for the first game is 4n+1. Look at the first possible number, when n=0 the losing term is 1. So basically whoever says 1 loses, the person who starts.

Using this logic, the nth term for 239 is 7n-6 and again we get for n=1, the losing term is 1. Because Carla starts she will say 1 and so she is the loser which means that Alice is the winner.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...