The Sleeping Top and the Number That Won't Move
Spin a well-balanced top hard enough and it does something unsettling: it stands perfectly vertical and appears to stop. The wobble that should grow instead shrinks. Each tiny lean feeds a precession that nudges it back toward upright, and the faster it spins the smaller that correction needs to be. Machinists call this a sleeping top. It hasn’t stopped — it has converged.
There’s a number that behaves exactly like a sleeping top, and you can find it with a pocket calculator. Put it in radians, type any number, and press cosine over and over. 1, then 0.540, then 0.858, 0.654, 0.793 — the digits thrash at first and then settle, locking onto 0.739085. Press cosine again and nothing changes. That value is the Dottie number, and it’s a fixed point of cosine: an input the function maps straight back to itself.
The procedure that hunts for one is four lines. Apply the function, check whether the answer moved, and if it did, recurse on the new answer. This is almost verbatim from the book that taught a generation of us to think this way — it was on my desk in the ’80s and Scheme was its native tongue.
(define tolerance 0.00001)
(define (fixed-point f guess)
(define (close? a b) (< (abs (- a b)) tolerance))
(let ((next (f guess)))
(if (close? guess next) next (fixed-point f next))))
(fixed-point cos 1.0) ; => 0.7390822985224024
The same loop in Java, where the recursion flattens into a while and the function comes in as a lambda:
import java.util.function.DoubleUnaryOperator;
class FixedPoint {
static double find(DoubleUnaryOperator f, double guess) {
double next = f.applyAsDouble(guess);
while (Math.abs(next - guess) > 1e-5) {
guess = next;
next = f.applyAsDouble(guess);
}
return next;
}
public static void main(String[] a) {
System.out.println(find(Math::cos, 1.0)); // 0.7390822985224024
}
}
Not every function sleeps. Cosine works because it never stretches a gap — the distance between two guesses shrinks each pass, so they’re pulled together like a fast top pulled upright. Try it on something that magnifies distances instead and the values fly apart with each step, the way an under-spun top’s lean grows until it clatters off the bench. On the lathe today I couldn’t tell by eye whether a blank would sleep or topple; the spin either damps the wobble or amplifies it, and 0.00001 of tolerance is about how close I have to get the mass to the axis before it decides in my favour.