# Math/Probability question from Sagan/Contact (Pi)

**URL:** <https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347>\
**Category:** Factual Questions\
**Created:** [June 19, 2013, 7:11am UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347 "2013-06-19T07:11:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![standingwave](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@standingwave](https://boards.straightdope.com/u/standingwave)\
**Post date:** [June 19, 2013, 7:11am UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/1 "2013-06-19T07:11:03Z")

</div>

From the novel, not the movie.[Ellie, acting upon a suggestion by the senders of the message](http://en.wikipedia.org/wiki/Contact_%28novel%29#Plot_summary), works on a program which computes the digits of pi to record lengths in different bases. Very far from the decimal point (10[sup]20[/sup]) and in base 11, it finds that a special pattern does exist when the numbers stop varying randomly and start producing 1s and 0s in a very long string. The string’s length is the product of 11 prime numbers. The 1s and 0s when organized as a square of specific dimensions form a rasterized circle. The extraterrestrials suggest that this is a signature incorporated into the Universe itself. Yet the extraterrestrials are just as ignorant to its meaning as Ellie, as it could be still some sort of a statistical anomaly. They also make reference to older artifacts built from space time itself (namely the wormhole transit system) abandoned by a prior civilization. A line in the book suggests that the image is a foretaste of deeper marvels hidden even further within pi. This new pursuit becomes analogous to SETI; it is another search for meaningful signals in apparent noise.  
Now granted, if you extend any transcendental (irrational? I’m a little fuzzy on the differences) you will eventually generate, well, [pretty much everything](http://www.csua.berkeley.edu/~ranga/humor/pi.txt). But my question is, can we pin any factor of improbability to the strings of ones and zeros (in base 11, of all things) described in the novel? Anyone want to take a stab at it? FWIW, we haven’t yet reached 10[sup]20[/sup] [but we seem to closing in](http://upload.wikimedia.org/wikipedia/commons/thumb/2/25/Record_pi_approximations.svg/1000px-Record_pi_approximations.svg.png).

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [June 19, 2013, 7:45am UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/2 "2013-06-19T07:45:32Z")

</div>

An irrational number is a number which can’t be written as a fraction of integers (a ratio.) Pi, e, and the square root of two are all irrational numbers.

Transcendental numbers are numbers which can not be the solution to a polynomial equation (whose coefficients are rational.) Pi and e are transcendental numbers but √2 is not because x[sup]2[/sup] = 2 has a pair of easy solutions.

As for the rest of it, I got no idea.

---

<div class="post-metadata">

**Author:** ![Wendell\_Wagner](https://avatars.discourse-cdn.com/v4/letter/w/8491ac/32.png) [@Wendell\_Wagner](https://boards.straightdope.com/u/Wendell_Wagner)\
**Post date:** [June 19, 2013, 8:09am UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/3 "2013-06-19T08:09:53Z")

</div>

Suppose it were true that the expansion of pi in base 11 contained nothing except 1’s and 0’s for some long stretch. You would expect a random number in base 11 to contain all 11 base-11 digits mixed together randomly. The chances that a random base-11 number of length n consists of just two of those digits is thus (2/11) ^ n. Suppose that n were 10,000. The chances would be thus (2/11) ^ 10,000 = .18181818… ^ 10,000, which is around 10 ^ -7404. It is thus excruciatingly unlikely that you would find a 10,000-long string of only 1’s and 0’s by looking through just 10^20 base-11 digits.

The plot then has Ellie put those 1’s and 0’s into a square (in the example I’m giving, a 100-by-100 square) and noticing this makes a picture showing something. The problem is that (according to the Wikipedia entry) the length of the stretch of uninterrupted 1’s and 0’s is “the product of 11 prime numbers.” Of course, a product of 11 prime numbers can not be arranged in a square. To be arranged in a square, it would have to be a square number. Obviously, the product of 11 primes is not a square number.

---

<div class="post-metadata">

**Author:** ![Ximenean](https://avatars.discourse-cdn.com/v4/letter/x/aca169/32.png) [@Ximenean](https://boards.straightdope.com/u/Ximenean)\
**Post date:** [June 19, 2013, 9:18am UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/4 "2013-06-19T09:18:29Z")

</div>

I don’t know about you, but whenever I see a coded message whose length is the product of 11 prime numbers, I tend to assume that it is supposed to be arranged as an 11-dimensional hyperrectangle. Silly aliens. If they wanted to send a two-dimensional image, just make the length the product of two primes.

---

<div class="post-metadata">

**Author:** ![KarlGauss](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/karlgauss/32/3713_2.png) [@KarlGauss](https://boards.straightdope.com/u/KarlGauss)\
**Post date:** [June 19, 2013, 11:06am UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/5 "2013-06-19T11:06:20Z")

</div>

Would it matter in what base the analysis is conducted? If there’s a pattern in base 11, would there not also be a pattern in (every) other base?

BTW, if a MOD is reading this, you may want to add a SPOILER warning to the title of the OP. The highlight of the book for me when I read Contact was how the message was ‘stored’ and, even more, how it was created.

---

<div class="post-metadata">

**Author:** ![ZenBeam](https://avatars.discourse-cdn.com/v4/letter/z/3ab097/32.png) [@ZenBeam](https://boards.straightdope.com/u/ZenBeam)\
**Post date:** [June 19, 2013, 11:54am UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/6 "2013-06-19T11:54:46Z")

</div>

> [@Wendell\_Wagner](#):
>
> The plot then has Ellie put those 1’s and 0’s into a square (in the example I’m giving, a 100-by-100 square) and noticing this makes a picture showing something. The problem is that (according to the Wikipedia entry) the length of the stretch of uninterrupted 1’s and 0’s is “the product of 11 prime numbers.” Of course, a product of 11 prime numbers can not be arranged in a square. To be arranged in a square, it would have to be a square number. Obviously, the product of 11 primes is not a square number.

So _almost_ a square. Like 6480 is a product of nine prime numbers, and the product of 80 and 81. A figure 80 by 81 could be referred to as a square, even though it really isn’t quite a perfect square.

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [June 19, 2013, 12:09pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/7 "2013-06-19T12:09:49Z")

</div>

> [@Ximenean](#):
>
> I don’t know about you, but whenever I see a coded message whose length is the product of 11 prime numbers, I tend to assume that it is supposed to be arranged as an 11-dimensional hyperrectangle. Silly aliens. If they wanted to send a two-dimensional image, just make the length the product of two primes.

Sagan wrote _Contact_ about the same time as the 11-dimensional M-theory of strings emerged. Connection? … And wouldn’t it better if the image were on some sort of hyper-torus, and a treasure map?

---

<div class="post-metadata">

**Author:** ![yellowjacketcoder](https://avatars.discourse-cdn.com/v4/letter/y/4bbf92/32.png) [@yellowjacketcoder](https://boards.straightdope.com/u/yellowjacketcoder)\
**Post date:** [June 19, 2013, 12:33pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/8 "2013-06-19T12:33:15Z")

</div>

> [@KarlGauss](#):
>
> Would it matter in what base the analysis is conducted? If there’s a pattern in base 11, would there not also be a pattern in (every) other base?
> 
> BTW, if a MOD is reading this, you may want to add a SPOILER warning to the title of the OP. The highlight of the book for me when I read Contact was how the message was ‘stored’ and, even more, how it was created.

You want a spoiler warning for a 28 year old book? Would you also want a spoiler if I told you Romeo and Juliet die at the end?

as far as the base, it would make a big difference. If you’re someone that needs to think in different bases (ie, if you’re a programmer that occaisionally needs to read binary or hex, like me), you realize that different bases make representing certain values very different.

For example, 0.25 in decimal is 0.01 in binary. That’s not so bad. But when you try to do 0.1 decimal in binary, you get 0.00011001100110011001100110011001100110011…

The representation matters.

---

<div class="post-metadata">

**Author:** ![KarlGauss](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/karlgauss/32/3713_2.png) [@KarlGauss](https://boards.straightdope.com/u/KarlGauss)\
**Post date:** [June 19, 2013, 12:49pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/9 "2013-06-19T12:49:22Z")

</div>

> [@yellowjacketcoder](#):
>
> as far as the base, it would make a big difference. If you’re someone that needs to think in different bases (ie, if you’re a programmer that occaisionally needs to read binary or hex, like me), you realize that different bases make representing certain values very different.
> 
> For example, 0.25 in decimal is 0.01 in binary. That’s not so bad. But when you try to do 0.1 decimal in binary, you get 0.00011001100110011001100110011001100110011…
> 
> The representation matters.

I’m not saying the pattern would be easier or harder to detect, or prettier, but, that if there’s a “pattern” i.e. a non random sequence of digits base[sub]x[/sub], it will be non random in every base, i.e. there will be a “pattern” in every base. Remember, part of the purpose of the encoded message was to signal that there was an intelligence ‘out there’, that the digits of pi were not random but had been ‘designed’. The other part of the purpose was the content of the message itself - and that would be the same regardless of the base, just like the message would be the same whether it was written in French or English.

The representation doesn’t matter.

---

<div class="post-metadata">

**Author:** ![standingwave](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@standingwave](https://boards.straightdope.com/u/standingwave)\
**Post date:** [June 19, 2013, 1:31pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/10 "2013-06-19T13:31:42Z")

</div>

> [@KarlGauss](#):
>
> I’m not saying the pattern would be easier or harder to detect, or prettier, but, that if there’s a “pattern” i.e. a non random sequence of digits base[sub]x[/sub], it will be non random in every base, i.e. there will be a “pattern” in every base. Remember, part of the purpose of the encoded message was to signal that there was an intelligence ‘out there’, that the digits of pi were not random but had been ‘designed’. The other part of the purpose was the content of the message itself - and that would be the same regardless of the base, just like the message would be the same whether it was written in French or English.
> 
> The representation doesn’t matter.

Interesting question. I’m tempted to agree but does it? I hear what you are saying, that a long string containing only two digits would still look like something in some other base, but this is already beyond my pay grade.

Dec: 3.14159265358979323846 …  
Hex: 3.243F6A8885A308D31319 …

---

<div class="post-metadata">

**Author:** ![standingwave](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@standingwave](https://boards.straightdope.com/u/standingwave)\
**Post date:** [June 19, 2013, 1:41pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/11 "2013-06-19T13:41:11Z")

</div>

> [@standingwave](#):
>
> Interesting question. I’m tempted to agree but does it? I hear what you are saying, that a long string containing only two digits would still look like something in some other base, but this is already beyond my pay grade.
> 
> Dec: 3.14159265358979323846 …  
> Hex: 3.243F6A8885A308D31319 …

Missed the edit window but wanted to add, from the novel:

> [@](#):
>
> The anomaly showed up most starkly in Base 11 arithmetic, where it could be written out entirely as zeros and ones. Compared with what had been received from Vega, this could be at best a simple message, but its statistical significance was high. The program reassembled the digits into a square raster, an equal number across and down.

_Most_ starkly in base 11. For whatever that’s worth.

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [June 19, 2013, 2:11pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/12 "2013-06-19T14:11:12Z")

</div>

I’m not sure the base doesn’t matter. A good test would be to express the number \sum{i=1}^\infty 10^{-n!}. In base ten it looks like 0.110001000000000000000001… with ones in position 1,2,6,24,…,n!,… and zeroes elsewhere. Someone might want to see what it looks like in base 11. It is, BTW, transcendental. There is a theorem that says that an irrational number that is too closely approximated by rational numbers must be transcendental. (What does too closely mean? It means too closely with respect to the denominator of the rational number approximating it.)

---

<div class="post-metadata">

**Author:** ![standingwave](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@standingwave](https://boards.straightdope.com/u/standingwave)\
**Post date:** [June 19, 2013, 2:30pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/13 "2013-06-19T14:30:36Z")

</div>

> [@Wendell\_Wagner](#):
>
> Suppose it were true that the expansion of pi in base 11 contained nothing except 1’s and 0’s for some long stretch. You would expect a random number in base 11 to contain all 11 base-11 digits mixed together randomly. The chances that a random base-11 number of length n consists of just two of those digits is thus (2/11) ^ n. Suppose that n were 10,000. The chances would be thus (2/11) ^ 10,000 = .18181818… ^ 10,000, which is around 10 ^ -7404. It is thus excruciatingly unlikely that you would find a 10,000-long string of only 1’s and 0’s by looking through just 10^20 base-11 digits.
> 
> The plot then has Ellie put those 1’s and 0’s into a square (in the example I’m giving, a 100-by-100 square) and noticing this makes a picture showing something. The problem is that (according to the Wikipedia entry) the length of the stretch of uninterrupted 1’s and 0’s is “the product of 11 prime numbers.” Of course, a product of 11 prime numbers can not be arranged in a square. To be arranged in a square, it would have to be a square number. Obviously, the product of 11 primes is not a square number.

Thanks. This is pretty much what I was looking for. Excruciatingly unlikely. I like that.

---

<div class="post-metadata">

**Author:** ![Great\_Antibob](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Great\_Antibob](https://boards.straightdope.com/u/Great_Antibob)\
**Post date:** [June 19, 2013, 2:31pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/14 "2013-06-19T14:31:51Z")

</div>

> [@standingwave](#):
>
> Now granted, if you extend any transcendental (irrational? I’m a little fuzzy on the differences) you will eventually generate, well, [pretty much everything](http://www.csua.berkeley.edu/~ranga/humor/pi.txt).

Just as a side note, this is probabilistically true for any real number, but it’s not been proven true for most, if any, of the interesting numbers.

Any number that satisfies this property is called a [normal number](http://en.wikipedia.org/wiki/Normal_number) (with some nomenclature on whether they are normal in one number base or all of them). We know for certain that a few constants are normal, but sqrt(2), pi, and e are not among them. We do suspect they are normal, though.

---

<div class="post-metadata">

**Author:** ![naita](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/naita/32/5862_2.png) [@naita](https://boards.straightdope.com/u/naita)\
**Post date:** [June 19, 2013, 3:09pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/15 "2013-06-19T15:09:35Z")

</div>

> [@KarlGauss](#):
>
> I’m not saying the pattern would be easier or harder to detect, or prettier, but, that if there’s a “pattern” i.e. a non random sequence of digits base[sub]x[/sub], it will be non random in every base, i.e. there will be a “pattern” in every base. Remember, part of the purpose of the encoded message was to signal that there was an intelligence ‘out there’, that the digits of pi were not random but had been ‘designed’. The other part of the purpose was the content of the message itself - and that would be the same regardless of the base, just like the message would be the same whether it was written in French or English.
> 
> The representation doesn’t matter.

Yes it does.  
base eleven 10101010 = base ten 19649564  
base eleven 11111111 = base ten 21435888

And I just tried to make a universe where pi in base 11 is 3.0110100110010110 -\> random sequence of base 11 digits, which has a rasterised “circle” in the first 16 digits, and although the project failed due to excel not being able to handle more than 15 significant digits, I now know that in base ten mypi starts with 3.00902199191354245

---

<div class="post-metadata">

**Author:** ![standingwave](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@standingwave](https://boards.straightdope.com/u/standingwave)\
**Post date:** [June 19, 2013, 3:23pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/16 "2013-06-19T15:23:32Z")

</div>

> [@Great\_Antibob](#):
>
> Just as a side note, this is probabilistically true for any real number, but it’s not been proven true for most, if any, of the interesting numbers.
> 
> Any number that satisfies this property is called a [normal number](http://en.wikipedia.org/wiki/Normal_number) (with some nomenclature on whether they are normal in one number base or all of them). We know for certain that a few constants are normal, but sqrt(2), pi, and e are not among them. We do suspect they are normal, though.

A good point. Random doesn’t necessarily mean a normal distribution, though I am often guilty of using the terms interchangeably.

Back to the novel, what would it mean really if we discovered some sort of artifact inside Pi? How could such a thing exist? As Arroway says in the novel: _“You’re telling me there’s a message in eleven dimensions hidden deep inside the number pi? Someone in the universe communicates by… mathematics? But… help me, I’m really having trouble understanding you. Mathematics isn’t arbitrary. I mean pi has to have the same value everywhere. How can you hide a message inside pi? It’s built into the fabric of the universe.”_

Pi isn’t arbitrary unlike some physical constants which may or may not be. For one example, it’s also the result of [several infinite series](http://en.wikipedia.org/wiki/Pi#Infinite_series). How does a designer embed a message in that?

---

<div class="post-metadata">

**Author:** ![Keeve](https://avatars.discourse-cdn.com/v4/letter/k/f07891/32.png) [@Keeve](https://boards.straightdope.com/u/Keeve)\
**Post date:** [June 19, 2013, 3:40pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/17 "2013-06-19T15:40:03Z")

</div>

> [@standingwave](#):
>
> Missed the edit window but wanted to add, from the novel:
> 
> > [@](#):
> >
> > The anomaly showed up most starkly in Base 11 arithmetic, where it could be written out entirely as zeros and ones. Compared with what had been received from Vega, this could be at best a simple message, but its statistical significance was high. The program reassembled the digits into a square raster, an equal number across and down.
> 
> _Most_ starkly in base 11. For whatever that’s worth.

Yes, that is quite familiar to me, and sure sounds like an exact quote from the novel. I don’t remember anything about the product of eleven prime numbers. Gonna check it when I get home.

---

<div class="post-metadata">

**Author:** ![Frylock](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@Frylock](https://boards.straightdope.com/u/Frylock)\
**Post date:** [June 19, 2013, 3:52pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/18 "2013-06-19T15:52:57Z")

</div>

> [@standingwave](#):
>
> A good point. Random doesn’t necessarily mean a normal distribution, though I am often guilty of using the terms interchangeably.
> 
> Back to the novel, what would it mean really if we discovered some sort of artifact inside Pi? How could such a thing exist? As Arroway says in the novel: _“You’re telling me there’s a message in eleven dimensions hidden deep inside the number pi? Someone in the universe communicates by… mathematics? But… help me, I’m really having trouble understanding you. Mathematics isn’t arbitrary. I mean pi has to have the same value everywhere. How can you hide a message inside pi? It’s built into the fabric of the universe.”_
> 
> Pi isn’t arbitrary unlike some physical constants which may or may not be. For one example, it’s also the result of [several infinite series](http://en.wikipedia.org/wiki/Pi#Infinite_series). How does a designer embed a message in that?

I don’t think it’s possible. But what one could do is create a universe in which pi is very likely to come to be seen as an important number to its inhabitants.

It is possible that my ignorance is showing, but I do not think it’s physically necessary for pi to fill an important physical role in just any possible physical universe. (“possible” here has to be constructed very broadly, though. A physical universe in which spheres aren’t likely to strike inhabitants as important? Hard to imagine! But I don’t think impossible.)

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [June 19, 2013, 5:00pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/19 "2013-06-19T17:00:28Z")

</div>

> [@standingwave](#):
>
> Pi isn’t arbitrary … How does a designer embed a message in that?

That’s what made Sagan’s concept so beautiful to me! Any old Creator God can hide a message in Planck’s constant, or something like that. But to hide a message in an arithmetic fact is spookily awesome.

BTW, I have mixed feelings about pi’s normalcy, assuming it is. It seems nice that pi rendered in Ascii contains the Complete Works of Shakespeare and the Complete History of the U.S.A. published in the 23rd century. But … before you ever get to them in pi’s expansion, you’ll have to wade through gazillions of Hamlet versions where the Prince and Ophelia elope in Act II. And before you get to the correct History, there will be incorrect versions which end suddenly with the Cuban Missile Crisis … or in which GWB is elected to a third term in 2008.

---

<div class="post-metadata">

**Author:** ![Frylock](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@Frylock](https://boards.straightdope.com/u/Frylock)\
**Post date:** [June 19, 2013, 5:23pm UTC](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347/20 "2013-06-19T17:23:55Z")

</div>

> [@septimus](#):
>
> That’s what made Sagan’s concept so beautiful to me! Any old Creator God can hide a message in Planck’s constant, or something like that. But to hide a message in an arithmetic fact is spookily awesome.
> 
> BTW, I have mixed feelings about pi’s normalcy, assuming it is. It seems nice that pi rendered in Ascii contains the Complete Works of Shakespeare and the Complete History of the U.S.A. published in the 23rd century. But … before you ever get to them in pi’s expansion, you’ll have to wade through gazillions of Hamlet versions where the Prince and Ophelia elope in Act II. And before you get to the correct History, there will be incorrect versions which end suddenly with the Cuban Missile Crisis … or in which GWB is elected to a third term in 2008.

See Borges’ [The Library of Babel](http://en.wikipedia.org/wiki/The_Library_of_Babel), which I occasionally teach in my intro to philosophy course.

[Next page](https://boards.straightdope.com/t/math-probability-question-from-sagan-contact-pi/661347.md?page=2)
