---
title: "Cosmology from expansion to inference"
description: "Learn how expansion, acoustic peaks and sky statistics constrain cosmic ingredients, with eight chapters and three interactive experiments."
canonical_url: "https://sandboxphysics.com/stories/cosmology/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/cosmology/"
---

FR08

# Cosmology from expansion to inference

Sandbox Physics · 2026-10-28

The angular size of a pattern depends on both its physical size and its distance. Follow that observation from expanding space to primordial sound, random skies and a public lensing likelihood. Each step explains what the data measure and which assumptions let us infer cosmic ingredients.

## A ruler whose size and distance both matter

An early-universe sound wave leaves a preferred size in the microwave sky. Its apparent angle tells us a ratio: how far sound traveled divided by how far away the pattern lies. To learn the ingredients of the universe, we need to understand both lengths and the statistical scatter of one observed sky.

Observer Equal comoving sound horizons

Increasing comoving distance to the ruler →

$$
\theta_* = r_s(z_*) / D_M(z_*)
$$

Schematic geometry, with both lengths comoving. Temperature peaks also carry phase shifts and projection effects.

Chapters one and two establish expansion and small perturbations. Chapters three to five connect sound, angular spectra and cosmic variance. Chapters six to eight build a likelihood, examine released lensing data and ask which model extensions the available observations can distinguish. Derivations, worked examples and explained exercises appear where each new tool becomes useful.

