# Tag Archives: reddit

## A response to FtYoU’s question on Reddit

FtYou writes

Hello everyone ! There is a concept I have a hard time getting my head wrap around. If you have a Vector Space V and a subspace W, I understand that you can find the least square vector approximation from any vector in V to a vector in W. And this correspond to the projection of V to the subspace W. Now , for data fitting … Let’s suppose you have a bunch of points (xi, yi) where you want to fit a set a regressors so you can approximate yi by a linear combination of the regressors lets say ( 1, x, x2 … ). What Vector space are we talking about ? If we consider the Vector space of function R -> R, in what subspace are we trying to map these vectors ?

I have a hard time merging these two concepts of projecting to a vector space and fitting the data. In the latter case what vector are we using ? The functions ? If so I understand the choice of regressors ( which constitute a basis for the vector space ) But what’s the role of the (xi,yi) ?

I want to point out that I understand completely how to build the matrices to get Y = AX and solving using least square approx. What I miss is the big picture. The linear algebra picture. Thanks for any help !

We’ll go over this by closely examining and understanding an example. Suppose we have the data points ${(x_i, y_i)}$

$\displaystyle \begin{cases} (x_1, y_1) = (-1,8) \\ (x_2, y_2) = (0,8) \\ (x_3, y_3) = (1,4) \\ (x_4, y_4) = (2,16) \end{cases},$

and we have decided to try to find the best fitting quadratic function. What do we mean by best-fitting? We mean that we want the one that approximates these data points the best. What exactly does that mean? We’ll see that before the end of this note – but in linear algebra terms, we are projecting on to some sort of vector space – we claim that projection is the ”best-fit” possible.

Posted in Expository, Mathematics | | 1 Comment

## Response to bnelo12’s question on Reddit (or the Internet storm on $1 + 2 + \ldots = -1/12$)

bnelo12 writes (slightly paraphrased)

Can you explain exactly how ${1 + 2 + 3 + 4 + \ldots = – \frac{1}{12}}$ in the context of the Riemann ${\zeta}$ function?

We are going to approach this problem through a related problem that is easier to understand at first. Many are familiar with summing geometric series

$\displaystyle g(r) = 1 + r + r^2 + r^3 + \ldots = \frac{1}{1-r},$

which makes sense as long as ${|r| < 1}$. But if you’re not, let’s see how we do that. Let ${S(n)}$ denote the sum of the terms up to ${r^n}$, so that

$\displaystyle S(n) = 1 + r + r^2 + \ldots + r^n.$

Then for a finite ${n}$, ${S(n)}$ makes complete sense. It’s just a sum of a few numbers. What if we multiply ${S(n)}$ by ${r}$? Then we get

$\displaystyle rS(n) = r + r^2 + \ldots + r^n + r^{n+1}.$

Notice how similar this is to ${S(n)}$. It’s very similar, but missing the first term and containing an extra last term. If we subtract them, we get

$\displaystyle S(n) – rS(n) = 1 – r^{n+1},$

which is a very simple expression. But we can factor out the ${S(n)}$ on the left and solve for it. In total, we get

$\displaystyle S(n) = \frac{1 – r^{n+1}}{1 – r}. \ \ \ \ \ (1)$

This works for any natural number ${n}$. What if we let ${n}$ get arbitrarily large? Then if ${|r|<1}$, then ${|r|^{n+1} \rightarrow 0}$, and so we get that the sum of the geometric series is

$\displaystyle g(r) = 1 + r + r^2 + r^3 + \ldots = \frac{1}{1-r}.$

But this looks like it makes sense for almost any ${r}$, in that we can plug in any value for ${r}$ that we want on the right and get a number, unless ${r = 1}$. In this sense, we might say that ${\frac{1}{1-r}}$ extends the geometric series ${g(r)}$, in that whenever ${|r|<1}$, the geometric series ${g(r)}$ agrees with this function. But this function makes sense in a larger domain then ${g(r)}$.

People find it convenient to abuse notation slightly and call the new function ${\frac{1}{1-r} = g(r)}$, (i.e. use the same notation for the extension) because any time you might want to plug in ${r}$ when ${|r|<1}$, you still get the same value. But really, it’s not true that ${\frac{1}{1-r} = g(r)}$, since the domain on the left is bigger than the domain on the right. This can be confusing. It’s things like this that cause people to say that

