wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> easy >> 31 Flavours
(Message started by: Yoda on Jan 25th, 2004, 12:22am)

Title: 31 Flavours
Post by Yoda on Jan 25th, 2004, 12:22am
At a bar with a few friends, one friend, who is a somewhat compulsive gambler, introduced a game to me. I have searched this forum for it, but since I couldn’t find it, I thought I’d post it in this forum. He called the game Baskin Robbins 31 so I’ll leave the name at that. It goes like this:

I choose a number 1, 2, or 3 and then the other player chooses a number 1, 2, or 3 and adds it to my number. Then I choose a number 1, 2, or 3 and add it to the total and so on. The player who is forced to choose ‘31’ (exceed 30) is the loser.
(1) If you are the first player, devise an algorithm so that you will win every time.

Now, as it turns out my friend didn’t ‘know’ the algorithm (and still doesn’t, which I hope will keep the beer flowing due to his compulsive gambling nature). As well, in our game, I didn’t get to go first. Instead, we flipped a coin to see who would go first.

(2) Given that he didn’t know the algorithm but I did. What is my probability of winning?

(3) Do you think playing the algorithm is the smartest way to play the game? (This is really open-ended.)

(4) In several puzzles, the strategy for winning is exactly the same as for this one. I wonder if anybody could point out anymore puzzles where this strategy seems to work.
Other puzzles where it works are:
The Faustian Table (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi?board=riddles_medium;action=display;num=1027807317;start=22)
Cutting a Square. (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi?board=riddles_medium;action=display;num=1072287847)

(edited to make the formulation clearer).

Title: Re: 31 Flavours
Post by Sir Col on Jan 25th, 2004, 4:31am
I'm a little unclear on the game. Suppose the total has got to 30 and it's my go. Couldn't I choose 2 and avoid 31, or is the loser the first player to exceed 30?

In which case...
::[hide]
(1) The winning strategy is to get yourself to 30.
As each player picks 1, 2, or 3, we need to control in counting blocks of 4.
As 30==2 mod 4, if I went first, I would choose 2. Now it doesn't matter what they pick, I can make a total of 4 from our combined totals, so I can maintain control up to 30.

(2) This is split into a number of possibilities:
If I went first, I would pick 2: p=1/2.

If he went first we shall assume he picks 1, 2, or 3, with equal chance.
If he picked 1, I could pick 1, to make 2: p=(1/2)(1/3)=1/6.
If he picked 3, I could pick 3, to make the next target, 6: p=(1/2)(1/3)=1/6.
If he picked 2, the process would continue.

So P(win) = 1/2+1/6+1/6+(1/2)P(win)
2P(win) = 5/6+P(win).
Therefore, P(win) = 5/6.

Hmm, I'm not sure about my answer: the process is not infinitely recursive? Needs more thought...
[/hide]::

Title: Re: 31 Flavours
Post by Yoda on Jan 25th, 2004, 4:52am
Yes, the first person to exceed 30 (pick 31 or higher is the loser).

(1) Solved!   :)

(2) I think the probability is much higher than that because I'll get more than one chance to make a target.

Title: Re: 31 Flavours
Post by towr on Jan 25th, 2004, 8:12am

on 01/25/04 at 04:31:40, Sir Col wrote:
::[hide]So P(win) = 1/2+1/6+1/6+(1/2)P(win)
2P(win) = 5/6+P(win).
Therefore, P(win) = 5/6[/hide]::

since [hide]1/2+1/6+1/6 is allready 5/6[/hide] this would mean P(win) = 0, from the first equation.. So this can't be correct. I agree with the first part of the solution though, but I'd expect a higher answer at the end.

Title: Re: 31 Flavours
Post by Sir Col on Jan 25th, 2004, 9:26am
Silly me...

::[hide]
1/2 = probability I go first – I win.
(1/2)(2/3) = probability he goes first, and picks the wrong number – I win.
(1/2)(1/3)(2/3) = probability he goes first, picks the right number, I pick, say 1, he then picks the wrong number – I win; that is, he picks 2, I pick 1, he picks something that doesn't get to 6.
(1/2)(1/3)(1/3)(2/3) = probability he goes first and picks 2, I pick 1, he picks 3 (taking to the next target 6), I pick 1, he picks something other than 3 – I win.

And so on.

Assuming he is stupid and if he keep picking the 'right' number, he will hit the targets 2, 6, 10, 14, 18, 22, 26, and 30.

The probability of getting to 30 by chance is (1/2)(1/3)8, so the probability of getting to 26 by chance and making a mistake is (1/2)(1/3)7(2/3).

