---
title: "Formulas - Paper Gallery"
description: "A short paper set in mathematics: why the sample variance divides by n - 1, in numbered display equations, inline formulas, an aligned derivation and a table - and how it prints."
slug: "paper-math"
---

import { DocPage, PageHeader, DocLink, SourceFiles } from "../../lib/components/index";

<DocPage meta={meta}>

<PageHeader slug="paper-math" title="Formulas" component="paper">
  A paper that argues in equations. Each display equation is a <DocLink href="math-renderer.html">Formula Rendering</DocLink> element in a numbered <code>.paper-equation</code>, inline formulas sit in the sentence, and the derivation aligns at its equals signs - typeset by KaTeX, spoken as MathML. The subject is a classic: why the sample variance divides by n - 1.
</PageHeader>

```html example label="Why n - 1" schema="none" hint="Every formula is TeX in a code element - readable before KaTeX arrives, copyable after. A numbered equation is a .paper-equation: the formula centered in the column, its number at the edge; the text refers to it by that number." previewStyle="align-items:stretch;padding:0;"
<article class="paper" data-print="a4" aria-labelledby="pm-title">
  <header class="paper-hero">
    <p class="paper-venue"
      ><span class="badge" data-variant="secondary">Note</span
      ><span>defuss-shadcn · <time datetime="2026-10-13">13 October 2026</time></span></p
    >
    <h1 class="paper-title" id="pm-title"
      >Why n - 1<span class="paper-title-sub">Bessel's correction for the sample variance, in five equations</span></h1
    >
    <ul class="paper-authors"
      ><li>Claude</li
      ><li>Aron Homberg</li></ul
    >
  </header>

  <section class="paper-abstract" aria-labelledby="pm-abstract">
    <h2 id="pm-abstract">Abstract</h2>
    <p
      >The sample variance divides the sum of squared deviations by n - 1, not by n. The deviations are measured from
      the sample mean, which lies closer to the data than the true mean does; on average the sum falls short by exactly
      one variance. Dividing by n - 1 makes the estimate unbiased.</p
    >
  </section>

  <section class="paper-section" aria-labelledby="pm-s1">
    <h2 id="pm-s1"><span class="paper-num">1&nbsp;</span>Setup</h2>
    <p
      >Let
      <span class="math-renderer" data-variant="inline"><code class="math-renderer-source">x_1, \dots, x_n</code></span>
      be independent observations with mean
      <span class="math-renderer" data-variant="inline"><code class="math-renderer-source">\mu</code></span>
      and variance
      <span class="math-renderer" data-variant="inline"><code class="math-renderer-source">\sigma^2</code></span
      >. Their mean is</p
    >
    <div class="paper-equation" id="pm-eq1">
      <figure class="math-renderer" aria-label="Equation 1: the sample mean">
        <code class="math-renderer-source">\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i</code>
      </figure>
      <span class="paper-equation-num">(1)</span>
    </div>
    <p>and the first estimate of the variance that comes to mind averages the squared deviations from it:</p>
    <div class="paper-equation" id="pm-eq2">
      <figure class="math-renderer" aria-label="Equation 2: the naive variance">
        <code class="math-renderer-source">\hat{\sigma}^2 = \frac{1}{n} \sum_{i=1}^{n} (x_i - \bar{x})^2</code>
      </figure>
      <span class="paper-equation-num">(2)</span>
    </div>
  </section>

  <section class="paper-section" aria-labelledby="pm-s2">
    <h2 id="pm-s2"><span class="paper-num">2&nbsp;</span>The expected sum</h2>
    <p
      >Split each deviation at the true mean. The cross term collapses because the deviations from the true mean add up
      to
      <span class="math-renderer" data-variant="inline"><code class="math-renderer-source">n(\bar{x} - \mu)</code></span
      >:</p
    >
    <div class="paper-equation" id="pm-eq3">
      <figure class="math-renderer" aria-label="Equation 3: the sum of squared deviations, split at the true mean">
        <code class="math-renderer-source"
          >\begin{aligned} \sum_{i=1}^{n} (x_i - \bar{x})^2 &amp;= \sum_{i=1}^{n} \big((x_i - \mu) - (\bar{x} -
          \mu)\big)^2 \\ &amp;= \sum_{i=1}^{n} (x_i - \mu)^2 - n(\bar{x} - \mu)^2 \end{aligned}</code
        >
      </figure>
      <span class="paper-equation-num">(3)</span>
    </div>
    <p
      >Each
      <span class="math-renderer" data-variant="inline"><code class="math-renderer-source">(x_i - \mu)^2</code></span>
      has expectation
      <span class="math-renderer" data-variant="inline"><code class="math-renderer-source">\sigma^2</code></span
      >, and the mean of n independent observations has variance
      <span class="math-renderer" data-variant="inline"><code class="math-renderer-source">\sigma^2 / n</code></span
      >. Taking expectations in (3):</p
    >
    <div class="paper-equation" id="pm-eq4">
      <figure class="math-renderer" aria-label="Equation 4: the expected sum of squared deviations">
        <code class="math-renderer-source"
          >\mathbb{E}\Big[\sum_{i=1}^{n} (x_i - \bar{x})^2\Big] = n\sigma^2 - n \cdot \frac{\sigma^2}{n} = (n -
          1)\,\sigma^2</code
        >
      </figure>
      <span class="paper-equation-num">(4)</span>
    </div>
  </section>

  <section class="paper-section" aria-labelledby="pm-s3">
    <h2 id="pm-s3"><span class="paper-num">3&nbsp;</span>The correction</h2>
    <p>By (4), the sum divided by n - 1 has the true variance as its expectation:</p>
    <div class="paper-equation" id="pm-eq5">
      <figure class="math-renderer" aria-label="Equation 5: the unbiased sample variance">
        <code class="math-renderer-source"
          >s^2 = \frac{1}{n - 1} \sum_{i=1}^{n} (x_i - \bar{x})^2, \qquad \mathbb{E}[s^2] = \sigma^2</code
        >
      </figure>
      <span class="paper-equation-num">(5)</span>
    </div>
    <p
      >The estimate (2) is low by the factor
      <span class="math-renderer" data-variant="inline"><code class="math-renderer-source">(n - 1) / n</code></span>
      - by half for two observations, by a few percent for thirty.</p
    >
    <figure class="paper-table">
      <table class="table">
        <thead
          ><tr><th scope="col">Observations n</th><th scope="col" data-num>Expected (2) / σ²</th></tr></thead
        >
        <tbody>
          <tr><td>2</td><td data-num>0.500</td></tr>
          <tr><td>5</td><td data-num>0.800</td></tr>
          <tr><td>10</td><td data-num>0.900</td></tr>
          <tr><td>30</td><td data-num>0.967</td></tr>
        </tbody>
      </table>
      <figcaption class="paper-table-caption"
        ><b>Table 1.</b> How far the naive estimate (2) falls short on average.</figcaption
      >
    </figure>
  </section>
</article>
```

