Can You Beat a Computer At Rock-Paper-Scissors?
tekgoblin writes "The New York Times has created a game that uses artificial intelligence to outsmart you. It uses a simple game called Rock-Paper-Scissors which is pretty much known by everyone on the planet by now. The computer tries to mimic human reasoning by building on simple rules and statistical averages. So based on the rules of the game and your previous moves, the computer tries to make predictions on your next move. The game has 2 modes, the first being Novice, where the computer learns the game from scratch, and Veteran, where the computer has experience of over 200,000 rounds of previous experience."
I for one, welcome our new rock-paper-scissors overlords.
When the foot seeks the place of the head, the line is crossed. Know your place. Keep your place. Be a shoe.
... in the slightly modified version:
Rock-paper-scissors-control-alt-delete.
__ Someday, but not this morning, I'll finally learn to use the preview button.
I've never been comfortable with the idea that paper can somehow beat rock: http://www.cslacker.com/images/funny/signs/billboards/paper_vs_rock/. Also, there are strategies for winning the game consistently: http://i.imgur.com/F2r3V.jpg.
I understand that English is a living language, but I object to changes arising merely from repeated errors.
Slap the paper over the intake fan, cut the Ethernet cable with the scissors, then bash it with the rock, easy.
--
Pass
At 10-3-2 I feel like I can say yes. Now do my dishes computer!
This is a well-known academic exercice. As an example, the Linux Mag France published such code in March 2004.
NYTimes = the new candystand?
Just keep making purely random choices and the computer can only ever draw.
Just use iocaine powder against it
http://www.ofb.net/~egnor/iocaine.html
Also FatPhil on SoylentNews, id 863
rock-paper-scissors-lizard-spock!
and then we always tie at 'spock' :)
Good ol' rock, nothing beats it.
Monstar L
Your choices aren't truly random though.
It's been argued many times, that people make choices in patterns.
- Don't do what I do, it's probably not healthy nor safe. -
Bart: Good ol' rock, nothing beats that!
well, at least they're not wasting time on any pointless games :)
Sure, first its a little R.P.S. with our computer, then maybe freeze tag with our robot pals. But what are you going to do when you catch your child playing doctor with your housekeeper 3000 cyborg? This needs to end.
"What this country needs now is a drink." -FDR
2000: Andreas Junghanns writes: "Check out the Second International RoShamBo Programming Competition for a completely different experience! If you think you know everything about Rock-Paper-Scissors -- here is your chance to prove it against some stiff international competition. At the Web site you can find rules, sample programs and a report of the first contest, complete with results and program descriptions." This looks pretty cool, and it might make a neat first project for someone, too.
So, it is a computer version of Derren Brown?
"It's too bad that stupidity isn't painful." - Anton LaVey
The best strategy is:
a) You roll a dice (6 sides) that only you can see
b) 1-2 Rock, 3-4 Scissor, 5-6 Paper
No Watson can beat that one...
CU, Martin
I guess the point is that people tend to deviate from this strategy and the computer can take advantage of those deviations.
I would be very interested to know how the learning algorithm works. Given that the program is taking advantage of your deviations from the 1/3-1/3-1/3 strategy, it follows that the computer is itself deviating from that strategy. Therefore there should be some strategy that beats the computer on average.
I guess you could continue this reasoning ad infinitum, but I would say that the meta-meta-meta strategies would converge to 1/3-1/3-1/3 pretty quickly.
Slashdot: news for Apple. Stuff that Apple.
The odd thing is, I did keep making random choices, and the computer is still winning by a large margin. Is there something suspicious going on here?
I understand that a small but growing number of people are heading toward the hills in Montana and Idaho to prepare for the human revolution against the machines.
up an immunity to iocane powder.
Watch this Heartland Institute video
I'm not using a random generator to pick my moves, so the veteran algorithm should be able to predict what I'm thinking at least slightly. Instead, it gets it wrong more often than not, and after 20 rounds I led 6:4 with 10 ties. Maybe it'll get better after I play a while.
Beating a human player at rock-paper-scissor is easy. Computers playing against each other is much more fun. There used to be a computer RoShamBo (same game, different name) competition, see: http://webdocs.cs.ualberta.ca/~darse/rsbpc.html
assignment != equality != identity
Exactly. They aren't random at all. Laugh if you want but there is actually a RPS strategy guide. Its mostly determining what kind of person your opponent is and knowing what that person is likely to pick from what they know of you. it's much more like the battle of wits in The Princess Bride than random guessing.
The Computer does what the average human would do based on the last 5 throws. If you can guess that, you can guess what the computer will do. The tricky part is that you're predicting 2 entities instead of one. Once you shift you train of Rock, Paper & Scissors thoughts to that method - it seems alot more favorable.
I recall reading years ago that most fight games work this way. They take the players controller input and build up a statistical layout of what the player is likely to do next.
Us nerds have already moved on to Rock-Paper-Scissors-Spock-Lizard a long time ago.
Been there, done that, got the shirt.
Playing in veteran mode when I loose, and then stubbornly refuse to change my choice, I'll constantly loose as the computer then 'correctly predicts I would play scissors' or whatever losing choice I've made repeatedly. Surely at some point it should think I won't be that dumb any more and I'll change my choice so shouldn't it change it's choice at some point too? Why does it always stick with it's winning choice? How many of the previous 200,000 rounds would have over twenty consecutive choices of scissors for it to always choose rock. Having "convinced" the computer I'll play scissors every time I can then win when I eventually choose paper. I can't get more than three consecutive ties though. For some reason I'm reminded of Derren Brown recording for hours on end until he got twenty consecutive heads in a coin toss in one take.
"pretty much known by everyone on the planet by now".
USA != planet. I grew up in India. Never heard of the game until I came to US. And actually I still don't know how it is played.
Except that you're not capable of making purely random choices. The human brain isn't wired for it.
It's easily possible to do better than random: just decide what would your natural throw at a given point, and then actually do the throw that feels worst to you. With a quick test it seemed to work, got something like 5:4 win ratio with lots of ties too.
The first draw seems to be a bit biased for the computer.
I tried randomly selecting (eyes closed, moved mouse around) and I could only win 3 out of 20. And yes, I reloaded the page between. I think statistically speaking should have been something like 6 or 7 out of 20.
They can be, for example I can decide by dice throw.
For an intro (and I mean intro) course in Computer Science at uni, we were assigned to write a Java client in a game called Paper Rules. Establish TCP connection, wait for the master server to find an opponent (another client) for you, and then repeatedly send either ROCK, PAPER or SCISSORS to the server and read the result of the match. To make it interesting, the rules were enhanced so winning a round yielded 1 point, losing -1 point, except when paper won, in which case 2 points were assigned to the winner and -2 to the loser. Our task was to write an "AI" to outsmart the other students' AI.
I wrote a simple algorithm that kept track of the statistics for each of the 18 combinations of [my choice in round n, round n result, opponent's choice in round n+1] and chose based on what the opponent had picked the most in the past. In a match, the winner was declared after 1000 rounds.
Of course, the so-called PaperServer was a <1000-SLOC inefficient by-students-for-students Java one-system-thread-per-connection server running in a Java VM inside a Java VM (yes, really - an IDE called BlueJ) on a terribly underpowered virtual server, so it didn't last long, and anything educational was lost on us that day. Fun times.
Then it's not your choice.
- Don't do what I do, it's probably not healthy nor safe. -
I did this many years ago. No need for fancy AI, a simple Markov chain was enough to beat the people I tried with. Today I would make it adapt the chain length dynamically, trying with different lengths and keeping track of their performance. But even a 3-level chain (if I remember right) beat humans consitently in about 50 games, and the random number generator of that old machine in less than 10000 games. But it was probably not a good random number thing...
In Murphy We Turst
yea i couldn't get evens. print screen saved.
60% of the time... all the time.
I think there could be ways to get random enough.
If there is time, one could first pick a number(n) between 7 and 23 (or something else), think of a song, pick the n:th letter, convert that letter into a number by some not too complicated algorithm to come up with a letter in another song, to use that letter for a number to pick one of all the memorized songs. Do this again with another starting number and song to pick a number. Use that number to pick a letter from the song selected earlier. Convert that letter to a number. Repeat to get another number. Use one of the numbers to choose a song and the other to get a letter from that song. Repeat several times to get a string of letters. Use some algorithm to convert each letter into either a 1, 2 or 3. Use aforementioned ways to select a slice of the string of numbers. Start over to get a number to use to find the index in the string of numbers. Or something like that.
Try using a random number generator instead of what you think is you being random. It seems to use the last 4 moves you made as a predictor of your next move, though I was using its moves to influence my own.
which is totally what she said
If it's designed to outsmart me, I'm guessing unless I really learnt its algorithms, and there was a limit placed on its memory/analysis, that I couldn't.
Don't mean to brag, but I'm pretty fucking awesome when it comes to Paper-Rock-Scissors (it's like Rock-Paper-Scissors with ROT1). The reason I was good, was I was good at gauging the intelligence of my opponent, and emulating how they would emulate me, then moving to the next level.
The best experience of this was a competition at school, where you had to beat one person, advance to level 2, beat a level 2, advance to level 3, until I think it was level 6 or 7. If you lost, you got demoted, if you won, you advanced. It was the best of 3. This was done in quick succession, eg, the entire game took about 5 minutes for me, 30 minutes to an hour for others.
I won by beating level 1 (easy), people think you go rock, so they go paper, so I go scissors. Next they chase scissors, not sure why, but this round is in quick succession to the first, and maybe its being unable to come up with anything else, so I go rock. BAM! LEVEL UP!
Next level was relatively easy, they must have had a similar thought process to me, so I go rock (remembering the decision process for level 1). Next they go 2 moves ahead from rock, because that's their level of emulation. This means they go scissors again. So I go rock. BAM! LEVEL UP!
Next level was harder, first round they had the level 2 decision process, but the second round they've caught on, so I need to go scissors, which is 1 move ahead (or could also be seen as taking the level 2 decision process, but I modeled it in my mind as taking 1 move ahead). They go paper! BAM! LEVEL UP!
Next level was much harder, but by now I got a good idea of what I should be doing. Following on from before, I emulate them as my last turn, and BAM! LEVEL UP!
Did this a few times.
At the end had a collision, I went rock, they went rock. WHOAH! FIRST LOSS/DRAW! I realized that this person was doing exactly as I was doing, the hard problem then became, modelling my own process. I remember we did the count down 1..2.. and I said stop. Wait. Because I couldn't walk through the chain of previous decisions fast enough in my mind, to come at the one I want. Once I had it, I went, okay go. 1...2...3...BAM! I WIN! Next round, 1...2...3...BAM! I WIN! LEVEL UP!
I'm now crowned king of all students and get to go sit on the benches and wait for the idiots. When I talked to the people who finished next, and asked them what they did, they explained it exactly how I did. In the end, I was able to predict their capability one further though. A large part of why the decision processes above would have worked was also because I was the first to level up, and get out, if I messed up early on, and got stuck amongst the riffraff I'd likely be unable to apply the same reasoning, as each level would follow that process less, and be less refined. Also, give I sort of knew these people, I probably had a reasonable feeling on their ability to think like me, which probably helped quite a lot.
As you may be able garner by now, this was the greatest moment of my life. Now some might say, the law of large numbers applies here, and that what I achieved, was just randomness in action. Well fuck you! Given their explanations later, my ability to repeat this a few other times, and my ego, I come to the conclusion that this was not random.
Wait... what was I saying. Oh yeah.
Anyhow, because of this, I'd likely be unable to defeat the computer over and over again, as its ability to estimate my thought process (give it's simple like above), would be far greater as it can store a lot more of "if I go x he goes y after I went x and he went y and I went...", while also applying statistical analysis to it. Though, I do however think I'd be able to give it a good enough run for its money, that we'd diverge towards 50% win rate, as my thought process would devolve to random, in the long run.
Ergo, could you beat a computer at Paper-Rock-Scissors? No, no I fucking couldn't, that's a stupid question. Next you'll be fucking asking me "Could you beat a computer at calculating and verifying primes?".
This is my footer. There are many like it, but this one is mine.
Yes, easily. Play: Rock Paper, Paper Scissors, Scissors, Scissors repeat. I'm currently sitting at: My 38 wins, 49 ties and Veteran 3 wins... Silly computer...
How often were you making the same choice 3 times in a row? This happens surprisingly frequently in real life.
you can get it to be picky about when it breaks out of ties and in what direction, i need a few ties before a win or a loss.
I am 25-10-5 vs the computer right now. It doesn't seem to be a great algorithm - i picked veteran to start out, and it seem to favor rock a lot more than the others
There's still only a 1-in-3 chance that you'd beat the computer. Hardly game-breaking.
I can let the fact your naive enough to think humans are good at making genuinely random (or even pseudo-random) decisions go. What I don't understand is why did you bother posting, you're evidently not informed on the subject or experienced in a related field. Your post, at best, wastes other peoples time and, at worst, misleads others.
But can it play Rock Paper Scissors Lizard Spock?
lol 9 consecutive wins against it 21:11:9 i think it was easier for me to subconsciously learn what the computer thought it was learning about me and plan ahead than it is for the computer to learn from me as it's always a few moves behind.
Back in my youth, programming in BASIC and 6502 assembler on the Apple ][, I wrote a "learning" game of "23 matches". The object of this 2-person game (in this case, human v. computer) is to avoid taking the last match. Each round, the player can take 1, 2 or 3 matches.
Although written in about 100 lines of Woz's Integer BASIC, the learning algorithm was simplicity itself: Each round, the computer kept track of its moves (and only its moves) in a table that was indexed by how many matches were left (a 22-row by 3 column table). The table started out with all "zeros" in each of 3 X 22 "weighting" columns (1 column for each possible "move" at each point). If the computer won a round, it incremented the "weight" of each "choice" that was made as the "pile of matches" for that round dwindled. Conversely, if the computer lost a round, it decremented all the "weight" cells at the junctures of "how many left?" X "how many did I take?".
And the algorithm was "predisposed" to "favor" the move that was the "most successful" at any given "how many left?" point.
That was it. No statistical math. No deep AI. Nothing. Just sort of a "path of evolutionary success" that formed a kind of "groove" that guided the correct answer at any given point, without regard to the past moves in a round, nor with any "forward-looking" capability, either. Just stimulus-response.
It was fascinating to watch just how quickly this algorithm "learned". During the first 5 or 6 rounds, it hardly ever won. By the 12th or 13th round, it was pretty hard to beat. By about the 20th round, it was no fun to play anymore, because it was simply unbeatable at that point, and had to be "lobotomized" (lose its "experience").
And, just like those walking robotic "insects" that teach themselves to walk in a matter of minutes with only 2 simple rules (IIRC, standing up is better than laying down; and moving forward is better than standing still), this was a real eye-opener as to just how simple a "learning" algorithm can be, and still achieve results that are both impressive and effective.
in some mag about 25 years ago. "Hit this key or that key." Algorithm just will have significant predictive success because people just don't do random.
As in, instead of following your natural inclination you use an outside random event decide your next move you could keep the computer from establishing a pattern in your behavior. Like, using dice or basing your choice on single pull from a deck of cards. Otherwise I am quite sure it can establish a pattern regardless of what you do
* Winners compare their achievements to their goals, losers compare theirs to that of others.
can you beat a computer at tic-tac-toe?!
oh yeah, well can you beat a computer at tic-tac-toe on weed, man?!
it's much more like the battle of wits in The Princess Bride than random guessing.
Did you watch that movie? The game was entirely random, but Westley won by cheating, he poisoned both cups. You can't do that in RPS.
Yes.
I played 100 rounds against the "veteran". End Score: 38 (wins) 35 (ties) 27 (computer). So can anyone get some statistically meaning out of that?
I only play Rock, Paper, Scissors, Lizard, Spock you insensitive clod.
I mean, seriously, who plays the plain rock paper scissors any more? Plus, for the augmented game, a winning strategy for the computer is much easier: if player's http referrer is slashdot, always choose lizard to poison Spock..
Violence is the last refuge of the incompetent. Polar Scope Align for iOS
If a pattern exists, it is possible that the algorithm used by the program will be be able to detect it. But that doesn't mean that the program has been written in such a way that it actually is able to detect any given pattern being used, let alone detect the correct pattern. And what if the strategy being used is a pattern of patterns? Would the machine be able to pick up on a change of strategies every Nth interation?
For that matter, it's also possible that the program could falsely detect patterns where none exists. If one were to use a random number generator to determine moves, the computer may draw a false positive and project a pattern where none exists.
What was the worst moment of your life?
Sorrry, but it's bullshit, the winning strategy is randomness. (see Nash-equilibrium)
Tied over 20 games...seems about what I would expect from a human.
When I want to be 'random' I map successive digits of pi to whatever problem I am considering. (In this case, 1-3: rock, 4-6: paper, 7-9: scissors.)
Apparently memorising hundreds of those as a kid wasn't worthless after all!
I can fairly reliably beat some people. You see, a human's idea of "random" can be pretty predictable. People's reactions can be quite amusing; especially if they "know" it's a random game.
Once they figure it out and start playing by predicting my moves instead of trying to behave randomly, the score tends to even out. Also, it becomes quite an interesting game.
# cat
Damn, my RAM is full of llamas.
Ask someone to pick a random number and 99% of the population won't use more than two digits.
It may be the "winning strategy" in a "perfect economic world of rational humans" but here in the real world, people aren't random. Or rational.
If one were careful it should be possible to predict what the computer will pick knowing that its choice is purely based on your previous choices. If one could determine the algorithm used (assuming it does not incorporate a random value) it should be possible to win 100% of the time.
I won!
It lacks intuition... Avoid predictability!
I can consistently beat my girlfriend in RPS, maybe 70% of the time. The trick it to focus on what she thinks I am thinking and be one step ahead. The reason I win is that my girlfriend has a research masters degree in a humanities subject and the game requires both logic and empathy; the humanities focus precludes logic and postgraduate education precludes empathy. It is like beating Steven Hawking in an arm wrestling match.
When Argumentum ad Hominem falls short, try Argumentum ad Matrem
Untrue. Nash equilibria aren't 'winning strategies' (see prisoner's dilemma). Randomness is an unbeatable strategy, but the best strategy depends on what your opponent does.
If they play completely randomly, you can't do any better than also playing completely randomly. But if there is any non-randomness in their actions you can definitely do better. For example, if they always play scissors, the winning strategy is clearly not completely random.
11 wins, 4 ties, 5 losses. Actually, winning on veteran mode is not that difficult. The computer only knows what all other people did and it responds to your actions by using the actions of all other users. So in fact the computer is limited by the actions of all other people; it predicts that you are the same as one of those other people. If you can predict what most users would do, than you know what the response of the computer will do and so you pick a different option. So in fact you only have to beat the average guy.
And thus, Skynet was born.
Sure, you might be able to beat it now, but when it decides to change the rules to Rock, Paper, Scissors, Nukes... we are f*cked.
~Syberz
I used the random number generator from truerandom.org to make all of my choices for a quick game. 20-5-14, I won. I figured that if the computer was trying to analyze my previous moves to predict future performance, I'd give it something to chew on. I think the statistical analysis that the computer does assumes some sort of rational play by the human.
Even if it could detect the 'random play', the human could try to fool the computer by using RNG for a while, and then switch to his own choice, and back (randomly, of course).
I feel that no matter how well the prediction based on previous algorithms, if chosen randomly with no thought to what you will be picking, this should be the outcome every time. It assumes you will pick something based upon your previous choice. Obviously, this is an easy system to beat once you figured it out, but I was just clicking randomly. Against random, you'll see nice, even numbers. Or odds, depending on when you want to show your score.
...but I figured out that if I just randomly pick moves while talking to someone or thinking about another task I was much more successful. If, however, I thought hard about my choice and tried to use strategy then I lost big time.
Loading...
If you think about it, Veteran mode is easier; all you have to do is try to think counter to what a 'normal person' would do.
13-7-6 on Veteran
8-9-9 on Novice
Hardly scientific, but yeah.
maybe YOU can't make random choices... please stfu about the rest of us
Randomness won't lose but it won't win either. Overall it will draw against any non-cheating* strategy. Therefore it would be the best strategy under the following conditions
1: everyone had a true rng or a a csprng in their head.
2: noone was cheating* and/or the player had the ability to throw consistenly in a way that defeated cheats
3: everyone was rational
4: everyone assumed everyone else was rational.
However people are neither rational or good at coming up with random numbers....
*A "cheating" strategy would be one where you try and determine what your opponent is in the process of throwing before you make you mind up on what you will throw...
note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
Rock, Paper, Taser! I win!
* Carthago Delenda Est *
When I want to be 'random' I map successive digits of pi to whatever problem I am considering. (In this case, 1-3: rock, 4-6: paper, 7-9: scissors.)
Hold on while I write an algorithm to match RPS choices to strings of pi digits and I'll have you beaten.
this is a load of utter crap -i can't see anything on my ipad...
I've got 7 wins and 2 ties so far. I don't want to play any further.
I've been going against the veteran computer, and knowing what I do about the psychology of rock paper scissors, and assuming the demographic it has the most experience against is young men, I've decided that I will design my strategy to counter the counter to a young man's moves.
Start with scissors. Always.
From there, shit gets real.
I do it quite easily. I pick up a standard D6, roll it, and pick rock on 1-2, paper on 3-4, scissors on 5-6.
"I do not agree with what you say, but I will defend to the death your right to say it"
Yeah, if you guess purely random, you will probably win only 50% of the time. The real trick is to outguess the computer by figuring out what it thinks that you think.
In reality, I beat the first 7 rounds, then lost 10 in a row. Then later lost about 12-15 rounds in a row and ragequit immediately.
GET OUT OF MY HEAD!!!
New webcomic updated on Sundays: HERE
The one I pick isn't random, but it is more than 2 digits. 80085.
What the hell is rock-paper-scissors? Seriously. Enlighten me.
...by being stupid.
not if you only play once.
Maybe a human cannot beat it, but random.org can: 7-10-3 vs Veteran.
Aww bless, look , a little troll has come out to play! But isn't it past your bedtime? Won't mummy troll be worried about you?
By clicking on the "See what the computer is thinking" button I think that the AI works with a simple history based algorithm. Assuming that a human player will only remember the immediate previous throws, it takes the last 4 throw pairs and will search what was the subsequent throw among all the human players who played the same sequence. Then it will just pick the move that defeats the human most likely next throw. My explanations might be a bit clumsy, sorry English is not my mother tongue, but click the button and you will understand.
A possible strategy to defeat the AI would then to search for these patterns yourself and pick the throw that would defeat the throw that the AI thinks would defeat the human's. The problem is that if most players start acting like that, the history will change and the AI wil outsmart the human player again. As some commenters noticed before, there is no dominant strategy in RPS and playing at random seems to be the best.
It reminds me of the Keynesian beauty contest where players have to pick not the prettiest contestants but the contestants that most people thought were pretty. I think think the next step for this algorithm would be to not only rely on the total history but also to make a model of the human player and compute how many moves he/she can read ahead of the CPU. For example, a "naive" player will always play according to the history (e.g. human scissors, CPU rock). A human player reading 1 throw ahead would play in order to defeat the CPU, based on the history (e.g. human paper). A human player seeing this strategy defeat could decide to play 2 moves ahead (e.g. human scissors). Since reading 3 moves ahead is equivalent to the naive one, the CPU would only have to make 3 categories of players.
I am not an expert in game theory but I think it could work...
According to the Jargon file 37 is the most random number.
http://www.catb.org/jargon/html/R/random-numbers.html
Kenny
Exactly. They aren't random at all. Laugh if you want but there is actually a RPS strategy guide...
... published in Maxim.
I actually played many games of RPS throughout my life. I even did a RPS science fair project my senior year where I went to the state level. I played my judges and ended up determining what their first two moves were as my opener for my presentation. I've easily played hundreds of thousands of games in my lifetime. In fact, I just played the AI for 1,000 matches and had the following results: I won: 373 ties: 331 Computer won: 296 I started off behind actually, but soon caught on and experienced a geometric increase of wins versus losses over time. Note how you can observe "what the computer is thinking". It's actually quite simple logic. Given the data set against 200,000 games it chooses what is most probable to win. I won't go in to the details as to what the algorithm was, you can understand it when you see it. But it makes sense. Because it had to follow that data set I found a few times where it seemed forced into certain patterns. I noticed many "paper, paper, rock sequences". I got a lot of wins out of it through that pattern. It seems that it can't adapt to you personally in real time but rather it is forced to reference its data set. Because of this, it can be defeated by humans still. It's just a matter of being proactive and noticing the patterns instead of being reactive and falling into the standard human pattern yourself. I know the standard human pattern exists from my own experiences. 90% of males start out with "scissors, paper" (at least in the Ohio area) and that was exactly how I beat all of my male judges. On a personal level, I love RPS. When two really good players are playing it as if they are staring into the depths of each other's souls and psyches. In the end, we all have a pattern. The winner is determined by how deep their pattern analysis and memory are.
I programmed my 16 kB Sinclair ZX81 to play that game back in the '80s. It learned my game pattern quite well and I think to remember that it was winning about 60% of the games. The algorithm was quite simple: it recorded the frequencies of my chain of choices (depth 3 or 4?). Too bad I didn't knew about /. to come bragging on myself here :-)
Back in the late 1970s, there was a magazine called "Creative Computing", and the people involved put out books called "Basic Computer Games" and "More Basic Computer Games". I don't remember exactly where it was, but there was a penny-matching game that kept track of what I entered, and played accordingly. I never did manage to beat it consistently, and this was with access to the source code.
"When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
If you're interested in how this works, here are two blog posts about Bayesian inference and decision theory in similar games:
my-ai-can-read-your-mind
my-ai-can-read-your-mind (part 2)
I win.
http://boardgamegeek.com/boardgame/28522/finger-ball Nice rock-paper-scissors variant for American football fans...
----------------------------------- My Other Sig Is Hilarious -----------------------------------
So, this kinda makes me think about a related question.
"Is it possible to construct an AI which is able to guess the k+1 digit of a transcendental mod n number if given k correct values"
esp from how this AI works, I think it might win against it; although my math might be wrong I'm not sure if numbers like pi or e have no repeating sequences in modulo.
Random.org rolling dice 1-Rock 2-Paper 3-Scissors 4-Rock 5-Paper 6-Scissors
Randomness rules!
So I gave it a random choice ffor 52 rounds and I'm leading by 25 to 18. Having a hard time predicting randomness, are we?
If you're interested in how this works, here are two blog posts about Bayesian inference and decision theory in similar games:
my-ai-can-read-your-mind
my-ai-can-read-your-mind (part 2)
"Republics decline into democracies, and democracies degenerate into despotisms" - Aristotle
http://img508.imageshack.us/img508/9280/scr4496486.jpg
Beat logic with logic
My choices are purely random. I get my random numbers from a nonhuman source.
Given that it learns, it also picks up stupid information from the masses that taught it.
I just played twenty rounds against this software on advanced and beat it with 8 me, 8 ties, 4 it.
I think it might slowly learn based on a huge amount of rounds, but being a human I got pretty bored with this computer very quickly.
That's okay though, I have access to a device that can generate sufficiently uniform random numbers between 0 and 2.
I starting do much better when I stated using Wolfram-Alpha to come up with random sequences for me.
Facts do not cease to exist because they are ignored. -Aldous Huxley
I did the same thing. BASIC on the C64, it just pattern-matched to the player's choice history. After playing for a while, it would converge to winning about 60% of the time.
It's a good exercise for someone to write when they're just learning programming... and it helps them learn something about psychology at the same time.
I used this strategy
>>> import random
>>> random.choice(["rock", "paper", "scissors"])
>>> etc.
and it still beat me 20-10. I didn't have the patience for a statistically significant number of tries, though.
Lost: one sig, witty, 120 chars, sentimental value. Reward offered.
The standard D6 does it quite easily. I pick up a standard D6, roll it, and pick rock on 1-2, paper on 3-4, scissors on 5-6.
Fixed it for you
I got 20-15-7. Interestingly, I used a pattern to see how the patten-learning machine would respond. I would throw the choice that would be vulnerable to what the computer just played. If the computer played Rock, I'd play Scissors on the next round. If the computer played Paper, I'd play Rock on the next round.
I think that the failure of a pattern-matching algorithm is that most people will play a simple strategy so the machine will learn to expect that. If you try to anticipate, you gain an advantage because fewer people will put in the effort and the machine is less likely to learn those tactics. I'd think that if you played to the third level (anticipating that the machine is anticipating), you may gain an additional advantage.
I think a competition of algorithms would be very cool. Start 'em up and let them play 100 million games and see who wins :)
This is not the human brain making those choices, though. It's a die making the choices.
The Quirkz Handbook of Self-Improvement for People Who Are Already Pretty Okay
Using rand() from php against the AI the results after 200 rounds:
Wins(PHP) / Ties / Losses(AI)
74 / 70 / 56
Confirming, it can't handle pseudo-randomness.
A quick 100 round test versus Excel's Rand function produced a 33-32-35 record. So while technically the program "won" it was certainly not a statistically significant win. Knowing how predictable the rand function can be, I fully expected the program to run away, but I think the greatest margin between either side at any point was 5.
Long story short....I am disappoint.
After 100 rounds on "Novice" I was 33-35-31. That doesn't seem like a very amazing record for a program that alleges to be able to predict what you're going to throw and beat you. I'm not exactly sure how to calculate the random odds for rock-paper-scissors, but I can't imagine that an even split like that is too far off what one would expect. So then I did 100 rounds on "Veteran" to see how it fared there, since they seem to be claiming that this will be even better at predicting what you are going to throw. I went 42-34-23. Maybe I'm just a super champ at this game, but either way I'm not impressed.
This is old but these types of programs have been out for a long time. I took part in a rock paper scissors AI contest ten years ago.
http://webdocs.cs.ualberta.ca/~darse/rsbpc.html
I choose to select random outcomes with a dice and won 15-1-4.
I might not be able to beat the computer at rock-paper-scissors, but i clearly dominate in kickboxing.
This is true. However, real people aren't as random as they think they are. Years ago I heard of a competition between rock-paper-scissors computer programs and I wondered what the point was, as there's really no skill involved in this game. But that isn't really true. The skill comes in when you start trying to predict what the opponent will do.
A random opponent can't be predicted, but if the opponent is not random and your program fails to take advantage of that fact, then your algorithm isn't the best it could be. If I always play scissors, the computer could beat me 100% of the time by always playing rock. A computer that plays randomly would win only 33% of the time. A random player would also win 33% of the time against another random player. So the program does no better on a completely predictable opponent than on a completely random one -- it's a poor algorithm.
I beat it. I don't think I play RPS with the standard strategies. I'm rather consistent, but unable to place my strategy.
My decisions must be seemingly random however. I played until 100 wins, it was 100 wins, 94 ties, 95 loses. There was a certain consistency between the number of wins, ties, and losses. I was generally winning by 5 though, although sometimes it went up to a tie again, but then I'd pull ahead. I believe at 50, it was 50-50-50.
So yea... that's ~300 RPS games of my life that I will never get back...
I prefer Cat Microwave Tin-Foil (use the scissors gesture for the cat, the rock gesture for the microwave, and the paper gesture for the tin foil - microwave kills cat, tin-foil kills microwave, cat cuts up tin-foil).
... a while ago.
If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
Isn't this just a variant on Claude Shannon's outguessing machine, which I think was developed in 1953?
I tied the computer on Veteran by choosing as randomly as I could each time. Here's a way to actually choose a more or less random number between 0 and 2 in a RoShamBo setting. Say three numbers between 0 and 9 in your head. Now take each number mod 3 and add those up. You get something between 0 and 6; take that mod 3 again and that's your number. The two-step process is a somewhat chaotic system, in that it's hard to predict the outcome while you're making up the original numbers, and you're just as likely to get 0, 1, or 2. And it's easy to do mod-3 arithmetic in your head, so with a little practice you can actually apply it while playing against real people.
That's my foolproof system for at least breaking even no matter what your opponent's strategy is.
On the Commodore 64, I had a program that had you input a series of values ("heads or tails", I think, as if you were calling a coin flip... I think it was from Compute's Gazette.) and tried to follow patterns in your input to guess what you'd input next. It was actually pretty good at it.
I expect it worked by building a table of recent history (say, the last 4 moves, so a table size of 16) and then counting how many times, at the end of that sequence, you picked one value or the other...
Bow-ties are cool.
The code (at least what they publish that it is) is fairly simple in that it just checks your last four throws and its last four throws versus its throw-database. So it is definitely not throwing on a random basis. Instead of testing to see if you can beat the 'computer' what means to me is that you're really comparing your thought processes to those of the general public that has tried the program. The database is made up of throws from a self selected sample group but I'd guess that since it was on the NYT it probably has a more diverse user base than if it had been posted on /.
So if you win at a statistically significant level then maybe it proves that you think differently than the average joe...?
I think it might Rock Rock
Rock Rock
Paper Paper
Rock Rock
Paper Paper
Rock Rock
Paper Paper
Rock Rock
And the Uncharted Territories. From The Farscape Encyclopedia Project:
They actually used RPS a lot to settle things...
It must have been something you assimilated. . . .
Just throw a dice for your next move. 1-2 for rock, 3-4 for paper, 5-6 for scissors. You can't be second-guessed.
A good AI would be able to recognize patterns in an individual's play, rather than merely guess the best strategy based on a stored corpus of 200k other games (I don't know anything about AI, but I suspect that's a very challenging problem, even when there are only 3 possibilities). For example, I just won by repeating the pattern "rock-scissors-paper-paper" over 60 rounds and it doesn't appear to have any facility to recognize that.
If you click "What is the computer thinking" it will tell you: It looks at the last few moves you made. It looks at the last few moves it made. It then scans its database of previous games and says "The last time a human made the moves you made, and the last time I made the moves that I made, what was the NEXT thing the human picked"
In 50 matches, my pseudo random number generator went 19-13 with 19 ties. I could swear I heard sobbing.
Not only argued... Documented!
How to Win at Rock, Paper, Scissors
Where's the bazooka?
Don't fear the penguins
I always make my choices based on the role of a d6!
Maybe it's situational
I have seen a lot of people driving who were very random!
I'm with CrimsonAvenger. The D6 isn't going to roll itself!
I've had a perfectly wonderful evening. But this wasn't it. -- Groucho Marx
its true, matlab's rand function as gotten me to: 23 wins, 23 ties and 23 losses
15 wins 15 ties and 15 losses I decided to stop at those nice figures.
You got the touch!
I suspect most people who are good at anticipating responses will start off ahead. The veteran doesn't really catch on to your habits until round 40 or so. I found it is best to rotate strategies and always heavily err on the side of a tie. Not sure why everybody has arbitrary numbers of rounds on their posts, but I got 43-35-21 in one hundred games against veteran.
I'm sure for real statistical relevance, well over a hundred trials are needed. I'll see how far I can get while I eat my lunch and watch my code compile.
Use my userscript to add story images to Slashdot. There's no going back.
The strategy with the highest expectation of winning is to pick 1 of 3 completely at random, unrelated to previous behavior. Then if humans have any strategy or pattern at all other than this, the computer has a winning expectation.
It's a somewhat paradoxical approach to the game: they assume that humans all have non-random patterns, which gives the random strategy an advantage, but then choose a predictive strategy which possibly gives the computer a losing expectation.
So to be proper, they are not trying to win since a known winning strategy already exists for any nonrandomizing human. They are trying to increase the chance of a win at the risk incorrectly predicting the pattern of some humans and losing in their cases.
Your choices aren't truly random though.
It's been argued many times, that people make choices in patterns.
That's okay bro, computers can't spit out true random numbers either.
Be seeing you...
I got to 8 wins without losses. I got to 12 wins with 2 losses. My final score was 14 wins with 5 losses. I accidentally deviated from my strategy for 2 moves. Maybe the computer learned something. If you see what the computer thinks, you can read about it's exact algorithm and in theory beat it every time until its database of statistics updates.
The idea is that, you either pick the opponent's last move, what beat's the opponent's last move, or what the opponent's last move beats, and assumes that the computer assumes you are using one of those 3 strategies. If you win a game, keep going. If you lose a game, assume the computer knows your strategy and switch to a new one which will beat the computer. If you tie, assume the computer guessed the strategy you are using incorrectly, and switch to a new one which will beat the computer.
Step 1:
Choose the first 4 moves randomly using a pseudo random number generator.
i.e. paper, rock, scissors, scissors
Step 2:
Choose the opponent's last move until you don't win.
If you lose, goto step 3.
If you tie, goto step 4.
Step 3:
Choose what the opponent's last move beats until you don't win.
If you lose, goto step 4.
If you tie, goto step 2.
Step 4:
Choose what beats the opponent's last move until you don't win.
If you lose, goto step 2.
If you tie, goto step 3.
Step 5:
???
Step 5:
Profit!!!
Score:
Me: 6
Ties: 12
Computer: 6
On Veteran, started off at 9-1-1.
Kept going, after 100 rounds was at 38-35-27.
So, winning more than a third of the time, and losing less than a third of the time through 100 rounds.
I don't know, I came from 1-5 down, then 2-8 to 13 all now. Seems like I'm the one learning what the computer thinks.
But I don't have its patience, so I'm gonna do something else now.
It is actually easier in Veteran mode, where it feels like playing against another human (probably because of the input of other users)
The Novice mode is too unpredictable!
Im not sure I can beat my 10 y/o at RPS...lol
Joe Investor
Has anyone beaten this program? I tried it and managed to reach an uncomfortable draw of: 6 Wins, 7 Draws, 6 Losses.
I haven't played it since and wonder if my chances against the Skynet armies are better than most of ye.
Computer only uses the past 4 outcomes to determine how it will progress :) Too easy to game
Start with Rock, and restart until you have a victory (We're going for undefeated right?) then:
S,S,P,P,S,R,P,P,S - Repeat (P,S,R,R,P,P,S)
- Holy crap, I've got MOD points! Who thought that was a good idea.
Also, Arnold could beat this guy... I'm at 100+ victories using the same pattern of victory... Seems that the 200,000 entries that it started with are all she wrote.
- Holy crap, I've got MOD points! Who thought that was a good idea.
I'm not going to trawl through 291 comments to check, but... Ahem.. Destiny of The Daleks.