Numerical Analysis

Math 370 Fall 1998  MWF 11:30am - 12:25pm
\begin{matrix}c \\ ◯ \end{matrix}1998 Ron Buckmire  Fowler 127

Class 5: Monday September 14

SUMMARY Introduction to Algorithms and Pseudocode CURRENT READING Burden & Faires Sections 1.3

Machine Precision

There is a number ϵ_{m} such that 1 + δ = 1 whenever δ < ϵ_{m} For exact arithmetic, ϵ_{m} is zero. However, on a computer (calculator) ϵ_{m} is non-zero. We want to compute what it is for your calculator.

\underline{Exercise} Write down (in your own words) the meaning of the following terms: Algorithm :

Pseudocode :

Consider the following algorithm to compute ϵ_{m}, the machine precision:

epsilon = 1;
it = 0;
maxit = 100;
while it < maxit
   epsilon = epsilon/2;
   b = 1 + epsilon;
   if (b == 1)
      break;
   it = it + 1;
end

\underline{Example} Can we parse the above code in order to execute the given algorithm?

\underline{Exercise} Find the machine precision of your calculator.

\underline{Groupwork} Write an algorithm to compute the average of N numbers