Blog

A blog of Python-related topics and code.

The hanging chain

The description of the oscillations of a hanging chain was a problem in mechanics solved by Daniel Bernoulli in the 18th century and which led to the discovery of the class of functions known as Bessel functions.

Using prime numbers to determine if two words are anagrams

A recent tweet by Fermat's Library noted that the Fundamental theorem of arithmetic provides a novel (if inefficient) way of determining whether two words are anagrams of one another.

Maze Generation by Cellular Automaton

Cellular automata (CA) can be used to generate mazes, as described on the LifeWiki. A commonly used algorithm operates like John Conway's Game of Life in that a cell is born if it has exactly 3 neighbours but the survival rule is more liberal: a cell survives if it has 1–5 neighbours (rulestring B3/S12345).

Fireball statistics

In astronomy, a fireball is a meteor bright enough to be seen over a wide area (either apparent magnitude greater than -4 or greater than -3 at zenith, depending on the definition used). The terms bolide and, for exceptionally bright meteors, superbolide are also used. A famous recent example is the Chelyabinsk meteor.

Muller's Recurrence

The recurrence devised by Jean-Michel Muller[1] and described in a slightly modified form by William Kahan in a 2006 monograph[2] provides an interesting example of how the finite precision of floating point arithmetic can lead to wildly incorrect results in some circumstances.