Перейти к содержанию

Этот урок ещё не переведён на русский язык, поэтому показан на английском.

Начало урока

Fractions Are Stored Approximately

Integers bent to the finite cell and survived: a range appeared, a sign became a reading, but every integer inside the range is stored exactly. Fractions will not be so lucky. Today the finite cell meets an infinite enemy — and loses, honestly, by an argument you can count on your fingers. Every language on Earth inherits the loss.

Learning goals: derive why storing all fractions exactly is impossible in principle; explain what a fraction agreement actually chooses; and carry away the two practical laws — never compare fractions for exact equality, and never count money in fractions.

The counting argument

How many fractions live between 0 and 1? Infinitely many: 1/2, 1/3, 1/4, … and between any two of them, more. How many values can a cell represent? Finitely many — the previous lessons' fixed catalog (a million, for our six-digit toy). Now the argument, complete in one sentence:

A finite catalog cannot give a distinct entry to each of infinitely many fractions — so storing all fractions exactly is impossible in principle, for any cell size, any machine, any language, forever.

This is not a limitation to be engineered away next decade — it is arithmetic: infinite into finite does not go without loss. Every fraction agreement is therefore a choice of casualties: which fractions get an exact catalog entry, and which are replaced by the nearest stored neighbor. Our toy machine's simplest such agreement: "the cell holds the fraction's first six digits after the point" — it stores 0.5 exactly, and replaces 1/3 with 0.333333, forever short of the truth by a sliver that no widening of the cell eliminates (0.3333333333 is still not 1/3).

Продолжите этот урок на YourAIZone

В полном уроке — объяснение целиком, разобранные примеры, частые ошибки, тесты с мгновенной проверкой и ИИ-репетитор. Начните сразу как гость или создайте аккаунт, чтобы сохранять прогресс.

В полном уроке

  • Объяснение целиком
  • Разобранные примеры
  • Частые ошибки и как их избежать
  • Тестовые вопросы: 2
  • ИИ-репетитор, который отвечает на вопросы по теме
  • Отслеживание прогресса для ученика, родителей и учителя