M2M Day 339: If I had a trillion trillion trillion years, I’d be the world’s best chess player

Max Deutsch
4 min readOct 6, 2017

--

This post is part of Month to Master, a 12-month accelerated learning project. For October, my goal is to defeat world champion Magnus Carlsen at a game of chess.

Yesterday, I wondered if I could sidestep the traditional approach to learning chess, and instead, develop a chessboard evaluation algorithm that I could perform in my head, effectively transforming me into a slow chess computer.

Today, I’ve thought through how I might do this, and will use this post as the first of a few posts to explore these ideas:

Method 1: The extreme memory challenge

Chess has a finite number of states, which means that the 32 chess pieces can only be arranged on the 64 squares in so many different ways.

Not only that, but for each of these states, there exists an associated best move.

Therefore, theoretically, I can become the best chess player in the world entirely through brute force, simply memorizing all possible pairs of chessboard configurations and associated best moves.

In fact, I already have an advantage: Back in November 2016, I became a grandmaster of memory, memorizing a shuffled deck of playing cards in one minute and 47 seconds. I can simply use the same mnemonic techniques to memorize all chessboard configurations.

If I wanted to be smart about it, I could even rank chessboard configurations by popularity (based on records of chess matches) or likelihood (based on the number of ways the configuration can be reached). By doing so, I can start by memorizing all the most popular chessboard configurations, and then, proceed toward the least likely ones.

This way, if I run out of time, at least I’ll have memorized the most useful pairs of configurations and best moves.

But, this “running out of time” problem turns out to be a very big problem…

It’s estimated that there are on the order of 10⁴³ possible chessboard configurations. So, even if I could memorize one configuration every second, it would still take me slightly less than one trillion trillion trillion years (3.17 × 10³⁵ years) to memorize all possible configurations.

I’m trying to contain this challenge to about a month, so this is pushing it a bit.

Also, if I had one trillion trillion trillion years to spare, I might as well learn chess the traditional way. It would be much faster.

Method 2: Do it like a computer

Even computers don’t have the horsepower to use the brute force approach. Instead, they need to use a set of algorithms that attempt to approximate the brute force approach, but in much less time.

Here’s generally how a chess computer works…

For any given chessboard configuration, the chess computer will play every possible legal move, resulting in a number of new configurations. Then, for each of these new configurations, the computer will play every legal move again, and so on, branching into all the possible future states of the chessboard.

At some point, the computer will stop branching and will evaluate each of the resulting chessboards. During this evaluation, the computer uses an algorithm to compute the relative winning chances of white compared to black based on the particular board configuration.

Then, the computer takes all of these results back up the tree, and determines which first order move produced the most future states with strong relative winning chances.

Finally, the computer plays this best move in the actual game.

In other words, the computer’s strength is based on 1. How deep the computer travels in the tree, and 2. How accurate the computer’s evaluation algorithm is.

Interestingly, essentially all chess computers optimize for depth, and not evaluation. In particular, the makers of chess computers will try to design evaluation algorithms that are “good enough”, but really fast.

By having an extremely fast evaluation algorithm, the chess program can handle many more chess configurations, and thus, can explore many more levels of the tree, which grows exponentially in size level by level.

So, if I wanted to exactly replicate a chess computer, but in my brain, I would need to be able to extrapolate out to, remember, and quickly evaluate thousands of chessboard configurations every time I wanted to make a move.

Because, for these kinds of calculations, I’m much slower than a computer, I again would simply run out of time. Not in the game. Not in the month. But in my lifetime many times over.

Thus, unlike computers, I can’t rely on depth — which leaves only one option: Learn to compute evaluation algorithms in my head.

In other words, can I learn to perform an evaluation algorithm in my head, and, if I can, can this algorithm be effective without going past the first level of the tree?

The answer to the second question is yes: Recently, using deep learning, researchers have built effective chess computers that only evaluate one level deep and perform just as well as the best chess computers in the world (although they are about 10x slower).

Perhaps, I can figure out how to convert this evaluation algorithm into something that I can computational perform in my head a la some kind of elaborate mental math trick.

I have some ideas about how to do this, but I need to experiment a bit further before sharing. Hopefully, by tomorrow, I’ll have something to share.

Read the next post. Read the previous post.

Max Deutsch is an obsessive learner, product builder, and guinea pig for Month to Master.

If you want to follow along with Max’s year-long accelerated learning project, make sure to follow this Medium account.

--

--