How to Talk to Aliens

So, you have met aliens.


According to most sci-fi books and movies, the first thing you should do is establish the first contact. This task may seem daunting, but don’t panic: various people, ranging from professional linguists to total idiots, have outlined possible ways to do it. In particular, a recent movie called Arrival is centered around trying to communicate with an alien species. In this article, I would like to present an alternative way to do the same thing.

First of all, you should listen to what aliens are saying.

Talking alien

You can then use the most general cryptographic tricks, like frequency analysis, to uncover the basic structure of their speech. A computer would help you greatly at this point. After that you can start manually comparing what they say in different situations. If you have solved any of my ciphers, you know how to do it.

It is also probable that aliens don’t use sound, but instead communicate via light waves or chemical compounds. The basic analysis techniques remain the same. However, don’t have overly high expectations: since aliens haven’t yet read my article, they may start communicating ideas that seem trivial to them but completely bewildering to you.

Now it’s time to start speaking yourself! Begin with some math and science…

Teaching primes to aliens

…but again, lower your expectations. Math is a very artificial construct, and it is possible to imagine an advanced civilisation that doesn’t know prime numbers or powers of two. Science, on the other hand, is something that exists in the real world, so aliens should know it, but differences in notation can cause total misunderstanding. For example, look at Voyager Golden Record:

Voyager Golden Record

See these two circles in the bottom right? Most humans would have a hard time figuring out what they represent (hydrogen), and it is even harder to see how they are related to other things in the image. If it is difficult for humans, should we expect aliens to understand it without trouble?

Now that you have done all that stuff and it didn’t work, let’s move to the real thing: teaching aliens some language. I don’t recommend choosing English because it is extremely complicated. Instead, you should opt for a language that is easy and logical, even if it can’t be used to express as much thoughts. Also, use written language instead of sounds, so that you don’t have to pack all communication into a timeline.

Here is an example of how you can make a suitable language and gradually explain it to aliens.

Start by representing human:

Smiling face

Now, that’s definitely not how you should represent a human. You can be sure that aliens will see no similarity between these two:

Emoji and a human

So, aliens can think that your smiling face actually consists of four different objects, each of which has its own meaning. You don’t want aliens to make such a mistake, so you represent human with a single object, even if it’s not so cute:

Creepy face

How do you tell aliens what it is? Simple, just set up a screen and show this emoji when different humans show up. A few tips:

  • Use more than one human, so that aliens understand that the symbol applies to all humans, not just one.
  • Use real humans, not images. Aliens may not understand that images are in some sense the same as real things. After all, images are just light rays, and things are made of matter. We will get to images later.
  • Learn a bit about aliens’ eyes to make sure they see the symbol. If they don’t, change the symbol’s color.
  • The fact that I drew symbols by hand for this article doesn’t mean that you should do the same thing. If you do, the same symbol will be a bit different each time, and aliens might think that you are showing them different symbols.
  • At first, aliens could think that the symbol for human represents the entire room, or some action, or nothing at all. Be patient with them.

Make symbols for a few more objects via the same procedure, like this:

Symbols for table and water

In reality, you should teach them more things, a lot more. But three things are enough for this demonstration.

The next concept is action. You should make symbols for a few basic actions:

Symbols for walking and drinking

As you can see, action is represented by a different color. You should introduce a new color every time you get to a new concept. Blinking symbols are a bad option, try to guess why.

Since actions are hard to separate from the subject who performs them and the object on which they are performed, the next thing you should do is make a syntax for the (subject, action, object) triple:


If an action has more than one object, put all objects in a row, starting with the direct object. Sometimes an action has no object, and that’s even simpler: just don’t put anything after the action symbol at all.

Teach this stuff to aliens by showing lots of examples.

If you need to use properties of objects, make symbols for them, always place them just below the object (or action) they refer to, and teach it all to aliens. I think you will not need them.

(Also, let me omit the phrase “and explain it to aliens by showing lots and lots of examples” from now on. Assume that everything you do is followed by this.)

Now comes something really important: purpose. Whether you want to tell aliens your plans or ask about theirs, the concept of purpose is vital. Purpose is written above the action, like this:

Human goes to a table to drink water

