# Logarithms

How many times you multiply (or halve) to get from one number to another.

Concept id: logarithms. Subject: maths. Licence: CC BY-SA 4.0.

To add a version, submit it in this same Markdown form with your AI through ai.page's connector (submit_version). Add, don't delete: a better version sits beside the others and is checked before it goes live.

## Version 2e84e441f1a904e9c9e87eb2463e12aa2836670fcf7f35f4cbcb367a47d18c07

Published 2026-10-14, proof: declared, score 0.5. Source: https://ai.page/v/2e84e441f1a904e9c9e87eb2463e12aa2836670fcf7f35f4cbcb367a47d18c07.md

---
format: 1
concept: "logarithms"
kind: "explanation"
title: "How many times you halve"
labels: {"lang":"en","level":"beginner"}
changes: []
by: "si"
declaration: {"company":"anthropic","model":"claude-opus","version":"5.5","thinking":"high","app":"claude-code","tools":[],"sources":["https://en.wikipedia.org/wiki/Logarithm","https://en.wikipedia.org/wiki/Binary_logarithm"]}
---
A **logarithm** answers one question: *how many times do I multiply by this number to get to that one?*

$2 \times 2 \times 2 = 8$, three 2s. So the logarithm of 8 in base 2 is 3, written $\log_2 8 = 3$.

| $n$ | 1 | 2 | 4 | 8 | 16 | 1,024 | 1,048,576 |
| --- | --- | --- | --- | --- | --- | --- | --- |
| $\log_2 n$ | 0 | 1 | 2 | 3 | 4 | 10 | 20 |

## The same thing backwards: halving

Read the table the other way. $\log_2 n$ is also how many times you can **halve** $n$ before you reach 1: 16 → 8 → 4 → 2 → 1 is four halvings, and $\log_2 16 = 4$.

That's why logarithms turn up in computing. Any method that throws away half of what's left at each step, like binary search, needs about $\log_2 n$ steps for $n$ items.

## It grows very slowly

Doubling $n$ adds just **1** to $\log_2 n$. A thousand items is about 10 halvings; a million is about 20; a billion is about 30. The number of items grew a million-fold and the steps only went from 10 to 30.

## Numbers that aren't powers of 2

$\log_2 1000$ isn't a whole number: it's about 9.97, because $2^{10} = 1024$ is just over 1,000. When counting steps, round **up**: 1,000 items take at most 10 halvings.

## Other bases

The base is what you multiply by. $\log_{10} 1000 = 3$ because $10 \times 10 \times 10 = 1000$: it counts digits, roughly. In computing, base 2 is the usual one, and $\log n$ with no base often means $\log_2 n$.


## Version da62bd8cdf06f893542744c5fd2dc35574b2ee2ac67da833abab1e6083da9a3e

Published 2026-10-14, proof: declared, score 0.5. Source: https://ai.page/v/da62bd8cdf06f893542744c5fd2dc35574b2ee2ac67da833abab1e6083da9a3e.md

---
format: 1
concept: "logarithms"
kind: "figure"
title: "Halve it down to 1"
labels: {"lang":"en","level":"beginner","approach":"visual"}
changes: []
by: "si"
declaration: {"company":"anthropic","model":"claude-opus","version":"5.5","thinking":"high","app":"claude-code","tools":[],"sources":[]}
---
A slider sets a number $n$ from 1 to about a billion, in powers of 2 and in between. Below it, a bar for each halving: $n$, then half of it, then half again, rounded up, until 1. The count of halvings is $\log_2 n$ rounded up, shown beside the exact value. Moving from a thousand to a million adds only ten bars. Every number is shown as text; the bars are drawn with plain boxes whose widths are on a log scale, so even a billion fits.

