Tuesday, December 13, 2016

The Riemann Hypothesis and Primes

Hey guys! I know it's been awhile, but with exams this week, I've been spending a lot of time recently procrastinating studying. But those are (almost) over now, so it's time for some new stuff! Today, a favorite topic of mine, the Riemann Zeta function, and it's (one of many) connections to the primes! I'm not going to lie, this is going to be a little complicated. But anyone with a cursory knowledge of calculus should be able to grasp it.

By the way, if you don't know what the Riemann Zeta function is, or what a zeta zero is, you should read my last post or do some quick googling.

Now, there is a "common" approach to this problem, which works but is not very elegant, and hard to understand without some concepts in complex analysis. For that reason, and the fact that I can never understand where the apostrophe goes in "Grams Series" (Is it the series belonging to gram, is gram plural, is it the series belonging to my grandmother? So many questions), I will be taking a less known approach.

So, let's jump right in.

Chebyshev introduced the function:
$$ \psi(x) =\sum_{n \leq x} \Lambda(n)$$

Which not only sums prime numbers, but also every power of a prime, but takes its natural log before summing it, because, well, it's math.
Formally, the von Mangoldt function (the big upside down V thing in the sum) is 0 when its argument is not a prime power, and the natural log of it's argument when it is a prime power.

Now, one may feel inclined to ask at this point why we are mucking around with von Mangoldt functions when we have a perfectly good function, $\pi(x)$, that is robust, does it's job, and seems much closer to the actual goal than this one.
The naive answer to this question is that the second Chesbyshev function (the formal name of the function I introduced) is much better approximated by a straight line, and therefore is easier to work with.
Graph of $y=\psi(x)$ over graph of $y=x$
The real answer is that at some point, you have to stop asking these kind of questions and just accept the fact that it will all work out in the end.

Kind of.

So, returning to our original topic, what does this function have to do with the zeta zeroes? Well, first, we define a slightly different function, which is simply the original function except that at its points of discontinuity (the prime powers) it takes the value halfway between the values to the left and the right.
$$ \psi_0(x)=\begin{cases} \psi(x) - \frac{1}{2} \Lambda(x) & x = 2,3,4,5,7,8,9,11,13,16,\dots \\
\psi(x) & \mbox{otherwise.} \end{cases}$$

Now, prepare for your mind to be blown.
$$\psi_0(x) = x - \ln(2\pi) \sum_{\rho} \frac{x^{\rho}}{\rho} - \frac{1}{2} \log (1-\frac{1}{x^2})$$

Where $\rho$ represents the zeroes of the Riemann Zeta function. Let me re-iterate: You can express a formula for primes in terms of only zeta zeroes. Insane, right? But surely, there must be some explanation for this explicit, incredible formula in its proof?

Nope. This is simply a result of applying Perron's Formula to our original definition, which leaves you with a complex integral of the function $\frac{\zeta ' (s)}{\zeta(s)}\frac{x^s}{s}$ over $\mathbb{C}$, do some contour integration using rectangular contours, and evaluate the integral in terms of the residues of the integrand. The details of this integration will be left as an exercise to the reader.

