Rearranging a formula
Why this matters
A formula like distance = speed × time holds three letters, and any one of them can be the unknown. Rather than learning three formulas, learn one and rearrange it. It's the balance from the last lesson again, with letters on the pans instead of numbers. In machine learning the same skill turns "how many steps will this take?" into "how many examples do I need for this many steps?" Along the way, you'll write each rearranged formula as a Python function and check every pair with a round trip, a test that catches a wrong rearrangement every time. Engineers use the same habit before trusting any formula they've rearranged by hand.
- Make any letter of a formula its subject, with the four moves done to both sides
- Rearrange d = s·t, y = mx + b and a = c/n for each of their letters
- Write one function per subject in Python, and check each pair by a round trip
- Rearrange the formulas for accuracy and training steps to answer planning questions
The math: any letter can be the subject
Purpose. One formula, any unknown.
The subject of a formula is the letter on its own on one side: in d = s·t, it's d. To make another letter the subject, treat the formula as a balance and use the four moves, always on both sides:
- add the same thing to both sides
- take the same thing from both sides
- multiply both sides by the same thing (not 0)
- divide both sides by the same thing (not 0)
It's exactly what you did with numbers in the last lesson. The letters just stay as letters.