Back to the previous page



  Backgammon Behind the Scenes Article




Backgammon – Random Dice



random - lacking aim or method; purposeless; haphazard

I have a confession to make. I am a truly terrible card shuffler. It's a bit embarrassing since my four-year-old and I both love playing games, and he loves to watch me shuffle cards. Fortunately for me, he hasn't visited Vegas yet, so he has no sense that occasionally dropping the cards on the ground isn't an integral part of the shuffling process. The myth of "dad can do anything" remains intact… for the time being. Sorry I'm being a bit random here, but the point is that automatic shuffling is one of the many reasons I play games online. I can enjoy a game without exposing my personal flaw. Of course, when I do play online, I want to have confidence that the game I'm playing is as close to the real thing as possible (minus the dropped cards).

Since I haven't found the ultimate online game of Go Fish or Old Maid yet, I think it's time for my son to tackle Backgammon. I don't think he'll get it right away, but I might as well try to recruit another playing partner while I still have minimal influence on the tyke. It doesn't hurt that I'm a little better at rolling dice than I am at shuffling cards. Still, there are those rolls, games, and even entire days when I am utterly convinced that my dice are cursed. It was on one of those bad-luck days that I set off on a quest through the programming department here at MSN Games, searching for proof that there really was a “curse” (or some game developer with a major grudge against me).

And this is what I discovered…

randomStatistics of, pertaining to, or characterizing a method of statistical sample selection in which all possible samples have equal probability of selection.

MSN Games is full of people who love games. They play the same games as we do, and they play them all the time. Right now, they’re working on a brand-new version of Backgammon, so (big surprise) they’re playing a whole lot of Backgammon. As you can probably guess, this gives them plenty of insight on what players want out of the game, which in turn lets them focus their time and energy on building the best game possible.

Or perhaps it’s all just a great excuse to play games during work hours. Still, it seems to do the trick.

Anyway, when I finally found someone who wasn’t embroiled in a multiplayer match or neck-deep in bits and bytes, I learned that randomness was more than just another feature to these developers: it was practically a passion. The first engineer I managed to collar was quite verbose on the subject. While it sounds like a no-brainer that a game such as Backgammon needs random dice, he said, there are actually varying degrees of randomness. The more random you want the dice to be, the more work it takes to develop. So just how random do you make them? How far are you willing to go?

The answer to that, at least for this team, is “quite far indeed.”

For the new version of Backgammon, the MSN Games developers are taking the concept of precision dice and going it one further. If you’re a veteran Backgammon player, you’ve probably heard of precision dice or even own a set; they’re engineered to be as neutrally weighted as mathematically possible, and therefore provide the most random roll possible in a real-world game. Well, we’re going to leave them in the dust.

According to my exuberant new mentor, the code controlling the dice in this new Backgammon game uses the cryptographically-secure RNG (random numbers generator) found in Microsoft’s CryptoAPI. "Cryptographically secure" means that the RNG is so completely random that even a large amount of computer analysis cannot predict or detect patterns in the output, a fact that has been validated by the National Institute of Standards and Technology*. This actually makes it far more random than a set of physical dice. Better still, the RNG is unaware of what’s going on in the game itself, so when the game requests a random number, the RNG has no idea of whose turn it is, how the game is going, or even what its own previous rolls might have been. It’s the ultimate impartial tool. As the man said in the movie “Short Circuit,” “It doesn’t get happy, it doesn’t get sad, it just runs programs.”

Of course, even with this staggering level of randomness, you’ll still see some runs of very good, or very bad, luck… that’s the nature of true random rolling. Let’s have a bit of fun with numbers. There’s a 1 in 36 (2.8%) chance of rolling a double-six. The odds of each player in Backgammon rolling two double-sixes in a row, four double-sixes total, are about 1 in 1,700,000 (1.7 million). If you saw that happen in a game, you’d doubt the dice's randomness, wouldn’t you? It seems improbably lucky.

However, over a 40-turn game of Backgammon, there will be about 76 runs of four rolls. So statistically speaking, you’ll see four sequential double-sixes in one game out of every 22,100. There might be 4,500 games of Backgammon going on at once in the evening on MSN Games. If each game takes approximately 10 minutes, that means 27,000 games an hour. In other words, it’s likely that on any given night, there will be five to ten games of Backgammon in which both players roll double-sixes twice in a row.

While a roll like this is actually completely random, you have to admit that it will make more of an impression on the players involved than will all the hundreds of other rolls they've made in other games. That double-six twice in a row will no doubt even lead a few people to scratch their heads and question if the dice-rolling algorithm is askew. But no, those players were just pretty darn lucky. Even if there's only a very slim chance of a certain roll or combination, there's always going to be someone who actually gets that roll. If you're lucky, it's you. If you're not lucky, I'm looking for someone to play against.

What’s more, the odds of four double-fives, double-fours, double-threes, double-twos and double-ones are exactly the same as four double-sixes. So that means an average of 60 to 120 people will see four consecutive identical doubles in a single night. Compound that with the human brain’s astonishing ability to draw patterns out of any randomness, and this number explodes. Rolling a 1-2 followed by a 2-3 followed by a 3-4 followed by a 4-5 is actually more likely than rolling four double-sixes, but it will appear to the players to be impossibly unlikely. All sorts of combinations or odd rolls might lead you to believe that the dice are fixed, but with this new RNG algorithm, it’s guaranteed that the only factor causing them is sheer random chance.

By this time, the engineer’s vocal enthusiasm had drawn other developers from their offices, the mathematical computations were flying fast and furious, and my head was starting to hurt. I fled to the relative safety of my own office for a therapeutic game of Backgammon, and lo and behold, I immediately rolled four double-sixes!

Okay, bad joke. I rolled a three and a four, and began another fun, guaranteed-curse-free game of Backgammon on MSN Games.

*—The CryptoAPI RNG complies with Federal Information Processing Standard 186-2 appendix 3.1, using SHA-1 as the G function. It has been validated by the NIST’s Cryptographic Module Validation Program. Details on this may be found at //