Let’s move to the last big concept: questions. To make a question, you put a blob in place of one of the elements of a sentence:

Where does human go to drink water?

Now you have to go back to the beginning. There is at least one important thing you can’t yet describe: an alien. Before you tell aliens about themselves, teach them what images are. Put a big rectangle around the sentence to indicate that it describes what is happening on a screen:

Human on a screen

With enough example images, aliens will figure it all out. Now you can use pictures to agree on symbols for aliens, planets and so on:

Symbols for alien and Earth

If the aliens made it to this stage, it’s great! You can now start chatting. What do you want to say? Well, it depends on the situation. For example, if aliens came to Earth, it may be good to ask what they are doing here:

Why did aliens come to Earth?

After the first contact is established, both you and aliens will have a lot to say. This rudimentary language can communicate only the simplest thoughts, so it’s time to teach aliens English. Fortunately, it is now really easy to do: just show random sentences in the language they already know and include the English translation. You will be able to show thousands of sentences in a very short period of time, and the sample size will be more than enough for aliens to understand what is going on.

That’s it! What do you think about this method? I would love to hear your comments. Also, what would you do if aliens got stuck at some point (for example, if they didn’t get the hang of representing objects with symbols)?

And lastly, it seems necessary to include a…

Warning: In reality, contacting aliens is a very, very, very bad idea. Avoid doing it if you can.

Posted in Uncategorized | 1 Comment

The Blogowar

Today I deleted my Facebook account. To celebrate, here is a short story.

Blogger Mary ate the last potato chip, threw the bag away, and once again gripped the handles of her blogoscope. She always did routine tasks diligently, and this time was no exception. In her skilled hands, the blogoscope scanned one IP after another at incredible rate. A few minutes later, something unusual caught her attention. After double-checking her observation, Mary opened a chat client and wrote,

“Come here, SuperSonic.”

SuperSonic15 was Mary’s only true friend. She had started blogging long before Mary was born and knew a lot about the internet. She ran to Mary’s room immediately after receiving the message.

“What’s up?”

“I was scanning Facebook City when I noticed this,” Mary turned the blogoscope to SuperSonic15.

“Let me see… Oh my god. Facebook is preparing its troops.”

“Yes, but why would they do it?”

“Elementary. They are planning an attack that would put an end to free blogging and confine all of us to writing on Facebook pages. We need to react fast. Wait here, Mary. I’ll be back soon.”

SuperSonic15 returned about half an hour later, just when Mary started to feel anxious because of her long absence.

“After a short discussion in a comment thread, the greatest bloggers unanimously decided that we should initiate a preventive strike. The best defense is a good offence, you know.”

“So… we will fight?”

“Yeah. Don’t worry, it will be fun,” said Supersonic15 and then quietly added, “That’s if we win, of course. If we lose, it will be no fun.”

“When will it all start?”

“Less than an hour later. Get ready.”

A little boy was sitting on the stoop of his house, which was located in a picturesque suburb of Facebook City. He knew that something unusual was about to happen, and he didn’t want to miss it. Guys in uniforms have been running around for a few hours, and the boy even saw a couple of large vehicles go along the street.

As he was trying to figure out what was going on, he noticed his mother standing near him. She said,

“Go inside, son. You will be able to see everything through the window and…”

She was interrupted by a loud rumble coming from the sky. A few moments later, something huge broke through a thick layer of tag clouds. It was a round object measuring about three kilometers in diameter and covered with pictures of cats and pages upon pages of text, which was too small to read at such distance.

“What is it, mom?” the boy asked.

“It is the Blogosphere.”

All bloggers, including Mary and SuperSonic15, grabbed game controllers and opened fire. Facebook troopers responded in a matter of seconds. The launched heavy torpedoes, each of which contained a DMCA takedown notice. The torpedoes produced sizable explosions, but Facebook admirals were not satisfied.

“The Blogosphere regenerates almost immediately. Every important post is reposted in so many places that we can’t hope to hit them all at once. Our weapons are futile.”

“Execute Plan B.”

The screen above Mary’s head showed Facebook City in all its glory. Suddenly she noticed a bunch of grey dots floating in the sky. She put away her game controller and reached for the blogoscope to look closer.

