Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: [Phys-l] Significant figures -- again



For those that want a reference; I first ran across this in "Numerical Recipes" 
by Press, Teukolsky, Flannery, and Vetterling. 

In their discussion (section 5.5 on Quadratic and Cubic Equations of the 
original volume) they also mention a not so widely known alternative to the 
standard quadratic formula that is typically taught in middle school: (-b +- 
Root[b^2 - 4ac])/(2a)

Namely:

(2c)/(-b +- Root[b^2 - 4ac])

Which also suffers from the same numerical instability as the more widely known 
formula.

Joel R.

| -----Original Message-----
| From: phys-l-bounces@carnot.physics.buffalo.edu [mailto:phys-l-
| bounces@carnot.physics.buffalo.edu] On Behalf Of David Bowman
| Sent: Friday, March 30, 2012 1:21 PM
| To: Forum for Physics Educators
| Subject: Re: [Phys-l] Significant figures -- again
| 
| Regarding:
| 
| > One of my favorite problems, before I retired, was the "drop a
| > stone down a well and listen for the splash."  Calculate the
| > well depth from the time delay.   Following the normal sig figs
| > rule eliminates the answer.  Students did not know what to do
| > next!
| >
| > "Expand" the square root (from the quadratic formula).  This
| > shows precisely what is happening.  The "big" terms cancel out
| > - exactly - leaving the answer in the (quickly converging)
| > series.  Sig figs takes on a whole new meaning in this problem
| > after the expanding algebra is complete.
| >
| > Do students learn how to expand a function any more?  Will a
| > computer do this for them??
| >
| > Oren Q.
| 
| Any problem such as this one where a quadratic equation has one of its
| roots nearly cancel out from a subtraction involving the square root
| hardly requires an expansion of the square root to get a easily
| calculable result without the subtraction error.  All that is needed is
| to rewrite the "small" root in a way that does not involve the
| subtraction.  In particular, consider the quadratic equation:
| 
| x^2 - 2*B*x = C
| 
| where the magnitude of C is multiple orders of magnitude smaller than
| B^2.  The way to write the 2 solutions to this equation so no
| subtraction of nearly cancelling terms is done is to write and evaluate
| them as:
| 
| x_1 = B + sgn(B)*sqrt(B^2 + C) and
| 
| x_2 = -C/(B + sgn(B)*sqrt(B^2 + C)) = -C/X1.
| 
| In this case the x_2 root is the "small" root and no subtraction of
| nearly equal terms is done to evaluate it, nor is an expansion of the
| square root is needed to accurately evaluate it.
| 
| Of course sometimes it *is* necessary to expand a function to preserve
| significance in the difference involving a subtraction of nearly equal
| quantities.  It is just that in the case of the quadratic equation
| example, such a drastic step is not really needed, and it is easier to
| just evaluate the expression in a sensible way that avoids the
| subtraction error.  In general, when faced with a problem that has a
| significant loss of significance due to subtraction, I would recommend
| that one first look for ways rewrite the expression to avoid the
| subtraction.  I would recommend the series expansion method only
| *after* one has decided that there is no discernible way to rewrite
| things to avoid the subtraction.
| 
| David Bowman
| 
| _______________________________________________
| Forum for Physics Educators
| Phys-l@carnot.physics.buffalo.edu
| https://carnot.physics.buffalo.edu/mailman/listinfo/phys-l
_______________________________________________
Forum for Physics Educators
Phys-l@carnot.physics.buffalo.edu
https://carnot.physics.buffalo.edu/mailman/listinfo/phys-l