---
title: "Baryon Acoustic Oscillations: Galaxy Pairs as a Cosmic Ruler Interactive Lab | Sandbox Physics"
description: "How do galaxy pair counts measure the expansion of the Universe?"
canonical_url: "https://sandboxphysics.com/labs/baryon-acoustic-ruler/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/baryon-acoustic-ruler/"
last_modified: "2026-11-17"
---

# Baryon Acoustic Oscillations: Galaxy Pairs as a Cosmic Ruler

**How do galaxy pair counts measure the expansion of the Universe?** Sound waves in the hot plasma of the early Universe travelled about 147 million parsecs (147 Mpc) and stopped once atoms formed. That distance is printed in today's galaxy distribution as a small excess of galaxy pairs separated by it. Surveys such as DESI compare the excess's apparent size with its known length, which gives the distance at each redshift and so the expansion history.

Stretch the assumed distances of a synthetic galaxy catalog and watch the 147 Mpc acoustic peak in pair counts move along and across the line of sight.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

This synthetic teaching catalog follows the seed-and-shell picture of Eisenstein, Seo and White (2007). Each acoustic seed has a Gaussian clump of 6 Mpc width and a shell of galaxies at the sound horizon with an 8 Mpc spread, inside a 900 Mpc box with uniform field galaxies. The z axis is the line of sight (plane-parallel approximation). The sound horizon follows the DESI DR2 fitting formula with the dark-matter density held fixed. Pair counts use the Landy-Szalay estimator with 12 000 uniform randoms; errors come from 27 jackknife cubes and ignore correlations between bins. The model omits redshift-space distortions, nonlinear damping of the peak, reconstruction, survey masks and radial selection, and the catalog is not DESI data. The peak significance is not corrected for the search over alpha.

## The same catalog, counted in pairs

Synthetic catalog, not DESI data

A perfect fit would return $\alpha_\parallel^{\mathrm{exp}}=1,\quad \alpha_\perp^{\mathrm{exp}}=1$

The fitted ring sits where the settings predict, within the quoted errors.

### Excess pairs at each separation, in two directions

### The ring in the pair-count map

More numbers from this catalog

- **Galaxies in the catalog**: $6645$
- **Best-fit chi-squared over degrees of freedom**: $19.2/43$
- **Redshift at which the sound wave stalled**: $1058$

How the pairs are counted and the ring is fitted

$$
\hat\xi=\frac{DD-2DR+RR}{RR},\qquad s_\parallel=\frac{\Delta z}{q_\parallel},\quad s_\perp=\frac{\Delta x_\perp}{q_\perp}
$$

Pairs are counted once on a 2 Mpc grid of true separations, so changing the assumed distances only regroups them. The fit uses separations from 60 to 190 Mpc in two wedges. The template is the analytic seed-and-shell correlation at the expected ruler, with one amplitude and three smooth terms per wedge. The significance compares the fit with and without the template and ignores the search over the stretch.

