Communicating ideas is difficult

How would you teach an alien to read?

Jack Holland
Understanding computer science
8 min readNov 25, 2013

--

Aliens from outer space!

Aliens have landed on Earth!

Exciting news! Aliens have landed on Earth and by a series of bizarre circumstances, your country of citizenship has asked you to educate these recently arrived guests. Always up for a challenge, you accept and begin work right away. The officials tell you that at this point, the aliens have learned to speak English but have no idea how to read or write in it.

At first, the task of teaching them may seem easy. After all, children can learn to read in just a few years, so how hard can it be to teach fully grown, English speaking aliens a little written English? Making it easier, the aliens are apparently quite friendly and open to new ideas, although they don’t have the ability to easily learn new languages like human children do. So you set out thinking about how to teach them.

And, if you’re like me, think some more.

And some more.

And some more.

If you’ve tried this thought experiment, you may understand what I’m getting at. Namely, that the more you think, the more you realize it may be a more difficult task than first imagined. You can break it down into steps, but every step you outline requires several steps itself; those steps also require steps, and on and on.

It didn’t look so jagged from farther away…

It’s like trying to measure a coastline: the more you zoom in on the coast, the more detail you see, revealing that what looks like a smooth line from far away is actually very winding and jagged. This means that the more closely you observe the coastline, the longer it appears. The measured length of a coastline depends on how closely those who measured it looked. Communicating complex ideas works in a similar way. Each part of language is made of smaller parts…

paragraph -> sentence -> expression -> word -> letter -> stroke

… and each part takes time to explain. Like coastlines get longer, these parts get more complicated the more closely they are examined. To further complicate things, most parts can be understood in many different ways. For instance, a word can be described as a collection of syllables, roots, letters, or morphemes. A word can be so many different parts of speech — noun, verb, adjective, adverb, conjunction, preposition, interjection, particle, etc. — and each part of speech can have multiple categories or uses. Verbs can be one of several different tenses (past, present, future, past perfect, infinitive, etc.) and prepositions like for, in, and like have different meanings depending on what word they precede. Consider the different meanings of for in for example versus for a while. And on top of all of this, there are idioms like once in a blue moon, whose meanings have little to do with the words that make them up. Teaching an alien everything about English would take a long time.

In other words, just because humans are really good at learning language doesn’t make teaching language to an alien easy. It is the difference between being an expert at language, which most adults are, and being an expert in language, a title usually reserved for people with extensive knowledge of linguistics and literature. Humans can be very talented at something without understanding why they’re so talented or how to spread this talent to fellow beings who lack it. We’ve all experienced the very intelligent math teacher who can’t explain their ideas to students.

But if you think it’s difficult explaining ideas to a human-like alien, you should try explaining ideas to a computer. Really, you should. It’s called programming and while it’s definitely challenging, it’s also useful and a lot of fun. The difficulty lies in that computers don’t have human minds and don’t understand ideas the way humans do. There will likely be artificial intelligences in the future, but for now, computers are just excellent math machines. They are limited to simple calculations and must be told very explicitly what to do and how to do it. Unlike a human, who can make educated guesses and learn by example, computers take everything literally and must be told how to learn.

At first, instructing computers may seem dauntingly precise and burdensome. But please stick with it! Learning how to explain complicated concepts to a uninformed listener is an incredibly valuable skill to have both as a programmer, computer scientist and human. Learning computer science is excellent practice for breaking down ideas into manageable, teachable chunks. In fact, you’ll begin understanding computer science by doing just this.

Can you teach me how to walk?

Not his best performance

Try playing QWOP. It’s really difficult, right? Controlling a sprinter for 100 meters by activating each of his muscles individually takes a lot more coordination and planning than you might expect. Granted, the game is supposed to be freakishly hard, but the principle holds: if a being had no intuitive notion of how to walk, explaining which muscles to move when is quite a struggle. Imagine how difficult it would be to teach a robot how to master a martial art (even if you have mastered it yourself). Like teaching an alien English, teaching a robot to walk is very difficult because you can’t rely on human intuition to guide the process.

