This video presents a follow-up analysis of a simple formula for approximating square roots, sqrt(x) β (x + b) / (2 * sqrt(b)), where b is the nearest perfect square to x. Moving beyond the integer-based analysis of Part 1, this installment investigates the formula's behavior with continuous real numbers. The analysis explores three main scenarios: the approximation for numbers between 0 and 1 (where b=1 is used), the optimal choice of b when x is exactly at the midpoint between two perfect squares, and the nature of the overall error function. Key findings reveal that using the larger perfect square at the midpoint yields a more accurate result, and a graph of the error function surprisingly shows jump discontinuities at these midpoints, making the function right-continuous rather than smoothly continuous.
Uncovering the Quirks of a Simple Square Root Formula
0:00The Approximation Formula: The video recaps the simple and effective formula for approximating the square root of a number x by using the closest perfect square, b.
1:23Approximating for Numbers Between 0 and 1: The creator explores how the formula behaves for real numbers between 0 and 1 by consistently using b=1 as the closest perfect square.
2:32Visualizing the Error: A graph compares the approximation to the exact square root for values between 0 and 1. It shows that while the approximation is poor for very small values of x (with an error limiting to 0.5), it becomes quite accurate for x > 0.5.
3:29The Midpoint Dilemma: A new problem is investigated: when a number x is exactly equidistant from two perfect squares, which one should be chosen for the formula?
5:04The Midpoint Solution: It is mathematically shown that using the larger (or right) perfect square in the formula always produces a smaller error and thus a more accurate approximation.
6:18Graphing the Continuous Error Function: To visualize the accuracy across a range of numbers, the presenter graphs the error between the approximation and the true square root for continuous values of x from 0 to 16.
7:06A Surprising Discontinuity: The resulting graph is not a smooth, continuous curve as expected. Instead, it features sudden drops or "jumps" at the midpoints between perfect squares, which occurs precisely where the algorithm switches to using the larger perfect square.
8:11Right-Continuous Function: This "jumpy" behavior means the error function is not fully continuous but is classified as right-continuous. The size of these jumps gets progressively smaller as x increases.