0%
0%

# How to be a Rock Paper Scissors Champ

An illustration of Bayes Theorem inspired by the book "The Signal and the Noise" by Nate Silver

Similar projects worth following
0 followers
Rock Paper Scissors is a seemingly random game...for humans. While the odds of a player winning any given game are just 1/3, not many people consider their opponents past history of choices when deciding on a winning strategy. This project demonstrates the ability of Bayes Theorem to give you the best chance of increasing your win percentage above the expected 33%. It will also show what strategies are best toward combating Bayes Theorem and give you the opportunity to interact with different strategies, view performance over the long run, and even analyze certain strategies' success or failure over multiple tests.

If you haven't read "The Signal and the Noise" by Nate Silver, I would highly suggest doing so. In Chapter 11 of his book entitled "If You Can't Beat 'Em...", he discusses the futility of beating the stock market in the long run. To emphasize his point, he mentions that strategies to beat the stock market in the long run "resemble a high-stakes game of rock-paper-scissors at best." Reading this reminded me of an old probability class I took because the Professor hosted a link to a Roshambo bot. The Professor challenged any student to beat the bot in the long run, but the best outcome you could expect was a draw - a third of the games were wins, a third were ties, and the bot was victorious for the last third. This expectation is exactly why Silver compared this children's game to beating the stock market in the long run, but what are the mechanisms at play that give the bot an advantage?

# Intro

This project hopes to shine some light on these mechanisms in a thorough manner. I decided to reproduce my Professor's bot but add more features to let you peek under the mathematical hood. Here is how you can learn more:

• Go to my GitHub page, clone the repo, and start play against some of the bots. Which ones are easier/harder to beat?
• Try facing the bots off against one another. Which are stronger/weaker?
• Come up with a couple of sequences and test them against every bot. Which bot performs best against your sequence?
• Take the results files from all of your tests above and make sure that you don't mistake the noise (a single game in which a weak bot is victorious over a strong one) for the signal (you can't beat the strongest bot in the long run).

# Bayes Theorem

A good introduction to this section regardless of how familiar you are with Bayes Theorem is to watch 3Blue1Brown's video and Veritasium's video. Both do an excellent job of reining in the math to tangible examples. Here is the formula restated:

Your likelihood models can be as thorough as you like. You can build a model that only considers one step into the past, multiple steps into the past, or even a model that also considers the outcome of the game or the choices you made in estimating the probability of R, P, or S. The following example will just consider the case of one step into the past.

• 1
Clone the repository

Go to my GitHub page and clone the RockPaperScissors repository.

• 2
Follow the instructions on the README to build, compile, and execute the program

I recommend doing this in a desktop Linux environment. I have not tested this procedure on either Windows or Mac.

Share

## Similar Projects

Project Owner Contributor

### Havens

Owen Trueblood

Project Owner Contributor

### single stage to orbit robotic space plane

starlord

Project Owner Contributor

### Retro style Star Trek action adventure game

Timescale

Project Owner Contributor

Jessica

# Does this project spark your interest?

Become a member to follow this project and never miss any updates