Choosing the Right Pseudoinverse

January 17, 2017

On a number of previous occasions, I have used the pseudoinverse of a matrix solve systems of equations, and do other things such as channel mixing. However, the demonstration I gave before isn’t entirely correct. Let’s see now why it’s important to make the difference between a left and a right pseudoinverse.

otter

Read the rest of this entry »


Logarithms (Part I?)

January 3, 2017

The traditional—but certainly not the best—way to compute the value of the logarithm of some number x is to use a Taylor series, for example

\displaystyle \ln x = (x-1)-\frac{1}{2}(x-1)^2+\frac{1}{3}(x-1)^3-\frac{1}{4}(x-1)^4+\cdots

but that expansion is only valid for 0<x\leqslant{2}, or so, because it is the Taylor expansion of \ln x "around 1", and the convergence radius of this particular expression isn't very large. Furthermore, it needs a great deal of terms before converging.

Read the rest of this entry »


π, π, Archimedes!

December 20, 2016

This week, another derivation for a famous formula: Archimedes’
formula for π.

arkimedes-konkani_vishwakosh

Some time in the 3rd century BC, Archimedes used the perimeter of a regular polygon, starting with an hexagon and repeatedly doubling the number of sides, to estimate the value for π. He arrived at the approximation

\displaystyle 3\frac{10}{71}=\frac{223}{71}<\pi<\frac{22}{7}=3\frac{10}{70}.

How he arrived to this result is a bit mysterious until we completely understand how he got that result. Let’s see together how he did it.

Read the rest of this entry »


Binet’s Formula

December 13, 2016

You will encounter a large number of formulas in your life, and quite many of them just seem to come out of the blue. That’s fortunately quite false, despite it being not always easy to retrace the formulas’ authors’ steps. One that appears as suspicious as it seems magic, is Binet’s Fibonacci Number formula:

\displaystyle F_n=\frac{\phi^n-(1-\phi)^n}{\sqrt{5}},

where

\displaystyle\phi=\frac{1+\sqrt{5}}{2}

is the golden number.

But it’s not quite out of nowhere, and, if you know how to solve recurrences using the characteristic equation, it’s in fact quite straightforward. Let’s see how.

Read the rest of this entry »


The infinite radicals of Ramanujan

November 29, 2016

What if I asked you to find the numerical value of

\displaystyle \sqrt{1+2\sqrt{1+3\sqrt{1+4\sqrt{1+5\sqrt{1+6\sqrt{\cdots}}}}}} ?

If you have difficulty figuring out what this thing is, don’t worry. You’re not the only one. This question is one the problems posed by Srinivasa Ramanujan, one of the most brilliant and, well, mysterious mathematicians of all time. In fact, it was head enough that Ramanujan had to give the answer a few months later.

Read the rest of this entry »


Square Roots (Part V)

November 15, 2016

Last week we examined the complexity of obtaining k in the decomposition n=2^k+b for some integer n. This week, we’ll have a look at how we can use it to speed-up square root extraction. Recall, we’re interested in k because

2^k \leqslant 2^k+b < 2^{k+1},

with 0 \leqslant b < 2^k, which allows us to get easy bounds on \sqrt{n}. Better, we also have that

\sqrt{2^k} \leqslant \sqrt{2^k+b} \leqslant \sqrt{2^{k+1}},

and we know how to compute \sqrt{2^k}=2\frac{k}{2} (somewhat efficiently! Let’s combine all this and see how it speeds up things.

Read the rest of this entry »


Square Roots (part IV)

November 8, 2016

In a previous post, we noticed that

\sqrt{2^k} \leqslant \sqrt{n} = \sqrt{2^k+b} \leqslant \sqrt{2^{k+1}},

where 0 \leqslant b < 2^k, could be used to kick-start Newton's (or another) square root finding algorithm. But how fast can we find k and b in this decomposition?

Read the rest of this entry »