Become a fan of Slashdot on Facebook

typodupeerror

## A Rock Paper Scissors Brainteaser167

New submitter arsheive (609065) writes with a link to this interesting RPS brainteaser: "How do you play against an opponent who _must_ throw Rock 50% of the time, and how much would you be willing to pay to play against them?"
This discussion has been archived. No new comments can be posted.

## A Rock Paper Scissors Brainteaser

• #### 100% paper (Score:1)

100% paper strategy will win 50% of the time. Of the remaining 50% of games played, (assuming even distribution of the remaining picks) 25% will be losses and 25% will be tied. Thus, you'd be assured a win-loss-tie ratio of 2-1-1, which is quite good. If their remaining options are not distributed evenly, this changes things. You'd want to look at their play to see whether there are any discernable patterns, such that you know that Rock will be played for certain every other move, for example. Then you
• #### Re: (Score:2)

The opponent is forced to pick 50% rock, but he has no limitations other than that. If you went 100% paper, you'd not beat me playing 50% rock by more than a tiny sliver of a percent it takes me to realize you are going 50% paper.

And the problem has nothing to do with the someone not just picking rock, but doing so in a very predictable manner. Otherwise, we'd not be talking about someone picking rock 50% of the time, but playing against someone that plays randomly, but tells you what he is picking half the

• #### Re:100% paper (Score:5, Informative)

