liveBook · Manning

Real number

As explained in Grokking Statistics

A real number is any number that can be represented as a point on the continuous number line.

A real number is any value that can be placed on a continuous number line. Real numbers describe measurements that may include decimal parts, such as 6.73 miles, 5.32 miles, or half a gallon. They include rational numbers, which can be written as ratios, and irrational numbers, such as pi, e, and the square root of 2, which cannot. section 2.11

Working with real numbers involves a distinction between mathematical values and their computer representations:

  • Rational values include fractions, finite decimals, and repeating decimals; Python can display examples such as 2/3, 1.572, and 55/7. section 2.11
  • Irrational values have infinitely many nonrepeating decimal digits, so Python stores approximations such as 3.141592653589793 for pi. section 2.11
  • Floating-point formats use limited bits, so calculations can introduce small precision errors; libraries may provide techniques for avoiding underflow and related problems. section 2.11

Whole-number measurements can still be continuous

Baristas report coffee amounts in whole grams because scales and workflows limit practical precision. The underlying amount remains continuous: a cup could theoretically require any value between those measurements. A sample with mean 27.6 grams, median 28.0 grams, and standard deviation 3.2 grams can therefore be modeled with a continuous normal distribution. section 4.3

How Grokking Statistics covers it

How deep it goes
Defines rational and irrational values, then explains floating-point approximation and precision limits without deriving numerical representations.
Examples
Uses fractions, decimals, pi, e, square root of 2, biking distances, milk quantities, and coffee-weight measurements.
What it assumes
Assumes familiarity with basic numbers and decimals while introducing rational, irrational, continuous, and floating-point ideas incrementally.
What you can do after
Evaluate/understand why measured data can be continuous and why computer decimal values may contain small approximation errors.
How it connects
Connects real numbers with rational numbers, irrational numbers, floating-point arithmetic, continuous distributions, and normal distributions.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Statistics. The section links point to the parts of the book it draws on.