Given the difficulties, let’s start with something even simpler: explaining how to solve a maze. Specifically, how to help the hero (portrayed by a blue square) navigate through the maze to the treasure (portrayed by a green square). Imagine something like this:

hero=blue square
treasure = green square

How would you explain to the hero how to get to the treasure? You can explain your strategy to him in any language you want. Spend a minute or two thinking about this. When you’re done, compare your answer(s) to the ones below:

  • Walk forward a few paces, turn right, walk forward a few more paces, turn right again; the treasure is just ahead.
  • Follow the passage around two right turns; the treasure is just ahead.
  • Walk until you find the treasure.
  • The maze is shaped like a horseshoe. You are at one end and the treasure is at the other.

Not all of these instructions are equally useful, but there was no rule saying they had to be. If the hero is a human, they can probably find the treasure given any of the above instructions. But what if they’re not human? What’s if they’re a mindless automaton who needs your help every step of the way? Let’s assume they have a very limited vocabulary:

  • walk: the hero walks forward until they hit a wall
  • turn left: the hero turns 90 degrees left
  • turn right: the hero turns 90 degrees right

How would you instruct them to find the treasure? Assume they’re facing up (↑) to start with. Try this:

  1. walk
  2. turn right
  3. walk
  4. turn right
  5. walk

The hero will walk until they hit the top wall, turn right (facing the right wall), walk until they hit the right wall, turn right (facing the bottom wall) and walk down until the bottom wall. Let’s assume the hero is smart enough to grab the treasure if it’s right next to them.

Does this make sense? If not, try following the five steps yourself and see where you end up. If followed exactly, you should end up next to the treasure. What about a more complicated maze? Once again, assume the hero faces up (↑) at the start.

A more labyrinthine maze awaits the hero this time!

Can you help the hero this time? Try a few sequences of commands (e.g. walk, turn right, etc.) and see what happens. Is there a way to indicate to the hero that they should walk through the lower passage?

I must confess that this was a bit of a trick question. Using just walk, turn left, and turn right, there is no way to get the treasure. Yet it seems like such an obvious request. C’mon, hero, just walk through the lower passageway, the one closer to you! But the hero doesn’t understand. Lower just isn’t a part of their vocabulary. So this hero’s journey must end. Fortunately, a new hero has just arrived; donned in blue like their predecessor, this hero is better trained. They can visualize mazes as grids, like this:

The grid lines can help you communicate with the hero

This is great news because now you can better communicate with this hero. Here is their vocabulary:

  • walk x steps: the hero walks forward x steps (each step is a square in the grid), stopping at the first wall they hit
  • turn left: the hero turns 90 degrees left
  • turn right: the hero turns 90 degrees right

The x in walk x steps can be any reasonable number like 1, 2, 5, or 100 (although the hero will certainly hit a wall before walking forward 100 steps). Using x instead of a specific number allows much more flexible communication between you and the hero; no matter the size and shape of the maze, the hero can always walk along the grid in any direction necessary. Here’s how you might instruct them to find the treasure:

  1. walk 4 steps
  2. turn right
  3. walk 8 steps
  4. turn right
  5. walk 4 steps
  6. turn right
  7. walk 3 steps

Follow each instruction with your finger and make sure it works. Will these instructions guide the hero to the treasure? I hope you agree that they will. I hope you will also agree that this hero’s vocabulary is much more useful than the first one’s. If you’re not used to algebra, the x may seem a bit abstract, but I think its usefulness makes up for it.

Looking at the big picture, this exercise was intended to show you how complicated communication can be, especially when the listener isn’t intelligent and intuitive like a human. The mazes above are trivially easy to solve if you’re a human, but an uninformed robot can have quite the difficulty. As we saw with the first hero, robots with too limited of a vocabulary can’t even solve some mazes.

In the next post, we’ll expand on these mazes to include monsters, lava, and tiptoeing. In fact, there will be a couple more posts about these mazes before we even start looking at code. The idea is that by the time I show you actual code, your experience with the mazes will have properly prepared you for understanding it.

Image credits: flying saucer, coastline, QWOP

--

--