Play n Tools

Free tools & games for everyone

Free · No sign-up · No accounts

Hidden Maths for Makers: Tuning, Thermistors and Logic

· in Learning

Cover picture: Hidden Maths for Makers: Tuning, Thermistors and Logic

Why a piano is never perfectly in tune, how a cheap sensor reads temperature, and how a truth table checks an argument. Three new labs explained.

Music, electronics and reasoning seem far apart, but each depends on a small piece of maths. Three new labs let you play with those ideas and hear or see the results.

Why a piano is slightly out of tune

The Tuning & temperament lab starts with a famous problem. A perfectly pure fifth has a frequency ratio of 3:2. Stack twelve pure fifths and you should land back on the same note seven octaves up. You do not: you overshoot by about 23.5 cents, a quarter of a semitone. That gap is called the Pythagorean comma.

Every tuning system hides the gap somewhere:

  • Equal temperament, used on modern pianos, shrinks every fifth a tiny bit, so every key sounds the same. The price is major thirds about 14 cents too wide.
  • Quarter-comma meantone makes the common major thirds perfectly pure, but leaves one terrible fifth, the "wolf".
  • Werckmeister III spreads the gap unevenly, so each key keeps its own colour.

Press play on the chords and listen for the beating: a gentle wobble in the sound when an interval is not pure.

How a sensor turns heat into a number

A thermistor is a cheap resistor whose resistance changes with temperature. A typical one measures 10,000 ohms at 25 °C and about 33,000 ohms at 0 °C. The Temperature sensor calculator turns resistance into temperature with the Beta and Steinhart-Hart equations. It also handles platinum Pt100 sensors, which follow an international standard curve: 100 ohms at 0 °C and 138.5 ohms at 100 °C.

The divider tab shows what a small microcontroller actually reads, and how many tenths of a degree one step of its converter is worth.

Checking an argument with a truth table

The Logic lab makes truth tables for any formula. Try this classic argument:

  1. If it rains, the ground is wet.
  2. The ground is wet.
  3. So it rained.

The lab finds a counterexample: the ground is wet but it did not rain (perhaps someone used a hose). The argument is not valid. Swap premise 2 for "it rains" and the argument becomes valid.

A formula that is true in every row of its table is a tautology. One that is false in every row is a contradiction.

The lab also finds the shortest form of a formula, the same job a Karnaugh map does for logic circuits. Try the result in the logic gate simulator beside this post.

Tags:

All blog posts

See you tomorrow!

A fresh daily puzzle every morning, and new tools added every month.

Browse every product