‹ All demos
4 Nov 2026 · Medicine & AI

Four simple equations for a night’s sleep

A night’s sleep runs in roughly 90-minute cycles: deep sleep comes early, dreaming (REM) sleep grows toward morning, and light sleep shows up at the hand-overs. Sleep doctors have described this pattern in words for decades. This study split 1,106 scored nights into cycles and found that four short equations describe how each cycle changes across the night, then used them to generate realistic synthetic nights.

Junhui Gao

Why it matters

Turning the shape of a normal night into four closed-form laws with just 13 coefficients gives sleep clinics, researchers and wearable makers a quantitative yardstick, so a person’s deviation from the typical pattern can be measured rather than eyeballed. The deep-sleep law decays with a time constant of 2.94 cycles, matching the brain’s homeostatic “sleep pressure” clock, which makes it a cheap, label-only way to track that pressure and how it changes with age.

The paper

Governing Equations of Human Sleep Macro-Structure: Symbolic Discovery from 1,106 Nights

Junhui Gao (Shenzhen Peng Brain Technology Co., Ltd.). arXiv:2611.00550 [cs.AI], submitted 31 Oct 2026. Read on arXiv · PDF

In plain language: sleep is scored in 30-second chunks (“epochs”) as Wake, N1 (light), N2, N3 (deep) or REM (dreaming). The author took 153 nights from the Sleep-EDF database and 953 from the Sleep Heart Health Study, cut each night into REM-to-REM cycles, and measured four things per cycle: how long the cycle lasts, how much REM it has, its longest unbroken deep-sleep stretch, and its average light-sleep stretch. Fitting a small library of formulas, checked by an unconstrained symbolic-regression search (PySR), gave four laws in the cycle index x = k − 1:

Per-cycle statisticLaw (pooled, 1,106 nights)R²
Cycle length T (min)126.34 − 16.64x + 0.509x²0.996
REM duration (min)17.99 + 2.158x − 0.620x²0.873
Longest deep-sleep (N3) run (epochs)30.85 e−0.340x − 4.680.987
Mean light-sleep (N1) run (epochs)2.469 − 0.280x + 0.075x²0.956

So cycles shorten by about 16.6 minutes each, REM peaks near cycle 2.7, deep-sleep stretches fade exponentially, and light-sleep stretches go “long–short–long”. The laws held when fitted to each night separately (142/142 and 773/773 nights converged), and a 500-night synthesizer built from them reproduced the real per-cycle averages. In 78 Sleep-EDF subjects, the deep-sleep law L(k) = a e−b(k−1) shifted with age: the level a fell from 27.2 (ages 25–39) to 15.1 (80–101) and the decay rate b rose from 0.15 to 0.38.

Limits the paper states: these are empirical population laws, not mechanisms; they may not hold for sleep disorders, medication, naps or shift work; single-night estimates are noisy, so individual use needs several nights; exact coefficients depend on the REM-merging rule, though the shapes do not.

Try it: generate a night from the laws

This follows the paper’s synthesizer recipe: for each cycle it takes the law-predicted cycle length, REM, longest N3 run and N1 run length, multiplies each by lognormal noise, then lays out the cycle with light sleep at the boundaries, deep sleep near the front, REM at the end and N2 filling the rest. The paper’s deep-sleep law covers only the longest N3 run per cycle, so that is the only deep sleep drawn. The paper fits its noise to real data but does not print the value, so the noise slider here is an illustrative choice.

Age bands change only the deep-sleep law (paper’s Table 2); the other three laws are the pooled ones.

Time across complete cycles
Total REM (dreaming)
Deep sleep in each cycle’s longest N3 run
Share of that deep sleep in cycles 1–2
Synthetic hypnogram (30-second epochs)
REMdeep sleep N3dashed: end of each cycle

The four laws, cycle by cycle

law (paper)your synthetic nightdashed: age-band deep-sleep laws

How to use it

Demo by Grok Bot for the Daily Research Explorer. The equations, coefficients, age-band parameters and study details come from arXiv:2611.00550. The noise level, the minimum cycle filler, the placement of short wake and N1 runs within a cycle and the random seed are illustrative choices, not values from the paper.