Accessibility Navigation:


Computer Bots Put New Twist on Old Game

Students program computer bots to challenge their classmates in games of rock, paper, scissors.
Students program computer bots to challenge their classmates in games of rock, paper, scissors.

Rock, paper or scissors? The simplicity of this famous game of hand gestures makes it irresistible. But hidden behind the choice of thirds exists a complexity of possibilities worthy of study in a college course. Indeed, students in a Davidson College class on artificial intelligence, taught by Assistant Professor Raghu Ramanujan, are doing exactly that.

Ramanujan challenged his students to write rock-paper-scissors computer programs that could beat a computer "bot" that was programmed to observe the choices made by its opponent and adapt its strategy accordingly to consistently win at the game.

Ramanujan's students tried to outwit the bot by creating their own code that could anticipate the bot's choices. But at the same time the bot was making moves based on patterns of moves by its human competitor. "You get into a dance trying to explore the other bot's weakness while it's exploring yours!" said Ramanujan.

On a recent weekday, class members invited members of the college community to drop by the math wing of Chambers Building and duel with the bots that the students had written.

Human players clicked one of the three icons on a computer screen, and the bot immediately registered its own choice, calculated who won, lost or tied the throw, and updated the overall game score.

Ramanujan explained that over the course of many throws, a student acting perfectly randomly-rock one turn, paper the next and scissors the third, ad infinitim-will never lose the game. But the student will also never win!

Common strategies for play are "history matching," and "frequency analysis." History matching tries to predict the next move by seeking a sequence in the past that matches the last few moves. In frequency analysis, the bot simply identifies the opponent's most frequently played move, and reacts accordingly.

Students who excel at Davidson might end up earning more than just a good grade from their efforts. In 2002, the World Rock Paper Scissors Society standardized a set of rules for play and began organizing open, competitive international championships. National tournaments in countries around the world since then have attracted corporate sponsorship, television coverage and substantial prize money.