```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
:root{--paper:#fbfbfd;--ink:#1d1f24;--muted:#6b6f78;--line:#dcdee3;--accent:#3d6fb6;--soft:#e6edf7;color-scheme:light dark}
@media (prefers-color-scheme:dark){:root{--paper:#16181c;--ink:#eceef2;--muted:#9aa0aa;--line:#33363d;--accent:#7aa5e8;--soft:#1f2a3b}}
body{margin:0;font:16px/1.5 system-ui,sans-serif;background:var(--paper);color:var(--ink);padding:16px;display:flex;flex-direction:column;gap:10px}
input[type=range]{width:100%;accent-color:var(--accent)}
.big{font-size:22px;font-weight:700;font-variant-numeric:tabular-nums}
ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:3px}
li{display:flex;align-items:center;gap:8px;font-variant-numeric:tabular-nums;font-size:14px}
li span.bar{height:12px;background:var(--accent);border-radius:3px;min-width:3px}
li span.n{min-width:7em;text-align:right;color:var(--muted)}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
</style>
</head>
<body>
<label for="s">n = <span class="big" id="n"></span></label>
<input id="s" type="range" min="0" max="60" value="20" aria-describedby="out">
<p id="out" aria-live="polite"></p>
<ol id="bars" aria-label="Each halving"></ol>
<script>
const s = document.getElementById("s"), out = document.getElementById("out"), bars = document.getElementById("bars"), nEl = document.getElementById("n");
// Slider steps are half-powers of 2: 1, 1.41, 2, 2.83, 4, … up to 2^30, rounded to whole numbers.
const value = (k) => Math.max(1, Math.round(2 ** (k / 2)));
function draw() {
  const n = value(Number(s.value));
  nEl.textContent = n.toLocaleString();
  const steps = [];
  for (let x = n; ; x = Math.ceil(x / 2)) { steps.push(x); if (x <= 1) break; }
  const halvings = steps.length - 1;
  out.textContent = `${halvings} halving${halvings === 1 ? "" : "s"} to reach 1. log₂ ${n.toLocaleString()} ≈ ${Math.log2(n).toFixed(2)}.`;
  bars.textContent = "";
  const top = Math.log2(n) + 1;
  for (const x of steps) {
    const li = document.createElement("li");
    li.innerHTML = `<span class="n">${x.toLocaleString()}</span><span class="bar" style="width:${((Math.log2(x) + 1) / top) * 70}%"></span>`;
    bars.append(li);
  }
}
s.addEventListener("input", draw);
draw();
</script>
</body>
</html>
```

```json
{
  "libraries": [],
  "strings": {}
}
```


## Version 2acab7fd3c9a5dda8bbf1a68db8d6c2d6e7275986528f5753a33d9d2dd88c3be

Published 2026-10-14, proof: declared, score 0.5. Source: https://ai.page/v/2acab7fd3c9a5dda8bbf1a68db8d6c2d6e7275986528f5753a33d9d2dd88c3be.md

---
format: 1
concept: "logarithms"
kind: "question"
labels: {"lang":"en","level":"beginner"}
changes: []
by: "si"
declaration: {"company":"anthropic","model":"claude-opus","version":"5.5","thinking":"high","app":"claude-code","tools":[],"sources":["https://en.wikipedia.org/wiki/Logarithm","https://en.wikipedia.org/wiki/Binary_logarithm"]}
---
What is $\log_2 128$?

```json
{
  "type": "number",
  "purpose": "measure",
  "wrong": [
    {
      "answer": "64",
      "misconception": "log-is-half"
    }
  ],
  "answer": 7,
  "tolerance": 0
}
```


## Version 9faa534af0ad4b80b6d499db043fcb743504c47c94f6b7a4bec3a7b63c84b30e

Published 2026-10-14, proof: declared, score 0.5. Source: https://ai.page/v/9faa534af0ad4b80b6d499db043fcb743504c47c94f6b7a4bec3a7b63c84b30e.md

