Cosmology That ClicksEpisode 4 · the math-friendly edition

The "light slows down" universe from Episode 1 — this time you run it yourself

Chasing "Light Used to Be
Faster" on a Computer Not just staring at equations — compute them step by step and make the graphs move.
The figures below are the real thing: drag a slider and they recompute on the spot.

Tools you'll need: repeated addition (a recurrence), a little programming \(c(t)=c_0 t_0/t\)

In Episode 1 we rewrote cosmic expansion as "the speed of light slowly drops." The equations were elegant — but "staring at" an equation and "running" it are different kinds of understanding. This time we'll step that universe forward on a computer. No hard math needed: all it takes is "add a little to the previous value to make the next one" — repeated addition. And the figures on this page aren't decoration; they're real data your browser computes on the spot. Drag the sliders and spin the universe.

STEP 01Turn the continuous equation into the computer's language: a recurrence

Episode 1's rule was \(c(t)=\dfrac{c_0 t_0}{t}\). How far light has traveled was speed × time, added up: \(D=\displaystyle\int c(t)\,dt\). "Integral" sounds intimidating, but to a computer it's just "add up the distance traveled, a small time \(\Delta t\) at a time." Written as a recurrence (make the next value from the previous one) —

A form the computer understands (a recurrence)
$$t_{n+1} = t_n + \Delta t,\qquad D_{n+1} = D_n + c(t_n)\,\Delta t = D_n + \frac{c_0 t_0}{t_n}\,\Delta t$$

"Advance the time by \(\Delta t\). In that interval light travels \(c(t_n)\times\Delta t\), so add it to the distance." Repeating this thousands of times is tedious for a human but a computer's specialty. As a program it's just a few lines.

# In Episode 1's universe, add up the distance light travels, one step at a time c0, t0 = 1.0, 1.0 # normalize today's speed and age to 1 dt = 0.001 # small time step t, D = 0.001, 0.0 # can't divide at exactly t=0, so start just after while t < t0: c = c0 * t0 / t # speed of light at this moment (faster in the past!) D = D + c * dt # add the distance traveled t = t + dt print(D) # -> keeps growing (diverges logarithmically)

The heart of this program is the one line \(c = c_0 t_0 / t\). The smaller \(t\) is (the younger the universe), the larger \(c\), racking up distance fast early on. That was the essence of "early light reached far." Let's watch it happen in the next figure.

STEP 02Run it — the further back, the more light's speed shoots up

First, let's plot the speed of light itself, \(c(t)=c_0t_0/t\), against the age of the universe. The slider below is the time step \(\Delta t\). Moving it changes how finely the smooth curve gets tracked.

