Tuesday 15 April 2014

2048

I am fascinated by the game 2048. I have been playing it for a month or so now and it has not really lost its appeal. The fascinating thing is that it seems to appeal to so many people. Students play, whether they are in applied math or calculus or not taking math at all. Little kids play. Adults with varying skills and careers play. It has this mass appeal that seems fairly rare these days. I play less now that I have "conquered" the game, but there is always another level to reach. My best is 4096, but knowing that others have reached 8192 makes it a challenge.

Here is a quick explanation of how the game works. On a 4 by 4 grid you start with two tiles, both can be either a 2 or a 4. You can swipe right, left, up or down and it moves all the tiles in that direction and adds another tile. When you swipe, any two tiles next to each other with the same number will be combined. For example - given this:

Swiping left gives you this:

The goal is to get the 2048 tile (but you can keep going).

I have a degree in computer science so powers of 2 are somehow appealing to me. The simplicity of the game, the lack of time-pressure and the beauty of having that perfect chain to reach a new milestone are some of what makes it a game I like. But I also see the math in it. And wanted to take that a step further.

I collected some data and discovered that I am fairly consistent - it takes me about 12 minutes to "win". I recorded the length of time needed to get the first 8 tile, 16 tile, 32 tile, and so on up to 2048.  If we consider 2 as the first tile then the 8 tile would be tile number 3, 16 would be tile number 4 and so on. I plotted the results in Desmos:



Nice! Exponential data that students can relate to (and gather themselves) that doesn't have to do with bacteria. But wait - how does the independent variable here (tile number) related to the number on the tile: 2, 4, 8, 16 ,32, etc.? It's the exponent in that sequence written as powers of 2. So we have used a log (base 2) scale to see our data this way. Cool! If you plot the time vs tile value you will see a linear relationship.

Although my school board has blocked the 2048 website, students can download a 2048 app or have their own data plan. I will be getting more data collection going in class and have them model this to find out how much time I need to set aside to reach 8192.

Update (May 17, 2014)

The folks at Desmos, being who they are, naturally replied to my tweet about this blog post. 

Here is the cool stuff they did.




And here is the link to their file. Thanks, Desmos! Just part of why I think you are awesome.

1 comment:

  1. Fascinating!
    I tried Sum of numbers on remaining tiles vs score. Pretty cool too.

    ReplyDelete