Decoding the Poem in the Pigeons
Thank you so much for reading This Mortal Coil, and for stopping by this page. In the book, Catarina discovers a string within the DNA of the passenger pigeons that she decodes, discovering a poem. The method Cat follows is detailed in the book:
“… I translated the base pairs into binary, then ASCII and finally into a string of alphanumeric letters.”
If you do create your own decoding (and/or encoding) algorithms, I would LOVE to see them! Can you code one in R or Python? What about a solution in Google Sheets? Tag me in a post on social media or contact me through this site and I’ll try to check them out and share them. If your tool is especially awesome, I’ll even link to it on this page!
How to get the Text
The question you’re probably asking is: how do I get the GTCA-text from the pages? Do I need to type it all out?!? The answer is no – you probably don’t, thanks to the magic of the internet. Early readers and myself will be tweeting and sharing sections of the encoded poem in the weeks after the book’s release with the hashtag #ThisMortalCoilPoem. Each section is 100 characters, and there are 41 in total. You’ll need to gather the sections and decode them as you go.
For those of you who want to help decode the poem – and there are rewards to be won if you do – here’s the plan:
There are 4544 characters in the poem. Typing the whole thing out is a big task – but some people (like me) enjoy that kind of challenge. However, it’s only 41 sections of 112 characters – or 41 tweets! For those of you who use twitter, please type out as many sections as you like and tweet them using the hashtag #ThisMortalCoilPoem, including which set of 112 characters you’re tweeting, like this:
I’ll be tweeting some of these sections from my account at @emilysuvada – there’s no need to tag me, as I’ll be checking the hashtag, and I’ll verify and retweet each set of 112 characters the first few times they’re tweeted. If you have the 280-character limit, feel free to share two sections at a time. Please also share longer sections on other social media sites with longer character limits! All I ask is that you don’t share the entire decoded poem. Please let other people decode it for themselves. The readers who type out and share the poem’s encoded letters early on will have a chance at winning bookmarks, signed bookplates, and other goodies. Make sure you use the hashtag #ThisMortalCoilPoem for a chance to win!
Once you’ve either typed out the GTCA letters, or copied them from social media, you’ll need to decode them…
Decoding the Text
If you have the encoded text, or part of it, and just want to jump straight into decoding it, you can use this tool on my site:
Please note that you’ll need to enter text with character counts that are a multiple of 8, and if you have one letter missing in the middle of a string of text, everything after it will be nonsense, or may not decode! Hence the reason for tweeting or sharing sections of 112 characters.
But I want to do it myself…
Awesome! Okay, let’s talk a little bit about how to do that. First, let’s break the problem down into steps, based on the book:
1) Cat says she converts the base pairs into binary…
2) then ASCII…
3) and finally into a string of alphanumeric letters.
Let’s talk through these steps one at a time. Depending on what language you’re coding in, you might mix up the way these steps are done. But let’s step through them like this anyway.
Converting the base pairs to binary
Cat says she converts the “base pairs into binary”. For information on binary numbers, check out this cool site. But how does Cat convert to binary, when there are four bases in DNA (G,T,C, and A) and only two bases in binary (0 and 1)? Is there any reason you can think of to put the letters into two groups? (Hint: they’re called base pairs for a reason…)
Once you’ve figured out which letters go together, you’ll have to build a mapping from each letter to either 1 or 0. I’m going to tell you now that A maps to 0, and C maps to 1. So if we have a string of letters: ACACACAC, and A -> 0, and C -> 1, then this would be converted to the binary number 01010101.
Your first job in decoding the message is figuring out the rest of this mapping, and then thinking about what commands you would use in your preferred language to change the letters in a long string of text. At the end of this step, you should have a long string of binary numbers, i.e. 010101010101010101010101 etc.
Converting binary to ASCII
For this step in the decoding process, you’ll need to split up your long string of binary digits into smaller sections. One thing you’ll notice about ASCII is that there are 128 characters in the ASCII system. This is because these characters can be represented by 8 “bits”, in the form of an 8-digit binary number. So once you have a long string of binary, you’ll need to chop it up into sections of 8 digits, and then turn those 8-digit numbers into decimals. This step requires you to understand binary numbers – so check out the link above!
For example, the string: 010101010101110001011111 would be split into three numbers: 01010101, 01011100, and 01011111. Depending on what language you’re coding in, you might split this text up in a loop over all letters, a loop over every eight letters, or you may be able to use a command to split the long string into shorter ones in one step.
Once you are dealing with 8-digit binary numbers, they can be re-written as decimal numbers: 01010101, 01011100, and 01011111 become 85, 92, and 95. When you’re done with this step you should be dealing with numbers between 0 and 127. If you take a look at the ASCII table linked above, you can see we’re almost done.
Converting ASCII to Alphanumeric Letters
This is the last step! By now you should be working with numbers like 85, 92, 95, etc. For this last step, you’ll need to use a built-in function in your preferred language to convert these numbers to letters. For instance, 85 -> “U”, 92 -> “\”, and 95 -> “_”. To find the command for your preferred language, Google is your friend! At the end of this step, you should have the full text!
Okay – example time! I’ve created a working example here, at JSfiddle: https://jsfiddle.net/emilysuvada/Lnvwkgbn/