Kayavak / Recaps / Arithmetic and Numbers
Recaps · Book 1
Arithmetic and Numbers
The revision sheet of every chapter, on one page: the key ideas, the numbers worth knowing, the pitfalls and the words. Use it before an interview, after a chapter, or to find which chapter to reread. Each title opens its chapter; below each sheet are its exercises, companion and TiffinBox stage, and the misconceptions the companion corrects.
01
Key ideas
- One-to-one correspondence (pairing) defines "same size"; counting is pairing with the counting words.
- A number is a quantity; a numeral is a name for it. Numbers do cardinal, ordinal and nominal jobs; arithmetic applies to quantities.
- Natural numbers 0, 1, 2, … never end: every number has a successor.
- Addition combines; subtraction takes away, compares, or finds a missing part, and is the inverse of addition.
- Multiplication is repeated addition, a rectangle, or scaling; division is sharing or grouping, and is the inverse of multiplication.
- Commutative, associative, distributive and the identities follow from the stories; subtraction and division are neither commutative nor associative.
- Division by zero is undefined; is undefined too.
- Order of operations is a convention: brackets, powers, then × and ÷ left to right, then + and − left to right; power towers read top down.
Glossary
- One-to-one correspondence: a pairing of two collections in which every item on each side has exactly one partner on the other.
- Numeral: a symbol or string of symbols that names a number, such as 7, VII or सात.
- Cardinal number: a number used to say how many.
- Ordinal number: a number used to say which position in an order (first, second, third).
- Nominal number: a numeral used only as a label, like a phone number or pincode, on which arithmetic is meaningless.
- Natural numbers: 0, 1, 2, 3, …, each the successor of the one before (some books start at 1).
- Successor: the next natural number, obtained by adding one.
- Partitive division: division as sharing, where the number of groups is known and the size of each is wanted.
- Quotitive division: division as grouping (or measuring), where the size of each group is known and the number of groups is wanted.
- Commutative property: an operation is commutative when swapping its inputs doesn't change the result, as with .
- Associative property: an operation is associative when the grouping of a chain doesn't change the result, as with .
- Distributive property: multiplication distributes over addition: .
- Identity element: a number that leaves others unchanged under an operation: 0 for addition, 1 for multiplication.
- Inverse operation: an operation that undoes another: subtraction undoes addition, division undoes multiplication.
- Order of operations: the agreed convention for evaluating an expression without brackets: brackets, powers, multiplication and division left to right, addition and subtraction left to right.
Practise: Exercises · Companion · Household Numbers stage
Misconceptions (from the companion)
| Misconception |
What's actually true |
| " is undefined, like ." |
It's a matter of convention: algebra and every mainstream language take ; analysis leaves it undefined. |
| "There's only one zero in a computer." |
IEEE 754 floats have +0 and −0; they compare equal, but 1 / -0 is -Infinity. |
| "Brackets in code are only for when you need them." |
Unneeded brackets are often worth keeping for readers; ast.unparse removes them, which shows exactly which ones the grammar needs. |
| "An ID made of digits is a number." |
It's a label; stored as a number it loses leading zeros and, in JavaScript, digits beyond . |
| "The average of daily averages is the average." |
Only when every day has the same count; otherwise compute from totals. |
02
Key ideas
- Place value: each position is worth the base times the position to its right; a digit's value is digit × .
- Zero holds an empty place; without it positions slide and numerals become ambiguous.
- Digits are smaller than the base: base uses 0 to ; hex uses A–F for 10–15.
- Counting is an odometer: a digit rolls over to 0 and carries one to the left.
- -digit numbers in base run from to ; there are of them; has digits.
- To decimal: expand, or read left to right with "× base, + digit" (Horner).
- From decimal: repeated division; remainders are the digits, last first.
- Binary ↔ octal/hex: group bits in threes or fours from the right.
- Every number has exactly one numeral in base (no leading zeros).
- Grouping (millions or lakhs and crores) and separators are conventions, not part of the number.
Glossary
- Place value: the value a digit contributes because of its position: the digit times the position's power of the base.
- Face value: the value of a digit on its own, regardless of position.
- Base (radix): the number of distinct digits in a positional system, and the factor between neighbouring positions.
- Positional notation: a way of writing numbers in which a symbol's value depends on its position.
- Expanded form: a number written as the sum of each digit times its place value.
- Placeholder: a symbol, our zero, that marks an empty position so the other digits keep their places.
- Carry: moving one unit to the next position left when a position reaches the base.
- Binary: base two, with digits 0 and 1.
- Bit: a binary digit; the smallest unit of information a computer stores.
- Byte: eight bits, able to hold 256 different values.
- Octal: base eight; each octal digit corresponds to exactly three bits.
- Hexadecimal: base sixteen, with digits 0–9 and A–F; each hex digit corresponds to exactly four bits.
- Sexagesimal: base sixty, used by the Babylonians and still in time and angle measurement.
- Horner's method: evaluating a numeral (or polynomial) left to right by repeatedly multiplying by the base and adding the next digit.
- Lakh and crore: Indian names for (1,00,000) and (1,00,00,000).
Practise: Exercises · Companion · Household Numbers stage
Misconceptions (from the companion)
| Misconception |
What's actually true |
| "A leading zero never changes a number's value." |
In C, older JavaScript and the C library's inet_aton, a leading 0 means octal: 010 is 8. |
| "An IP address is four separate numbers." |
It's one 32-bit number written as four base-256 digits; 192.168.1.10 is 3,232,235,786. |
| "Negative binary numbers are a minus sign and the bits." |
Machines store a fixed-width two's complement pattern; 11111011 is −5 or 251 depending on how it's read. |
| "Sorting numbers stored as text works." |
Text sorts character by character: "10" comes before "9". |
"parseFloat reads a number with commas." |
It stops at the first comma: parseFloat("1,000") is 1. |
03
Key ideas
- Column addition adds place by place (distributivity and regrouping), then carries: a column total of ten or more becomes one of the next place up.
- Adding two numbers, carries are 0 or 1; adding numbers, at most .
- In any base, carry when a column reaches the base; in binary .
- Strategies: make ten, near doubles, number bonds, compensation (round, then correct in the right direction).
- Decomposition: unbundle one from the next place when a column is short; the number doesn't change.
- Equal addition: add ten to the top column and one to the next bottom column; uses same difference, .
- Counting up: the missing-part story; best when numbers are close or near round ones.
- From a power of ten: each digit from 9, the last from 10; computers' complements use the same idea.
- Check by the inverse, by estimating, by casting out nines (which misses swapped digits).
- Floating-point addition rounds each step, so order matters.
Glossary
- Addend: a number being added.
- Sum: the result of an addition.
- Minuend and subtrahend: in , the number subtracted from () and the number subtracted ().
- Difference: the result of a subtraction.
- Carry: in column addition, the part of a column total that moves to the next place to the left.
- Decomposition: the subtraction method that regroups the top number, unbundling one of a higher place into ten of the place below ("borrowing").
- Equal addition: the subtraction method that adds ten to a column of the top number and one to the next column of the bottom number.
- Compensation: adjusting a number to a convenient one for calculating, then correcting the result.
- Number bond: a pair of numbers with a convenient sum, such as 3 and 7 for ten.
- Nines' complement: the number obtained by subtracting each digit from 9; for a four-digit .
- Casting out nines: checking a calculation by comparing the remainders of its numbers on division by 9, found from digit sums.
- Full adder: a circuit that adds two bits and an incoming carry, giving a sum bit and an outgoing carry.
- Overflow: a result too large for the fixed number of digits or bits that store it.
Practise: Exercises · Companion · Household Numbers stage
Misconceptions (from the companion)
| Misconception |
What's actually true |
| "An exact sum of floats gives the exact total." |
It gives the exact total of the stored approximations: ten float 0.1s sum to slightly more than 1. |
"x | 0 just removes the fraction in JavaScript." |
It converts to a 32-bit integer and wraps: 4000000000 | 0 is −294,967,296. |
| "The number of days from the 3rd to the 10th is 7." |
7 is the difference; counting both ends gives 8 days; a hotel charges 7 nights. Say which you mean. |
| "Comparing money totals with == works if you round first." |
Rounding hides it in one case and fails at the next boundary; store paise and compare integers. |
| "Borrowing just adds ten to the column." |
It moves ten from the next place; forgetting to take it away from there inflates the answer. |
04
Key ideas
- Times tables shrink to a short list via commutativity, identities, doubling, ×5 = half of ×10, ×9 = ×10 − ×1.
- Long multiplication = distributivity over place value: one row per digit, shifted by its place, then column addition. Works in any base; binary is shift-and-add.
- Multiplying by one digit, carries are at most 8.
- An -digit × -digit product has or digits.
- Mental strategies: double and halve, ×5, ×9, ×11, .
- Division algorithm: , , exactly one solution.
- Short and long division share the biggest place first and bring down (unbundle the leftover into the next place).
- Each quotient digit is an estimate: remainder ≥ divisor means the digit was too small.
- Never skip a 0 in the quotient.
- Check a division by and ; a product by length, estimate, casting out nines.
- Languages disagree on negative remainders.
Glossary
- Product: the result of a multiplication; the numbers multiplied are its factors.
- Partial product: one row of a long multiplication, the product of the first number with one digit of the second, shifted to its place.
- Long multiplication: the column method that adds shifted partial products.
- Box (grid) method: multiplication by splitting both numbers by place value and writing every pairwise product in a grid.
- Lattice method: multiplication in a grid of cells split by diagonals, adding along the diagonals.
- Dividend and divisor: in , the number divided () and the number divided by ().
- Quotient: the whole number of times the divisor fits into the dividend.
- Remainder: what is left after taking away the quotient's worth of divisors; always less than the divisor.
- Division algorithm: the theorem that with has exactly one solution in whole numbers for .
- Short division: division by a one-digit number with the intermediate steps done mentally.
- Long division: division written out step by step, bringing down one digit at a time.
- Karatsuba multiplication: a method that multiplies -digit numbers using three half-size products instead of four, taking about steps.
Practise: Exercises · Companion · Household Numbers stage
Misconceptions (from the companion)
| Misconception |
What's actually true |
| "Printing a number is free." |
Converting to decimal is repeated division; naive conversion of huge numbers is slow enough that Python limits it to 4,300 digits by default. |
"math.ceil(n / k) rounds up correctly." |
Only while n / k is exact in floating point; use (n + k - 1) // k for integers. |
| "Rounding each share to the paisa keeps the total." |
It can lose or invent paise; give the remainder to some shares explicitly. |
| "Multiplying by 1,000,000 just adds zeros, even in JavaScript." |
Above , floats are spaced apart: nanosecond timestamps lose their last digits. |
| " has to be computed by multiplying tens." |
, and multiplying by is a shift: Python builds powers of ten that way. |
05
Key ideas
- means ; remainder 0. Factors come in pairs; search up to . Odd number of factors ⇔ perfect square.
- If divides and , it divides and any multiple of .
- Tests: last digit (2, 5, 10), last two (4, 25), last three (8); digit sum (3, 9); alternating sum (11). In base : and .
- Remainders add and multiply like the numbers: . Casting out nines works because a number and its digit sum are congruent mod 9, and misses multiples of 9.
- A prime has exactly two factors; 1 is not prime. Sieve up to ; test by primes up to .
- Infinitely many primes (Euclid); about of them up to .
- Fundamental theorem: one factorisation into primes. A prime dividing a product divides a factor.
- From : number of factors ; square ⇔ all exponents even.
- gcd: smaller exponents; lcm: larger; . Coprime: gcd 1.
- Euclid's algorithm: .
Glossary
- Factor (divisor): a whole number that divides another with remainder 0.
- Multiple: the result of multiplying a number by a whole number.
- Divides (): is a multiple of .
- Prime number: a whole number greater than 1 whose only factors are 1 and itself.
- Composite number: a whole number greater than 1 that is not prime.
- Prime factorisation: a number written as a product of primes, unique apart from order.
- Sieve of Eratosthenes: a method of listing primes by crossing out the multiples of each prime in turn.
- Greatest common divisor (gcd): the largest number dividing each of two (or more) numbers.
- Least common multiple (lcm): the smallest positive number that is a multiple of each of two (or more) numbers.
- Coprime: having greatest common divisor 1.
- Euclid's algorithm: finding the gcd by replacing the pair with until the remainder is 0.
- Congruent modulo : leaving the same remainder on division by , written .
- Modular arithmetic: arithmetic with remainders, in which numbers wrap around after , like the hours on a clock.
- Prime number theorem: the number of primes up to is approximately , in the sense that the ratio tends to 1.
Practise: Exercises · Companion · Household Numbers stage
Misconceptions (from the companion)
| Misconception |
What's actually true |
| "The gcd of 0 and 0 is undefined, so code can ignore it." |
By convention it's 0, and dividing by it fails; handle zero explicitly. |
"range(2, int(sqrt(n))) tries every divisor up to the square root." |
It stops one short: 4, 9, 25 and 143 are reported prime. |
"int(math.sqrt(n)) is the integer square root." |
Only while is small enough for floats; use math.isqrt. |
"a ** b % m is fine for modular powers." |
The power can be huge or rounded; reduce as you go with pow(a, b, m). |
| "Euclid's algorithm is only for gcds." |
Its quotients are the continued fraction of a/b, which finds the best simple fractions near any number (22/7, 355/113 for π). |
06
Key ideas
- = : the number that times gives . Part, division, point, scale factor.
- Mixed ↔ improper is the division algorithm: .
- Equivalent: ; . Lowest terms: divide by the gcd; unique.
- Compare by common denominator or cross-multiplying; benchmarks and 1.
- Add/subtract: common denominator (lcm best): . Never add the bottoms.
- Mediant combines records; lies between the two.
- Multiply: tops × tops, bottoms × bottoms (area). "Of" means ×. Cancel common factors first.
- Divide: multiply by the reciprocal. Dividing by a fraction below 1 enlarges.
- Fractions are dense: always another between two.
Glossary
- Fraction: a number (), the number that multiplied by gives .
- Numerator: the top number of a fraction; how many pieces.
- Denominator: the bottom number; what size of piece (into how many equal parts the whole is split).
- Unit fraction: a fraction with numerator 1.
- Proper fraction: numerator less than denominator; less than 1.
- Improper fraction: numerator at least the denominator; 1 or more.
- Mixed number: a whole number and a proper fraction written together, such as .
- Equivalent fractions: fractions that name the same number, like and .
- Lowest terms: a fraction whose numerator and denominator are coprime.
- Common denominator: a denominator shared by two or more fractions after rewriting; the lcm of their denominators is the least.
- Reciprocal: the number that multiplies a given non-zero number to give 1; for it is .
- Mediant: for fractions and ; it lies between them.
- Egyptian fraction: a sum of different unit fractions.
Practise: Exercises · Companion · Household Numbers stage
Misconceptions (from the companion)
| Misconception |
What's actually true |
"Fraction(0.1) is one tenth." |
It's the float's exact value, a fraction with denominator ; use Fraction("0.1"). |
| "Converting to decimals is a safe way to compare fractions." |
Floats can't separate fractions closer than about relative; cross-multiply instead. |
| "Cross-multiplying always compares fractions correctly." |
Only when both denominators are positive; normalise the sign first. |
"divmod turns any fraction into a mixed number." |
For negative fractions it gives a floored whole part; format the sign separately. |
| "Fractions with integer parts are exact in every language." |
Only with arbitrary-size integers; JavaScript numbers lose exactness past . |
| "The average of the daily rates is the overall rate." |
Records combine as the mediant: total successes over total tries. |
07
Key ideas
- Decimal places: tenths, hundredths, thousandths; each a tenth of the place to its left. .
- × 10 shifts every digit one place left (the point appears to move right); ÷ 10 shifts right.
- Trailing zeros after the point don't change the value; zeros between digits hold places.
- Compare by lining up points; longer isn't bigger.
- Add/subtract: line up the points. Multiply: ignore points, then count decimal places. Divide: scale both numbers to make the divisor whole.
- Terminates ⇔ lowest-terms denominator has only primes 2 and 5 (in base : only primes of ). 0.1 never ends in binary.
- Otherwise it repeats, with period at most (remainders repeat).
- Repeating → fraction: multiply by , subtract. ; .
- Percent = per hundred; part = percent × whole; reverse by dividing.
- Percentage change is of the starting value; changes multiply (compounding); percentage points ≠ percent.
Glossary
- Decimal point: the mark separating the ones place from the tenths place (a comma in many countries).
- Decimal place: a position to the right of the point; "to 2 decimal places" means to the hundredths.
- Terminating decimal: a decimal with finitely many non-zero digits after the point.
- Repeating (recurring) decimal: a decimal in which a block of digits repeats forever, such as .
- Period: the length of the repeating block.
- Percent (%): hundredths; means .
- Percentage change: the change as a percentage of the starting value.
- Reverse percentage: finding the original amount from an amount after a percentage change, by dividing by the multiplier.
- Percentage point: the unit for the difference between two percentages.
- Multiplier: the number a percentage change multiplies by, such as 1.18 for an 18 % increase or 0.8 for a 20 % decrease.
- Compounding: applying a percentage change repeatedly, each time to the new amount.
- Banker's rounding: rounding exact halves to the nearest even digit (2.5 → 2, 3.5 → 4).
Practise: Exercises · Companion · Household Numbers stage
Misconceptions (from the companion)
| Misconception |
What's actually true |
| "Short decimals like 0.1 or 0.35 are exact in a computer." |
Only fractions with power-of-two denominators are; of 0.01 to 0.99, only 0.25, 0.50 and 0.75. |
| "Rounding 2.5 gives 3 everywhere." |
Python gives 2 (ties to even); JavaScript's Math.round(-2.5) gives ; name the rule you want. |
| "The average yearly change is the average of the yearly percentages." |
Changes multiply; use the geometric mean. |
"int(price * 100) converts rupees to paise." |
It truncates a float that's often just below the true value: 19.99 becomes 1998. |
"parseFloat reads any number a person wrote." |
It stops at the first character it doesn't expect: "1,234.50" becomes 1. |
| "GST is 18 % of the bill." |
For a bill that includes GST, it's of it. |
| "Rounded percentages add up to 100." |
Rounding each can give 99.99 or 101; allocate the rounding. |
08
Key ideas
- Ratio : "for every , "; part to part. Part to whole: .
- Equivalent ratios: multiply or divide all parts by the same number; simplest form: divide by the gcd.
- Sharing in a ratio: total parts → one part → multiply. Check the shares add up.
- Proportion: ; rule of three; unit method via the unit rate.
- Scale 1 : : lengths × ; areas × .
- Direct: , constant ratio, straight line through the origin. Inverse: , constant product.
- Rate: a ratio of different kinds (₹/kg, km/h); units divide and multiply like numbers.
- Unit price: the same unit for every option; or cross-multiply.
- Average speed = total distance ÷ total time; equal distances → harmonic mean.
- Combine rates by totals (the mediant), not by averaging; Simpson's paradox: group comparisons can reverse when combined.
Glossary
- Ratio: a comparison of quantities by how many times, written ("for every , ").
- Simplest form: a ratio whose parts are whole numbers with no common factor above 1.
- Proportion: a statement that two ratios are equal.
- Rule of three: finding the fourth number of a proportion from the other three (multiply the diagonal pair, divide by the third).
- Unit rate: the amount of one quantity for one unit of another (₹65 per kg).
- Scale factor: the number every length is multiplied by in a scaled copy.
- Direct proportion: two quantities whose ratio is constant, .
- Inverse proportion: two quantities whose product is constant, .
- Constant of proportionality: the fixed in direct or inverse proportion.
- Rate: a ratio between quantities of different kinds, such as km per hour.
- Unit price: price per unit of quantity, used to compare pack sizes.
- Harmonic mean: the average of rates over equal amounts, .
- Simpson's paradox: a comparison that holds in every group but reverses when the groups are combined.
Practise: Exercises · Companion · Household Numbers stage
Misconceptions (from the companion)
| Misconception |
What's actually true |
"A table with equal ratios will pass len(set(y / x)) == 1." |
Float rounding can split equal ratios; use exact fractions or a tolerance. |
| "Resizing keeps the aspect ratio." |
Rounding to whole pixels makes it drift, except at exact multiples. |
| "Any summary of a rate can be combined across groups." |
Totals combine; percentiles and medians don't. |
| "Compute the scale factor first, in integers." |
new_w // w is 0 when shrinking; multiply first, then divide. |
| "The rule of three always multiplies by the new amount." |
For inverse proportion it divides: more workers, fewer days. |
"Converting decimals to integers with int(x * 100) is safe." |
Floats just below the value truncate down: 0.29 m becomes 28 cm. |
| "A rate rounded to two places is good enough." |
Its error is multiplied by every amount converted, and inverting it rounds again. |
09
Key ideas
- Opposite: ; unique; . Integers: whole numbers and their opposites.
- Order: left to right on the line; . Absolute value : distance from 0. Distance between and : .
- Add: move right for positive, left for negative. Subtract = add the opposite: .
- Signs: ; ; , forced by distributivity. Same for division.
- Distributivity with subtraction: ; .
- Inequalities: multiplying or dividing by a negative reverses them.
- Remainders with negatives: floored (Python), truncated (C, Java, JS), Euclidean (); all satisfy .
- Two's complement ( bits): stored as ; as = flip the bits and add 1. Range to .
- Overflow wraps; has no opposite in bits.
Glossary
- Opposite (additive inverse): the number that adds to a given number to make zero; .
- Integer: a whole number or the opposite of one:
- Absolute value: a number's distance from zero, .
- Signed number: a number with a direction (positive or negative) as well as a size.
- Sign rule: same signs multiply or divide to a positive result, different signs to a negative one.
- Floored division: division whose quotient is rounded down, so the remainder has the divisor's sign.
- Truncated division: division whose quotient is rounded towards zero, so the remainder has the dividend's sign.
- Euclidean division: division whose remainder is never negative.
- Sign and magnitude: storing a sign bit and the size separately.
- Ones' complement: storing as with every bit flipped.
- Two's complement: storing in bits as ; flip the bits and add 1.
- Sign extension: widening a two's complement number by copying its sign bit into the new high bits.
- Integer overflow: a result outside a fixed-width type's range, which wraps around.
Practise: Exercises · Companion · Household Numbers stage
Misconceptions (from the companion)
| Misconception |
What's actually true |
| "There's only one zero." |
Floats have and : equal, but distinguishable. |
| "Subtracting a bigger number from a smaller gives a negative result." |
Not in unsigned types: it wraps to a large positive number. |
| "Mixing signed and unsigned is harmless." |
It can convert to float (losing precision) or reinterpret as a huge number. |
| "Every decimal library rounds division the same way as integers." |
Python's Decimal truncates, so Decimal(-17) % 5 is while -17 % 5 is 3. |
| "A remainder is a valid array index." |
A truncated remainder can be negative; JavaScript returns undefined for it. |
"Math.abs makes a hash code safe to use as a bucket." |
Math.abs(Integer.MIN_VALUE) is still negative. |
"sort() sorts numbers." |
JavaScript's default sort compares text, so comes before and 10 before 2. |
| "Integer division of a timestamp by 86,400 gives the day." |
For times before 1970, truncation gives the next day; floor. |
10
Key ideas
- ( factors). Laws: , , , .
- Forced by the laws: , , , .
- , ; even powers of negatives are positive, odd negative.
- Scaling: lengths × → areas × , volumes × .
- Roots: is the non-negative root; ; . Heron: average and ; digits double each step.
- Scientific notation , : multiply mantissas, add exponents; match exponents to add.
- Compound growth: ; doubling time .
- Logarithm: . Laws: products → sums, quotients → differences, powers → multiples; change of base .
- Digits: (base : ); halvings to one item: .
Glossary
- Power (exponentiation): repeated multiplication, .
- Base: the number being raised to a power, in ; also the base of a logarithm.
- Exponent (index): the number of factors, in ; extended to zero, negative and fractional values.
- Square root: the non-negative number whose square is a given number.
- Cube root / nth root: the number whose cube (th power) is a given number.
- Scientific notation: writing a number as with .
- Mantissa: the digits part of a number in scientific notation.
- Order of magnitude: the power of ten of a number's size.
- Compound growth: growth by the same percentage each period, .
- Logarithm: the exponent to which a base must be raised to give a number, .
- Natural logarithm: the logarithm to base , written .
- Logarithmic scale: a scale on which equal steps are equal multiplications.
- Doubling time: how long a steadily growing quantity takes to double, .
- Square–cube law: when lengths scale by , areas scale by and volumes by .
Practise: Exercises · Companion · Household Numbers stage
Misconceptions (from the companion)
| Misconception |
What's actually true |
| "Floats obey the exponent laws exactly." |
They round after each step; in the last digit, and overflows. |
| " is always safe to compute." |
For tiny , rounds to 1; use log1p and exp. |
| "Adding 1 to a number always changes it." |
Not above in a double. |
| "Fractional powers of fractions stay exact." |
Fraction(4, 9) ** Fraction(1, 2) is a float; roots are usually irrational. |
| "Variance is the mean of squares minus the square of the mean, so compute it that way." |
In floats that subtracts two huge, nearly equal numbers and can even go negative. |
"^ means power." |
In Python, JavaScript, C and Java it's bitwise XOR: 2 ^ 10 is 8. |
"3 ** 40 in JavaScript is exact." |
Numbers above are rounded; use BigInt. |
| "Taking logs of data is always safe." |
poisons averages; decide how to handle zeros. |
11
Key ideas
- Estimate first: one or two significant figures; compatible numbers; low and high bounds. Fermi estimates: multiply rough factors; errors partly cancel.
- Decimal places (after the point) vs significant figures (from the first non-zero digit). Trailing zeros after the point are information.
- Halfway rules: half up (away from zero), half even (no bias; Python, IEEE), down/truncate, up, floor, ceiling. Round once, at the end; double rounding can change the answer.
- Absolute error (measured minus true); relative error .
- Errors combine: sums/differences add absolute errors; products/quotients add relative errors (approximately). Cancellation: close differences lose relative accuracy.
- Units are factors: convert by multiplying by one (); km/h ÷ 3.6 = m/s.
- Areas and volumes: square and cube the length factor: , L.
- Mixed units: carry 60 (time), 12 (inches), 1000 (grams); safest to convert to the smallest unit, compute, and convert back with and remainder.
- Dimensional analysis checks formulas: both sides must have the same units.
Glossary
- Estimate: a calculation with deliberately rounded inputs, to find the size of an answer quickly.
- Fermi estimate: an estimate of an unknown quantity built from rough guesses of its factors.
- Significant figures: the digits of a number from its first non-zero digit, used to express relative precision.
- Half up (round half away from zero): rounding exact halves away from zero.
- Half even (banker's rounding): rounding exact halves to the neighbour with an even last digit.
- Floor / ceiling: rounding down / up to a whole number.
- Double rounding: rounding in two stages, which can differ from rounding once.
- Absolute error: the size of the difference between an approximate value and the true value.
- Relative error: absolute error divided by the size of the true value.
- Cancellation: loss of relative accuracy when subtracting nearly equal quantities.
- Unit: a standard amount of a quantity, part of every measurement.
- Conversion factor: a fraction equal to one that changes units, such as 1000 m / 1 km.
- Dimensional analysis: checking or deriving formulas by tracking units through them.
- SI: the International System of Units, built on seven base units.
Practise: Exercises · Companion · Household Numbers stage
Misconceptions (from the companion)
| Misconception |
What's actually true |
| "The total of 100 measurements is uncertain by 100 times each one's error." |
That's the worst case; independent errors typically grow like the square root of the count. |
| "A month is 30 days." |
Months have 28 to 31 days; adding months needs a rule for the last day. |
"math.ceil(n / k) counts the groups needed." |
Only while fits a float exactly; use integer division. |
| "Negative durations print with a minus sign on every part." |
timedelta(minutes=-90) is "−1 day, 22:30:00": floored carries. |
| "A tiny error per step doesn't matter." |
It accumulates: 0.1 s stored with error drifts 0.34 s in 100 hours. |
| "Multiply by 3.6 to get m/s." |
Divide; write the factors and check that the units cancel. |
"Python's round rounds money like a cash register." |
It rounds halves to even: 2.5 becomes 2. |
| "7 % can be stored as 7." |
A rate must say whether it's a percent or a fraction, or interest is off by 100 times. |
12
Key ideas
- Rational: with whole , . Irrational: a real number that isn't rational.
- is irrational: forces both and even, against lowest terms.
- is a whole number or irrational (unique factorisation: exponents must be even).
- Rational + irrational, and non-zero rational × irrational, are irrational; irrational × irrational can be rational.
- (Lambert 1761) and (Euler 1737) are irrational; both are transcendental (Lindemann 1882, Hermite 1873).
- Decimals: rational ⇔ ends or repeats; irrational ⇔ neither.
- Reals = all points of the line = all infinite decimals (with 0.4999… = 0.5). Completeness: nested shrinking intervals close on exactly one real.
- Between any two reals: a rational and an irrational.
- : each fills a gap (opposites, reciprocals, limits).
- Countable: can be listed (whole numbers, integers, fractions). Uncountable: the reals (Cantor's diagonal).
- Floats: a finite set of fractions ; spacing grows with size; equality needs tolerance.
Glossary
- Rational number: a number that can be written as a fraction of whole numbers.
- Irrational number: a real number that can't be written as a fraction of whole numbers, such as .
- Real number: any point of the number line; any infinite decimal.
- Transcendental number: a number that isn't the solution of any polynomial equation with whole-number coefficients, such as and .
- Algebraic number: a number that is a solution of such an equation, such as .
- Dense: having another member between any two.
- Completeness: the property of the real numbers that shrinking nested intervals always contain exactly one number; no gaps.
- Bisection: finding a number by repeatedly halving an interval known to contain it.
- Pell's equation: , whose solutions give the best fractions near .
- Countable: able to be listed, paired one to one with the whole numbers.
- Uncountable: too many to list, like the real numbers.
- Cantor's diagonal argument: building a number that differs from the th listed number in its th digit, to show no list contains every real.
Practise: Exercises · Companion · Household Numbers stage
Misconceptions (from the companion)
| Misconception |
What's actually true |
| "If the digits look random, the number is irrational." |
Rational numbers can delay repetition for thousands of digits; only a proof decides. |
| "Floats are spread evenly along the line." |
Half of the positive doubles are below 1; spacing is proportional to size. |
| "Bisection can reach any tolerance." |
Not below the gap between neighbouring floats. |
| "A fraction and a float with the same printed value are equal." |
Fraction(1, 10) == 0.1 is False: Python compares the float's exact value. |
| "Bisection returns a root whenever it returns." |
Without a sign change it returns an endpoint with no root nearby. |
"max ignores missing values." |
A NaN can make the result depend on the order of the list. |
"Number.EPSILON is the right tolerance." |
It's the spacing near 1: too strict for big numbers, too loose for tiny ones. |
"Decimal(19.99) is 19.99." |
It's the float's exact value, 19.9899999…; build decimals from strings. |