No history yet

Introduction to Numerical Analysis

Math by Computer

Many mathematical problems are impossible to solve perfectly with a formula. Finding the exact area under a complex curve or predicting the weather involves calculations that can't be done by hand. For these problems, we turn to computers. But there's a catch: computers don't do perfect math either. They work with finite approximations.

Numerical analysis is the art of using algorithms to find approximate, but very accurate, solutions to mathematical problems. It's about turning abstract math into concrete steps a computer can follow. To do this well, we need to understand the trade-offs and potential pitfalls of these approximations.

Understanding Error

Every numerical solution is an approximation, which means it contains some amount of error. The goal isn't to eliminate error completely—that's often impossible—but to understand it, quantify it, and keep it under control.

Error

noun

The difference between the true, exact value and the value calculated by a numerical method.

We measure error in two main ways. Absolute error is the straightforward difference between the true value and the approximation. If the true value is π\pi (about 3.14159) and our approximation is 3.14, the absolute error is about 0.00159.

Absolute Error=True ValueApproximation\text{Absolute Error} = | \text{True Value} - \text{Approximation} |

However, absolute error doesn't always tell the whole story. An error of 1 centimeter is a big deal if you're measuring an ant, but it's nothing if you're measuring the distance to the moon. That's where relative error comes in. It expresses the error as a fraction of the true value, giving us a sense of its scale.

Relative Error=True ValueApproximationTrue Value\text{Relative Error} = \frac{| \text{True Value} - \text{Approximation} |}{| \text{True Value} |}

Errors in numerical analysis come from two main sources:

  • Rounding Errors: Computers store numbers with a finite number of digits. Irrational numbers like π\pi or simple fractions like 1/3 have to be rounded, creating a small error from the very start.

  • Truncation Errors: These happen when we approximate an infinite process with a finite one. For example, some calculus calculations involve adding up an infinite number of terms. To make it computable, we might stop after a million terms. The part we cut off—the "tail" of the infinite series—is the truncation error.

Keeping Calculations Stable

Errors are inevitable, but we need to make sure they don't spiral out of control. Numerical stability is a property of an algorithm that describes how errors behave as the calculation progresses. A stable algorithm keeps errors in check, while an unstable one can cause them to grow exponentially, making the final result completely useless.

Imagine building a tower of blocks. A wide, sturdy base makes for a stable tower; you can nudge it, and it will barely wobble. That's a stable algorithm. Now imagine a tall, thin tower. The slightest nudge at the bottom can send the top blocks toppling over. That's an unstable algorithm, where a tiny initial rounding error can lead to a catastrophic failure in the final answer.

Choosing a stable algorithm is crucial. Two different algorithms might be designed to solve the exact same problem, but one could produce a reliable answer while the other generates nonsense because of instability.

Getting Closer to the Truth

Even with a stable algorithm, how do we know our approximation is getting better? This is the idea of convergence. A numerical method converges if its approximations get closer to the true, exact solution as we increase the computational effort.

What does "increasing computational effort" mean? It could be taking smaller step sizes in a simulation, using more rectangles to estimate an area, or running more iterations of an algorithm. If a method converges, doing more work will systematically reduce the error and improve the answer.

Lesson image

A method that doesn't converge is useless. No matter how much processing power you throw at it, the answers it produces won't get any closer to the real solution. They might bounce around randomly or even get farther away.

When choosing a numerical method, we want one that is both stable and convergent. This ensures that our calculations are not only reliable but also capable of achieving any desired level of accuracy, given enough computational resources.

The core challenge of numerical analysis is to design algorithms that are stable, convergent, and efficient, all while keeping errors acceptably small.

Ready to check your understanding?

Quiz Questions 1/5

What is the primary goal of numerical analysis?

Quiz Questions 2/5

A scientist measures the length of a bridge to be 999 meters, but its true length is 1000 meters. A second scientist measures a bolt to be 9 millimeters, but its true width is 10 millimeters. Which statement accurately compares the errors?

Understanding error, stability, and convergence is the foundation for exploring the powerful algorithms that solve complex problems in science, engineering, and finance.