$\displaystyle 1 + 2 + 4 + 8 + 16 + \ldots = \frac{1}{1-2} = -1,$

simply because ${g(2) = -1}$. This is conflating two different ideas together. What this means is that the function that extends the geometric series takes the value ${-1}$ when ${r = 2}$. But this has nothing to do with actually summing up the ${2}$ powers at all.

So it is with the ${\zeta}$ function. Even though the ${\zeta}$ function only makes sense at first when ${\text{Re}(s) > 1}$, people have extended it for almost all ${s}$ in the complex plane. It just so happens that the great functional equation for the Riemann ${\zeta}$ function that relates the right and left half planes (across the line ${\text{Re}(s) = \frac{1}{2}}$) is

$\displaystyle \pi^{\frac{-s}{2}}\Gamma\left( \frac{s}{2} \right) \zeta(s) = \pi^{\frac{s-1}{2}}\Gamma\left( \frac{1-s}{2} \right) \zeta(1-s), \ \ \ \ \ (2)$

where ${\Gamma}$ is the gamma function, a sort of generalization of the factorial function. If we solve for ${\zeta(1-s)}$, then we get

$\displaystyle \zeta(1-s) = \frac{\pi^{\frac{-s}{2}}\Gamma\left( \frac{s}{2} \right) \zeta(s)}{\pi^{\frac{s-1}{2}}\Gamma\left( \frac{1-s}{2} \right)}.$

If we stick in ${s = 2}$, we get

$\displaystyle \zeta(-1) = \frac{\pi^{-1}\Gamma(1) \zeta(2)}{\pi^{\frac{-1}{2}}\Gamma\left( \frac{-1}{2} \right)}.$

We happen to know that ${\zeta(2) = \frac{\pi^2}{6}}$ (this is called Basel’s problem) and that ${\Gamma(\frac{1}{2}) = \sqrt \pi}$. We also happen to know that in general, ${\Gamma(t+1) = t\Gamma(t)}$ (it is partially in this sense that the ${\Gamma}$ function generalizes the factorial function), so that ${\Gamma(\frac{1}{2}) = \frac{-1}{2} \Gamma(\frac{-1}{2})}$, or rather that ${\Gamma(\frac{-1}{2}) = -2 \sqrt \pi.}$ Finally, ${\Gamma(1) = 1}$ (on integers, it agrees with the one-lower factorial).

Putting these together, we get that

$\displaystyle \zeta(-1) = \frac{\pi^2/6}{-2\pi^2} = \frac{-1}{12},$

which is what we wanted to show. ${\diamondsuit}$

The information I quoted about the Gamma function and the zeta function’s functional equation can be found on Wikipedia or any introductory book on analytic number theory. Evaluating ${\zeta(2)}$ is a classic problem that has been in many ways, but is most often taught in a first course on complex analysis or as a clever iterated integral problem (you can prove it with Fubini’s theorem). Evaluating ${\Gamma(\frac{1}{2})}$ is rarely done and is sort of a trick, usually done with Fourier analysis.

As usual, I have also created a paper version. You can find that here.

Posted in Expository, Math.NT, Mathematics | | 4 Comments

## Response to fattybake’s question on Reddit

We want to understand the integral

$\displaystyle \int_{-\infty}^\infty \frac{\mathrm{d}t}{(1 + t^2)^n}. \ \ \ \ \ (1)$

Although fattybake mentions the residue theorem, we won’t use that at all. Instead, we will be very clever.

We will do a technique that was once very common (up until the 1910s or so), but is much less common now: let’s multiply by ${\displaystyle \Gamma(n) = \int_0^\infty u^n e^{-u} \frac{\mathrm{d}u}{u}}$. This yields

$\displaystyle \int_0^\infty \int_{-\infty}^\infty \left(\frac{u}{1 + t^2}\right)^n e^{-u}\mathrm{d}t \frac{\mathrm{d}u}{u} = \int_{-\infty}^\infty \int_0^\infty \left(\frac{u}{1 + t^2}\right)^n e^{-u} \frac{\mathrm{d}u}{u}\mathrm{d}t, \ \ \ \ \ (2)$

