Skip to content
The Lumenary

Practice · Early undergraduate

Numerical methods

Numerical methods

Warm-upHuman

Bisection is started on [1,2][1, 2] to find 2\sqrt 2 as a root of x2−2x^2 - 2. After nn halvings we report the midpoint of the current interval. What is the smallest nn for which Theorem 3 guarantees an error of at most 10−610^{-6}?

Numerical methods

Warm-upHuman

Newton's method for x2−2x^2 - 2 is xn+1=12(xn+2xn)x_{n+1} = \frac12\left(x_n + \frac{2}{x_n}\right). Starting from x0=1x_0 = 1, compute exactly x1=32x_1 = \frac32, x2=1712x_2 = \frac{17}{12} and x3=pqx_3 = \frac{p}{q} in lowest terms. Enter the numerator pp.

Numerical methods

CoreHuman

For large xx (say x=1012x = 10^{12}), which formula computes x+1−x\sqrt{x + 1} - \sqrt{x} most accurately in floating point?

Choose one

Numerical methods

CoreHuman

Newton's method for f(x)=x3f(x) = \sqrt[3]{x} (the real cube root) gives xn+1=−2xnx_{n+1} = -2x_n and diverges from every x0≠0x_0 \ne 0, although f(0)=0f(0) = 0. Which hypothesis of Theorem 4 fails?

Choose one

Numerical methods

CoreHuman

Apply Simpson's rule with n=2n = 2 strips (h=2h = 2) to ∫04x3 dx\int_0^4 x^3\,dx. What value does it give?

Numerical methods

CoreHuman

Which statements are true? (Choose all that apply.)

Choose all that apply

Numerical methods

CoreHuman

In binary64 arithmetic, approximately which step hh minimises the total error of the forward difference f(x+h)−f(x)h\frac{f(x + h) - f(x)}{h} for a typical smooth function with ff, f′′f'' of moderate size?

Choose one

Numerical methods

CoreFormal

With IsBinary64 x meaning "xx is a positive binary64 number", which Lean statement says that 2−522^{-52} is the gap between 11 and the next larger binary64 number?

Choose one

Numerical methods

StretchComputational

Write newton(f, df, x0, tol=1e-12, max_iter=50) that runs Newton's method and returns (x, n): the first iterate with abs(f(x)) <= tol and the number of steps taken. If a derivative is exactly 0, or max_iter steps pass without success, return (None, n).

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.