Inverse functions, lines and scaling
Why this matters
An inverse function runs a function backward: give it an output, and it returns the input. Peeling steps in reverse finds simple ones. This lesson uses a method that also works where peeling can't: write y = f(x), make x the subject, then rename. It covers x in two places, the one-to-one rule every inverse needs, and every form of a straight line. In AI and ML, the same moves unscale a model's predictions and turn a classifier's weights into a line you can draw.
- Find an inverse by writing y = f(x), making x the subject and renaming, even when x appears twice
- Say when an inverse exists (f must be one-to-one), restrict a domain to make one, and swap the domain and range
- Check an inverse both ways, f(f⁻¹(x)) = x and f⁻¹(f(x)) = x, by algebra and in Python
- Rearrange every form of a line: general, point-slope, the slope formula and the intercept from a point
- Unscale min-max and standardized predictions, and turn a classifier's weights into the boundary line you'd draw
The math: make x the subject of y = f(x)
Purpose. Find a function's inverse, and know when it has one.
lesson 20 wrote f⁻¹, read "f inverse", for the function that undoes f, so f⁻¹(f(x)) = x. The −1 means "undo", not "one over". That lesson peeled steps in reverse. Transposing y = f(x) for x also works where peeling can't:
- Write y = f(x).
- Make x the subject, with any move from this subcourse.
- Rename. The result takes y in and gives x out, so swap the letters and write f⁻¹(x).
- State the conditions, and check that f(f⁻¹(x)) = x.
Renaming changes no numbers: an input's letter is only a name. With x as its input, f⁻¹ can share a graph with f. Each point (a, b) of f becomes (b, a), so f⁻¹ is f's mirror image in the line y = x.