[Shared textbook foundations](https://github.com/yangzichao/sandboxphysics/issues/27) · [The observations behind modern cosmology](https://sandboxphysics.com/stories/astronomy-gravity/) · [FR08 research route and acceptance](https://github.com/yangzichao/sandboxphysics/issues/38)

1. L1 · 1

   ## [Following light through an expanding universe](https://sandboxphysics.com/stories/cosmology/expansion-distances/)

   Derive redshift and distance integrals, separate luminosity and angular distances, and check a numerical background against an analytic universe.

2. L2 · 2

   ## [How small fluctuations become structure](https://sandboxphysics.com/stories/cosmology/linear-perturbations/)

   Define density perturbations and gauge, derive pressureless growth, and separate gravitational attraction from expansion and pressure support.

3. L2 · 3

   ## [Why primordial sound leaves a series of peaks](https://sandboxphysics.com/stories/cosmology/acoustic-oscillations/)

   Derive a restricted photon-baryon oscillator, calculate the sound horizon, and distinguish peak spacing from the first temperature peak.

4. L2 · 4

   ## [From three-dimensional waves to an angular spectrum](https://sandboxphysics.com/stories/cosmology/transfer-and-degeneracy/)

   Connect primordial curvature, transfer functions and temperature power, then separate geometric degeneracy from frozen-grid interpolation error.

5. L3 · 5

   ## [How much can one sky tell us about its power?](https://sandboxphysics.com/stories/cosmology/one-sky-statistics/)

   Derive angular-power estimates and cosmic variance from harmonic modes, and distinguish sampling bands from confidence intervals on theoretical power.

6. L3 · 6

   ## [What a telescope adds to the sky](https://sandboxphysics.com/stories/cosmology/observing-and-likelihood/)

   Calculate Gaussian beam attenuation, follow sky-mask coupling, and distinguish an ideal full-sky likelihood from a foreground-marginalized analysis.

7. L3 · 7

   ## [Read a public lensing likelihood](https://sandboxphysics.com/stories/cosmology/lensing-likelihood/)

   Follow ACT DR6 bandpowers into a conditional amplitude fit, then see how normalized priors alter posterior intervals and model evidence.

8. L4 · 8

   ## [What sky patterns imply about dark components](https://sandboxphysics.com/stories/cosmology/dark-components-and-models/)

   Combine acoustic scales, growth and distance information to interpret conditional dark-component estimates, model extensions and unresolved tensions.

## Experiments along the route

- [Compare fixed Boltzmann spectra and nearly coincident peaks](https://sandboxphysics.com/labs/cmb-acoustic-peaks/)
- [Generate a sky and measure its angular power](https://sandboxphysics.com/labs/one-sky-cosmic-variance/)
- [Fit released lensing bandpowers with different priors](https://sandboxphysics.com/labs/cosmology-likelihood-priors/)
- [Separate a synthetic blackbody from Galactic dust](https://sandboxphysics.com/labs/cmb-spectrum-thermometer/)
- [Watch a beam smooth the same spherical-harmonic sky](https://sandboxphysics.com/labs/cmb-sky-angular-spectrum/)
- [Compare forty public supernova distances](https://sandboxphysics.com/labs/supernova-distance-expansion/)

The sky generator contains a prescribed low-multipole teaching spectrum. The acoustic experiment reads theoretical CAMB output. The inference and distance experiments use named public observations. Their labels and saved records preserve these different origins.

## Sources and calculation scope

1. [Lloyd Knox, Determination of Inflationary Observables by CMB Anisotropy Experiments, astro-ph/9504054v1 (1995)](https://arxiv.org/abs/astro-ph/9504054v1)

   Full-sky Gaussian mode counting, cosmic variance and Gaussian beam suppression. The course derives the chi-square sampling law from independent real harmonic coordinates; no inflationary forecast is reproduced.

2. [Hivon et al., MASTER of the CMB Anisotropy Power Spectrum, astro-ph/0105302v1 (2001)](https://arxiv.org/abs/astro-ph/0105302v1)

   The pseudo-angular-power estimator and ensemble mask-coupling relation. No real-sky mask inversion is performed by the full-sky teaching experiment.

3. [David Tong, Cosmology, Chapter 1](https://davidtong.org/teaching/cosmology/cosmohtml/S1)

   Sections 1.1.3–1.1.5 and 1.2–1.3 supply redshift, distances, horizons and fluid backgrounds. Course examples use explicitly flat models; the low-redshift supernova model omits radiation.

4. [David Tong, Cosmology, Chapter 3](https://davidtong.org/teaching/cosmology/cosmohtml/S3)

   Structure Formation: linear growth, pressure support, transfer functions and the microwave sky. The pressureless growth example applies inside the Hubble scale, during matter domination.

5. [Enrico Pajer, Cosmology, Part III course (2018–2019)](https://www.damtp.cam.ac.uk/user/ep551/cosmo.html)

   Course reading entry for background geometry and cosmological perturbation theory. Our Newtonian-gauge convention is defined in chapter two; this link is further study, not a claim of a numerical reproduction.

6. [Hu & Sugiyama, Small-Scale Cosmological Perturbations: An Analytic Approach, arXiv:astro-ph/9510117v2 (1996)](https://arxiv.org/abs/astro-ph/9510117v2)

   Tight-coupling acoustic physics and baryon loading. The constant-potential, constant-baryon-loading oscillator in chapter three is a restricted analytic example; the interactive spectra come from the frozen CAMB calculation.

7. [CAMB source and documentation](https://github.com/cmbant/CAMB/tree/1.6.6)

   The acoustic-grid generator pins CAMB 1.6.6, saves its full cosmological settings and checks interpolation at off-grid points. The browser interpolates a fixed grid; it does not run a Boltzmann hierarchy.

8. [Planck 2018 results. VI. Cosmological parameters, arXiv:1807.06209v4 (2021)](https://arxiv.org/html/1807.06209v4)

   Sections 2.2–2.3 define the data likelihoods, section 3.1 discusses the acoustic scale, and sections 6.2 and 7.3–7.5 separate lensing smoothing, curvature, dark energy and relativistic species. Published in A&A 641, A6 (2020), with the v4 corrigendum. This course does not reproduce the full Planck likelihood or chains.

9. [Qu et al., The Atacama Cosmology Telescope: A Measurement of the DR6 CMB Lensing Power Spectrum and Its Implications for Structure Growth, arXiv:2304.05202v3](https://arxiv.org/html/2304.05202v3)

   Section VIII.2 and Figure 25 discuss a fixed-template lensing amplitude; equation (45) in section IX.1 gives a Gaussian bandpower likelihood. Our fixed-template amplitude slice uses the released bandpowers and covariance, with the exact template and omissions documented beside the Lab.

10. [NASA LAMBDA, ACT DR6 lensing likelihood data](https://lambda.gsfc.nasa.gov/product/act/actadv_dr6_lensing_lh_info.html)

    Frozen public ACT DR6 lensing product. The data manifest records the release, original filenames, binning, template, covariance, checksums and attribution. Additional calibration uncertainty in the Lab is an explicitly chosen teaching extension.

11. [Pantheon+ public data release](https://github.com/PantheonPlusSH0ES/DataRelease)

    The existing distance Lab uses forty selected Pantheon+ supernovae and their statistical-plus-systematic covariance submatrix. Its free magnitude offset removes absolute-distance calibration; this sample does not measure the Hubble constant.