[Eisenstein, Seo and White (2007), the acoustic shell picture](https://arxiv.org/abs/astro-ph/0604361v1) · [DESI DR2 Results II (2025), BAO measurements](https://arxiv.org/abs/2503.14738v3)

[Continue with the course on measuring the acoustic ruler](https://sandboxphysics.com/stories/baryon-acoustic-oscillations/)

## Baryon Acoustic Oscillations: Galaxy Pairs as a Cosmic Ruler

**Background** For the first 380 000 years, photons, electrons and nuclei moved together as one fluid with a high sound speed. A pressure wave from every small overdensity spread outward until the photons let go of the baryons, about 147 Mpc in comoving units.

**Why it matters** Galaxies later formed where matter was dense, both at the original clump and on the stalled shell. A galaxy survey cannot see the shells one by one, but it can count how many galaxy pairs sit at each separation and look for a small excess near the sound horizon.

- **One-sentence intuition**: To turn angles and redshifts into separations, the analysis must assume distances. If the assumption is wrong, the ring of excess pairs looks larger or smaller, and differently so along and across the line of sight. Fitting the ring gives the two distances in units of the sound horizon.

### Core mathematical model

#### Counting excess pairs

$$
\hat\xi(s)=\frac{DD(s)-2\,DR(s)+RR(s)}{RR(s)}
$$

DD counts galaxy pairs at separation s, DR galaxy-random pairs and RR random-random pairs, each divided by its total number of pairs. The random points fill the same volume without clustering, so the ratio measures the excess over an unclustered catalog. This is the Landy-Szalay estimator.

#### How far sound travelled

$$
r_d=\int_{z_d}^{\infty}\frac{c_s(z)}{H(z)}\,dz,\qquad c_s=\frac{c}{\sqrt{3\,(1+3\rho_b/4\rho_\gamma)}}
$$

The sound speed is a little below c divided by the square root of three, slowed by the inertia of the baryons. More baryons mean slower sound, so the ruler shortens. In the Lab, raising the baryon density from 0.0224 to 0.026 shortens it from 147 to 143 Mpc.

#### What the fit measures

$$
\alpha_\parallel=\frac{D_H/r_d}{D_H^{\mathrm{fid}}/r_d^{\mathrm{fid}}},\qquad \alpha_\perp=\frac{D_M/r_d}{D_M^{\mathrm{fid}}/r_d^{\mathrm{fid}}}
$$

The ring of excess pairs appears at s equal to the fiducial ruler divided by alpha in each direction. A survey therefore measures distance divided by the sound horizon. Turning that into a distance needs r\_d from the early Universe.

### Common difficulties

#### A ruler, not a ring of galaxies

**Typical misconception** Surveys see rings of galaxies 147 Mpc across.

**Better mental model** Each shell holds a few galaxies among many others, and shells overlap. Only the statistics of millions of pairs reveal the excess, which in real surveys is well under one per cent of the pairs at that separation.

### Run the experiment

1. 01

   #### Watch the ruler form

   Watch one loop of the stage. Before the shell stops, predict where in the right-hand stack the galaxies of today will pile up.

   **What to observe:** The shell stops at 147 Mpc and stays there. Today each seed has galaxies in its centre and on that shell, and in the stack they sit on the dashed expected ruler.

2. 02

   #### Get the line-of-sight distance wrong

   Choose Squeezed along the line of sight, or drag the box corner down. Predict which of the two fitted stretches changes.

   **What to observe:** The ring flattens into an ellipse. The line-of-sight stretch moves to about 1.10 while the transverse one stays near 1.00, and the line-of-sight peak in the chart moves to smaller s.

3. 03

   #### Hide the signal

   Choose Too faint to see by eye, then No sound wave at all. Compare the naive peak significance in the two cases.

   **What to observe:** The faint ring is invisible in the slab yet the fit still finds it at about 5.6 sigma. With no shell, noise alone gives about 2 sigma and the fit runs to the edge of its range.

Physical conclusion

The acoustic peak gives distance divided by the sound horizon, separately along and across the line of sight.

## Related experiments and articles

Baryon acoustic oscillations · Reading path

### From a sound wave to galaxy pair counts and DESI distances

Articles on this path that use this experiment, followed by the other experiments they suggest.

1. [Article **How can pairs of galaxies measure the universe?**](https://sandboxphysics.com/stories/baryon-acoustic-oscillations/how-galaxy-pairs-measure-the-universe/)
2. [Article **How far sound travelled before the drag epoch**](https://sandboxphysics.com/stories/baryon-acoustic-oscillations/how-far-sound-travelled-before-the-drag-epoch/)
3. [Article **Counting galaxy pairs against a random catalogue**](https://sandboxphysics.com/stories/baryon-acoustic-oscillations/counting-galaxy-pairs-with-randoms/)
4. [Article **Reading the ruler along and across the line of sight**](https://sandboxphysics.com/stories/baryon-acoustic-oscillations/along-and-across-the-line-of-sight/)
5. [Article **Measure a correlation function from a DESI data patch**](https://sandboxphysics.com/stories/baryon-acoustic-oscillations/measure-a-desi-patch-correlation-function/)
6. [Article **How to read the DESI BAO results**](https://sandboxphysics.com/stories/baryon-acoustic-oscillations/reading-desi-bao-results/)

Fields & matter · Starter path

## From a field to an electron microscope

Map an electric field and steer a charged particle. Then find the electron's wavelength and use electron beams to see a crystal and a surface.

[Start here → **Make an Electric Field Visible** Move the probe around a dipole and check that the field always points downhill on the potential landscape. Observe · 8 min](https://sandboxphysics.com/labs/electric-field/)

1. [1 Make an Electric Field Visible](https://sandboxphysics.com/labs/electric-field/)
2. [2 A Charge Bending through Fields](https://sandboxphysics.com/labs/charged-particle/)
3. [3 Electron Wavelength & Voltage](https://sandboxphysics.com/labs/electron-wavelength/)
4. [4 Electron Diffraction & Reciprocal Space](https://sandboxphysics.com/labs/electron-diffraction/)
5. [5 TEM Bright Field, Dark Field & SAED](https://sandboxphysics.com/labs/tem-mode-selector/)
6. [6 SEM Secondary-Electron Topography](https://sandboxphysics.com/labs/sem-topography/)

[View the full path →](https://sandboxphysics.com/topics/fields-and-matter/#starter-path)