Hence P(I win)=1/2+(1/2)(2/3)(1+(1/3)+(1/3)2+...+(1/3)7)=13121/13122.
[/hide]::

Title: Re: 31 Flavours
Post by towr on Jan 25th, 2004, 9:44am
Instead of summing all those terms, why not simply take [hide]1/2 + 1/2(1-1/38)[/hide] ?  ::)
There's only one way for him to win, so you win in all the others.. P(you win)=1 - P(he wins) after all..

Title: Re: 31 Flavours
Post by Sir Col on Jan 25th, 2004, 10:25am
*feels very stupid*  :-[

(3) Do you think playing the algorithm is the smartest way to play the game? (This is really open-ended.)

I don't think it is the smartest way to play, as eventually even your most stupid friend would begin to recognise target numbers. For example, it wouldn't take long for them to realise that once you got them to 26, they were going to lose. Then they'd notice that they always seemed to get to 22, 18, ...

A sneaky variation, which would help obfuscate the stategy, would be to give your 'victim' the impression that they have more choice. For example, you could say, "Okay, instead of using 31, I'll let you pick the target number from, say, 30 to 40. In addition, rather than choose 1, 2, or 3, I'll let you choose the maximum we can add each time; for example, 1, 2, 3, 4, or 5."

It would be easy to adapt the winning strategy and they'd be clueless to the trick you're using. In fact, another twist would be to drop the coin idea and say, "I'll tell you what, how about YOU choose who starts... Of course, it won't matter, because I ALWAYS win!"  :P

Title: Re: 31 Flavours
Post by rmsgrey on Jan 25th, 2004, 10:40am
I've usually come across this game in the form of a "take away" game like Nim where you take counters from a pile and the person to take the last (or the person unable to take any) loses. One variant I encountered was to have four piles, with 1, 3, 5 and 7 objects and to be allowed to take as many objects as you liked from any one pile each turn. I forget whether the last object wins or loses, but either way, if memory serves, it's a second player win.

Title: Re: 31 Flavours
Post by THUDandBLUNDER on Jan 26th, 2004, 6:29pm
Here's a similar puzzle:

Starting with an unlimited supply of coins with values 1, 5, 10, 25, 50, and 100 pennies,
two players take turns placing a coin into a jar which is initially empty.

The amount in the pot may not exceed the target amount of 678 pennies.

The player who puts in the last coin, reaching the target, is the winner.  

Do you want to go first?



Title: Re: 31 Flavours
Post by towr on Jan 27th, 2004, 12:29am

on 01/26/04 at 18:29:18, THUDandBLUNDER wrote:
Do you want to go first?
::[hide]
678 mod 3=0

1 mod 3=1
5 mod 3=2
10 mod 3=1
25 mod 3=1
50 mod 3=2
100 mod 3=1

So I would not want to go first. If I'm second, I can allways make the total a multiple of three at the end of each turn, whereas the first player can not.

actually, it'd be faster working mod 6.. The end might pose some problems though.. hmm.. guess I'll have to give that a bit more thought..[/hide]::

Title: 31 Flavours with a dice
Post by ziep on Jan 27th, 2004, 3:10am
Martin Gardner wrote about a game resembling this. The first player throws a dice, the second player gives the dice a quarter turn. (So if  the dice is showing 5, the options are 1,3,4,6, but not 2 and 5). Add it to the total. Then the first player turns the dice and so on.
The player who is forced to exceed 31 is the loser.  An algorithm is not that easy, but it's fun to play for a while.

Title: Re: 31 Flavours
Post by towr on Jan 27th, 2004, 7:11am

on 01/26/04 at 18:29:18, THUDandBLUNDER wrote:
Do you want to go first?
after giving it some more thought, [hide]I do want to go first. I can't give a nice explanation though, I just worked backwards to find if the start is a winning position[/hide]

Title: Re: 31 Flavours
Post by why_linux_BSD_rule on Jan 27th, 2004, 8:04am
Hi,
I think the easiest way to do it is that (no matter who starts) is to make the sum of your answer and the previous answer (his answer) even because 30 is an EVEN number. You could go fast in the beginning (like lets say your opponent chooses 3 you could choose 1 to make the sum 4 or 3 to the sum 6). If you are in the beginning of the game, you would choose the latter to go faster.
If he is playing by the same startegy, then it depends on the choice of his first number (if it is bigger your next answer should make the sum smallest possible EVEN).

Title: Re: 31 Flavours
Post by Margit on Jan 27th, 2004, 9:29am
Ah, TB, I posted exactly the same Q over at GL  :D
So, I'd better stay out of this one.



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board