latest news

Distractions and amusements, with a sandwich and coffee.

Thoughts rearrange, familiar now strange.
•
• break flowers
• more quotes

On March 14th celebrate `\pi` Day. Hug `\pi`—find a way to do it.

For those who favour `\tau=2\pi` will have to postpone celebrations until July 26th. That's what you get for thinking that `\pi` is wrong. I sympathize with this position and have `\tau` day art too!

If you're not into details, you may opt to party on July 22nd, which is `\pi` approximation day (`\pi` ≈ 22/7). It's 20% more accurate that the official `\pi` day!

Finally, if you believe that `\pi = 3`, you should read why `\pi` is not equal to 3.

This year's `\pi` day art collection celebrates not only the digit but also one of the fundamental forces in nature: gravity.

In February of 2016, for the first time, gravitational waves were detected at the Laser Interferometer Gravitational-Wave Observatory (LIGO).

The signal in the detector was sonified—a process by which any data can be encoded into sound to provide hints at patterns and structure that we might otherwise miss—and we finally heard what two black holes sound like. A buzz and chirp.

The art is featured in the Gravity of Pi article on the Scientific American SA Visual blog.

All the art was processed while listening to Roses by Coeur de Pirate, a brilliant female French-Canadian songwriter, who sounds like a mix of Patricia Kaas and Lhasa. The lyrics Oublie-moi (Forget me) are fitting with this year's theme of gravity.

Mais laisse-moi tomber, laisse-nous tomber

Laisse la nuit trembler en moi

Laisse-moi tomber, laisse nous tomber

Cette fois

But let me fall, let us fall

Let the night tremble in me

Let me fall, let us fall

This time

The gravitational force between two masses `m_1` located at `(x_1,y_1)` and `m_2` located at `(x_2,y_2)` is given by

$$F = \frac{G m_1 m_2}{r^2} \tag{1} $$

where `r` is the distance between the masses given by

$$r = \sqrt{ \Delta x ^2 + \Delta y ^2 } = \sqrt{ (x_2-x_1)^2 + (y_2-y_1)^2 } \tag{2} $$

The force is directed along the vector formed by `r` and can be decomposed into `x` and `y` components using \begin{align} F_x &= F \frac{ \Delta x}{r} = F \frac{x_2-x_1}{r} \tag{3} \\ F_y &= F \frac{ \Delta y}{r} =F \frac{y_2-y_1}{r} \tag{4} \end{align}

The acceleration of each mass can be obtained using `F = ma` and similarly decomposed into `x` and `y` components \begin{align} a_{1x} &= \frac { F_{1x} }{ m_1} = \frac{G m_2 \Delta x}{r^3} \tag{5} \\ a_{1y} &= \frac { F_{1y} }{ m_1} = \frac{G m_2 \Delta y}{r^3} \tag{6} \\ a_{2x} &= \frac { F_{2x} }{ m_2} = -\frac{G m_1 \Delta x}{r^3} \tag{7} \\ a_{2y} &= \frac { F_{2y} }{ m_2} = -\frac{G m_1 \Delta y}{r^3} \tag{8} \end{align}

When there are `n` masses in the system, the acceleration of mass `i` is the sum of the accelerations due to all other masses \begin{align} a_{ix} &= \sum_{i \ne j} \frac{G m_j \Delta x_{ij}}{r_{ij}^3} \tag{9} \\ a_{iy} &= \sum_{i \ne j} \frac{G m_j \Delta y_{ij}}{r_{ij}^3} \tag{10} \end{align}

The equations of motion for the masses over a period of time `\Delta t` are

\begin{align} \Delta v_x &= \Delta t a_x \tag{11} \\ \Delta v_y &= \Delta t a_y \tag{12} \\ \Delta x &= \Delta t \left( v_x + a_x \frac{\Delta t}{2} \right) \tag{13} \\ \Delta y &= \Delta t \left( v_y + a_y \frac{\Delta t}{2} \right) \tag{14} \end{align}

