Back to Riemann, Part 10


Ok, back to the der Veen and de Craats version of the Riemann functional equation.

z( -x ) = ((-2 * x!) / (2*pi)^(x+1)) * sin(pi*x/2) * z(x + 1)

What this states is that if you have the zeta(x) value for any complex x (x = a + bi) then you can get zeta(x + 1), and from there apply the functional equation to define zeta(-x).

This extends the zeta function to the left hand side of the complex plane (a < 0). Combining the functional equation with eta(x) and the original version of zeta(x) for x>1, we now have complete coverage of the complex plane everywhere except for the pole point x = a = 1.

One interesting feature here is that the mirror relationship between -z and z + 1 gives a center of rotation at x = 0.5.
c = B + (A – B)/2 = -z + (z + 1 – (-z))/2
c = -z + (2z + 1)/2
c = -z + 2z/2 + 1/2
c = 0.5, for any z.

I’ve mentioned before that the zeta(x) function converges to 1 for large x, meaning that there are no zeros for x>1.

And, the functional equation relates -z to z + 1, so again, there are no zeroes for x < 0, except for the trivial zeroes at x = -2, -4, -6, etc, because of the sin() component. (If there were any other zeroes to the left of x = 0, then there would have to be matching zeroes for x > 1, and there aren’t.)

That just leaves what is called the “critical strip,” for x = a + bi, 0 <= a < 1, which is covered by the eta(x) function.

Given the nature of the complex plane, if we know the value for x = a + bi, then we also have the values for a – bi, -a + bi and -a – bi. Which means that if zeta(a + bi) = 0, then zeta(a – bi) = zeta(-a + bi) = zeta(-a – bi) = 0.

That is, if there is a zero within the critical strip, it will have 3 more matching zeroes to go with it.

What Riemann did with his hypothesis was minimize the number of possible zeroes, by saying that all of the non-trivial zeroes lie on the critical line x = 0.5. Or, instead of having 4 zeroes for any given a + bi combination, there are only 2 (a + bi and a – bi).

So far, no one has been able to prove OR disprove this statement. Billions of zeroes have been found by using computers, and they’re all on the critical line. But, that’s not a proof. If even just one zero exists that is not on the critical line, then the entire hypothesis collapses, as do all the other theorems that are based on it.

Ok, so that’s the basic concept of the zeta function. We have the regular version,
z = 1 + 1/2^x + 1/3^x + 1/4^x…

For x > 1 across the complex plane.

We have the eta(x) function,
eta(x) = 1 – 1/2^x + 1/3^x – 1/4^x…

followed by,
zeta(x) = eta(x) / (1 – 2^(1-x))

for 0 < x < 1 along the complex plane.

And Riemann’s functional equation above, for x < 0.

If we want to find the non-trivial zeroes, we need to use the eta(x) plus the conversion formula.

In order to follow the examples in the book, I’ve been playing around with Wolfram Alpha. It’s a pretty decent online math graphing tool, but there are some inconsistencies between the version online now and what der Veen and de Craats apparently used (dVdC say that the “|” character is used to calculate absolute values, i.e. “plot |x| for x = -10 to 10”. But that doesn’t work for me. I have to use “plot abs(x) x = -10 to 10). Most of the inconsistencies are minor, but it still takes time to figure them out.

The main thing is that because Wolfram Alpha already has the zeta function implemented, it’s very easy to see right away what it looks like near the origin. If we plot zeta(x) for (-30 -30i) to (30 + 30i), we get two graphs, one of the real component of the results and the other for the imaginary component.


(plot zeta[x + y*I] x = -30 to 30 y = -30 to 30)

Note that the results for both components get clipped at z = 1000. The important part of the complex plane is that strip between 0 and 1, where the results weave around z = 0, but that’s getting swamped out.

Plotting the absolute value of the above formula, we get the combined magnitudes of the real and imaginary components, but clipping is now occurring at 10^9. No zeroes visible from this altitude.


(plot abs(zeta[x + y*I]) x = -30 to 30 y = -30 to 30)

The next step is to concentrate only on the critical strip, and to try to include at least one of the zeroes. Remember, the zeroes themselves are on the critical line, x = 0.5.


(plot zeta[x + y*I] x = 0 to 1 y = -30 to 30)

And the absolute value of the plot as well. Note the pole at x = 1.


(plot abs(zeta[x + y*I]) x = 0 to 1 y = -30 to 30)

We can try plotting just the critical line, and to find the zeroes we need to see where both the real and imaginary components cross the x-axis at the same time.


(plot zeta[0.5 + y*I] x = -30 to 30)

Or, we can look at the absolute value of the graph, where the zeroes are the points where the line touches down on the axis. Regardless, the mirror nature of the complex plane is visible here. So, we only need to find the zeroes for y > 0 and we automatically get the matching zeroes for y < 0 at the same time.