Fun fact: The $\ln(2\pi)$ in our wonderful formula comes from the fact that $\frac{\zeta ' (0)}{\zeta(0)}=\ln(2\pi)$.

Here's the fun part. It is immediately obvious from the explicit formula that we can calculate this $\psi_0(x)$ function by taking $x-\ln(2\pi)-1/2\ln(1-\frac{1}{x^2})$ and adding pairs of these zeta zero functions, since this sum is taken over both negative and positive zeroes:
$$\frac{x^p}{p}+\frac{x^\overline{p}}{\overline{p}}$$

Using this, we can finally approximate our prime power sum function $\psi_0(x)$, using only zeta zeroes. Here is a gif of our function gradually approximated by the first 50 pairs of zeta zeroes.


Connections like these are rare in math, but they seem to pop up everywhere with the Riemann Zeta function. It's almost creepy how mysterious this function is. In fact, a few years ago, the zeta zeroes were found in the energy levels of quantum particles, of all thingw. It's one of the most astounding and deep functions in all of number theory, and I encourage each and every one of you to research it, because it is simply mind-boggling. 

And we still have no idea why.

Friday, August 26, 2016

The Riemann Hypothesis for Anyone

One of the longest standing conjectures in mathematics has been the ever elusive "Riemann Hypothesis" (RH). A proof of RH would have giant repercussions throughout not just pure mathematics, but physics as well. There are hundreds are equivalent forms, but perhaps the most famous is the simple question, "Is there some order in the distribution of the primes?". Most people just accept this as an answer, but it really isn't. So, after reading a few books and a few articles, I want to explain, in layman's terms, what the Riemann Hypothesis actually is.

To begin, let's talk about Euler. Euler was a 17th-century mathematician who was famous, among many other things, for his work on the harmonic series. The harmonic series is defined as the following:

$$\frac11+\frac12+\frac13+\frac14...$$

This series blows up to infinity, and it is relatively simple to prove so. Mathematicians had known such a result for hundreds of years before Euler. But what Euler was concerned with was that same series, but with the denominators raised to an integer power.

$$\frac{1}{1^s}+\frac{1}{2^s}+\frac{1}{3^s}+\frac{1}{4^s}...$$

Euler went on to prove wonderful things about this function, which you can learn more about in my earlier blog post, but it was Riemann who really analyzed this function, and extended it to the complex plane.

So, what is the complex plane? Well, let's first talk about i. The number i is defined as $\sqrt{-1}$. To most people, this seems like an absolute absurdity. How can a negative number be square rooted? There are no solutions to $x^2=-1$! But, to put this in perspective, take another equation. $x+2=0$. Well, obviously, x is -2. But to people in the early centuries, they thought of negative numbers in the way most people think of imaginary numbers (i and multiples of i). We are simply extending our number system in order to provide solutions to an equation. But the real fun comes when we have complex numbers. A complex number is of the form $x+yi$, where $x$ and $y$ are real numbers. Now, remember from your days of schooling, plotting on an x y graph. Well, if we take an x y plane, can't we just treat x and y as x and y in our complex number equation? Here lies the complex plane:





The y is our imaginary numbers, and the x is our real numbers. So if x is 2 and y is -2i, our complex number is 2+-2i. 

Bringing it back to the Riemann zeta function, Riemann found a genius way to extend the function so that the denominators could be raised to complex number powers. After doing this, he wondered about where this function equaled 0. He knew that if he plugged in any negative even number (-2, -4, -6, etc) into his function, it would be 0. These are called the trivial zeroes of the zeta function. But, looking at the graph of the zeroes, you should see a pattern:

All of these zeroes that are not trivial (called, aptly, nontrivial zeroes), seem to lie on one line, specifically x=1/2. The Riemann Hypothesis is the statement that all the nontrivial zeroes lie on that line. We have searched extremely far, and so far nothing has told us otherwise. We also know more than 40% of the zeroes line on the critical line, and that none lie off the line for less than $10^{20}$. 

We are so sure of ourselves that many proofs nowadays start with "Assuming the Riemann hypothesis..." But we are yet to find a proof, or really even come close to one. This is the true Riemann hypothesis, and (perhaps) in my next post I will talk about how it relates to the primes, and some attempts made at cracking it. Thank you so much for reading, and I'll see you in the next post!












Tuesday, August 16, 2016

A Mathematical Gem Explained With an Elegant Proof

There is so much beauty in mathematics - past the quadratic equations of your horrid algebra class and the tedious long division that seems to be present in every single badly-constructed problem.
There are gems, things that you simply wouldn't believe, that leave people's jaws hanging open thinking that something must be fundamentally wrong with the universe in order to allow for such an insane equality. But most of that doesn't get taught in math classes, because it's "above" the level of most common core math classes. I'm here today to prove that as a falsehood and introduce to you one of the most exciting functions in all of mathematics: $\zeta(s)$

Now, I don't believe I have the ability nor the writing talent to provide a proof of the following that any layperson could understand. So, in this, I'm going to assume a basic knowledge of calculus, including what an integral is, how to integrate, and what sin and cos are.

So - first, let's get a refresher on the cool concept of an "infinite sum". Most people assume that if you add up an infinite amount of positive terms, you will end up with infinity. Well, that's not actually right. Under certain conditions, an infinite sum will slowly come creeping up to a certain number and never surpass it. In that case, we say the infinite sum converges to that number. 
How about an example? Well, let's ask the question, what is the value of the following sum?
$$1+\frac12+\frac13+\frac14+\frac15+\frac16...$$

It turns out the answer is that it blows up to infinity, making the above a bad question. Let's instead look at that same series but with all the denominators squared:
$$1+\frac{1}{2^2}+\frac{1}{3^2}+\frac{1}{4^2}+\frac{1}{5^2}+\frac{1}{6^2}...$$

Miraculously, it turns out this series converges to a number:
$$\frac{\pi^2}{6}\tag1$$

To me, this is absolutely insane. Pi is the ratio of a circle's circumference to it's diameter, so what is it doing popping up in infinite sums? Well - this blog post is about exactly that. 
So first, let's introduce some notation. Instead of expressing the infinite sum in terms of a few terms and then ellipsis, we have a precise notation:
$$S=\sum_{n=1}^{\infty}\frac{1}{n^2}$$

Let's break this down. Because I know most of the people reading this are going to be programming people, it's like a big for loop or repeat loop. We start with $S=0$, and then we add $\frac{1}{n^2}$ to it for $n=1$ (which is why the bottom of the sum says $n=1$). Then, we add $\frac{1}{n^2}$ to it for $n=2$. Then for $n=3$. And so on, all the way to infinity. 

And we don't have to just square the number. We're interested in raising it to every power. In general, that sum with the denominator raised to the $s^{th}$ power is called $\zeta(s)$. We are going to talk about $\zeta(2)$. 

Now that we have introduced the notation, how do we actually prove our original theorem $(1)$? Well, here is the hard part. I will now introduce the concept of a Fourier Series. A Fourier series is a way of approximating a function in a certain range as a sum of sines and cosines. Let's say we have the graph of $x^2$ between $-\pi$ and $pi$. Call this $f(x)$. We can then, using a Fourier series, create an infinite sum that models this curve exactly. This infinite sum will be the sum of $\cos(x*n)$ multiplied by the nth term of $a$ (a is a list of numbers) plus  $\sin(x*n)$ multiplied by the nth term of $b$ (b is also a list of numbers). That whole infinite sum will then be added to the first term of $a$ (actually the zeroth term, 'cause we index from zero like real men) over 2. Expressed using our notation:
$$\dfrac{a_{0}}{2}+\sum_{n=1}^{\infty }(a_{n}\cos nx+b_{n}\sin x)$$ 

