# Maxing out 2048

This is my girlfriend achieving the highest possible tile in the game 2048. It took a long time, and yes she did use the undo button, because otherwise this is pretty much impossible. Keep reading and you'll find out just how long it took.

131,072 is the highest possible number because all the positions on the board are full before combining the tiles. In order to get to the next number, 262,144, you would need a 5×5 grid, and in that case 262,144 would be nowhere near the maximum number possible.

When everything is full on the 4×4 grid, before starting the epic run in the gif, the biggest number is 65,536, or 2^(4×4) = 2^16. Adding all those numbers together gets us to the maximum, 2^(16+1) = 131,072. So, continuing that for a 5×5 grid, the largest number when it's full is 2^(5×5), so the maximum number is 2^(5×5+1) = 2^26 = * 67,108,864*.

We can also estimate how many moves it will take to get to this ultimate number. In 2048, tiles appear with values of either 2 or 4. This complicates our estimate a little since we don't know how many 2's and how many 4's have gone into making up a huge number. So let's take each of them separately to get upper and lower bounds for the number of moves required.

If we assume that all new tiles will be 2's, we can make an 8 tile with 2+2+2+2. So this will require 4 tiles, but only 3 moves, since each move adds two tiles together. For a 16 tile, it will be 2+2+2+2+2+2+2+2. We can make it a little clearer by using brackets for each tile: {[(2+2)+(2+2)]+[(2+2)+(2+2)]}. Counting the plus signs gives us 7 moves. It's pretty clear that to make a number *N, *we will need (*N*/2)-1 moves to make it, since each pair of tiles requires one plus sign between them. So that means if you're playing the 5×5 grid, you need to make 33,554,431 moves to max out the board using 2's!

We can make the same analysis using 4's: 8 = 4+4; 16 = 4+4+4+4; 32 = 4+4+4+4+4+4+4+4. Counting the plus signs again shows us that to make a number *N*, we need (*N*/4)-1 moves to make it with 4's. So, to max out the board with 4's would take 16,777,215 moves.

Now, remember 2's and 4's occur randomly. This means that there are multiple ways to make up each number, e.g. 16 = 2+2+2+2+4+4 or 2+2+4+4+4, etc. However, if we assume that 2's and 4's are equally likely to come up, we can just take the average of our two results to give us the real answer.

Therefore, the number of moves it would take for an actual game of 5×5 2048 to max out is ** 25,165,823**. To put that in context, if you could make one move every second, and you played non-stop, with no sleep, no mistakes and no breaks, it would take you

*to max out the 5×5 board. For the 4×4 board, it's just under*

**291 days, 6 hours, 30 minutes and 23 seconds***, assuming no mistakes.*

**13 hours and 40 minutes**### Proof that averaging makes sense (and a generalisation):

To make 16, we can take 7 moves if we use only 2's, or 3 moves using only 4's. In between those extremes, each time we replace a pair of 2's with a 4, we save a move:

16= | |

2+2+2+2+2+2+2+2 | 7 moves |

2+2+2+2+2+2+4 | 6 moves |

2+2+2+2+4+4 | 5 moves |

2+2+4+4+4 | 4 moves |

4+4+4+4 | 3 moves |

So, the average number of moves to make a 16 tile is 5. This makes sense, as it takes (*N*/2)-1 moves with 2's and (*N*/4)-1 moves with 4's, so the average of those two will be [(*N*/2-1)+(*N*/4-1)]/2 = **(3 N/8)-1**. For

*N*=16, 3(16)/8-1 = 5.

Using this for the 5×5 grid's maximum *N*=67,108,864, our real total number of moves is (3×67,108,864/8)-1 = 25,165,823, as before.

Finally, I did say that the next size up after 4×4 is 5×5, but the grid doesn't technically need to be square. A generalisation for an arbitrary rectangular *m*×*n* grid, gives us the maximum number *N* and the number of moves needed to make it: