Category Archives: Math Munch

2048, 2584, and variations on a theme

Welcome to this week’s Math Munch! It’s a week of mathematical games, including a devilish little game and variations on the theme.

2048

2048

First up, check out this simple little game called 2048. Really, you must go try that game before reading on.

Gabriele Cirulli

Gabriele Cirulli

2048 was created by Gabriele Cirulli, a 20-year old who lives in northern Italy. He was inspired by a couple of very similar games called 1024 and threes, and he wanted to see if he could code a game from scratch. Nice work, Gabriele! (Stay tuned for a Q&A with Gabriele. Coming soon.)

The first time I played, I thought randomly moving the pieces around would work as well as anything, but wow was I wrong. Give it a try and see how far you get. Now watch how this AI (artificial intelligence) computer program plays 2048. You’ll probably notice some patterns that will help you play on your own.

A beautiful chain of powers of two.

A beautiful chain of powers of two.  Can you solve from here?

Did you notice that the smallest tiles are 2’s, and you can only combine matching tiles to create their double? This makes all of the tile values powers of two! (e.g. 2048=2^11) These are the place values for the binary number system! (Did you see our recent post binary?) This has something to do with the long chains that are so useful in solving the game. It’s just like this moment in the marble calculator video.

4, a silly, but interesting little variation

4, a silly, but interesting little variation

If you’re finding 2048 a bit too hard, here’s an easier version.  It’s called 4. It’s a little silly, but it’s also quite interesting. After you make the 4 tile (tying the world record for fewest moves), click “keep going” and see how far you can get. I’ve never been able to get past the 16 tile. Can anyone make the 32? What’s the largest possible tile that can be made in the original 2048 game? Amazingly, someone actually made a 16384 tile!!!

2584, the Fibonacci variant of 2048

2584, the Fibonacci version of 2048

Silly versions aside, there are lots and lots of ways you could alter 2048 to make an interesting game. I wondered about a version where three tiles combined instead of two, but I couldn’t quite figure out how it would work. Can you? (See below.) When I thought about different types of numbers that could combine, I thought of the perfect thing. The Fibonacci numbers!!! 1, 1, 2, 3, 5, 8, 13, 21, … The great thing is that someone else had the same idea, and the game already exists! Take some time now to play 2584, the Fibonacci version of 2048.

2048 and 2584 might seem like very similar games at first, (they’re only 536 apart), but there are some really sneaky and important differences. In the Fibonacci version, a tile doesn’t combine with itself. It has two different kinds of tiles it can match with. I think this makes the game a little easier, but the website says 2584 is more difficult than the original. What do you think?

I have a few more 2048 variations to share with you, as if you didn’t have enough already. These are my favorites:

I hope you dig into some of these games this week. Really think and analyze. If you come up with clever strategies or methods to solve these puzzles, please let us know in the comments. Have a great week, and bon appetit!

Making Pi, Transcending Pi, and Cookies

Welcome to this week’s Math Munch– and happy Pi Day!

What does pi look like? The first 10,000 digits of pi, each digit 0 through 9 assigned a different color.

You probably know some pretty cool things about the number pi. Perhaps you know that pi has quite a lot to do with circles. Maybe you know that the decimal expansion for pi goes on and on, forever and ever, without repeating. Maybe you know that it’s very likely that any string of numbers– your birthday, phone number, all the birthdays of everyone you know listed in a row, followed by all their phone numbers, ANYTHING– can be found in the decimal expansion of pi.

But did you know that pi can be approximated by dropping needles on a piece of paper? Well, it can! If you drop a needle again and again on a lined piece of paper, and the needle is the same length as the distance between the lines, the probably that the needle lands on a line is two divided by pi. This experiment is called Buffon’s needle, after the French naturalist Buffon.

If the angle the needle makes with the lines is in the gray area (like the red needle’s angle is), it will cross the line. If the angle isn’t, it won’t. The possible angles trace out a circle. The closer the center of the needle (or center of the circle) is to the line, the larger the gray area– and the higher the probability of the needle hitting the line.

This may seem strange to you– but if you think about how the needle hitting a line has a lot to do with the distance between the middle of the needle and the nearest line and the angle it makes with the lines, maybe you’ll start to think about circles… and then you’ll get a clue about the connection between this experiment and pi. Working out this probability exactly requires some pretty advanced mathematics. (Feeling ambitious? Read about the calculation here.) But, you can get some great experimental results using this Buffon’s needle applet.

Click on the picture to try the applet.

Click on the picture to try the applet.

I had the applet drop 500 needles. Then, the applet used the fact that the probability of the needle hitting a line should be two divided by pi and the probability it measured to calculate an approximation for pi. It got… well, you can see in the picture. Pretty close, right?

Here’s another thing you might not know: pi is a transcendental number. Sounds trippy– but, like some other famous numbers with letter names, like e, pi can never be the solution to an algebraic equation involving whole numbers. That means that no matter what equation you give me– no matter how large the exponent, how many negatives you toss in, how many times you multiply or divide by a whole number– pi will never, ever be a solution. Maybe this doesn’t sound amazing to you. If not, check out this video from Numberphile about transcendental numbers. Numbers like pi and e don’t do mathematical things we’re used to numbers doing… and it’s pretty weird.