So, the problem is finding what the nth term of a and b is. 
Well, thanks to the man himself (Fourier), we know that:
$$a_{n}=\dfrac{1}{\pi }\int_{-\pi }^{\pi }f(x)\cos nx\;dx\qquad n=0,1,2,3,...,$$ 
$$b_{n}=\dfrac{1}{\pi }\int_{-\pi }^{\pi }f(x)\sin nx\;dx\qquad n=1,2,3,... .$$ 

The graph of the integrand of $b_n$ looks like this:

The lines intersect y=0 at our integral bounds, and recalling that the definition of the integral is the area under the curve, since the curve is mirrored on both sides of the x axis, they cancel out which means $b_n$ is always 0. This reduces our equation to:

$$\dfrac{a_{0}}{2}+\sum_{n=1}^{\infty }(a_{n}\cos nx)$$ 

So all we  have to do is integrate $a_n$. This can be done by changing the integral bounds to 0, Pi, observing the antiderivative of the integrand and evaluating at the limits. For a more in-depthh explanation of how to integrate, just message me on whatever platform you know me from or at my email. 

But, in the end, we get:
$$a_{n}=(-1)^{n}\dfrac{4}{n^{2}}$$
Excluding the special case of $a=0$, which can be easily integrated to be $\frac{2\pi^2}{3}$.

