Household Numbers: the Mathematics CapstoneHousehold Numbers
0 / 0

Workbench / Household Numbers: the Mathematics Capstone

S11 · B1·11

Honest Numbers at Home

Stage 11, after chapter 11: estimating the month's spending before adding it up, rounding each kind of figure by its own rule (money, shares, things you buy whole), keeping kWh, kilolitres and litres apart until they become rupees, and catching a bill that's ten times too big by estimation.

6 topics · ~6 min read
Updated Suggest a correction

Stage 11: honest numbers at home

The brief

What you'll build. A set of checks the household can run every month: a one-figure estimate of spending compared with the exact total; each kind of number rounded by the rule that fits it; utilities kept in their own units until they're priced; and a quick estimate that flags a suspicious bill.

Why a real household needs this. Most money mistakes are of size, not detail: a meter misread by one digit, a bill in the wrong unit, a monthly figure that's really quarterly. An estimate made in ten seconds catches them; and rounding with the wrong rule (a share shown as 39 % in one place and 39.4 % in another) erodes trust in a household's own spreadsheet.

Why now. Chapter 11 gives estimation with significant figures, rounding rules (half up, ceiling), relative error, and units as factors. Every earlier stage produced exact numbers; this one makes sure they're sensible.

What you'll have at the end. honest.py; your month estimated and checked; a list of which figures round which way; and a habit of estimating any bill before paying it.

Theory to own

  1. One-figure estimates. Why is a sum of one-significant-figure amounts usually within about 10 % of the exact total? (Chapter: Experiment 4.)
  2. The right rule. Money rounds to the paisa, half up; a percentage share rounds for display only; gas cylinders, school notebooks and tiles round up (ceiling), because you can't buy part of one. Why does each fit? (Chapter: "Rules for the halfway case".)
  3. Units stay apart. 339 kWh, 18 kL and 42.5 L can't be added; their costs can, because rate × quantity gives rupees (₹/kWh × kWh = ₹). (Chapter: "A quantity is a number and a unit".)
  4. Relative error as a check. A bill nine or ten times the estimate isn't a 900 % price rise; it's an extra digit or a unit slip. Why do unit errors show up as powers of ten? (Chapter: "Estimates as checks in code"; exercises, S3.)

Build it

Step 1: by hand. Round each of last month's payments to one significant figure and add them in your head. Write the estimate down before you add the exact figures.

Step 2: the code. Exact decimals for money, named rounding rules, units carried in the labels:

Python
"""Stage 11: estimate the month before adding it, round each figure by its own rule, keep units apart, and check a bill."""
import math
from decimal import Decimal as D, ROUND_HALF_UP

def one_fig(x):
    p = 10 ** math.floor(math.log10(x))
    return round(x / p) * p

# 1. Estimate the month's spending from one-figure amounts, then compare with the exact total (rupees).
spends = [24_000, 6_480, 2_215, 31_249.50, 18_750, 7_335.25, 1_499, 899, 3_640]
estimate, exact = sum(one_fig(x) for x in spends), sum(D(str(x)) for x in spends)
print(f"estimate ₹{estimate:,} | exact ₹{exact:,} | off by {abs(estimate - float(exact)) / float(exact):.1%}")

# 2. Each kind of figure has its own rounding rule.
print("money to the paisa, half up:", D("1774.625").quantize(D("0.01"), ROUND_HALF_UP))
print("a share for display, 1 d.p.:", D(str(100 * 10_584.84 / 26_836)).quantize(D("0.1"), ROUND_HALF_UP), "%")
print("gas cylinders to last 3 months at 1.4 a month:", math.ceil(D("1.4") * 3), "(ceiling: you can't buy part of one)")

# 3. Units that must not mix: electricity in kWh, water in kilolitres, fuel in litres, distance in km.
usage = [("electricity", 339, "kWh", D("5.23")), ("water", 18, "kL", D("7.00")), ("petrol", 42.5, "L", D("104.80"))]
for name, qty, unit, rate in usage:
    print(f"{name:<12} {qty:>6} {unit:<4} x {f'₹{rate}/{unit}':<11} = ₹{(D(str(qty)) * rate).quantize(D('0.01'), ROUND_HALF_UP):>9}")
print("adding 339 kWh + 18 kL + 42.5 L is meaningless; adding their costs in rupees is fine")

# 4. Check a bill by estimation: a water bill of ₹1,260 for 18 kL at about ₹7 per kL?
print(f"water bill check: about 20 x ₹7 = ₹{20 * 7} expected; billed ₹1,260 is {1260 / (20 * 7):.0f} times that: look for a misread meter or a unit slip")
Text
estimate ₹90,900 | exact ₹96,067.75 | off by 5.4%
money to the paisa, half up: 1774.63
a share for display, 1 d.p.: 39.4 %
gas cylinders to last 3 months at 1.4 a month: 5 (ceiling: you can't buy part of one)
electricity     339 kWh  x ₹5.23/kWh   = ₹  1772.97
water            18 kL   x ₹7.00/kL    = ₹   126.00
petrol         42.5 L    x ₹104.80/L   = ₹  4454.00
adding 339 kWh + 18 kL + 42.5 L is meaningless; adding their costs in rupees is fine
water bill check: about 20 x ₹7 = ₹140 expected; billed ₹1,260 is 9 times that: look for a misread meter or a unit slip

Step 3: read the output. The estimate, ₹90,900, is within 5.4 % of the exact ₹96,067.75: close enough to have caught a missing rent payment or a doubled EMI. Money is rounded to the paisa half up (₹1,774.63), a share to one decimal place for display (39.4 %), and cylinders up to 5, because 4.2 rounded to the nearest would leave you short. Each utility keeps its own unit until it's multiplied by its rate, and only the rupee amounts are added. And a water bill of ₹1,260 for about 20 kL at about ₹7 is roughly nine times the estimate: the right response is to check the meter reading and the unit, not to accept a ninefold rise.

Step 4: your numbers, and a habit. Run it with your own month. Then for one week, estimate every bill or receipt before looking at its total, and note how often your estimate was within 10 % and whether any bill was wrong.

Senior and architect lens

  • Estimates are tests. A computed value outside its estimated range should fail loudly; checks by order of magnitude catch unit and scaling bugs that exact tests with typical data miss.
  • Rounding rules are part of the data. Store which rule applies to each kind of figure, and round only at display or where a contract demands it; mixing rounded and unrounded values in later calculations is how totals drift.
  • Units belong in names and types. usage_kwh, rate_per_kwh, cost_paise: when the unit is in the name, a mismatch is visible in review.

Evidence

  • honest.py with your own month, and its output.
  • Your written estimate from Step 1 next to the exact total.
  • Your week of estimates from Step 4, with how close each was.

Carry forward

Stage 12, the last, brings the household's numbers together as a year: the ledger, shares, recurring payments, rates, growth and checks of stages 1 to 11 in one annual summary, with a final look at which of its numbers are exact, which are rounded, and which are estimates.