What looks like just a cool hat is actually a secret binary code! And it’s written in a elementary cellular automaton called Rule 110. Finally, a hat just for your computer science, math, or other cool loved ones.

My boyfriend and I are going to Iceland in March…brr! He doesn’t normally wear hats, which is frustrating for an avid hat-knitter. I’ve taken to asking all his friends if they like hats and want any (and I have even made 3 of them hats). Especially at this point in my life, when I have no space for craft storage (everything has to fit under my bed). I am trying to knit up all that yarn I have so that I don’t have to do the unthinkable…get rid of it. He, however, does not show any desire to wear hats.

Except…Iceland!

We’re going when it’s still technically winter, so I managed to convince him he’ll need a hat. Plus, we’ll be kayaking on the Arctic Ocean, and everything we’ve read has suggested we bring a woolen “cap”. So he relented. But I can’t just make him ANY old hat. It has to be something he really will wear, so we discussed it, and eventually he settled on a pattern he liked. It’s called Rule 110, and if you aren’t a computer science person, you’ve probably never heard of it.

There is a pretty decent description of it on Wikipedia, or here if you’d rather, but basically what it is, is a grid of triangles that fits a specific pattern. Choose one cell in the grid. Based on the contents of the cellsabove, diagonal left above, and diagonal right above, the cell you chose will either have a 1 or a 0 (or will be filled in or left blank). There are 8 possible ways for this T shape to be filled in, which are in the link I included earlier.

If you continue on down the cells using this pattern, a larger picture emerges. It looks something like this:

A bunch of triangles, right? Well, apparently, the binary in this is special for some computer science reason (not my forte). The point is not that I don’t understand computer science, but rather that this is what Hotcakes wanted in his hat.

So, with his mad programming skills, we went into Excel and created a spreadsheet that would respond in a way that would create this file (which you can download at the bottom of the post). Then, we put in some ones and zeroes (binary!) to create a pattern that he liked. He picked an 84 by 30 square, and I worked out the pattern from there. You can find the link to the free Ravelry download at the bottom of this post.

Here is the result:

What most people probably won’t realize is that it’s actually a message! The starting pattern is binary for Luke ❤ Meghan (cute…his idea, not mine), so it’s really like a secret code hat! We made it using Excel and a binary code generator. If you want to create your own message, you can do the same thing here. You have to input the binary in manually by putting all the numbers into the top row. Then you can pick a part of the pattern that is 84 across and 30 high (or as much as you need to create a hat), and knit away! Otherwise, you can use the design I included in the pattern, which is a random series of 0 and 1. I am including a link to the Excel file as well (you have to download it). If you want to see the whole pattern, zoom out. Ones in the top row will create triangles below it. You can do as many or as few as you like to get a pattern you want. Then choose a square about the size you need for your hat (or other knitted object) and knit away! For decreasing, I redesigned the entire top part. It’s pretty difficult to get it to continue the pattern while also skipping stitches! If you have questions, feel free to contact me! Good luck!

The pattern is here.

The link to the original Excel file is here.