# Thread: The digits of e in pi

1. ## The digits of e in pi

Well, it's late, I'm tired, my mind is wandering, and maybe that's why I thought of this.

Can it be said that somewhere in the decimals of pi=3.14159..., we can find any arbitrary number of digits of e=2.718281828459045...

For example, of course we can find 7 in pi.
And 71.
And 718.
And 7182.
And ...
But can we find (or even claim) that the first million digits of e are in pi?

2. It may exist, but I doubt you'd find it.

If each of the digits 0-9 in $\pi$ are equally likely, then the probability that the first $10^6$ digits of e occur somewhere in the first n digits of $\pi$ should be around the following:

0 if $n < 10^6$

$(0.1^{10^6}) \cdot (n - (10^6 - 1))$ for $10^6 \leq n$

The above is only approximate.

3. Originally Posted by jamix
It may exist, but I doubt you'd find it.

If each of the digits 0-9 in $\pi$ are equally likely, then the probability that the first $10^6$ digits of e occur somewhere in the first n digits of $\pi$ should be around the following:

0 if $n < 10^6$

$(0.1^{10^6}) \cdot (n - (10^6 - 1))$ for $10^6 \leq n$

The above is only approximate.
That's one big if' you have there! If the digits 0-9 in $\pi$ are equally likely, then...'

I am unsure about base 10, but certainly noone knows if this `if' holds for any base. That is to say, if we write $\pi$ as a decimal expansion base $n$ then we do not know if every number less than $n$ is equally likely to appear in each position.

See here for more details.

4. Originally Posted by jamix
It may exist, but I doubt you'd find it.

If each of the digits 0-9 in $\pi$ are equally likely, then the probability that the first $10^6$ digits of e occur somewhere in the first n digits of $\pi$ should be around the following:

0 if $n < 10^6$

$(0.1^{10^6}) \cdot (n - (10^6 - 1))$ for $10^6 \leq n$

The above is only approximate.
Under the assumption that $\pi$ is normal, I believe your probability is wrong as $\lim_{n\to\infty}\left\{(0.1^{10^6}) \cdot (n - (10^6 - 1))\right\}=\infty>1$

5. edit ignore this post, its wrong

6. I know this isn't your question, but on a related note, the first 200 million digits of pi can be searched here.

7. Chip...

Thanks for noticing that. Hopefully I'll do better this time.

.................................................. .................

The question of whether there exists $k$ particular objects in sequence, within another RANDOM sequence of n objects can be solved using recurrent sequences.

Letting $f_n,_k$ denote the above probability, and conditioning on \whether or not the first object in the $n$ sequence, is also the first object in $k$, we see we have the following relation:

$f_n,_k = p \cdot f_n,_{k-1} + (1-p) \cdot f_{n-1},_{k}$

where $p$ is the probability of any particular object in $k$ occurring in a given position in the $n$ sequence.

In this particular question, if we assume random/normal conditions, then we would have $p = \frac{1}{10}$ and $f_n,_k = 0$ for $n < k$.

Unfortunately even now we cannot efficiently solve the above for $k = 10^6$ since we have to calculate $f_n,_{k-1}$ for each $1,2,...k-2$ first. This is doable since calculating $f_n,_1$ is easy for any $n$, but I don't suppose anyone sees any shortcuts?

8. BTW, i never studied this and i am basically guessing.

I'm not sure whether the questioner is really interested in the specific case of "is a part of e inside pi", or the general question of "will an irrational number contain an arbitrary finite sequence if you go through enough digits".

If the interest is in the second question, read on...
The answer to the second question is no, it is not necessary. The simplest way to prove it is to show that an irrational number can be constructed without containing a sequence, x.

Define:
x = the finite sequence you are looking for
y = all but the last digit in that sequence

Then the following number is irrational because it never repeats:
z=y0y00y000y0000y00000y00000y000000y0000000y...

(if the last digit of x was zero, youd need to use a different number as a spacer, obviously!)

9. Originally Posted by SpringFan25
BTW, i never studied this and i am basically guessing.

I'm not sure whether the questioner is really interested in the specific case of "is a part of e inside pi", or the general question of "will an irrational number contain an arbitrary finite sequence if you go through enough digits".

If the interest is in the second question, read on...
The answer to the second question is no, it is not necessary. The simplest way to prove it is to show that an irrational number can be constructed without containing a sequence, x.

Define:
x = the finite sequence you are looking for
y = all but the last digit in that sequence

Then the following number is irrational because it never repeats:
z=y0y00y000y0000y00000y00000y000000y0000000y...

(if the last digit of x was zero, youd need to use a different number as a spacer, obviously!)
Expanding on this I believe we can construct a normal number with this property. Take the same $y$ and append a bunch of digits to the back to get a new number $a$ such that $a$ is normal. Ex: $y=786290$ we would then make $a=7862901345$ (note the number of digits of $a$ will always be a multiple of $10$).

Now let $z=a.0a12a345a6789a01234a567890a1234567\ldots$

Edit: there is a family of exceptions to my proposed solution, but there's an easy way around them: a similar construction.