The dots turned out to be huge flying saucers moving towards the Blogosphere at great speed. A few red symbols were inscribed on the surface of each saucer. Mary started reading: /pol/, /b/, /s/…


“What’s wrong?”

“4chan is here.”

SuperSonic15 pressed a big red button on the wall, activating a loud alarm. Bloggers immediately started commenting on the situation.

“Why is 4chan supporting Facebook?”

“It doesn’t matter now.”

“There is a special saucer for each board!”

“Not all 4chan is here. Many members decided to stay at home.”

“Still, there are tons of people in these saucers!”

“Wow, a few of them are falling down.”

“Look at the board names. I am sure nobody in the falling saucers has the slightest idea on how to control them.”

“I think the remaining ones are not about to fall.”

“They are firing!!!”

Down in Facebook City, the little boy and his mother were still standing on the stoop and watching the fight. 4chan’s weapons were making large holes in the Blogosphere, and bloggers were unable to stop the attackers.

The boy noticed a new dot appear in the sky. It was red. Just when the boy was unsuccessfully trying to show his mother where the dot was, it activated an unusual weapon. Two lines or red light shot from the dot, and the boy heard a sound like “boing-boing”. The sound was heard exactly when the light was seen, since at the moment everyone was too busy to think about the difference in the speeds of light and sound.

The dot came closer, and the boy could now easily see that it was actually a balloon. It continued to shoot, taking down one saucer after another. To be fair, 4chan members could have destroyed the balloon if they cooperated and fired all their weapons at one spot at exactly the same time. Fortunately for the Blogosphere, such cooperation was beyond 4chan’s capabilities.

Eventually, only one saucer was left. Of course, it was /b/. The Boing Boing weapon could not penetrate its shields. The balloon circled it a few times and disappeared in the sky.

For a couple of minutes, the bloggers were thinking what to do. Then someone fired a meme gun. This weapon was generally considered ineffective, but it worked incredibly well in this situation. People in the saucer started repeating the memes and forgot to control the ship. The saucer began a rapid descent.

The only person not affected by the meme blast was Christopher Poole. He saw that there was no way to regain control of the ship, so he shouted in a computer terminal,

“Python! import startrek!” and, a second later, added, “Energize!”

The bloggers watched /b/ saucer crash and explode. Everybody sighed in relief. Then a notification came from an inner part of the Blogosphere,

“Hey, these guys are here! They teleported from the saucer at the last moment! What the…”

“How bad is it?” asked Mary.

“Very bad,” answered a blogger she had never seen before, “The thing is, our main engine has to burn 100 subscribers per second to function correctly. And now that /b/ folks are spamming the blogs, our readers are fleeing!”

He quietly added,

“I mean, they have been fleeing since we turned the engine on. But now it is happening even faster!”

“Not all is lost,” said SuperSonic15, “If I change the contents of startrek module to initiate self-destruction when any function is called, I think it will stop them. Mary, you go with me.”

A minute later, Mary and SuperSonic15 were sitting in a hovercar.

“Authenticate the driver by real name, Mary Null.”

“Error: Field SURNAME cannot be left blank.”

“Okay, then authenticate SuperSonic15.”

“Error: It doesn’t look like a real name.”

“Who said it was a real name?”

“Error: Voice recognition failed. Please try again.”

Half an hour later, they managed to persuade the hovercar to leave the Blogosphere.

A Facebook agent saw the hovercar and aimed his smart gun at it. He pressed “Fire”, but the screen froze. A second later, some text appeared on the screen.

“Installing Windows 10. 1% done. Please do not turn off your device until the installation is finished.”

The agent swore and helplessly watched the hovercar go by.

Mary and SuperSonic15 reached Paramount headquarters.

“Let me in,” SuperSonic15 said.

“Why should I?” someone replied from the other side of the door.

“If you don’t, I will write in my blog that your next movie is not worth watching.”


“Wait a minute,” said Mary, “Suppose you change the module. But everyone has a local copy. How will you persuade them to update it?”

“Ah, that’s your job. Write a blog post entitled ‘Huge Security Breach Discovered in startrek Version…’ whatever the current version number is.”