Still curious about transcendental numbers? Here’s a page listing the fifteen most famous transcendental numbers. My favorite? Definitely the fifth, Liouville’s number, which has a 1 in each consecutive factorial numbered place.

Escher cookies 1Finally, maybe you don’t like pi. Maybe you like cookies instead. Lucky for you, you can do many mathematical things with cookies, too. Like make cookie tessellations! This mathematical artist and baker made cookie cutters in the shapes of tiles from Escher tessellations and used them to make mathematical cookie puzzles. Beautiful, and certainly delicious.

If you happen to have a 3D printer, you can make your own Escher cookie cutters. Here’s a link to print out the lizard cutter. If you don’t have a 3D printer, you could try printing out a 2D image of an Escher tessellation and tracing a tile onto a sheet of paper. Cut out the tile, roll out your dough, and slice around the outside of the tile to make your cookies. If you do it right, you shouldn’t have to waste any dough…

Here’s hoping you eat some pi or cookies on pi day! Bon appetit!

Fullerenes, Fibonacci Walks, and a Fourier Toy

Welcome to this week’s Math Munch!

Stan and James

Stan and James

Earlier this month, neuroscientists Stan Schein and James Gayed announced the discovery of a new class of polyhedra. We’ve often posted about Platonic solids here on Math Munch. The shapes that Stan and James found have the same symmetries as the icosahedron and dodecahedron, and they also have all equal edge lengths.

One of Stan and James's shapes, made of equilateral pentagons and hexagons.

One of Stan and James’s shapes, made of equilateral pentagons and hexagons.

These new shapes are examples of fullerenes, a kind of shape named after the geometer, architect, and thinker Buckminster Fuller. In the 1980s, chemists discovered that molecules made of carbon can occur in polyhedral shapes, both in the lab and in nature. Stan and James’s new fullerenes are modifications of some existing shapes first described in 1937 by Michael Goldberg. The faces of Goldberg’s shapes were warped, not flat, and Stan and James showed that flattening can be achieved—thus turning Goldberg’s shapes into true polyhedra—while also having all equal edge lengths. There’s great coverage of Stan and James’s discovery in this article at Science News and a fascinating survey of the media’s coverage of the discovery by Adam Lore on his blog. Adam’s post includes an interview with Stan!

Next up—how much fun is it to find a fractal that’s new to you? That happened to me recently when I ran across the Fibonacci word fractal.

A portion of a Fibonacci word curve.

A portion of a Fibonacci word curve.

Fibonacci “words”—really just strings of 0’s and 1’s—are constructed kind of like the numbers in the Fibonacci sequence. Instead of adding numbers previous numbers to get new ones, we link up—or “concatenate”—previous words. The first few Fibonacci words are 1, 0, 01, 010, 01001, and 01001010. Do you see how new words are made out of the two previous ones?

Here’s a variety of images of Fibonacci word fractals, and you can find more details about the fractal in this article. The infinite Fibonacci word has an entry at the OEIS, and you can find a Fibonacci word necklace on Etsy. Dale Gerdemann, a linguist at the University of Tübingen, has a whole series of videos that show off patterns created out of Fibonacci words. Here is one of my favorites:

Last but not least this week, check out this groovy applet!

Lucas's applet showing the relationship between epicycles and Fourier series

Lucas’s applet showing the relationship between epicycles and Fourier series

A basic layout of Ptolemy's model, including epicycles.

A basic layout of Ptolemy’s model, including epicycles.

Sometime around the year 200 AD, the astronomer Ptolemy proposed a way to describe the motion of the sun, moon, and planets. Here’s a video about his ideas. Ptolemy relied on many years of observations, a new geometrical tool we call “trigonometry”, and a lot of ingenuity. He said that the sun, moon, and planets move around the earth in circles that moved around on other circles—not just cycles, but epicycles. Ptolemy’s model of the universe was incredibly accurate and was state-of-the-art for centuries.

Joseph Fourier

Joseph Fourier

In 1807, Joseph Fourier turned the mathematical world on its head. He showed that periodic functions—curves with a repeated pattern—can be built by adding together a very simple class of curves. Not only this, but he showed that curves created in this way could have breaks and gaps even though they are built out of continuous curves called “sine” and “cosine”. (Sine and cosine are a part of the same trigonometry that Ptolemy helped to found.) Fourier series soon became a powerful tool in mathematics and physics.

A Fourier series that converges to a discontinuous function.

A Fourier series that converges to a discontinuous function.

And then in the early 21st century Lucas Vieira created an applet that combines and sets side-by-side the ideas of Ptolemy and Fourier. And it’s a toy, so you can play with it! What cool designs can you create? We’ve featured some of Lucas’s work in the past. Here is Lucas’s short post about his Fourier toy, including some details about how to use it.

Bon appetit!