Back Homeland

Read Homeland PDF Online - Page 93

Chapters (26)
  1. Titlepage
  2. Title Page
  3. Copyright Notice
  4. Dedication
  5. Chapter 1
  6. Chapter 2
  7. Chapter 3
  8. Chapter 4
  9. Chapter 5
  10. Chapter 6
  11. Chapter 7
  12. Chapter 8
  13. Chapter 9
  14. Chapter 10
  15. Chapter 11
  16. Chapter 12
  17. Chapter 13
  18. Chapter 14
  19. Chapter 15
  20. Epilogue
  21. Afterword by Jacob Appelbaum
  22. Afterword by Aaron Swartz
  23. Acknowledgments
  24. Bibliography
  25. Also by Cory Doctorow
  26. About the Author

Well, not really. That also happens to be a number called “e,” which is sometimes called “Napier’s constant.” Never mind what “e” means, it’s complicated. The point is that e is a number like pi. Every digit in it can be predicted.

How about if your random-number generator gave you this number:

22222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222
2222222.

Is that random?

Well, duh. No.

Why isn’t it random? Because if I said, “What’s the one hundredth digit of a number that consists of a thousand twos?” you’d know the answer. You wouldn’t be surprised.

It turns out a lot of people have spent a lot of time trying to come up with a decent definition of “random.” One of the best definitions anyone’s ever come up with is “A number is random if the simplest way to express it is by writing it down.”

If you just went lolwut, don’t panic. This is hard, but cool. So, take our friend pi again. You could write a program to print out pi in, like two hundred characters. Maybe less. Pi itself is infinite, which is a lot more than two hundred characters long. So the simplest way to express pi is definitely to write the “print out pi program” and not to write out all the infinite digits of pi.

And if pi is easy, “222222222222222222222222222222222222222222” and so on is really easy. In python, it’d be: “print “.join(['2']*42).” Perl’s more compact: “print 2×42.” But even in verbose old BASIC, a programming language that’s so flowery and ornate it’s practically Shakespearean, it’s:

10 PRINT “2” 20 GOTO 10 30 END

That’s thirty characters, which is shorter than 222222222222222222222222222222222222222222 to infinity. A lot shorter. So if we mean a random number is a surprising one—one that has no easily expressed pattern or structure, then we can say that:

A number is “random” if the shortest program you can write to print that number out is longer than the number itself.

This has a neat compactness to it, the ring of a good rule: short, punchy, and to the point. A guy named Gregory Chaitin came up with this neat rule, then he came up with a hell of a twist on it. He was so proud of this feat that he mailed a paper to one of math’s great mad geniuses, a guy called Kurt Gödel (pronounced “Girdle,” more or less) and messed everything up by asking, “How do you know whether you’ve come up with the shortest program for printing out a number?”

Which was a good point. Programmers are always coming up with novel ways of solving problems, after all. And there may be some hidden pattern to a number you didn’t even realize was there. Say I asked you to write a program to print out this number:

6464126002437968454377733902647251281941632007684
87362517640659675406936217588793078559164787772747392
7200291034294956244766130820072925073452917076422662
10476730378631699542374551174565220227833240968035246
676631908610112067458562873174135111622920788651329412
44815471628182079877168346341322362234117788231027659
82510935889235916205510876329808799316517252893800123
78174348968321515905624933473702068322321001186373957
70567473867102173212375224325241626358034376253606808
66916357159455152781780392177432282343663377281118639
05118930759016666507429527583840085446354193171905313
63659724905158409106582201814734799022359067138146905
11605192230126948231611341743994471483304086248426913
9502336713412425123864026657258130943967621939655407
38652422989787978219863791829970955792474732030323911
64104459069079778623155183495930353059237898175158914
57650408025109479123421758482841881950138546165680301
7550355800549448948848713516053755934023457489795166
0244233832140603009593710558845705251570426628460035