There are various ways in which the numerical simulation can be performed. The Euler, Verlet, Runge-Kutta methods are perhaps the most common. I use the Verlet approach.

Using the equations of motions above, the Verlet simulation goes as follows

- calculate acceleration, `a_1` (eq 9,10)
- update position (eq 13,14)
- calculate new acceleration, `a_2` (eq 9,10)
- update velocity using `(a_1+a_2)/2` (eq 7,8)

The masses are initially uniformly distributed on a circle and given a zero initial velocity or a normally distributed random velocity.

I ran about 10,000 individual simulations with different values of `n` and `k` and collected ones that stood out as pretty.

The size of a mass is taken to be `s = m^{1/3}`. When two masses, `m_1` and `m_2` come within a distance of `\left( s_1 + s_2 \right)(1-z)` of each other, they collide. Here `z` is a collision margin parameter that I set to either `z=0` or `z=0.25`.

During the collision, a new body is created with mass `M = m_1 + m_2` given a speed that conserves momentum in the collision. \begin{align} v_x &= \frac{m_1 v_{1x} + m_2 v_{2x} }{M} \\ v_y &= \frac{m_1 v_{1y} + m_2 v_{2y} }{M} \end{align}

For my simulation, the following values are used

- `G = 100`
- mass for each digit, `d` is `(1+d)^k`
- masses placed on circle with radius `216`
- when randomized, `(v_x,v_y) \sim N(0,1)`
- `\Delta t = 0.01`
- simulation runs for up to 100,000 steps
- canvas size is `1440 \times 1440`

Discover Cantor's transfinite numbers through my music video for the Aleph 2 track of Max Cooper's Yearning for the Infinite (album page, event page).

I discuss the math behind the video and the system I built to create the video.

*Everything we see hides another thing, we always want to see what is hidden by what we see.
—Rene Magritte*

A Hidden Markov Model extends a Markov chain to have hidden states. Hidden states are used to model aspects of the system that cannot be directly observed and themselves form a Markov chain and each state may emit one or more observed values.

Hidden states in HMMs do not have to have meaning—they can be used to account for measurement errors, compress multi-modal observational data, or to detect unobservable events.

In this column, we extend the cell growth model from our Markov Chain column to include two hidden states: normal and sedentary.

We show how to calculate forward probabilities that can predict the most likely path through the HMM given an observed sequence.

Grewal, J., Krzywinski, M. & Altman, N. (2019) Points of significance: Hidden Markov Models. *Nature Methods* **16**:795–796.

Altman, N. & Krzywinski, M. (2019) Points of significance: Markov Chains. *Nature Methods* **16**:663–664.

My cover design for Hola Mundo by Hannah Fry. Published by Blackie Books.

Curious how the design was created? Read the full details.

*You can look back there to explain things,
but the explanation disappears.
You'll never find it there.
Things are not explained by the past.
They're explained by what happens now.
—Alan Watts*

A Markov chain is a probabilistic model that is used to model how a system changes over time as a series of transitions between states. Each transition is assigned a probability that defines the chance of the system changing from one state to another.

Together with the states, these transitions probabilities define a stochastic model with the Markov property: transition probabilities only depend on the current stateâ€”the future is independent of the past if the present is known.

Once the transition probabilities are defined in matrix form, it is easy to predict the distribution of future states of the system. We cover concepts of aperiodicity, irreducibility, limiting and stationary distributions and absorption.

This column is the first part of a series and pairs particularly well with Alan Watts and Blond:ish.

Grewal, J., Krzywinski, M. & Altman, N. (2019) Points of significance: Markov Chains. *Nature Methods* **16**:663–664.

*Places to go and nobody to see.*

Exquisitely detailed maps of places on the Moon, comets and asteroids in the Solar System and stars, deep-sky objects and exoplanets in the northern and southern sky. All maps are zoomable.