## Print layout

```html example label="Printed: the equations keep their numbers" mode="print" schema="none" hint="The preview boots in the Print device: an A4 sheet whose print styles apply. A display equation never breaks across a page; its number stays at the edge of the column." previewStyle="align-items:stretch;padding:0;"
<article class="paper" data-print="a4" aria-labelledby="pmp-title">
  <header class="paper-hero">
    <h1 class="paper-title" id="pmp-title">Why n - 1</h1>
  </header>
  <section class="paper-section" aria-labelledby="pmp-s1">
    <h2 id="pmp-s1"><span class="paper-num">1&nbsp;</span>The expected sum</h2>
    <p>Split each deviation at the true mean, then take expectations:</p>
    <div class="paper-equation">
      <figure class="math-renderer" aria-label="Equation 3">
        <code class="math-renderer-source"
          >\begin{aligned} \sum_{i=1}^{n} (x_i - \bar{x})^2 &amp;= \sum_{i=1}^{n} (x_i - \mu)^2 - n(\bar{x} - \mu)^2
          \end{aligned}</code
        >
      </figure>
      <span class="paper-equation-num">(3)</span>
    </div>
    <div class="paper-equation">
      <figure class="math-renderer" aria-label="Equation 4">
        <code class="math-renderer-source"
          >\mathbb{E}\Big[\sum_{i=1}^{n} (x_i - \bar{x})^2\Big] = (n - 1)\,\sigma^2</code
        >
      </figure>
      <span class="paper-equation-num">(4)</span>
    </div>
    <p>Dividing by n - 1 makes the estimate unbiased.</p>
  </section>
</article>
```

<SourceFiles component="paper" />
</DocPage>