“And what should I write in this post?”

“Doesn’t matter. Nobody will click the link to full article anyway.”

By the time SuperSonic15 returned from Paramount headquarters, Mary had already received a message from the Blogosphere.

“4chan no longer poses a threat. However, so many subscribers left the Blogosphere that our main engine will run out of fuel in less than an hour. SuperSonic15 knows what to do.”

“Do you know what this guy is talking about, SuperSonic?”

“Yes. He wants us to activate our ultimate weapon. This weapon will only work if activated in the main tower of Facebook City. We need to get there as quickly as possible.”

“Okay, I will launch the hovercar.”

The hovercar did not share Mary’s enthusiasm.

“I am sorry, but you have reached the end of the 30-day free trial. To continue using the hovercar, enter your credit card number…”

“I have a better idea,” said someone standing nearby.

Mary and SuperSonic15 freaked out at first, but then smiled as they saw the speaker. He was dressed in a red cape and goggles, and a red balloon was floating above him – the exact balloon that took down most of 4chan’s saucers not long ago.

Cory Doctorow

“Hi, Cory!”

“Hi, friends! Get in my balloon!”

Soon, the balloon was floating above the main Facebook skyscraper, shaped like the letter “f”. Cory Doctorow said to Mary,

“Here, take my cape. Knitted from thousands of witty comment threads, it is guaranteed to save you in any situation.”

“Thanks, Cory!” shouted Mary, jumping out of the balloon.

Two bloggers entered the building without encountering any guards or even moderators. Mary thought it might be a trap; SuperSonic15 was even less optimistic. They opened one more door and got into a huge room filled with heavy machinery. A conveyor belt transported likes from one side of the room to another, where they fell into a big blue box. The purpose of other mechanisms was completely mysterious.

“Okay, launch it!” Mary said.

“Too late,” said someone standing behind the like box, “I knew you would come here.”

The man slowly walked towards the bloggers, who were terrified to realize that he was Mark Zuckerberg himself.

Two swords appeared in Zuckerberg’s hands. Bloggers pulled out their own swords. SuperSonic15 shouted,

“Remember what you learned at Blogging U?” and they got into the fight.

Zuckerberg was more skilled than each of the bloggers, but he had a hard time fighting with both of them at once. Eventually he managed to perform a certain closed-source maneuver. It happened too fast to see what exactly he did, but a second later SuperSonic15 was lying on the floor, unconscious.

Now that he had only one opponent remaining, he was sure he would win. He tried to stab Mary, but she turned around at the last moment, and Zuckerberg’s sword hit the cape. Nobody (except Cory Doctorow, of course) will ever understand what happened next. A sudden flash of red light blinded Mary.

When she opened her eyes, she found out that Zuckerberg was lying on the floor, and she was pointing a sword at him. SuperSonic15 had already regained consciousness and was preparing to launch the weapon. She pressed a button on a small disk, and a mechanical sound filled the room.

“F-I-R-S-T P-O…”

This sound mixed with the sound of explosions, as Facebook skyscrapers collapsed one by one.

“Stop it! I agree to negotiate!” Mark Zuckerberg cried.

“Why should I stop?” SuperSonic15 said angrily.

“I think you can disable the weapon,” Mary replied, “I doubt Facebook will ever try to attack us again.”

“Let’s hope you are right,” said SuperSonic15 and pressed another button on the disc.

All sounds disappeared.

After a month of negotiations between Mark Zuckerberg and the greatest bloggers of our time, a peace treaty was signed. It received 50 million likes on Facebook and was reposted all over the Blogosphere.

Speaking of the Blogosphere, it was repaired and now it has even more pictures of cats on its surface than before. Mary and SuperSonic15 are still living in it and writing blog posts. Mary’s latest post, entitled “The Benefits of Open Source, Part 37”, became hugely popular. Cory Doctorow took back his cape. Wanting to find adventures, he flew upwind in his balloon, which caused a lot of concern among physicists, who said that balloons can’t fly like this.

Posted in Humour | Leave a comment

Cipher 13

It was once almost unimaginably far away. Then, cipher after cipher, it drew closer. And now it is here. Dozen II. And it contains a new, fresh cipher. Go check it out.

