Friday, March 17, 2023

The Perfect Game of Chess

According to the Oxford dictionary “Chess is a board game for two players, the object of which is to put the opponent’s king under a direct attack, leading to checkmate”.

In other words the goal of chess is total annihilation of your opponent, to eliminate all hope and potential from their side of the board. One of the things that makes chess so unique from other board games is the fact that there are almost infinite number of positions that can arise in the quest for victory.

Consider this, after each player makes just one move there are 400 different positions possible! After 2 moves – about 72,000 positions possible. After 3 moves – 9 million. After 4 moves – 288 billion (yes, billion with a “b”) positions can arise on a chess boards. And the average chess game is around 40 moves! That translates into 10^50 legal positions in chess that are possible after 40 moves! 

There’s an ancient joke about this.

A guy finally builds the perfect chess computer, capable of computing every possible position in chess. So he starts a game against the perfect chess computer. Pawn to e4, a standard vanilla opening. The computer computes furiously for a few seconds and then announces, “I resign.”

But seriously, what would it look like to achieve a perfect game of chess? The great granddaddy paper on this topic was written by Claude Shannon in 1949, and his analysis has proven to be remarkably resilient. The paper was so important, that we now refer to the number of possible games in chess, as the Shannon number.

But no one has any idea how to actually build that much computing power. Need proof? Let's break this down to something that we can better understand.

If we literally took all the observable atoms in the universe, and made them all into one massive gigantic hard drive, you still wouldn't have enough disc space to store all possible chess games. Maybe engineers of the future can pick up some additional hard drives from parallel universes, or something like that.

These numbers are staggeringly large. Like hard to comprehend how big. This “Shannon Number” looks like this:

1,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.

The fastest super computer in the world can do about 200 quadrillion calculations per second. (1 with 15 0’s)

You would need 10^105 seconds to complete the calculations.

That is: 

1,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 seconds.

For reference the earth is 10^17 seconds old. (4.6 billion years) which is only 100,000,000,000,000,000 seconds.

You would have needed 10^88 of the fastest super computers ever invented, running since the beginning of earth, in order to get close to the Shannon number.

Again - this assumes that 1 calculation = 1 move. Computers do not complete complex calculations like chess iterations with just 1 calculation so this number is actually conservatively low.

So the answer to achieving a perfect game of chess is this - nobody knows how to create a computer with enough power to do this yet. 

And we aren’t even close.