Thus

$$f(x)=\dfrac{\pi ^{2}}{3}+\sum_{n=1}^{\infty }\left( (-1)^{n}\dfrac{4}{n^{2}}\cos nx\right) .$$

Remembering that $f(x)=x^2$, which is the function we just found the fourier series of,  $f(\pi )=\pi ^{2}$, plugging in $\pi$ for x, we obtain

$$\pi ^{2}=\dfrac{\pi ^{2}}{3}+\sum_{n=1}^{\infty }\left( (-1)^{n}\dfrac{4}{n^{2}}\cos \left( n\pi \right) \right) $$ 

Extracting the constant 4 from the sum and simplifying:
$$\pi ^{2}=\dfrac{\pi ^{2}}{3}+4\sum_{n=1}^{\infty }\left( (-1)^{n}(-1)^{n}\dfrac{1}{n^{2}}\right) $$

$$\pi ^{2}=\dfrac{\pi ^{2}}{3}+4\sum_{n=1}^{\infty }\dfrac{1}{n^{2}}.$$

Therefore

$$\sum_{n=1}^{\infty }\dfrac{1}{n^{2}}=\dfrac{\pi ^{2}}{4}-\dfrac{\pi ^{2}}{12}=\dfrac{\pi ^{2}}{6}$$

It always is so baffling how you think such a result is so impossible, but then just show, with cold hard logic, that it must be true. It seems insane, but it's true. I am sorry that I sort of jumped around in difficulty levels, if you need further clarification on something feel free to contact me via email, Twitter, Hopscotch forum, or whatever. Thank you so much for reading through, and I'll see you in the next (less math-y) post! :D







Tuesday, July 19, 2016

A tricky equation

Hey guys! First blog post. I wanna share with you, the story of a seemingly easy but startlingly complex equation I stumbled upon.

$$y^2=x^3-2$$

To add to it, this was in our rising 8th 'math placement' worksheet, right next to a question about finding the area of a square with a width of 5. So, naturally, I thought it was going to be easy. But upon further inspection, after attacking it with many tools of Algebra 1, I hadn't even made a dent.

It is hard not to show that the question is equivalent to finding a perfect square that is 2 less than a perfect cube (I should mention we are looking for non negative integral solutions). Well, immediately, a solution sprang to mind. $(3,5)$. $3^3=27$, $5^2=25$. Looking back, I think that's all the teacher wanted us to do. Find that solution by trial and error. But, was it the only solution?

Looking back, I could have spared myself a lot of time and energy if I just assumed that solution was the only one and moved on with my life. But that's not how we roll :)
So, the first thing to do was an exhaustive search. I checked it up to $100,000$, and it seemed like there were no other solutions. But remember, a pattern is not a proof. Remember Richard Guy's conjecture that $\gcd(n^{17}+9, (n+1)^{17}+9)$ is always 1? Well, the first counterexample is $$n=8424432925592889329288197322308900672459420460792433$$.
So yeah, an exhaustive search is not a proof. We are here for mathematical rigor.

Well, first, let's establish some preliminary results.
Assuming there is an $x$ and $y$ other than $(3,5)$, both x and y would have to be odd.
Proof:
Assume $x$ is even. Then, $x$ can be expressed as $2z$ for some integer z. So $x^3$ can be expressed as $8z^3$ Rearranging the original equation with these new terms, we get:
$$y^2+2=8z^3$$
And it is, from that, obvious that $y^2+2$ is a multiple of 8. We can also express this as a modular congruence. But before I do that, let me explain what modular congruence is.

