Day 4

Roundoff and truncation error for log(1+x)/x

20250904_085728.jpg error_plot.png

A nice proof of Taylor's theorem

Please read this carefully on your own time, and let me know if any of it is unclear. This author uses "a" for what I called x0, and "t" for what I called ξ.

This proof requires f to be in Cn + 1 on the interval in question.

proof_of_taylor_theorem.png

Ch 2. Solving equations in one variable

Example problem: Surveillance video. Task: find time when the black car left parking lot. It's between 0 and 2:30.

surveillance_parking_lot.jpg

Joel intuitively solved this problem using something like the bisection method ...

Bisection method: least demanding, most robust, slow

20250904_085733.jpg

Bisection algorithm: Check sign of f at midpoint c = (a + b) ⁄ 2 and "replace" either a or b by c accordingly. Repeat until |a − b| small enough.

day04_code_1.png day04_code_2.png

Functional iteration

Alternatively could try iterating g(x) = f(x)+x, hoping to converge to a fixed point of g.

Here that can be done by repeatedly pressing the "cos" button on a calculator.

20250904_092436.jpg day04_code_3.png g_h_id.png 20250904_092450.jpg

The hope is that if g is constructed from f in a good way, the rate of convergence will be faster than halving the error on each step (as in bisection), hence needing fewer evaluations to get the desired accuracy.