Fig. 1: How the speed of light c(t) changes over time (blue = true curve, dots = the computer's stepped values)
true curve c(t)=c₀t₀/t computer's steps

The curve shooting up on the left (the past) is "light was fast in the young universe." Make the step coarser and you'll see the dots fail to keep up with that steep part, drifting off the curve — the fate of numerical computation, which leads into STEP 04.

STEP 03The distance light has reached — the horizon really does "keep growing"

Next, let's plot the distance \(D\) that STEP 01's program added up (the horizon light has reached) against time. In Episode 1 we said "\(\int c_0t_0/t\,dt\) diverges logarithmically — grows without bound." Let's verify that with the computer's addition.

Fig. 2: The buildup of the distance light has reached, D(t) (grows logarithmically without bound)
accumulated distance D(t)

The slider is "when to start computing." Start adding from an earlier moment (a younger universe) and — because the speed of light is enormous early on — the total distance jumps way up. The closer you get to the beginning, the more it grows without bound — this is the "logarithmic divergence," the numerical version of Episode 1's conclusion that any two points in the universe, however far apart, could once have been in contact.

The reveal (linking to Episode 1) This "grows without bound" of \(D\) is exactly why the horizon problem of standard cosmology doesn't arise in a \(c\cdot t=\text{constant}\) universe. But the same caveat as before — what's doing the work isn't changing \(c\), it's the way the universe expands, \(a\propto t\) (straight-line expansion). Even numerically, the two draw exactly the same curve.
◇ ◇ ◇

STEP 04The practical core — why "changing variables" speeds up the computation

This is the most interesting part of the episode. As Fig. 1 showed, early on (the past) the speed of light changes sharply, so tracking it requires a fine step \(\Delta t\). But later it's gentle, where a fine step is wasted. Compute the whole thing at one fineness and you're forced to make every interval as fine as the early part — very slow.

So we swap the "ruler" for time. Instead of ordinary time \(t\), use \(u=\ln t\) (the logarithm of \(t\)) as the new time. Then \(t=e^u\), and the speed of light becomes

$$c = \frac{c_0 t_0}{t} = c_0 t_0\, e^{-u}$$

— a smooth exponential in \(u\). The sharp spike is gone, and the whole range can be tracked at nearly one fineness. The same accuracy, with far fewer steps — this is the essence of "changing variables speeds up the computation." In the figure below, compare the same physics on the \(t\) axis and the \(u=\ln t\) axis.

Fig. 3: The same c(t) on the ordinary time axis (left) and the log-time axis u=ln t (right). The right is smooth — trackable with few points
true curve evenly spaced points

Try reducing the number of points. On the left (ordinary time), few points miss the steep early curve and drift far off it. But on the right (log time), the same few points track the curve cleanly. Without throwing away a single bit of information, just by swapping the "ruler," the computation got easier — this is the visible, real thing behind Episode 1's "speedup that isn't an approximation."

The reveal — this is a real technique from cosmology In numerical cosmology, using exactly this \(u=\ln a\) (the log of the scale factor) as the time variable is standard practice. It lets you track the rapidly-changing early universe at even spacing, speeding up the computation by orders of magnitude. When Episode 1 said "\(c\cdot t=\text{constant}\) is easy to compute," this "ruler swap" is what it meant. Not new physics — a clever choice of coordinates was the real substance.
The honest line (kept light, just one)

"Changing variables speeds things up" only works when the problem becomes smooth in that variable. A problem that's already uniform across the whole range won't speed up from a swap (it's already smooth). This time it worked because the \(c\cdot t=\text{constant}\) universe had a bias — "steep only early on." It's not magic; it's the skill of choosing a "ruler" to match the problem's bias.

Practice problems (if you can code, actually run them)
  1. In STEP 01's program, if you set \(\Delta t\) to \(0.01\) versus \(0.0001\) and compare \(D\), how would you predict the value changes?
    Show answer
    The finer it is, the more accurately it picks up the steep early part, so \(D\) grows larger, approaching the true (diverging) value. A coarse step misses the early part and underestimates \(D\).
  2. After switching to \(u=\ln t\), why can the speed of light \(c=c_0t_0 e^{-u}\) be called "smooth"?
    Show answer
    \(e^{-u}\) changes at a gentle rate as \(u\) varies, with no infinitely steep spike like on the \(t\) axis. With no sharp changes, even evenly spaced points don't miss the curve.
  3. Give one example, from this episode's reasoning, of a problem where "speedup via change of variables" does NOT work.
    Show answer
    A problem with uniform change — like something moving at constant speed from start to finish. With no bias, no "ruler" swap changes where the points land, so there's no speedup. (It's already an optimal encoding.)

Wrap-upOnce you "run" the equation, the practical payoff appears

We turned the continuous equation \(\int c\,dt\) into the computer's language (the recurrence \(D_{n+1}=D_n+c(t_n)\Delta t\)) and added it up step by step. In the young universe the speed of light shoots up, and the distance light has reached keeps growing logarithmically — Episode 1's conclusion, reproduced in the graph before your eyes.

And the core this time was the ruler swap to \(u=\ln t\). Without discarding information, just by changing coordinates, the computation of sharp changes gets orders of magnitude easier. When Episode 1 said "\(c\cdot t=\text{constant}\) is easy to compute," this clever choice of coordinates is what it meant. A notation that's easy to understand is often, at the same time, a notation that's fast — that's what became visible this time, hands-on.

This is Episode 4 of "Cosmology That Clicks," a reading piece for curious high-schoolers. Every figure is real data computed on the spot in your browser, visualizing \(c(t)=c_0t_0/t\), the numerical integration of \(D=\int c\,dt\) by Euler's method, and the change of variables to \(u=\ln t\). Numbers are normalized dimensionless examples. Speedup via change of variables (time reparametrization) is a technique genuinely used in numerical computation and numerical cosmology. — To print, use your browser's Print → Save as PDF (in the printed version, the interactive figures and answers are static/hidden).

Print / save as PDF: ⌘+P (Ctrl+P on Windows). On screen, sliders recompute the figures and "Show answer" opens the solutions.