Posted in Ciphers | Leave a comment

How Many Tribbles?

Assuming I haven’t made a mistake in time zone calculations, this post should go online exactly 50 years after the intrepid crew of USS Enterprise appeared on American screens for the first time. Since then, the adventures of Starfleet officers have been depicted in six TV series and 13 movies. Even though newer Treks are in many ways better, The Original Series will be forever beloved for its unique charm. Here is the opening of The Man Trap, the exact episode that aired 50 years ago:

Anyway, this is a math blog, so I should write about the math of Star Trek. This is a broad topic, and I decided to only discuss one scene, which involves tribbles. Tribbles are funny little creatures famous for being infallible Klingon detectors and notorious for reproducing way too fast. Soon after Deep Space Station K-7 was infiltrated with them, Kirk discovered a population living in a grain storage tank:

Spock estimated that the tank contained 1,771,561 tribbles under the assumptions that a single tribble had entered the tank three day before and had been producing a litter of 10 every 12 hours since then. Knowing Spock, it is hard to imagine him solving such a simple problem incorrectly, but let’s confirm his result anyway.

When a tribble produces a litter of 10, the number of tribbles multiplies by 11 (10 for offsprings + 1 for original tribble). They had just enough time for 6 reproduction cycles, so we would expect to have 116 tribbles, which is exactly the number that Spock arrived at. Great!

If you want to learn more about the math of Star Trek, I recommend an excellent video by James Grime:

If you want to solve a Star Trek-themed cipher, go check it out.

Finally, if you want to celebrate the anniversary of Star Trek in another brilliant way,


Posted in Uncategorized | Leave a comment

Cipher 12

After a very long break, Cipher 12 has finally been released.

Posted in Ciphers | Leave a comment

A Question Most People Get Wrong

Edit: The poll is now over. A bunch of people voted after I wrote this article, but I decided not to redo all calculations because I am lazy.

A few days ago I created a Twitter thing called Geeky Polls. The first poll I posted was this one:

At first glance, this question may look like an obfuscated version of the liar paradox. However, it is not paradoxical, and you can answer correctly by choosing whichever option fewer people preferred.

When I made this poll, I expected that both answer choices will get roughly equal number of votes. Surprisingly, this turned out not to be the case: one of the options received 71% of votes. In case you haven’t voted yet, I will not disclose which option was more popular, since it would allow you to cheat.

But is this difference significant? Let’s find out. The poll attracted the attention of 70 people. The last time I checked, 71% of 70 was 50, so that’s how many people preferred the Popular Option. 20 people chose the Unpopular Option – what nice round numbers!

We can now start some kind of analysis. I will not use Bayesian approach because it is not suitable in this situation I know nothing about it, so let’s stick to good old frequentism. In this case, the p-value is the probability that 70 coin tosses will result in some side showing up at least 50 times. There are two ways to calculate it: smart one (do the math) and silly one (write a program). I will use the second approach.

Since you are probably tired of me posting Delphi apps, here is some nice and clean JS code:

var numTries = 100000;

var i, j, heads, skewed;