where I interchanged the order of integration because everything converges really really nicely. Do a change of variables, sending ${u \mapsto u(1+t^2)}$. Notice that my nicely behaving measure ${\mathrm{d}u/u}$ completely ignores this change of variables, which is why I write my ${\Gamma}$ function that way. Also be pleased that we are squaring ${t}$, so that this is positive and doesn’t mess with where we are integrating. This leads us to

$\displaystyle \int_{-\infty}^\infty \int_0^\infty u^n e^{-u + -ut^2} \frac{\mathrm{d}u}{u}\mathrm{d}t = \int_0^\infty \int_{-\infty}^\infty u^n e^{-u + -ut^2} \mathrm{d}t\frac{\mathrm{d}u}{u},$

where I change the order of integration again. Now we have an inner ${t}$ integral that we can do, as it’s just the standard Gaussian integral (google this if this doesn’t make sense to you). The inner integral is

$\displaystyle \int_{-\infty}^\infty e^{-ut^2} \mathrm{d}t = \sqrt{\pi / u}.$

Putting this into the above yields

$\displaystyle \sqrt{\pi} \int_0^\infty u^{n-1/2} e^{-u} \frac{\mathrm{d}u}{u}, \ \ \ \ \ (4)$

which is exactly the definition for ${\Gamma(n-\frac12) \cdot \sqrt \pi}$.

But remember, we multiplied everything by ${\Gamma(n)}$ to start with. So we divide by that to get the result:

$\displaystyle \int_{-\infty}^\infty \frac{\mathrm{d}t}{(1 + t^2)^n} = \dfrac{\sqrt{\pi} \Gamma(n-\frac12)}{\Gamma(n)} \ \ \ \ \ (5)$

Finally, a copy of the latex file itself.

Posted in Math.NT, Mathematics | Tagged , , | 1 Comment

## The Collatz Conjecture – recent development?

On his site, John D. Cook recently proliferated a paper by Gerhard Opfer that claimed to solve the Collatz Conjecture. The Collatz Conjecture is simple to state:

Collatz (or the 3n + 1 conjecture):
Starting at any number do the following: if n is even, divide by 2; if n is odd, multiply by 3 and add 1.
The conjecture states that no matter what positive integer you start at, you will end up at 1 (the so-called 1-4-2 loop).

At first, I had high hopes for the paper. It seems relatively well-written and was submitted to the Mathematics of Computation, a very respectable journal. I even sent out a brief email about the paper. But the paper is flawed. The problem, I think, can be succinctly summarized by the following: he relies on the assumption that starting with any number $n_0$, one will eventually hit a number that is less than $n_0$. When stated like this, it seems obvious that there is a problem, but he only relied on that one number (rather than the apparent infinite descent that could follow). The exact problem occurs with his ‘annihilation argument’ on page 11 of the pdf above. He more or less states that one can start at 1 and reach every number by doing a sort of reverse Collatz function (he’s actually a bit wittier than that), but does not prove it.

More commentary can be found on reddit, reddit again, and on math.SE (a question protected by Qiaocho Yuan – go him).

I use this as an intro to a sort of joke that goes around mathematician’s circles. A while back, Sean Carroll wrote up ‘The Alternative-Science Respectability Checklist,’ and it’s awesome. Find it here. It turns out that Scott Aaronson wrote up a similar article, inspired by Sean Carroll, that is titled “Ten Signs a Claimed Mathematical Breakthrough is Wrong.”

His inspiration was the time-old problem that simply stated problems encourage generations up people to attack them, and frequently to think that they have made progress. So he asks :

Suppose someone sends you a complicated solution to a famous decades-old math problem, like P vs. NP. How can you decide, in ten minutes or less, whether the solution is worth reading?

And thus his 10 signs were created. I happen to have heard a few people say that this most recent paper on the Collatz Conjecture only failed three: #6 (The paper jumps into technicalities without presenting a new idea), #8 (The paper wastes lots of space on standard material), and #10 (The techniques just seem too wimpy for the problem at hand). {though perhaps #8 is debateable – some say it’s related to a different convention of writing papers, but I don’t know about any of that}

In my experience, I rely mostly on #1 (it’s not written in $TeX$), #4 (it conflicts with some impossibility result), and #7 (it doesn’t build on any previous work). But both of these articles are very funny, though not exactly precise nor entirely true.

Posted in Expository, Humor, Mathematics, Open | | 2 Comments