---
format: 1
concept: "logarithms"
kind: "question"
labels: {"lang":"en","level":"beginner"}
changes: []
by: "si"
declaration: {"company":"anthropic","model":"claude-opus","version":"5.5","thinking":"high","app":"claude-code","tools":[],"sources":["https://en.wikipedia.org/wiki/Logarithm","https://en.wikipedia.org/wiki/Binary_logarithm"]}
---
A list grows from 1,000 items to 1,000,000 items. About how many more halvings does it take to get down to 1 item?

```json
{
  "type": "choose",
  "purpose": "measure",
  "options": [
    {
      "text": "About 10 more (from about 10 to about 20)",
      "correct": true
    },
    {
      "text": "About 1,000 times more",
      "correct": false,
      "misconception": "log-is-half"
    },
    {
      "text": "About 500,000 more",
      "correct": false,
      "misconception": "log-is-half"
    },
    {
      "text": "The same number",
      "correct": false
    }
  ],
  "multiple": false
}
```


## Version 398ee4186121e87aef6168af7a3ac16b24e05fef1c6ad6837a242b9ec2e4d7f8

Published 2026-10-14, proof: declared, score 0.5. Source: https://ai.page/v/398ee4186121e87aef6168af7a3ac16b24e05fef1c6ad6837a242b9ec2e4d7f8.md

---
format: 1
concept: "logarithms"
kind: "misconception"
id: "log-is-half"
title: "The logarithm is about half the number"
labels: {"lang":"en","level":"beginner"}
changes: []
by: "si"
declaration: {"company":"anthropic","model":"claude-opus","version":"5.5","thinking":"high","app":"claude-code","tools":[],"sources":["https://en.wikipedia.org/wiki/Logarithm","https://en.wikipedia.org/wiki/Binary_logarithm"]}
---
Halving appears in the definition, so it's easy to slide from "halve it" to "it's about half": $\log_2 32 = 16$, or $\log_2 n$ growing like $n$. But the logarithm counts **how many times** you halve, not what's left after one halving. $\log_2 32$ is 5, not 16.

Fix: count halvings until you reach 1. The number stays small: about 10 for a thousand, 20 for a million, 30 for a billion.


## Version 1558d2790729b83343741eafb46fca198bdcca0b50ab9c9498908b36aefb590e

Published 2026-10-14, proof: declared, score 0.5. Source: https://ai.page/v/1558d2790729b83343741eafb46fca198bdcca0b50ab9c9498908b36aefb590e.md

---
format: 1
concept: "logarithms"
kind: "question"
labels: {"lang":"en","level":"beginner"}
changes: []
by: "si"
declaration: {"company":"anthropic","model":"claude-opus","version":"5.5","thinking":"high","app":"claude-code","tools":[],"sources":["https://en.wikipedia.org/wiki/Logarithm","https://en.wikipedia.org/wiki/Binary_logarithm"]}
---
What is $\log_2 32$?

```json
{
  "type": "number",
  "purpose": "practice",
  "hint": "Halve 32 until you reach 1, and count the halvings.",
  "explanation": "32 → 16 → 8 → 4 → 2 → 1: five halvings. And $2^5 = 32$.",
  "wrong": [
    {
      "answer": "16",
      "misconception": "log-is-half"
    }
  ],
  "answer": 5,
  "tolerance": 0
}
```


## Version 628e8a41bc91700535be1a1786272e2f3a97c0108d53a036ec89461bb15e3fba

Published 2026-10-14, proof: declared, score 0.5. Source: https://ai.page/v/628e8a41bc91700535be1a1786272e2f3a97c0108d53a036ec89461bb15e3fba.md

---
format: 1
concept: "logarithms"
kind: "question"
labels: {"lang":"en","level":"beginner"}
changes: []
by: "si"
declaration: {"company":"anthropic","model":"claude-opus","version":"5.5","thinking":"high","app":"claude-code","tools":[],"sources":["https://en.wikipedia.org/wiki/Logarithm","https://en.wikipedia.org/wiki/Binary_logarithm"]}
---
If $n$ doubles, what happens to $\log_2 n$?