on Saturday April 05, 2014 @12:33PM (#46670773)

From TFA: "At the start of each round an independent judge flips a fair coin and tells your opponent the result but does not tell you. If the coin came up heads your opponent must play rock."
The opponent isn't forced to get at least 50% rock after any number of plays.

• #### Re: (Score:2)

100% paper strategy will win 50% of the time. Of the remaining 50% of games played, (assuming even distribution of the remaining picks) 25% will be losses and 25% will be tied

No, you are describing another game where the opponent is forced to play rock 50% of the time, paper 25% of the time and scissors 25% of the time.

This game is different.

(I'm repeating my self from another post but many people are making the same mistake)

• #### For money, you mean? (Score:1)

With no such restriction, random choices on both sides lead to 33% win, 33% draw, 33% loss, right? With the opponent throwing Rock 50% of the time, assuming the other 50% is evenly divided between Paper and Scissors, if I always throw paper I'll win 50% of the time, lose 25% of the time, and draw 25% of the time.

So depending how the betting works, I'd be pretty willing.

• #### Re: (Score:3)

With no such restriction, random choices on both sides lead to 33% win, 33% draw, 33% loss, right? With the opponent throwing Rock 50% of the time, assuming the other 50% is evenly divided between Paper and Scissors, if I always throw paper I'll win 50% of the time, lose 25% of the time, and draw 25% of the time.

So depending how the betting works, I'd be pretty willing.

No, you are describing another game where the opponent is forced to play rock 50% of the time, paper 25% of the time and scissors 25% of the time.

This game is different.

• #### Play paper 50% of the time. (Score:1, Interesting)

by Anonymous Coward

Expect them to play scissors a lot to beat your paper. Play rock as often as they play scissors.

• #### put a spin on it (Score:4, Interesting)

on Saturday April 05, 2014 @12:09PM (#46670575)

Rock, paper, scissors, lizard, Spock!

Scissors cut paper
Paper covers rock
Rock crushes lizard
Lizard poisons Spock
Spock smashes scissors
Scissors decapitate lizard
Lizard eats paper
Paper disproves Spock
Spock vaporizes rock
Rock crushes scissors

• #### Re: (Score:2)

I'd argue that this wouldn't change the fundamental outcome of the experiment, since by definition no one selection has a fundamental advantage or disadvantage over any other. In either game, you make a decision, then have a 50/50 chance of winning the round.

• scissors beats paper and lizard; loses to rock and Spock ( 50% win, given even distribution)
• paper beats rock and spock; loses to scissors and lizard (50% win, given even distribution)
• rock beats scissors and lizard; loses to paper and spock (50% win, giv
• #### 50% paper? (Score:2)

I think the winning strategy is to randomly throw 50% paper to cover his rock. I'm just guessing though. No idea how much to pay.

• #### Impossible (Score:1)

How would you measure 50%? When does the game end? If my opponent strictly goes by 50 25 25 then Yes, I'd be happy yo play for an infinite amount of money, however given the play I am going to be playing, my opponent may opt/adapt for 50 0 50 instead and we are stalemate again .. So the game is rigged, conditions flawed, how would you measure those 50%?
• #### Edward Scissorhands would hate this opponent (Score:2)

Oooh, not rock again!!!!
• #### 50% paper and 50% rock ? (Score:1)

Assuming we randomly use 50% paper and 50% rock, we get:
- on rounds he is forced to play rock, we get half victory and half tie, so 25% win, 25% tie so far
- on other rounds he can:
- always use scissors, which will turn into our 25% win, 25% lose - we win overall, 50% win, 25% tie, 25% lose
- always use rock, which will turn into our 25% tie, 25%win - we win overall, 50% win, 50% tie
- always use paper, which will turn into 25% win, 25% lose - we win overall, 50% w

• #### Re: (Score:2)

I think you have an error in there. His best strategy in your example would be to always use paper, in which case he's doing the exact same thing as you are, and so the odds are even.

I think your best strategy would have to involve reacting to his. Start with 100% paper until you see what he's throwing when he's not throwing rock. This gives you at least even odds regardless of what he does.

He'll probably start throwing scissors, at which point you switch to you switch to 50% rock 50% paper. This will h

• #### Re: (Score:2)

Yes, you are right - paper will be 25% tie, 25% lose, ending up with 50% tie, 25% win, 25% lose, so still purely random.

I don't think that strategy we are looking for involves "reactions" - this can be always defeated by opponent which overguess you by one step. I would hope to find a strategy which would lead you to win > 50% even if opponent knows it (strategy itself, not the result of random choice at given stage).

• #### Re: (Score:2)

How would the opponent overguess you? You can delay your strategy switch for as little or as much time as you like, since their best strategy only breaks even.

If they don't know what you're doing, you could rack up more wins by exploiting flaws in their strategy, and rack up even more wins when they "wise up" and try to counter you. I guess the difference between our answers is that I'm treating this as an actual game against another person, whereas you're looking for more a game theoretical optimum.

Now,

• #### 38% rock and 62% paper ? (Score:2)

Ok, my current guess would be around 1/3 rock and 2/3 paper. Opponent cannot replicate this strategy, because of requirement of having at least 50% rock. If he goes 50% scissors, he will have 1/6 tie, 2/6 lose, 1/6 lose and 2/6 win, so 3:2 in my favor. With 50% paper, he gets 1/6 tie, 2/6 lose, 1/6 win, 2/6 tie, so 2:1 in my favor. 100% rock is obvious lose. I think that mixing scissors and paper will be clearly worse than pure scissors on his part (because with scissors, he has at least 2/3 chances of winn

• #### Programming Course Topic (Score:4, Interesting)

on Saturday April 05, 2014 @12:31PM (#46670765)

I've been having students in my introductory programming courses work on this class of problem for a few years.. They all seem to really enjoy it. I code up bots to play RPS with certain biases just like the OP and they have to program a single player that identifies the bias in an opponent and adjusts its play to give it an advantage. They all routinely can generate solutions that perform far better than random against predictable, dumb bots, but things get very interesting when I throw the students' bots against each other in a throwdown tournament. :)

• #### recalculate every round (Score:1)

by Anonymous Coward

If i know the number of rounds in advance (atleast your oponent has to right if he needs to calculate the 50%). I would recalculate the odds after every round taking into account the number of rock move remaining for him...

• #### Like most decisions, it's partly mental (Score:2)

Like drawing to an inside flush, an "optimized" strategy is not necessarily what the opponent plays. There is no reason inherent in the description to make assumptions about the opponent's other play. They may also be constrained to play paper the other fifty percent of the time, and to play paper , then rock, then paper, then rock. In the real world, don't assume that the minimal description of the problem gives all the important data.

• #### Re: (Score:2)

I play a lot of poker, but I've never heard of an "inside flush" draw. I know the inside straight draw, and I suppose you could have an inside straight flush draw, but a flush is just a draw for another like suited card. All flush draws have nine possible outs unless you have seen your opponents cards and know there are fewer. An inside straight has only four outs, which is why it is a bad draw most of the time. An open ended straight has eight outs, which makes it almost as good as the flush draw. Bot

there is a factual problem with the summary.TFA says it all so better read it. If not read this (I hope not to mess up it too much).

It is not required of the opponent to play rock 50% of the time. The referee is using a fair coin to determine if your opponent is to play rock or not. If s/he is not forced to play rock s/he is free to chose allowing him also to chose rock 100% of time too if s/he so wishes.

• #### Re: (Score:2)

It is not required of the opponent to play rock 50% of the time. The referee is using a fair coin to determine if your opponent is to play rock or not. If s/he is not forced to play rock s/he is free to chose allowing him also to chose rock 100% of time too if s/he so wishes.

It totally is required to play rock 50% of the time. It's not required to play rock exactly 50% of the time.

• #### Re: (Score:2)

No. Depending on the luck of the coin, they might be required to play rock anywhere from 0 to 100% of the time.

• #### Re: (Score:2)

Obviously it's a long-time average. The chance of deviating from 50% by any given amount goes to zero as the number of trials becomes arbitrarily large. The summary doesn't spell this out in iron-clad logic, but anyone who spends time thinking about math, stats, or especially game theory knows the score.

• #### Re: (Score:2)

there is a factual problem with the summary...

It is a bad summary, but only because the wording is ambiguous, not that it's factually incorrect. The statement you're objecting to is perfectly correct in one interpretation, and dead wrong in another. Your own counter-statement, "it is not required of the opponent to play rock 50% of the time," is equally ambiguous. In fact, 50% of the time (assuming a fair coin), the opponent is required to play rock, so it's true that "it is required of the opponent to play rock, 50% of the time". Leaving out the c

• #### Re: (Score:2)

50% of the time the opponent is required to play rock
• #### Strategy... (Score:1)

"Never go in against a Sicilian when death is on the line!"
• #### Solution (Score:1)

Lets call the guy with the restriction player 1 and the other player 2.
If you think about it player 1 got 3 "pure" strategies (as in: each other strategy he can play can be seen as a mixture of these 3):
(1) rock 100%,
(2) paper 50%/rock 50% and
(3) scissors 50%/rock 50%.
Against (1) rock gives 0, paper -1 and scissors 1.
Against (2) rock gives 1/2, paper -1/2 and scissors 0.
Against (3) rock gives -1/2, paper 0 and scissors 1/2.
In each case, the number is the probability of player 1 winning minus player 2 winnin

• #### Re: (Score:1)

Sorry :/ There are some mistakes in the last part. The strategy for player 1 wins 1/2-1/6=1/3 and not 1/6 as claimed. Also, the strategy for player 2 wins 2/3 against pure rock and not 1/3 as claimed. Still, it just makes it even clearer that you should not play rock with probability more than 50% as player 1 and not play scissors at all.

Also, to be more precise, the strategy for player 1 is to play rock with probability 1/2, paper with probability 1/6 and scissors with probability 1/3.

• #### Re: (Score:2)

I still think that 38.4% rock and rest paper is better solution for 'free' player, than 1/3 rock and 2/3 paper if we assume that 'limited' player is very smart and knows 'free' player tactic upfront.

Can you tell me, what is the strategy which 'limited' player can take against 38.4% rock, rest paper which would lead to worse result for 'free' player than what you propose? I would suggest simulating the results before jumping to conclusion. I was also originally thinking that 1/3 rock is optimal, but increasi

• #### Randomize 2/3 paper, 1/6 rock, 1/6 scissors (Score:1, Insightful)

by Anonymous Coward

Over the long term, the strategy must converge to stable, therefore true random can be the only optimized strategy.

50% of time opponent must play R. The remaining 50% of the time they can equally choose R,P,S.

R -> P = 1/2 + 1/3 * 1/2
S -> R = 1/3 * 1/2
P -> S = 1/3 * 1/2

For a guaranteed win, roll a die: 1-4 => P, 5 => R, 6 => S.

By how much? Consider you are random as above and opponent is fixed wlog at 100% R. You win 2/3 of the time and lose 1/6 of the time.

The expected payoff to play i

• #### Two Games (Score:4, Insightful)

on Saturday April 05, 2014 @01:23PM (#46671095)
You should play paper 4/6 of the time, rock 1/6, and scissors 1/6 of the time.

The key (if you RFTA) is that whether or not your opponent plays rock is determined by a coin toss. So really you are playing a compound game. You are playing a coin toss and rock paper scissors (RPS). Since the coin toss determines your opponents move, you can think of it as playing 50% coin toss and 50% RPS. The RPS is a subgame of the coin toss.

Since the coin toss is the dominate game, you play with win that first. But instead of heads/tails, it is paper/other. The answer to the coin toss is a 50/50 guess of heads/tails, so the answer to the paper/other is 50% paper, 50% other.

The "other" is the RPS game. And since the answer to the RPS game is 1/3 rock, 1/3 paper, 1/3 scissors, we know what the solution to the other 50% of the game is.

So the equations are:choice = (Coin Toss) + (RPS) so: paper = 1/2 + 1/3, rock = 0 + 1/3, scissors = 0 + 1/3. Or paper = 4/6, rock = 1/6, scissors = 1/6.
• #### Re: (Score:3)

The opponent could respond to this by playing scissors on all non-forced-rock turns. If the opponent plays rock, you win 4/6 of the time and lose 1/6 of the time, but if the opponent plays scissors you lose 4/6 of the time and win 1/6 of the time, so overall you'd be even.

• #### Re: (Score:2)

The opponent doesn't have the option to play anything greater than 1/2 scissors because the other 1/2 must be rock. If he uses the "all scissors" response, he can only actually do a 1/2 scissors response. So is we play it out:

1/2 scissors x 4/6 paper = 2/6 = 1/3 victory for the opponent. 1/2 scissors x 1/6 scissors is 1/12 tie. And 1/2 scissors x 1/6 rock is 1/12 lose. So the "all scissors" strategy only nets him 1/3 victory not 4/6.
• #### Re: (Score:2)

I listed the chances in the context of the opponent move ("if the opponent plays rock"). The chance of playing rock or playing scissors is 1/2 each (the coin toss), so if you list it as overall chances you get 1/3 win and 1/12 loss (same as you wrote) due to the opponent playing scissors and also 1/3 loss and 1/12 win due to the opponent playing rock; the expected result result is still 0.

• #### Re: (Score:2)

How the fck would you manage to lose 4/6 of the time to an opponent who must play rock at least 50% of the time?

• #### Re: (Score:2)

Re-read the GP. The claim is that when the opponent responds by playing scissors 50% and rock 50%, you will win 4/6 of the time when they play rock and you will lose 4/6 of the time when they play scissors, which makes it 50/50. The stronger claim is that the opponent can adjust to any consistent strategy that you choose, ultimately making it a 50/50 game.

• #### Re: (Score:2)

Yes, that's what I meant. I originally though the stronger claim might be true but it is not: as Reaper9889 pointed out in another post, you should never play scissors. If you stick to that and are not so greedy to play 100% paper (to be exact: 1/2 < paper < 1, optimum at 2/3), you make a profit no matter how the opponent responds.

• #### Re: (Score:2)

There is a flaw in your reasoning. You do not know that your oppoent flipped so you can not condition on it like you do here (you can not play paper all the time if he "flips" rock because you do not know his coin flip). If you think about it you should NEVER play scissors. In the best case for you he plays rock 50% and paper 50% and you get 0 in expectation and clearly you got an advantage so 0 is not good.

The optimal strategy is to play 1/3 rock, 2/3 paper. It gives at least 1/6 against anything he could

• #### Re: (Score:2)

We know that the opponent must play rock 1/2 of the time.

If I play paper 4/6 of the time, than I should expect 1/2 of my paper to align with his rock. So 4/6 * 1/2 = 2/6 = 1/3. So I should expect to win 1/3 of the time, plus my winnings on the other combinations. That means 1/3 is the lower bound.

If you play 1/3 rock and 2/3 paper, his response will be 1/2 paper and 1/2 rock. So you are going to get 2/3 * 1/2 = 1/3 for your paper. But your 1/3 rock will never win because he will never play scissors either.
• #### Re: (Score:2)

This is where the two games key comes in. You and I both recognize that 2/3 paper is the right move because 1/2 of his moves will be rock. But by playing the other half as regular RPS with a win/tie/loss of 1/1/1 you can expect the win/loss to cancel out, leaving you with your 1/3 lower bound advantage

If you're playing 2/3 paper and 1/3 rock vs 1/2 rock and 1/2 paper, the regular RPS subgame is 2/3 paper and 1/3 rock vs paper, which has an expected result of 1/3 loss for the subgame, or a 1/6 loss contribution to the total game. It won't cancel out: you can't get a consistent 0 result from the regular RPS subgame since you play paper more than 1/3 of the time and the opponent can take that into account by not playing rock in the subgame at all.

Versus 2/3 paper and 1/3 rock, it actually doesn't matter in

• #### Re: (Score:2)

You've come up with a fair answer, but the flaw in your reasoning is that the RPS game is less independent of the coin toss game.

In particular, the coin toss game makes scissors an obvious loss. No solution that includes scissors can possibly be optimal, because scissors loses at minimum 50% of the time.

Redistribute your scissors over to rock and work it out on a calculator; you'll see an improvement in outcomes.

• #### No actual advantage? (Score:4, Insightful)

on Saturday April 05, 2014 @01:32PM (#46671157) Homepage

First, make sure you read TFA, since it explains what the summary doesn't: how the 50% is determined and how the opponent can play in the non-forced turns.

If you play using a deterministic algorithm, for example always play paper, the opponent can figure it out and beat you on all the non-forced turns. At best you'll get an even result.

If you play using a random algorithm, the opponent can figure out the frequencies you're using and compensate for that. For example, if you decide to play paper 50% of the time and rock and scissors 25% of the time, you'd win against an opponent playing rock 50% of the time and paper and scissors 25% of the time. However, if the opponent decides to play rock 50% of the time and scissors the other 50%, the result is even again. If the opponent would be forced to play rock more than 50% of the time, there is no room to compensate and you would win consistently with 100% paper. I think that with 50% rock, there is enough room to respond to any frequency distribution you can come up with, although I have no proof for that.

You could change your algorithms during play, but if there isn't any algorithm that results in an advantage when playing it consistently, gaining an advantage from changing your algorithm would depend on how well your opponent responds to your changes. In other words, you're playing mind games. I don't think the 50% rock restriction is going to be of any help here.

• #### Re: (Score:2)

You can get an advantage. The important point is to notice that you should not play scissors ever. You can only get 0 in expectation IF he plays paper 50% and rock 50% and he gets an advantage otherwise and 0 is not good for you :/ See my above post for further details (spoiler: The optimal choice for you is 1/3 rock, 2/3 paper).

• #### Re: (Score:2)

So here's what I have:

First, there is some uncertainty about what ratio of your opponent's throws will be paper. Let's call that ratio x. This means that we can define the likelyhood of his throws this way:

HeDoesRock = .5, HeDoesPaper = x, HeDoesScissors = .5 - x

Now you need to figure out the optimal winning ratio of your throwing either rock or paper.

YouWinIfRock = HeDoesScissors = (.5 - x); YouLoseIfRock = HeDoesPaper = x
YouWinIfPaper = HeDoesRock = .5; YouLoseIfPaper = HeDoesScissors = .5 - x

W

• #### Re: (Score:2)

You're right about never playing scissors. Since the perfect opponent will know you're never going to play scissors, he won't play rock any more than is required, so 50% of the time. This leads to an overall win frequency (profit) of (1 - 3 * Rp) * Po + Rp / 2, where Rp is how often you play rock and Po how often the opponent plays paper.

With 1/3 rock, the profit becomes 1/6 no matter what the opponent does. If you play less than 1/3 rock, Po is positive for your profit, so the opponent will opt to never pl

• #### Simple. (Score:1)

If your opponent must throw rock 50% of the time, then you throw paper 100% of the time.

You will win AT LEAST 51% of the time, because you get the 50% gifted to you, and the other non-0% of the times that your opponent throws paper will cause a rematch.

• #### Progressive Betting (Score:1)

If there were no betting caps, I would progressive bet on paper. Bet 1 dollar paper. If lose, bet 2 dollar. If lose, bet 4 dollar. If lose, bet 8 dollar, et al. Once you win you reset back to zero. This naturally has drawbacks and potential for huge failure, but I've had good luck with it in blackjack and roulette if betting caps are high and I have about \$10000 to play around with.
• #### What should opponent do on non-forced turns? (Score:2)

To figure out what you should do, first assume your opponent is rational, and will make good choices whenever he is able. Since he knows that you will play a paper-heavy strategy to counter his rock-heavy strategy, it would not be rational to voluntarily choose more rocks. That could only make things worse.

But if he tried to exploit your paper-heavy strategy by throwing scissors on turns when he gets a choice, you'd have a perfect strategy against this: All rock. On forced rock, you get a redo, and on non-f

• #### How many games are we playing? (Score:2)

It says that rock *must* be thrown 50% of the time. Not that there is a 50/50 chance of the choice being rock for each game. So the number of games *has* to be set out before gaming commences. As you draw closer to the last game, the odds will change to how likely rock will be thrown. This is very similar to counting cards in a blackjack.
• #### 50 percent of the time (Score:2)

doesn't include a consideration of my lifespan. If I only live 100 years my opponent can play scissors every single game and play rock continuously after I am dead and the restriction would still be satisfied. In other words, "having to play rock 50 percent of the time" doesn't give you any relevant information about your opponent's behaviour.

• #### Re: (Score:2)

Good point, the important specification would be "50% of what time?"

I've always had this problem about the whole idea of probability. If the odds of you dying in a car accident are 1/1000000, and you still die tomorrow, what good is the low number of one millionth? You either die or you don't. Probability is only a measure or a larger population, i.e. the fraction that gets the rock, death or whatever. The idea of a probability for a unique event is meaningless.

This is why I like the many-worlds interp

• #### I know this one... (Score:3)

on Saturday April 05, 2014 @06:19PM (#46672875) Homepage

You kick him in the testicles and let him keep the chicken.

• #### Full analytical solution (Score:2)

As some have said, the optimum is a mixed strategy of playing paper 2/3 of the time and rock the rest of the time.

Let's say we're player 1 and they're player 2. The way to calculate this exactly is to first observe that the general form for each players mixed strategy is:

P(r1) + P(p1) + P(s1) = 1
1/2 + P(p2) + P(s2) = 1

where, for example, P(r1) is the probability of a rock being played by player 1.

This means that for a given P(r1), P(p1) and P(p2),

P(s1) = 1 - P(r1) - P(p1) [1]
P(s2) = 1/2 - P(p2)

• #### Re: (Score:2)

Another correction (this time to the second to last line): "Finally it's nice to observe that when player 1 sets x = 1/3, the second player's choice of z has no effect on the gains function whatsoever."

I really should have proofread this post.

• #### Re: (Score:2)

Oh my, another correction and this one is bigger! I assumed that player 2 would always play the rock half the time when in fact he is still able to choose rock even when the coin-toss doesn't force it. This adds another variable for which I didn't account.

Still, without going into expanding the probabilities, my intuition tells me that it doesn't improve his strategy to increase the rate of playing rock as this would only makes him more exploitable. Whether my intuition is correct is something I'll test at

• #### A solver and a simulation of the solution, in Pyth (Score:2)

Based on @ShanghaiBill's solution, I wrote a solver and simulation in Python (that also fixes ShanghaiBill's buggy pinning of "him.rock" to 0.5 - the player could in theory, choose to play rock at more than 50% probability). Use Pypy for speedy execution - I uploaded the code to GitHub: https://github.com/ttsiodras/R... [github.com]
• #### Over what time does he have to do this? (Score:2)

He could throw whatever he likes in the short term, and claim he was going to make up the 50% rock in the long term. How would you disprove this?

#### Related LinksTop of the: day, week, month.

If you think the system is working, ask someone who's waiting for a prompt.

Working...