Solving equations: keep the balance
Why this matters
An equation says two things are equal, and solving it means finding the number that makes that true. The picture to keep is a balance: whatever you do to one pan, you must do to the other, or it tips. With that one rule, and undoing steps in reverse order, every equation in this lesson falls. In machine learning it answers backward questions, like which temperature makes a model predict 40 rentals. It also covers the two odd cases, an equation with no answer and one with every answer, and how to check any answer by putting it back, the habit that catches nearly every slip.
- Test whether a number solves an equation by putting it in
- Solve a linear equation by doing the same to both sides, undoing the steps in reverse order
- Solve and check equations in Python, with a function and by guess, check and adjust
- Run a model's formula backward: which input gives a target prediction
The math: an equation is a balance
Purpose. Find the number that makes a statement true.
An equation says two expressions are equal: 3x + 5 = 20. A solution is a value of x that makes it true. Before solving anything, you can always test a proposed answer by putting it in. If both sides come out equal, it's a solution.
To find the answer, picture a balance with 3x + 5 on the left pan and 20 on the right. They balance. You may do anything you like to the pans, as long as you do the same to both: then they still balance.