(plot abs(zeta [1/2 + x*I]) x = -30 to 30)

This just leaves the graphs of the trivial zeroes.


(plot zeta [x + y*I] x = -30 to 0 y = -0.5 to 0.5)


(plot abs(zeta [x + y*I]) x = -30 to 0 y = -0.5 to 0.5)

As x goes more negative, the results get much bigger faster, swamping the y-axis crossings. So, I’m only showing the first few trivial zeroes, for x = -10 to 0.


(plot zeta [x] x = -10 to 0)


(plot abs(zeta [x]) x = -10 to 0)

While I’m at it, I might as well include a little of the gamma function. I’ll just use the part closer to the origin to show the best detail.


(plot gamma[x + I*y ] x = -10 to 0 y = -10 to 10)


(plot abs(gamma[x + I*y ]) x = -10 to 0 y = -10 to 10)


(plot gamma[x ] x = -10 to 0. Note the zero crossings at -2, -4, -6, etc.)

Next time: Tying the non-trivial zeroes to the Prime Counting Function

Pi*r^2


Pi*r*not^2

Pi*r*2^2

Happy Pi*r^2 Day.

Back to Riemann, Part 9


Riemann was interested in understanding heat flow in a wire. As he was analyzing this, he developed a series of tools that could also be applied to the prime number distribution system.

What he came up with is the Riemann Functional Equation, which, according to der Veen and de Craats, is explained in more detail in chapter 9 of Jeffrey Stopple’s book “A Primer of Analytic Number Theory, From Pythagoras to Riemann.” This functional equation uses another mirror property of complex numbers to relate values to the left of the y-axis (x < 0) to those on the right side (x > 0), specifically as it applies to the zeta function.

z( -x ) = ((-2 * x!) / (2*pi)^(x+1)) * sin(pi*x/2) * z(x + 1)
(from the der Veen and de Craats book)

or,

(Image from the wiki article.)

That is, if you know zeta(x + 1) where x >= 0, then you can use this conversion function to get z( -x ).
Although both zeta(x) and eta(x) go to infinity for x < 0, using the functional equation extends the domain of zeta(x) to the entire complex plane, except for x=1, which still has a pole.

I’ll get to the idea of finding factorials of complex numbers in a minute.
Right now, if you look at the functional equation closely, you’ll see it has 4 parts:

-2 * x!
(2*pi)^(x+1)
sin(pi*x/2)
zeta(x+1)

We already know that zeta(x+1) doesn’t have zeroes for x > 1 across the complex plane, and that it converges to 1 for large x.
x! doesn’t have zeroes.
And (2*pi)^(x+1) doesn’t have zeroes.

However, sin(pi * x / 2) DOES go to 0 for integer multiples of pi.
0 = sin(0) = sin(pi) = sin(2*pi) = sin(3*pi) = sin(4*pi)…

And in the functional equation, that happens when x = -2, -4, -6, -8, etc.

These are the trivial zeroes, and they occur at all negative even integers of x.

Remember, the Riemann hypothesis says that the non-trivial zeroes for the zeta function are on the critical line, x=1/2.
This implies that there are trivial zeroes that don’t contribute to the hypothesis.

And we now know where the trivial zeroes come from:
the sin(pi*x/2) component.

Ok, factorials.

Traditionally, factorials are written as x!, which represents the product of all integers from 1 to x.
Example:
1! = 1
2! = 2
3! = 6
4! = 24
5! = 120
6! = 720

If we treat this pattern as a continuous line through all of the data points, it’s going to look something like this:

Meaning that technically we can have 3.3!, or 5.921!
It just means that the result is going to fall somewhere along the this line.

Now, trying to do something like this with imaginary numbers would be a little trickier, but it’s still something that can be visualized.
i! = i
2i! = i * 2i = -2
3i! = -2 * 3i = -6i
4i! = -6i * 4i = 24
5i! = 24 * 5i = 120i

which represents a rapidly growing spiral.
3.3i! would then be somewhere along that spiral between -6i and 24, which could be found with a variation of cos(x) + i*sin(x).


(Not really a proper spiral, but I think you get the point.)

Which is all really irrelevant when you mix the two, and try to get something like
(-6 + 4i)!

This is where the gamma function comes in. The gamma function is Riemann’s approach to complex factorials.

It’s also where I ran into a complete roadblock the first time I tried graphing the zeta function in my earlier blog series. The wiki entry was too difficult for me to follow  at that time, and right now, der Veen and de Craats completely whiff out by referring to the wiki article.

However, there’s more than one way to approximate the gamma function, and the wiki article for the Lanczos approximation does have a code example in Python that I might try to steal from.