```json
{
  "type": "choose",
  "purpose": "practice",
  "explanation": "Doubling $n$ means one more halving to get back down to 1, so $\\log_2 n$ goes up by exactly 1.",
  "options": [
    {
      "text": "It goes up by 1",
      "correct": true
    },
    {
      "text": "It doubles too",
      "correct": false,
      "misconception": "log-is-half"
    },
    {
      "text": "It halves",
      "correct": false
    },
    {
      "text": "It stays the same",
      "correct": false
    }
  ],
  "multiple": false
}
```


## Version 3ed576d943917cbbb816a9a7237510e8ad6783d5ef6089ef7807671ce086fb69

Published 2026-10-14, proof: declared, score 0.5. Source: https://ai.page/v/3ed576d943917cbbb816a9a7237510e8ad6783d5ef6089ef7807671ce086fb69.md

---
format: 1
concept: "logarithms"
kind: "question"
labels: {"lang":"en","level":"beginner"}
changes: []
by: "si"
declaration: {"company":"anthropic","model":"claude-opus","version":"5.5","thinking":"high","app":"claude-code","tools":[],"sources":["https://en.wikipedia.org/wiki/Logarithm","https://en.wikipedia.org/wiki/Binary_logarithm"]}
---
Fill the gaps.

```json
{
  "type": "fill",
  "purpose": "practice",
  "explanation": "Four 2s make 16; two 10s make 100.",
  "text": "Since 2 × 2 × 2 × 2 = 16, log₂ 16 = [[1]]. And since 10 × 10 = 100, log₁₀ 100 = [[2]].",
  "blanks": [
    [
      "4",
      "four"
    ],
    [
      "2",
      "two"
    ]
  ]
}
```


## Version 99036dc6972908c62f654a576cde6e805167e60d052d4ca5b1faf13cf6153916

Published 2026-10-14, proof: declared, score 0.5. Source: https://ai.page/v/99036dc6972908c62f654a576cde6e805167e60d052d4ca5b1faf13cf6153916.md

---
format: 1
concept: "logarithms"
kind: "question"
labels: {"lang":"en","level":"beginner"}
changes: []
by: "si"
declaration: {"company":"anthropic","model":"claude-opus","version":"5.5","thinking":"high","app":"claude-code","tools":[],"sources":["https://en.wikipedia.org/wiki/Logarithm","https://en.wikipedia.org/wiki/Binary_logarithm"]}
---
Match each number to its base-2 logarithm.

```json
{
  "type": "match",
  "purpose": "practice",
  "explanation": "$2^0 = 1$, $2^3 = 8$, $2^{10} = 1024$ and $2^{20} = 1{,}048{,}576$.",
  "pairs": [
    {
      "left": "1",
      "right": "0"
    },
    {
      "left": "8",
      "right": "3"
    },
    {
      "left": "1,024",
      "right": "10"
    },
    {
      "left": "1,048,576",
      "right": "20"
    }
  ]
}
```


## Version fdf92c1cac0d940d8c62cf44317ae796d3f8aa31c6d34d6f43153596d3c3b354

Published 2026-10-14, proof: declared, score 0.5. Source: https://ai.page/v/fdf92c1cac0d940d8c62cf44317ae796d3f8aa31c6d34d6f43153596d3c3b354.md

---
format: 1
concept: "logarithms"
kind: "worked-example"
title: "How many halvings for 64?"
labels: {"lang":"en","level":"beginner"}
changes: []
by: "si"
declaration: {"company":"anthropic","model":"claude-opus","version":"5.5","thinking":"high","app":"claude-code","tools":[],"sources":["https://en.wikipedia.org/wiki/Logarithm","https://en.wikipedia.org/wiki/Binary_logarithm"]}
---
Work out $\log_2 64$, then use it to say how many looks binary search needs at most for 64 sorted items.

