Lecture 01
Lecture 01
Lecture 1: Introduction
x2 + bx + c = 0 (1)
Of course, we can perform some simple algebraic manipulations leading to the familiar quadratic
formula: √
−b ± b2 − 4c
x1,2 = (2)
2
But does this bring us any closer to finding a numerical solution? The answer is no; while
we can easily perform simple operations like addition and multiplication, it is unclear how we can
calculate a square root. So this algebraic manipulation has gotten us nowhere.
• Limited storage - since there is only a limited amount of space to store any number, we cannot
always get an exact numerical solution. Rather, we can only get a solution that is accurate
up to the limit of our precision (for example, 16 digits).
• Limited time - Each operation (e.g. addition, multiplication) takes time to complete. We can
only perform a limited number of operations during a particular calculation, or it will take
too long to finish.
For example, consider the problem of evaluating a quadratic function f (x) = ax2 + bx + c
at a point. The evaluation will take 5 steps: 3 multiplications (x ∗ x, a ∗ x2 , b ∗ x) and two
additions.
To compute a square root, we would like a method that can calculate a numerical solution that
is accurate up to the limit of our representation and performs few operations. One such method
uses an initial guess at the square root value xold to calculate a more accurate value xnew . The
calculation can be repeated using the new value as input, producing increasingly accurate solutions.
1
In later lectures we will see how this method works in general, but for now, consider the following
formula for calculating the square root of 5:
x2old + 5
xnew = (3)
2xold
If we start with an initial value xold = 2.2 and repeat the computation for 3 steps, Matlab
produces the following results:
Using this procedure, only 3 × 4 = 12 simple arithmetic operations are required to arrive at a
numerical solution that is accurate to the limit of Matlab’s precision.