Briefly, the Lanczos approach uses a set of coefficients that can be pre-calculated and plugged into a table, then the gamma equation itself can be calculated as:


(from wiki)

where “g” is an arbitrary constant with the real part > 1/2, and Ag(z) is:


(from wiki)

If you pre-choose z, Ag(z) is just the sum:


(from wiki)

Why go through all this work?

Well, Excel does have a gamma function built-in, but it’s only for real values of x, and doesn’t support complex values. Wolfram Alpha supports complex values for gamma, but it’s difficult to create the kind of animations I want to make.

On the other hand, the animations I’m most interested in are those for the zeta function in the critical strip (0 < x < 1), and that just requires the eta function, not the Riemann functional equation. So, this is “nice to know” material, but not essential. Then again, there’s a key part of the critical strip that I haven’t addressed yet that does depend on knowing what the functional equation is, and I’ll get to that next time.

The main reason for going through all this work, though, is to be able to prove to myself that I can write up the zeta function for the entire complex plane in one format or another. If not in Excel, then in VBScript (which I can then use to load values into Excel for graphing purposes).

Back to Riemann, Part 8


Ok, yes, finally, extending the domain for the zeta function to the complex plane.

Up to this point, the conventional form of the zeta function:
z(x) = 1 + 1/2^x + 1/3^x + 1/4^x…

only converged to some constant if x was a real number greater than 1.
By introducing the eta function, we were able to extend the domain to real numbers greater than or equal to 0, but not including 1, which has a pole.

This is the same as saying that the zeta(x) function works for x = a + bi, where b = 0, and x > 1. And the eta(x) function works for x = a + bi, where b = 0, and 0 <= x < 1.

But, say we use the natural logarithm ln(x), instead of the current exponent form.
We know from part 5 that,
2 = e^ln(2)
and, from the rule of exponents that
2^z = e^(z*ln(2))

If z = a + bi,
2^(a + bi) = (2^a) * (2^bi) = (2^a) * e^(bi * ln(2))

But,
e^bi = cos(b) + i*sin(b)

So,
(2^a) * e^(bi * ln(2)) = (2^a) * (cos(b * ln(2)) + i*sin(b * ln(2)))

The reciprocal of 2^(a+bi) = 1/(2^(a + bi)) = 2^(-a -bi)

So, if we look at the above zeta function, the second term is 1/(2^x),
which we now know is:
(1/(2^a)) * (cos(b * ln(2)) – i*sin(b * ln(2)))

The third term is 1/3^x, so that’s
(1/(3^a)) * (cos(b * ln(3)) – i*sin(b * ln(3)))

And we just keep on doing this for every other term in the zeta function.
This is how we extend the domain for the zeta(x) function to the complex plane for all real x > 1.

There are two important points to note here.
First, the complex plane is a mirror around the x-axis. That is, if x1 = 5 + 3i,
then the mirror image point is x2 = 5 – 3i.

