Posts

Showing posts from May, 2018

Space filling curve

Image
Q: How do you catch a lion in the Sahara? A: Run along a space filling curve carrying a spear.  ($\dagger$) Surprisingly, it is possible to construct a continuous and surjective map $[0,1]\mapsto  [0,1]^2$.  In less techie language: you can plot a curve that fills space.  But how do you do it?  The answer uses the following four maps $[0,1]^2\mapsto [0,1]^2$. $$ \begin{align} & \phi_0(x,y) = \frac{1}{2}(y,x) & \text{flip about diagonal and shrink}\\ & \phi_1(x,y) = \frac{1}{2}(x,y)+(0,\frac{1}{2}) & \text{shrink and translate to top left}\\ & \phi_2(x,y) = \frac{1}{2}(x,y)+(\frac{1}{2},\frac{1}{2}) & \text{shrink and translate to top right}\\ & \phi_3(x,y) = \frac{1}{2}(1-y,1-x)+(\frac{1}{2},0) & \text{flip, shrink & translate to bottom right}\\ \end{align} $$ In words the recipe goes like this:  start off with any continuous map $\gamma:[0,1]\mapsto[0,1]^2$ with $\gamma(0) = (0,0)$ and $\gamma(1)=(1,0)$. apply al

Time AND date sundial

Image
Photo taken by me at 18:00 BST May 20, 2018 I was out and about in Cambridge and I saw a modern sundial on the side of a building in Tennis Court road .  It occurred to me then that I should be able to build a sundial which tells you both the time - in GMT - and the date.  (Although you do need to know whether it is before or after the summer solstice!).  In fact all you need is to know one out of compass bearing, time, date and you should be able to work out the other two! To run it you need to do the following copy the text into sundial.py and chmod +x sundial.py install pre-requisite packages: sudo apt install python-numpy python-matplotlib run it:  ./sundial.py The result is a printout like the one shown.  If you want to adapt the picture for your locale just edit the parameters passed to plot_fixed_lat_long() . When I printed out my first sundial I was surprised to discover that the trajectory of the shadow is straight on the equinoxes.  After a day of pondering

Proof of Gödel's Incompleteness Theorem in $bash$

Image
Gödel's incompleteness theorem says the following: Choose your axioms that uniquely define the integers (you'll need a minimum of about 10) Choose your rules of inference that define what type of statements about integers follows from what other types of statements Then, provided you chose a finite number of each, there will be true statements about the integers that you cannot prove using (1) and (2) What follows is a proof of Gödel's Incompleteness Theorem, using Turing's Halting Problem, and bash scripting to illustrate ($\dagger$). For the purpose of this high level (but consise) proof , imagine a computer running Unix which has infinite memory.  Apart from this limitless resource the computer is the same as any other Unix machine, i.e. all files must be of finite size, there are finitely many instructions and system calls, each instruction has a minimum completion time, etc. etc.. We will consider all files to be executable.  For the vast majority

The Golden Ratio

Image
The number $\phi = \frac{1+\sqrt{5}}{2}$, known as the Golden Ratio , turns up in a lot of places.  This one that I read about in National Geographic surprised me.  The following coordinates describe an icosahedron: $$ (\phi,1,0), (-\phi,1,0), (-\phi,-1,0), (\phi,-1,0) \\ (0,\phi,1), (0,-\phi,1), (0,-\phi,-1), (0,\phi,-1) \\ (1,0,\phi), (1,0,-\phi), (-1,0,-\phi), (-1,0,\phi) \\ $$I thought I'd have a go at figuring out why, and the above picture is the result.  All you have to do is observe that the vertices of an icosahedron are the same as those of a set of three identical intersecting rectangles.  The proof then reduces to showing that the ratio of the long side to the short side is $\phi$ - i.e. that these are golden rectangles.  The proof above takes the short side to be of length 1 and the long side to be of length $x$. So, why does $\phi$ turn up so often in maths and geometry?  I think the answer is the same as the answer to the question "why does $\frac{1}{2}$

Wave Particle Duality

Image
The idea of wave particle duality has been around for a long time, and is often used to explain phenomenon like the double slit experiment .  The idea goes like this: the particle (electron, photon, whatever) behaves like a wave some of the time - like when it is passing through the slits - and like a particle at other times - such as when it hits the screen and produces a flash in a single location.  This explains how it can behave as if it went through both slits at the same time despite being in just one location whenever we check - e.g. by making it collide with a surface.  The change from wave like behaviour to particle like behaviour is called the collapse of the wavefunction . This idea raises many questions, chiefly: what does and what does not collapse the wavefunction?  For example, if you replace the screen with a mirror then a photon continues to exhibit wave behaviour after bouncing off of it.  The proponents of the wave particle duality theory never answered this q

Pythagoras

Image
Proof that $a^2+b^2=c^2$, baked by me at a pottery in France while on holiday

Making Spaces

Image
In quantum mechanics a lot of emphasis is placed on the concept of  vector spaces.  One of the key tools is the ability to construct new vector spaces out of existing ones.  However, very often authors construct new vector spaces without explicitly saying what they have done, and the result can be confusing.  In this post I am going to attempt to summarize all the methods I have seen for constructing new vector spaces out of old, and point out where they are used in quantum mechanics. The building blocks What: Hilbert Spaces Why: To represent superpositions of classical states   The building blocks are always Hilbert spaces.  These are vector spaces over the complex numbers $\mathbb{C}$, with inner products and limits.  The pair $(V, \langle\cdot\lvert\cdot\rangle)$ is a Hilbert space if $V$ is a vector space over $\mathbb{C}$ $v\mapsto\langle u\lvert v\rangle$ is linear map $V\mapsto\mathbb{C}$ for any $u$ in $V$ $\langle u\lvert v\rangle = \overline{\langle v\lvert u\rang