Testing of computations
-
Use two independent methods!
(This is done in practice!)
-
If one method only works for
special cases, use it for those!
Types of methods
-
visual
-
most problems can be visualized
in 2 dimensions
-
behaviour of functions of 1
variable (keep all others constant)
-
also, intersection between curves,
common tangents, zeros of functions
-
4.9 in Horstmann shows intersection
between line and circle
-
analytical
-
take a paper and pencil!
-
... or Mathematica or Maple:
learning either or both can save a lot of time using a pocket calculator
-
at the very least for a special
case
-
cf. 4.9 in Horstmann
-
numerical
-
E.g., if you calculated an integral
by hand, check it by a numerical integration
-
Example in 4.9: step along
line and calculate distance to the center of the circle; check at
what point distance is equal to radius