23 December 2008

The Mathematics of ... Candyland???

Candyland game math statistics Markov chainI mentioned Markov-chains a while back (not to be confused with Markov Chaney), and I though that might make an interesting topic to relate to games. It seems though that several many others have beaten me to the punch, and written very well on this subject, so instead I'm going to point out one or two other fine efforts, review, and comment.

[Image taken from lscheffer.com, who also has a nice analysis.]

In my own words, a Markov-chain is a series of random states. A trivial example might be flipping a coin; the coin is either in a state of "heads" or "tails" and has a 50% chance of changing state with each flip. It can get more complicated, with the probabilities of changing to a different state dependent on the current or even (correct me if I am wrong) previous states. A state which ends the series (if any) is called an absorbing state. In my recent Netrek post the number of planets a team controls would be the state, and the absorbing state would be one team conquering all the planets, thus ending the series and the game (oversimplified, but true).

Candyland is a Markov-chain if you reshuffle the deck of cards after every draw. Each square (rhomboid?) on the board represents a state, and players advance randomly towards the end of the game. Reshuffling is required so that the probability of changing states remains independent of previous card-draws (if you were wondering). There is a nice summary and history of the game itself here.

Speaking of fine work, Greg Costikyan wrote about this a few weeks back, and it has traveled far in the blogosphere. The really interesting part here is (for me) the discussion of whether or not it really is a game; all moves are random, so if the player doesn't actually do anything is it really a game? My answer: Yes. Not the most interesting game we may ever play by any means, but most definitely a game. Games where players make decisions and enact strategies are more difficult, and for most, more interesting.

I should not end without mentioning an older game that is a Markov-chain to start with - no reshuffling required - known to most as Snakes and Ladders.

[Image from DKimages]

12 comments:

The villager: said...

Fascinating site and concept. Well done.

Klampai 77 said...

:-)

soni said...
This comment has been removed by a blog administrator.
Anonymous said...

Great site thi is like the television show numbers but for games. Your site layout is great. Keep up the good work and frequent posts.

!Teq-uila Del Zapata said...

First visit on blog. i never thought snakes and ladder could be that complicated.
But mixing games with probability can make it look hard!

v said...

Snake N Ladder. Yes... i love it. Congrats on blog of note.

Nik Adzhar said...

Hi, nice blog.Congrats on blog of note.How its done?

Anonymous said...

candyland and snakes and ladders are two of my favorite games on earth because they are so mindless!

Anonymous said...
This comment has been removed by a blog administrator.
Brandon Hansen said...

So are you saying that in order for Candyland to be a truely random game, the deck should be reshuffled after every move?

Dan Eastwood said...

Hi Brandon, thanks for the question.
In order for it to be a true Markov-chain, the cards need to be reshuffled, otherwise the probability of drawing a red card (for instance) depends on the cards already drawn, and more importantly, the probabilities of changing states (moving to the next squares) is not really random.

Imagine a single player in a series of games where they replace the drawn card on the bottom of the deck instead of shuffling, and play the game repeatedly. Eventually the player (after many many games) would wind up starting the next game with the same card they started the first game with, and the whole series would repeat again. This sort of repeating series is not random at all, so it is not a Markov-series unless you force the randomization (shuffle the cards).

Snakes-and-Ladders (the versions I am familiar with) uses dice for randomization, so there is no issue of it becoming a repeating series.

Zzzoney said...

refer to my recent google blogger titled (metaphor of monopoly) at: Zzzoney.blogspot.com and you can e-mail to Zzzoney@gmail.com
This is the truth that the mainstream media will not let go/as their careers are at risk, but so is AMERICA!
Sincerely,
Zzzoney 12/24/08