Home    All Articles    About    carlos@bueno.org    RSS

Pascal's Apology

Blaise Pascal once famously ended a letter with an apology: I'm sorry that this was such a long letter, but I didn't have time to write you a short one. Computer science has pretty much the same problem. It's a young field, and young fields are, by their nature, messy. As we race to generate new knowledge, we also generate excess Jargon. There are multiple names for the same ideas and the ideas themselves are often tangled together. What's worse, because that's the way things are now, we assume that's the way they are always going to be. It's a complicated science because we haven't taken the time to make a simple one.
A story about computer science
and other improbable things.

Let me show you what I mean:

A Von Neumann randomness extractor takes as input a Bernoulli sequence with p not necessarily equal to 1/2, and outputs a Bernoulli sequence with p equal to 1/2. More generally, it applies to any exchangeable sequence relying on the fact that for any pair, 01 and 10 are equally likely.

And now you know about as much as you did before. Let me try that again. Imagine that you have a coin that is unfair. It's biased. If you flip it you'll get Heads seventy percent of the time. If you wanted to make a fair choice, fifty-fifty, what do you do?

Well, one way is to get a coin that doesn't suck. Another way, discovered by John von Neumann, is to use the bias against itself. You can flip it two times. If you get a Heads then a Tails, you say Heads is your answer. If you get a Tails then a Heads, you say Tails. If you get anything else you just start over. And that's it. This works because no matter what the bias happens to be, the odds of getting a Heads and then Tails will always be exactly the same as the odds of getting a Tails and then Heads. For the same reason that seven times three is equal to three times seven.

That's all very interesting, but why should you care? This algorithm was invented to ensure that you can get a clean source of random numbers even if you are stuck with buggy hardware, which happens all the time. Quality randomness is essential for cryptography. Cryptography is essential for secure communications, which is the basis our entire modern life. Without this little coin trick there would be no Facebook, no Gmail, no Skyping grandma, no PIN numbers on your credit cards, no buying books online, no banking from your mobile phones. And, no mobile phones. It's fundamental, and it turns out that it's also easy to understand. You could teach it to a child. So, why don't we?

My overall complaint here, and the reason I wrote this book, is a little nuanced. I'm not just saying, Hey everyone! Guess what? Computer science is hard! Anything worth doing is going to be hard, and I can't change that. But some parts are harder than others. My complaint is that if the hard stuff is messy and complicated, and we allow the easy stuff to be messy and complicated too, then you can't really tell the difference.

That means, as teachers, we're probably starting in the wrong place.

I don't think it has to be this way. What do we expect children to understand about math? Negative numbers, zero, exponents, the square root of two, pi. In those boring little facts I see hope, precisely because they are boring little facts. It wasn't always like that. Once upon a time, the existence of negative numbers was considered the most difficult question in the world. People died arguing about the hypotenuse, for God's sake. The fact that we can teach these things to innocent children is evidence of progress. Real, measurable, personally empowering progress. The kind of progress we haven't had time to make in computer science.

If the mathematicians are making fun of you for being too complicated, you know there's work to do.

I started writing Lauren Ipsum by looking for ideas that I understood well enough to explain to a nine-year-old child, without regard for how supposedly hard they were. If I found something I couldn't then I tried to break it down further to learn why. Sometimes it worked, sometimes not. I learned a lot from this.

Early on I decided that I wasn't actually writing a book about how to program. I was writing a book about how programmers think. Once you get past the first hump and really start to learn this stuff, you develop some mental habits to help you cope. So, I figured, let's write those down. Start there.

The book starts with a character called the Wandering Salesman. He's lost, but only mostly lost. He actually knows where he is, and he knows where he's going. He's still lost because he doesn't know how to get there. This is the essence of effective problem solving. It's about having a clear goal, and knowing where you stand. Instead of giving in to that instinct to do the first thing that comes to mind, you try to imagine all the possible ways to solve the problem, compare them, and choose one.

This is a big part of what computer science actually studies. It's not about computers, they are just a tool. It's about how to generate those possible answers, those algorithms. How to characterize them so they can be compared. How to choose.

As the hero, a little girl named Lauren goes through her adventures, she learns not just that she is responsible for her own decisions. She learns that, maybe, there are better ways to make them. And, by the way, here are some tools to help you do that.

So far the response has been pretty good. It's a start. A small start. But I think this is a rich vein to explore. Think about it this way: if you leave this world as complicated as you found it; if the next generation takes just as long to learn what you've learned, then they'll never have time to do better than you.

So, wherever you can, don't just transmit knowledge. Simplify it. Take the time. Write the short letters. Because that's how we make progress.