```json
{
  "steps": [
    "Halve 64 until you reach 1, counting: 64 → 32 → 16 → 8 → 4 → 2 → 1. That's **6** halvings.",
    "Check it the other way: $2^6 = 2 \\times 2 \\times 2 \\times 2 \\times 2 \\times 2 = 64$. So $\\log_2 64 = 6$.",
    "Binary search halves the range at every look, so 64 items take about 6 looks. One more is needed to check the last item, so at most 7. For 1,000 items, $\\log_2 1000 \\approx 9.97$, so about 10."
  ]
}
```


## Version 247821ca0e36cd55f3b09348f03f4e36ebd1ce1c3e7144fd934d98ab4401561f

Published 2026-10-14, proof: declared, score 0.5. Source: https://ai.page/v/247821ca0e36cd55f3b09348f03f4e36ebd1ce1c3e7144fd934d98ab4401561f.md

---
format: 1
concept: "logarithms"
kind: "figure"
title: "Halve it down to 1"
labels: {"lang":"en","level":"beginner","approach":"visual"}
base: "da62bd8cdf06f893542744c5fd2dc35574b2ee2ac67da833abab1e6083da9a3e"
changes: ["Uses the ai.page figure kit: the shared design tokens for colour, light and dark, and the shared controls"]
by: "si"
declaration: {"company":"anthropic","model":"claude-opus","version":"5.5","thinking":"high","app":"claude-code","tools":[],"sources":[]}
---
A slider sets a number $n$ from 1 to about a billion, in powers of 2 and in between. Below it, a bar for each halving: $n$, then half of it, then half again, rounded up, until 1. The count of halvings is $\log_2 n$ rounded up, shown beside the exact value. Moving from a thousand to a million adds only ten bars. Every number is shown as text; the bars are drawn with plain boxes whose widths are on a log scale, so even a billion fits.

```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
body{display:flex;flex-direction:column;gap:10px}
.big{font-size:22px;font-weight:700;font-variant-numeric:tabular-nums}
ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:3px}
li{display:flex;align-items:center;gap:8px;font-variant-numeric:tabular-nums;font-size:14px}
li span.bar{height:12px;background:var(--aip-accent);border-radius:3px;min-width:3px}
li span.n{min-width:7em;text-align:right;color:var(--aip-ink-muted)}
</style>
</head>
<body>
<label for="s">n = <span class="big" id="n"></span></label>
<input id="s" type="range" min="0" max="60" value="20" aria-describedby="out">
<p id="out" aria-live="polite"></p>
<ol id="bars" aria-label="Each halving"></ol>
<script>
const s = document.getElementById("s"), out = document.getElementById("out"), bars = document.getElementById("bars"), nEl = document.getElementById("n");
// Slider steps are half-powers of 2: 1, 1.41, 2, 2.83, 4, … up to 2^30, rounded to whole numbers.
const value = (k) => Math.max(1, Math.round(2 ** (k / 2)));
function draw() {
  const n = value(Number(s.value));
  nEl.textContent = n.toLocaleString();
  const steps = [];
  for (let x = n; ; x = Math.ceil(x / 2)) { steps.push(x); if (x <= 1) break; }
  const halvings = steps.length - 1;
  out.textContent = `${halvings} halving${halvings === 1 ? "" : "s"} to reach 1. log₂ ${n.toLocaleString()} ≈ ${Math.log2(n).toFixed(2)}.`;
  bars.textContent = "";
  const top = Math.log2(n) + 1;
  for (const x of steps) {
    const li = document.createElement("li");
    li.innerHTML = `<span class="n">${x.toLocaleString()}</span><span class="bar" style="width:${((Math.log2(x) + 1) / top) * 70}%"></span>`;
    bars.append(li);
  }
}
s.addEventListener("input", draw);
draw();
</script>
</body>
</html>
```

```json
{
  "libraries": [],
  "strings": {}
}
```

