Heuristics–Programs that Learn

How do we learn? How do we develop strategy in games, in work, in our daily lives? We store information and we use information from the past to decide what will happen in the future. In software we use heuristics to create software that learns. Recently I found a great example of a program that learns. It plays Rock Paper Scissors (also known as Rochambeau) and it can be found at the New Your Times interactive web site - Rock-Paper-Scissors: You vs. the Computer 

image

I wrote about a simple program to allow two players to play Rock Paper Scissors against each other a while back but this program at the NY Times site pits a human against a computer. The user has a choice between playing a “novice” version that gradually learns how you play from actually playing against you and an “expert” version that uses the accumulated “wisdom” of playing over 200,000 games against human players. I elected to play the novice in the example above. I think it would have gotten better over time of course. I on the other hand was trying to figure out how “it” was thinking and I think that is why I was able to hold my own against it. Well for 21 rounds or so.

This program allows the user/player to see what the computer is “thinking.” This makes the software a great learning tool. It lets you see how it uses and searches data, how it makes assumptions based on past performance and concludes what it should play. It assumes that people fall into patterns which is generally a safe assumption. I don’ t think it takes into account how the human is evaluating it though. In real life, in live games, humans take into account more then just patterns. Good Rock Paper Scissors players also look at body language. The look at how the opponent responds to what they play. It’s as much art as science. This makes me wonder how increases in technology, think Kinect, will allow computers to respond to how we say and do things (which is what people do) and not just what they say and do.

This is not the only way to program a computer to play Rochambeau of course. One could have a computer just pick random plays. It would be interesting to see how that turns out given that computers, while not completely random, are generally more random than people are in things like this. That would make an interesting little project. In theory with absolute randomness each player would win the same number of times with a third of the games resulting in a tie. Rock, Paper, Scissors, Lizard, Spock would have a different outcome and I have no idea what that would be. I could see students looking at different strategies from random to heuristic with something in the middle that models how they play the game. It would be fun to have students write their own artificial intelligence modules and pit them against each other. Not sure this fits in a first course though. It would be interesting for post APCS exam students though. Anyone tried something like this?