In this series of posts, I consider how algebra can be used to answer a question about the 2048 game: From looking at a screenshot of the final board, can I figure out how many moves were needed to reach the final board? Can I calculate how many new 2-tiles and 4-tiles were introduced to the board throughout the course of this game? In this post, we consider the event horizon of 2048, which I reached after about four weeks of intermittent doodling:
In the previous posts, we have developed a system of two equations in two unknowns to solve for and
, the number of 2-tiles and 4-tiles (respectively) that appeared throughout the course of the game.
The first equation,
,
says that the sum of the tiles that were introduced has to be equal to the sum of the tiles that appear on the final board. Directly adding the sixteen tiles above yields
.
This sum can also be calculated using a trick to be discussed in tomorrow’s post.
The second equation,
,
says that the total number of points may be divided into the contributions provided by the tiles on the final board. For example, the 16-tile was formed by joining two 8-tiles for 16 points. Each of those 8-tiles were formed by joining two 4-tiles for another
points. Added together, the 16-tiles results in
points. This analysis does not account for any 4-tiles that were created by adding two 2-tiles. The number of such 2-tiles is
, where
is the number of 2-tiles that appear on the final board (in this case,
). These additions result in
2-tiles worth
points.
For the board above, this equation becomes
and (for this particular board) the sum can be written more simply as
Directly adding the sum — and being very careful to double-check the arithmetic — yields the second equation
This sum can also be calculated using a trick to be discussed in a future post.
Solving, we find
Substituting into the first equation:
So we conclude that 98,524 2-tiles and 16,273 4-tiles were introduced to the board. Stated another way, about 85.8% of the new tiles were 2-tiles, while about 14.2% of the new tiles were 4-tiles. Also, since two tiles were on the board before any moves were made, a total of moves were needed to reach the above board.
One thought on “2048 and algebra (Part 6)”