CMB Temperature
CMB Temperature
After the Big Bang, the universe was a hot, dense plasma of photons, electrons, and protons. As the universe expanded and cooled, photons decoupled from matter at recombination (z ≈ 1089, T ≈ 3000 K). These photons now form the Cosmic Microwave Background (CMB) — the oldest light in the universe — at a temperature of T₀ = 2.725 K.
Temperature Scaling with Redshift
As the universe expands, the photon temperature scales inversely with the scale factor:
At recombination (z = 1089): T ≈ 2970 K.
Photon Number Density
The photon number density is given by the Bose-Einstein distribution:
where ζ(3) ≈ 1.20206 is the Apéry constant. At T₀ = 2.725 K, this gives roughly 411 photons/cm³ — outnumbering baryons by a factor of ~10⁹.
Constants: k_B = 1.381 × 10⁻²³ J/K, ℏ = 1.055 × 10⁻³⁴ J·s, c = 2.998 × 10⁸ m/s
Wien's Displacement Law
The peak wavelength of the CMB blackbody spectrum:
where b = 2.898 × 10⁻³ m·K. At T₀ = 2.725 K, λ_max ≈ 1.064 mm — in the microwave band.
Your Task
Implement three functions. All constants must be defined inside each function body.
cmb_temperature_at_z(z)— returns CMB temperature T(z) = T₀ × (1+z) in Kelvinphoton_number_density_m3(T_K)— returns photon number density in m⁻³cmb_peak_wavelength_mm(T_K)— returns Wien peak wavelength in millimetres