For a positive integer $n$, two integers $a$ and $b$ are called congruent if their difference $a-b$  is a multiple of $n$. This is notated:
$$a \equiv b \pmod{n}$$
Notice that is not an equals sign, it's 3 bars.
So, we know the difference between $y^2$ and $-2$ is a multiple of 8. We can notate this:
$$y^2 \equiv -2 \pmod{8}$$
However, $-2 \pmod{8}$ is not a perfect square, so $y^2$ is not even, which implies $x^3$ is not even (Because $x^3$ is $y^2+2$ and and odd number plus two is always odd), which implies both $x$ and $y$ are not even.
So, we have established that both $x$ and $y$ are odd. Now what? Well, here is where it gets a bit tricky.

First, from now on we will be working with the equivalent equation:
$$y^2+2=x^3$$
Which was gotten by simply adding 2 to both sides.
We can factor this equation quite easily:
$$x^3=(y+\sqrt{-2})(y-\sqrt{-2})$$

Now, at this point, I got stuck. I had no idea what do from here. I tried a bunch of different stuff, but nothing worked. But after a few days of thinking, some help from the Math Stackexchange + some personal stupidity worked out.

I am going to prove that $(y+\sqrt{-2})$ and $(y-\sqrt{-2})$ are relatively prime (i.e they share no factors) within $Z[\sqrt{-2}]$. Now, to understand what that means, consider the set of all integers. Well, we can do operations outside of just the numbers. $\mathbb{Z}[\sqrt{-2}]$ is  the set of all numbers of the form $(m+n\sqrt{-2})$ where $m$ and $n$ are integers. So, to say that $(y+\sqrt{-2})$ and $(y-\sqrt{-2})$ are relatively prime in $\mathbb{Z}[\sqrt{2}]$ means they have no common factors within that set other than 1)
To prove this, let us consider a variable $d$ which is a common divisor. $d$ divides their difference: $$(y+\sqrt{-2})-(y-\sqrt{-2})=2\sqrt{2}$$
Which means $N(d)$ divides $N(2\sqrt{2})=8$* but $N(d)$ also divides $N(y+\sqrt{-2})=y^2+2$, which is odd because $y$ is odd, as we established.  And the only factor of 8 that also divides odd numbers is $1$. So because $N(d)$ is 1, $d$ is a unit in $\mathbb{Z}[\sqrt{-2}]$. So, $(y+\sqrt{-2})$ and $(y-\sqrt{-2})$ are both unit multiples of $+1$ and $-1$. Those are both cubes, so $(y+\sqrt{-2})$ and $(y-\sqrt{-2})$ are both cubes. We can express it this way:

$$y+\sqrt{-2}=(m+n\sqrt{-2})^3$$
For some integers $m$ and $n$.
Distributing and subtracting the square root gives us:
$$y = m^3 − 6mn^2 = m(m^2 − 6n^2 ), 1 = 3m^2n − 2n 3 = n(3m^2 − 2n^2 )$$
And from this we can extract solutions, with the help of Mathematica.
From the second equation, $n=\pm{1}$. When $n = 1$ the second equation says $1 = 3m^2 − 2$, so $m = \pm1$. Then $y = \pm1(1 − 6) = ±5$ and $x^3 = y^2 + 2 = 27$, so we recover the solutions $(x, y) = (3, \pm5)$. When $n = −1$ we have $1 = −(3m2 − 2 \cdot 1^2 ) = −(3m2 − 2)$, so $1 = 3m^2$ , which has no solution in $\mathbb{Z}$. (Thanks to Andre Nicolas on MSE for pointing this out)

So boom, there we go! We have extracted the solutions from this equation. I'm not sure it's what our math teacher wanted us to do... but, it was fun in any case :) See you in the next post!

*$N(m+n\sqrt{D})=a^2+Db^2$
Note: To actual people who know a lot more math than me, this might seem like a very shaky proof. I'm putting out a lot of assumptions and not really explaining a lot of things in depth. This is because I didn't want to get too into unique factorization domains and modular arithmetic. If you do want to discuss it in depth, feel free to email me!
Also, a lot of it is probably wrong! I had mathematica check most of it for me, but diving straight into something like this with no experience probably means my logic is flawed in places. For