1/2^x1 = 1/2^(5 + 3i) = (1/2^5) * (cos(3 * ln(2)) – sin(3 * ln(2))
1/2^x2 = 1/2^(5 – 3i) = (1/2^5) * (cos(3 * ln(2)) + sin(3 * ln(2))

Which is going to hold for all of the other terms in the series. I.e.,
1/3^x1 = 1/3^(5 + 3i) = (1/3^5) * (cos(3 * ln(3)) – sin(3 * ln(3))
1/3^x2 = 1/3^(5 – 3i) = (1/3^5) * (cos(3 * ln(3)) + sin(3 * ln(3))

Because e^i involves rotation around the origin, the rotations generated by each term for x = 5 + 3i are going to be mirrored on the other side of the x-axis for x = 5 – 3i.
That is, zeta(5 + 3i) and zeta(5 – 3i) will also be mirror images of each other.
In short, we only need to calculate zeta(5 + 3i) and we’ll know what z(5 – 3i) is, too.

Second, the eta function.
The eta function is what let us extend the zeta domain to x >= 0.
It also has a complex plane version, and the conversion formula is
zeta(x) = eta(x) / (1 – 2^(1-x))

And, eta(x) was a modified version of the zeta function that converges faster:
eta(x) = 1 – 1/2^x + 1/3^x – 1/4^x + 1/5^x – 1/6^x

To get the eta function we just need to flip the signs of every even cos()/sin() term in the zeta series, and the conversion formula uses 2^(1-x) instead of 2^x, which is the first term in the zeta series. Going from the zeta(x) series to the eta(x) series and back will be easy.

Technically, I could stop here.
The Riemann Hypothesis states that all of the non-trivial zeroes of the zeta function lie on the critical line, x = 1/2.
And, with the eta(x) function, which is valid from x = 0 to x < 1, whose domain has just been extended to include the entire complex plane in that range, I can now write a usable version of the zeta function in Excel to make animated graphs as I navigate around the complex plane (I think; I haven't proved this, yet).

The thing is, I still haven't covered what the trivial and non-trivial zeroes are, I haven't extended the domain of the zeta function to x < 0, and I haven't talked about why the critical strip only extends from x = 0 to x < 1.

So, I'm going to get into some of that next time.

Site problems – edited


WordPress support tells me they’ve fixed the problem that was causing images on mediafire to not display. If you still notice any missing images (such as, there’s a caption but no photo to go with it) please comment on this post and let me know. Thanks.

 

Hachette 3D Puzzle Series, vol. 1


Hachette is one of two international publishers selling serialized kits and/or magazines in Japan, which include TV show DVDs, 3D printer kits, drone and robot kits, etc. Hachette actually had a similar 3D puzzles line about 8-9 years ago, which consisted of 50 puzzles that came out one every 2 weeks. I’d missed most of those, and only discovered the series just about the time that it ended. I could only get a couple of the backissue volumes from Kinokuniya bookstore, because all the earlier ones were sold out.


(Game history page, this one for Mancala.)

The current line will only have 18 issues total. The first one is 499 yen ($4.50), which is why I picked it up. The other ones will probably all be about 1,300 yen each. If you get the full subscription right now, you get your choice of one more puzzle plus a copy of Mancala, or the “casino” game (the one where you have a dice box with wooden counters with the numbers 1-9 on them. Rolling a specific number on the dice lets you flip the counter over.)


(Paper puzzles page.)

Each volume will come with a magazine. The first mag is twice as long as the regular ones because it’s advertising for the series. The regular magazines will be shorter and all follow the same pattern. First will be a section on the history of a specific game, then there will be several pages of paper logic puzzles, including magic squares, Sudoku, and elimination grid puzzles (the kind where you are given the names, occupations, and cities of 5 people, plus a list of clues linking them together.) There’s also a classical painting memory game (you look at the painting for a few seconds, then try to answer questions about it from someone else, such as “how many people in the painting?”, “what animal is in the picture?”, “where in the picture is the animal?”, etc. All of the pages are 3-hole punched, so you can store them in a binder.


(Memory puzzle painting.)

Three of the issues are things in the same vein as the Rubik’s cube, where you have to scramble, then unscramble them. One of those looks kind of pretty, so I may get it just based on its looks. However, I normally don’t like those things. One toy is going to be the Tower of Hanoi, and the rest look to be 3D wood puzzles like the ones I’d gotten from capsule ball dispensers last year. In fact, the Hachette line has 3 identical duplications of the capsule ones I already have and another 2 are just fancier versions of the capsule puzzles. Overall, I’m only interested in 7 or 8 of the issues, not including #1, which I already have. The next one I want is #6, which won’t be hitting the shelves until sometime in May, I guess. On the other hand, the magazine cover shows 3 other puzzles that aren’t in the series, so I don’t know how they figure into all of this.

Ok, the toy for vol. 1 is this assembly puzzle. All the pieces are the same, and they form a cube about 2.5″ to a side. The holder has a flat corner so you can display the finished puzzle on-end like a kind of trophy. But, the pieces slide around easily and if the holder gets bumped, you’re going to find yourself trying to pick every single piece up from off the floor. This is going to be like a jigsaw puzzle – lose one piece and the entire thing becomes worthless.

As of this writing, I haven’t tried putting it back together. But, I’ve got a pretty good idea of what the trick is. When I get a free hour, I’ll sit down and see how well I do. As for the paper puzzles in the magazine, there are a couple I want to try, including the Sudoku one, and the elimination grid. If you want to cheat, the solutions for those are at the back of the same issue.

Back to Riemann, Part 7


Before expanding the zeta function to the complex plane, I want to talk about Euler a little more.

Recall the zeta function:

z(x) = 1 + 1/2^x + 1/3^x + 1/4^x…

Euler assumed that x would be small, for -1 < x < 1.

He then defined a function M(x), where there are infinite terms,

M(x) = 1 + x + x^2 + x^3 + x^4…

Then, he multiplied both sides by x,

x*m(x) = x + x^2 + x^3 + x^4 + x^5…

And subtracted both sides, M(x) – x*M(x):

M(x) – x*M(x) = 1 + x – x + x^2 – x^2 + x^3 – x^3 + x^4 – x^4…
M(x) – x*M(x) = 1
M(x)(1 – x) = 1
M(x) = 1/(1 – x)

Ex. M(0.5) = 1/(1 – 0.5) = 2

He followed this up by applying the same approach for x > 1 for the zeta function.

z(x) = 1 + 1/2^x + 1/3^x + 1/4^x…

1/2^x * z(x) = 1/2^x + 1/4^x + 1/6^x + 1/8^x…

1/2^x * z(x) – z(x) = -1 +1/2^x – 1/2^x – 1/^3^x + 1/4^x – 1/4^x – 1/5^x…

z(x)(1 – 1/2^x) = 1 + 1/3^x + 1/5^x + 1/7^x…

This removes all multiples of 2 from the right hand side. Repeating for 1/3^x:

z(x)(1 – 1/2^x)(1 – 1/3^x) = 1 + 1/5^x + 1/7^x + 1/11^x…

Removes all multiples of 2 and 3, etc.

Solving for z(x),

z(x) = (1/(1-1/2^x))*(1/(1-1/3^x))*(1/(1-1/5^x))*(1/(1-1/7^x))…

This is called Euler’s product formula, and it just contains terms with prime numbers in the denominators. And what this does is directly tie the zeta function to the prime numbers. Unfortunately, we’re still faced with the problem of not knowing the distribution of those prime numbers, or what the next one in a very long sequence will be. But, at least now we have a clear connection to the zeta function and the primes.

This probably a good place to talk about zeroes.

For certain polynomials, you can determine their function if you know where they cross the x-axis, and their value when x=0.

Example from the der Veen and de Craats book:
Say you have p(x), with p(2) = p(3) = 0, and p(0) = 1

This is a parabola pointing up, and can be written as:
p(x) = (1 – x/2)*(1 – x/3)
p(x) = 1 – (x*5)/6 + (x^2)/6

Expanding this function for zeroes at all integers 1 through 10,

p(x) = (1 – x/1)(1 – x/2)(1 – x/3)…(1 – x/10)

A simple question now: What’s the coefficient for x?

Answer, this is the component where we just have the a*x term, which is:
x/1 + x/2 + x/3… + x/10
= x*(1 + 1/2 + 1/3 + … + 1/10)

So, Euler assumed that S(x) = sin(pi*x)/pi*x
was a polynomial of infinite degree, with zeroes at …-4, -3, -2, -1, 1, 2, 3, 4…
Basically, all real integers excluding 0. And S(0) = 1.

Therefore,
S(x) = (1 – x/1)(1 – x/(-1))(1 – x/2)(1 – x(-2))(1 – x/3)(1 – x/(-3))…

Because (1 – x/3)(1 – x/(-3)) = (1 – ((x^2)/(3^2)) (1 minus x-squared divided by 3-squared),

S(x) = sin(pi*x)/pi*x = (1 – (x^2)/(1^2))(1 – (x^2)/(2^2))(1 – (x^2)/(3^2))…

BUT,
If we use the geometric expansion for sin(x),
sin(x) = x – x^3/3! + x^5/5! – x^7/7!…

And substitute pi*x for x,
sin(pi*x) = pi*x – (pi^3)*(x^3)/(3!) + (pi^5)*(x^5)/(5!) – (pi^7)*(x^7)/(7!)…

And divide both sides by pi*x,

sin(pi*x)/(pi*x) = 1 – (pi^2)*(x^2)/(3!) + (pi^4)*(x^4)/(5!) – (pi^6)*(x^6)/7!…

Euler found that the coefficient for x^2 is -(pi^2)/(3!) = -(pi^2)/6.

And, taking the above polynomial for finding the zeroes of S(x), the same coefficient for x^2 is
-x^2(1/1^2 + 1/2^2 + 1/3^2 + 1/4^2)
or,
-1/1^2 – 1/2^2 – 1/3^2 – 1/4^2…

And this is the zeta function for minus zeta(2). That is, the above zeta function, negative, with x=2.

From this Euler concluded that zeta(2) = pi^2/6

der Veen and de Crats say that this isn’t a really rigorous proof, but the end result is correct.
But, by using the same method above, Euler calculated zeta(x) for all even positive integers.
The odd positive integers are much harder, and they don’t work out to be as pretty as for the first few even integers. A little more information on them can be found in the wiki article.


(Image taken from the wiki page.)

The even numbers can also be found using the Bernoulli formula, where B2n is the 2nth Bernoulli number. (Note that because the odd-numbered Bernoulli values, excluding the first 1, equal zero, the above formula doesn’t work for the odd-numbered Zeta integers.)

Anyway. The above approaches let us get the zeta(x) values for the positive integer values for x, which are all non-zero.

Back to Riemann, Part 6


In the last entry, I introduced the prime number counting function, pi(x), and one equation used for approximating it. Remember that pi(x) actually does count the number of prime numbers less than or equal to “x”. But, this is a very slow process, and it doesn’t tell us anything about how the primes are distributed across the real axis. The approximation, x/ln(x), at the least, comes close to pi(x) for sufficiently large values of x. And, the relative error, as given by (pi(x) – x/ln(x))/x goes to zero for large x (there’s still an error, but it’s comparatively small given how many prime numbers we’re really talking about).

Now, we can define any kind of counting function that we like, such as the number of even numbers less than or equal to “x”, the number of odd numbers, or the number of cups of coffee I drink each day of the week. And, if we can plot those numbers, we can try to find an approximation for them in order to predict future events. In cases like with the even numbers, the approximation is going to be 100% accurate (T(x) = x/2, truncated), and the error is going to be 0 for all x. For a function Tc() for counting cups of coffee per day, Tc(x)=Number_of_Days will have an error of +/- 2 depending on how tired I am, but the relative error Tc(x)/x will go to zero for large “x” (that is, for a period of 3 weeks or longer), because I normally only drink one cup a day.

The Russian mathematician Pafnuti Chebyshev, in about 1850, introduced a new logarithmic prime counting function he called psi(x). He defined psi(x) to be the number of prime powers less than or equal to x, but he weighted them based on how frequently they occurred within the range.

psi(x) = T2*ln(2) + T3*ln(3) + T5*ln(5) + T7*ln(7) + T11*ln(11)…

In this case, the T components are counting functions for each prime number. Say we want to look at psi(100).

The powers of 2 less than 100 are: 2, 4, 8, 16, 32 and 64, so T2 = 6.
The powers of 3 less than 100 are: 3, 9, 27 and 81, so T3 = 4.
The powers of 5 less than 100 are: 5 and 25, so T5 = 2.
The powers of 7 less than 100 are: 7 and 49, so T7 = 2.
The powers of all other primes up to 97 occur once only.
After that, T=0 for all primes > 100.

psi(100) = 6*ln(2) + 4*ln(3) + 2*ln(5) + 2*ln(7) + 1*ln(11) + 1*ln(13)…
= 94

The idea here is that although it’s not practical to count the prime powers, this approximation goes to “x” for large values of “x”, and the relative error, (psi(x) – x)/x goes to zero. (Ex.: x = 100, and psi(100) = 94. Rel error = (100-94)/100 = 0.06)

And, psi(x) is going to have pi(x) terms. pi(100) = 25, so there will be 25 terms in psi(100), from T2*ln(2) up to T97*ln(97). psi(x) can be approximated by pi(x)*ln(x), and this is then further proof that pi(x) can be approximated by x/ln(x).

The take away here is that psi(x) is based on the prime numbers themselves, while pi(x) is tied specifically to x and ln(x).

Ok, so let’s go back to the zeta function,
z(x) = 1 + 1/2^x + 1/3^x + 1/4^x…

Euler used a modified form of the zeta function, defined over the range -1 < x < 1, as follows:
M(x) = 1 + x + x^2 + x^3 + x^4…

Now, if you multiply both sides by “x”,
x*M(x) = x + x^2 + x^3 + x^4 + x^5…

And then subtract equation 1 from equation 2, and group the M(x) terms,
M(x) – x*M(x) = 1 + x – x + x^2 – x^2 + x^3 – x^3…

Meuler(x) = 1/(1 – x) for -1 < x < 1 If we plug 2 into the original equation, Moriginal(2) = 1 + 2^2 + 3^2 + 4^2… the series goes to infinity. But, using the identity, Meuler(2) = 1/(1 – 2) = -1, the equation converges. We can use a similar approach with the zeta function. Recall that in its original form, z(x) converges only for x > 1 (so its domain is 1 < x < infinity). We can extend this domain as follows by defining eta(), as invented by Gustav Dirichlet (1805-1859):

eta(x) = 1 – 1/2^x + 1/3^x – 1/4^x + 1/5^x…

The minus signs cause the terms to cancel out faster, and the series then grows more slowly for positive x, even when x < 1.


(Coverage of domains by zeta(x) (top line) and eta(x) (bottom line).)

If we return to the geometric series (which I used to show that e^x is directly related to cos(x) and sin(x)), we get another equation, specifically:

ln(x+1) = x – x^2/2 + x^3/3 – x^4/4 + x^5/5…

Plugging in x = 1,

ln(2) = 1 – 1/2 + 1/3 – 1/4 + 1/5…
eta(1) = 1 – 1/2 + 1/3 – 1/4 + 1/5…
So that eta(1) = ln(2) = 0.693…

and, eta(0.5) = 0.6049…

Ok, what we want is the connection between zeta and eta. First, subtract both sides:

z(x) = 1 + 1/2^x + 1/3^x + 1/4^x…
e(x) = 1 – 1/2^x + 1/3^x – 1/4^x + 1/5^x…

z(x) – e(x) = (1-1) + (1/2^x + 1/2^x) + (1/3^x – 1/3^x)…
z(x) – e(x) = 2/2^x + 2/4^x + 2/6^x…

Factor out 2/2^x = 2^(1-x)

z(x) – e(x) = 2^(1-x) * (1 + 1/x^2 + 1/x^3 + 1/x^4…)
z(x) – e(x) = 2^(1-x) * z(x)

e(x) = z(x) * (1 – 2^(1-x)), or
z(x) = e(x) / (1 – 2^(1-x))

What this means is that, while we can’t find zeta(x) for x between 0 and 1, we can find eta(x) for that range. And, using the conversion formula here, we can map eta(x) to zeta(x) for this same range.

Because eta(x) converges for all real numbers x, with the exception of 1, we can define the behavior of the zeta function for 0 < x < 1. This extends the domain of the zeta function beyond its original 1 < x < infinity.

As an example, eta(0.5) was shown to be 0.6049… above. So,
zeta(0.5) = 0.6049 / (1 – sqrt(2)) = -1.46035…

And,
eta(0) = 0.5
zeta(0) = 0.5 / (-1) = -0.5

The next step is to expand the domain for the zeta function to the complex plane.

Back to Riemann, Part 5


So far, I’ve covered exponents, i, e, ln() and series expansions.

n^x is a continuous line from minus to plus infinity if n is not 0 or 1, and x is a real number.

If n = e, when x = a + bi, then e^x = e^(a+bi) = (e^a) * (cos(b) + i*sin(b))

And, if a=0 and b = pi (3.14159),
e^i*pi = -1

making e^bi the function for drawing the unit circle.

Then, ln(), the natural logarithm, is just the inverse function for e^x.

I kind of jumped from n^x, for any value of n, to e^x. We can convert between them if we want to. If j = n – e, then n^x = (j + e)^x.

And, logb(x) for any base “b” is = ln(x) / ln(b).

Again, why use “e” and ln()? Because they’re easy to work with, they have special properties that other numbers don’t have, such as e^i*pi being on the unit circle, and we can always convert between them and base 10 numbers if we have to.

Why use series expansions? Well, that’s what the zeta function is (1 + 1/2^s + 1/3^s + 1/4^s + 1/5^s…), and some functions that are harder to work with in one form (e^(a+bi)) can be easier to work with in another (e^x = 1 + x + x^2/2! + x^3/3! + x^4/4! + x^5/5!…)

Ok, what’s the point?
So far, I’ve just wanted to lay down the groundwork. It’s now time to look at how everything started, to lead up to the Riemann Hypothesis.

We begin by trying to count the number of prime numbers below a particular limit.

A number is prime if its only factors are itself, and 1. Because 1 is a factor of all other numbers, it is not included in the list of primes. That means that 2, 3, 5 and 7 are the only primes less than or equal to 10. 4 is not prime because its factors are 1, 2 and 4. 6 is not prime because its factors are 1, 2, 3 and 6. 8 is not prime because its factors are 1, 2, 4 and 8. 9 is not prime because its factors are 1, 3 and 9.

We can define a counting function, usually given as:

pronounced “pi”, but is not to be confused with the constant 3.14159. This function counts the number of primes from 2 to x.

pi(10)  = 4
pi(100) = 25
pi(1000) = 168

pi() as a function doesn’t have an equation to it, per se. At least, not just yet. It’s just a matter of sitting down and checking whether every number between 2 and 1000 is prime or non-prime, and then counting up all the ones that are prime.


(Plots here obtained from Wolfram Alpha. Above plot is for pi(10,000).)

What’s important here is to note that the plot of pi() from 2 to 10,000 is not linear. If we want to find some way of getting close at guessing the correct answers for how many primes there are between 100,000 and 199,999, we can’t use an expression in the form of y = n * x, or y = x^n, because they’re going to deviate too much from the real answer given by pi().

We could try using x * 0.125, or x^0.773, which look like they might be getting close to pi() in the range 0 to 10,000:

But, if we expand the range (referred to as changing the domain of the function) to 0 to 10,000,000, both approximations obviously fail.

Instead, it turns out that x/ln(x) works a lot better over the larger domains, and

pi(x) ~ x/ln(x)

is known as the Prime Number Theorem, where the squiggly means that the error between pi(x) and x/ln(x) goes to zero as x goes to infinity.

Remember, pi(x) actually does count the number of primes less than or equal to x, so that’s the truly correct value. But, hand-counting the primes is time consuming, so we want to find an equation that gives us a close approximate answer, and we use x/ln(x) for that.

How do we get the error between reality and the approximation?

error = pi(x) – x/ln(x)

And, we can introduce the idea of “a relative error”, which is (pi(x) – x/ln(x)) / x.

Or, the difference between the counting function pi() and the approximation x/ln(x), divided by x. If the relative error goes to 0 as x goes to infinity, then the number of primes below x is about x/ln(x), for large x.

What this means is that one of the closest methods we have, at the moment, for predicting the distribution of prime numbers is the formula x/ln(x). We’re going to try to find something better.


(Relative error for pi(x) and x/ln(x) from 0 to 1 million.)

Very quickly, one reason people care about prime numbers is that they’re used extensively in securing computer communications and data encryption. If you pick a very large number (150 digits) that is the product of 2 prime numbers, then you can make that number public, and it will be very difficult to determine which two prime numbers make up its factors. That is, it’s easy to test whether a random number is prime, but it’s much, much harder computationally to find the factors of that number. There can be billions of prime numbers that are 100 digits long, and the odds of randomly giving two people the exact same key are very near zero. So, for the moment, public key encryption is considered pretty secure, if you use long enough numbers. However, if there were some way of predicting the distribution of prime numbers exactly, it would become much easier to crack public key systems.

Back to Riemann, Part 4


Ok, let’s get back on topic for e^bi.

Or, maybe not.
I want to look at one more way to calculate e.

The zeta function is generally written as:

z(x) = 1 + 1/2^x + 1/3^x + 1/4^x + 1/5^x…

on into infinity, where x can have the value of a + bi across the complex plane.

If we set x = 1, we get the geometric series, AKA the Harmonic Series:

z(1) = 1 + 1/2 + 1/3 + 1/4 + 1/5…

Which doesn’t converge. It just goes to infinity kind of slowly.

Setting x = 2, however, gives us the series:

z(2) = 1 + 1/2^2 + 1/3^2 + 1/4^2 + 1/5^2…
z(2) = pi^2 / 6 = 1.6449…

I ran the above series in Excel, to 1/177^2, and got 1.6393, which is pretty close.

z(3) = 1 + 1/2^3 + 1/3^3 + 1/4^3 + 1/5^3…
Which approaches 1.202041
z(4) = pi^4/90 = 1.0823…

So, what this says is that the zeta function z(x) converges for x > 1, but it doesn’t converge to 0 (it converges to 1 for large values of x).

There’s also a series that converges to e^x:

e^x = 1 + x + x^2/2! + x^3/3! + x^4/4! + x^5/5!…

Where “!” is the symbol for factorial, or for multiplying the integers from 1 to n together.

2! = 1*2 —– = 2
3! = 1*2*3 — = 6
4! = 1*2*3*4 – = 24
5! = 1*2*3*4*5 = 120


(After only 10 terms, the series is already at 2.71828, and the curve looks flat.)

In the last blog entry, I mentioned that taking the derivative of f(x) = e^x => f'(x) = e^x.
We can prove this by taking the derivative of the series above:

d/dx e^x = d/dx (1 + x + x^2/2! + x^3/3! + x^4/4! + x^5/5!…)

Recall that if f(x) = x^b, then
d/dx f(x) = b * x^(b-1)

Note also that d/dx of a constant = 0.
We can take the derivatives of each term in the series separately, as in:

d/dx (1) = 0
d/dx (x) = 1*x^0 = 1
d/dx (x^2) = 2*x
d/dx (x^3) = 3*x^2
d/dx (x^4) = 4*x^3
d/dx (x^5) = 5*x^4
etc.

Plugging the terms back into f'(x),
f'(x) = 0 + 1 + 2*x/(1*2) + 3*x^2/1*2*3 + 4*x^3/1*2*3*4…
f'(x) = 1 + x + x^2/2! + x^3/3! + x^4/4! + x^5/5!…
f'(x) = e^x

What’s interesting about this infinite series approach is that it can also be used to find values for sin(x) and cos(x)

sin(x) = x – x^3/3! + x^5/5! – x^7/7! + x^9/9!…
cos(x) = 1 – x^2/2! + x^4/4! – x^6/6! + x^8/8!…

Now, what happens if we play with e^iy?

e^iy = 1 + iy + (iy)^2/2! + (iy)^3/3! +(iy)^4/4! + (iy)^5/5!…
e^iy = 1 + iy – y^2/2! + iy^3/3! + y^4/4! + iy^5/5! – y^6/6!…

If we group the terms with and without i components together,
e^iy = (1 – y^2/2! + y^4/4! – y^6/6!…) + i(y – y^3/3! + y^5/5!…)

Look at the series expansions for sin() and cos() above.

e^iy = cos(y) + i*sin(y)

And, if we pick y = pi
e^i*pi = cos(pi) + i*sin(pi) = -1 + 0 = -1

What’s this tell us? That e^iy defines the unit circle.

Therefore, e^x, where x = a+bi, gives us e^(a+bi) = (e^a) * (e^bi)
= e^a * (cos(b) + i*sin(b))
(if a=0, e^a  = 1)


(The unit circle as a function of e^bi, which we already saw in Riemann Prose part 7.)