skewed = 0;
for (i = 0; i < numTries; i++) {
    heads = 0;
    for (j = 0; j  0.5) {
    if (heads = 50) {

// As you can see, I multiplied the p-value by 10000
// Hence, any output less than 500 will indicate significance
println(10000 * skewed / numTries);

This code gives the result of 4.3, which is much less than 500. Significance proven! Well, technically, it’s not. Since the program is randomized, there is always a possibility that it will take an insignificant result and mark it as significant. It means that we should conduct a statistical analysis to determine the significance of the result coming out of significance-testing program… My head hurts. That’s why serious people always choose the mathematical approach.

Anyway, goodbye for now. If you would like to know what the correct answer to the question is, just vote yourself!

Posted in Uncategorized | Leave a comment

Epoch Article, Part 2

This is the second part of a two-part post about measuring time. Part one is here.

Last time we discussed our familiar calendar, and the conclusion was that it is really messy. Well, then we should maybe make a better one?

This idea is much less crazy than it sounds. Of course, it would be very hard, if not impossible, to persuade the entire world’s population to switch to a better calendar. But there is point in having a special calendar to be used by tech people in solving problems that are hard enough even without all these leap years.

In the simplest possible calendar, time is a single real number. This number indicates how many [time units] have elapsed since [reference date]. Easy, right? Well, as you have probably already guessed, the answer is “wrong”.

Julian date

The first people to adopt such calendar were astronomers. Their apparent lack of imagination resulted in the calendar being called Julian date. It is the number of days since noon GMT January 1, 4713 BC. Dealing with Julian date is simple; the only problem arises when one wants to convert between Julian and ordinary dates. This is done by using two extremely complex formulas, the more frightening of which is shown below:

There is even a joke among programmers that no living person understands the meaning of these coefficients.


USS Enterprise near Saturn

Up to this point, I successfully avoided speaking about fictional calendars. However, now I can’t resist writing a few words about Stardate.

Stardate is used by humans and other intelligent species in the Star Trek universe. It is always a single real number, but other than that, the format of Stardate varies wildly between different series and movies. Let’s first focus on Stardates in The Original Series.

The first episode starts with Kirk saying “Captain’s Log, Stardate 1513.1”. The most interesting question is whether this is a real date that can be converted to something else or just a random number. We could find the answer by browsing Wikipedia or Memory Alpha, but that’s not how mathematicians do it. Instead, let’s compare the number of digits in Stardate and ordinary date.

Stardate has 5 digits, that’s easy. Date in Gregorian calendar has two digits for day, but the first one doesn’t go all the way up to nine, so it’s like half a digit. Month is also two digits, but the first one doesn’t really count because it is usually zero. Using the same logic, we can say that the year has 3½ digits. In total, we have 6 digits. Therefore, Stardate either has very low precision or, more likely, it is made up. Memory Alpha confirms that Stardates were indeed chosen arbitrarily.

Note: If you are in high school learning logarithms, try doing your homework like this. Your Math teacher will love it.

Since I am writing this post only days after Star Trek Beyond came out, I should probably talk about Stardate as it appears in the newest Star Trek movies. There is not much to speak about, actually: the integer part is the year, and the fractional part is, quite counterintuitively, the number of days since the start of a year. For example, 2233.04 means the fourth day of 2233.

Unix time

Let’s get back to serious business. Single-number calendars are currently most widely used by computers. It would be great if all programmers agreed on one universal calendar, but they instead created a multitude of incompatible ones via the following scheme:

How standards proliferate

The only calendar that stands out from the rest is Unix time, used by all Unix-like operating systems. It uses the reference date (by the way, it is also called epoch) of January 1, 1970. The time increments by one every second, which is convenient, because it allows to drop the fractional part unless you need very high precision. Unix was not designed for such high precision, so it stored the time in a signed 32-bit integer.

Signed 32-bit integer can store a value between -231 and 231-1 inclusive. If you assign the highest possible number to a 32-bit variable and then try to increment it, one of two things will happen:

  1. You will get an error.
  2. The number will “wrap around”, and you will get -231. This option is much more likely than the first one.

In either case, it is obvious that everything will break when the Unix time overflows. But when will this happen?

A relatively useless chart

The chart above suggests that 231 seconds are just under one century, so the overflow should occur a bit before 2070. More precisely, it will happen at 03:14:07 UTC January 19, 2038.

Fortunately, most systems manufactured today use 64-bit integers, so they should avoid all problems… except they don’t. Not long ago it turned out that iPhone stored dates in an unsigned 64-bit integer, which can only manipulate numbers between 0 and 264-1. When the phone needed to deal with a date before 1970, it wrapped around and broke down.

There is of course more to Unix time than overflow and underflow errors. For example, every time a leap second is introduced, programmers have a massive headache.

Also, having a birthday on January 1, 1970 can probably be as bad as having surname Null.

Other systems

As I mentioned before, Unix time is not the only time standard used in computing. You can see a relatively complete list here.


Fortunately, most programming languages have a built-in date type, which takes care of more or less all issues that may arise. Use it; don’t try to make you own time libraries, because that way lies madness.

Live long and prosper.

Posted in Uncategorized | 1 Comment