Re: A little lesson for sqrt(144) year olds.

From: Androcles (androc1es_at_nospamblueyonder.co.uk)
Date: 07/05/04


Date: Mon, 05 Jul 2004 20:45:17 GMT


"The Ghost In The Machine" <ewill@aurigae.athghost7038suus.net> wrote in
message news:rmjor1-8ip.ln1@lexi2.athghost7038suus.net...
| In sci.physics, Eric Gisse
| <fsegg@uaf.edu>
| wrote
| on 5 Jul 2004 05:23:32 -0700
| <fd0fc2fa.0407050423.6e759273@posting.google.com>:
| > "Androcles" <androc1es@nospamblueyonder.co.uk> wrote in message
| > news:<kwCEc.88$rd1.1081531@news-text.cableinet.net>...
| >> "Jesper Pedersen" <jesper@befunk.com> wrote in message
| >> news:cbu7sn$a4i$1@news.net.uni-c.dk...
| >> | "Androcles" <androc1es@nospamblueyonder.co.uk> wrote in message
| >> | news:CmnEc.6449$MV.69480542@news-text.cableinet.net...
| >> | <snip>
| >> | > Yes, very probably, but remember that
| >> | > "3 = sqrt(9)
| >> | > -3 = -sqrt(9)" -Dinky the Deranged.
| >> | > "This way sqrt is ALWAYS positive."-Dinky the Deranged.
| >> | > and
| >> | > "IF x <= 0 THEN sqrt(x^2) = -x" - Dinky the Deranged
| >> | > is not written in the form -3 = -sqrt(9). There is a missing minus
sign
| >> | > after the word "THEN".
| >> | > Perhaps -x = -sqrt(x^2) is equivalent to sqrt(x^2) = -x
| >> | > because x is on the other side of the '='?
| >> | > Maybe we should ask Dinky.
| >> | <snip more commented quotes>
| >> |
| >> | You need to understand the fundamental difference between solving
x^2=2
| >> for
| >> | x
| >>
| >> I think the solution is -1.4142135623730950488016887242097.
| >> Let's see.
| >> -1.4142135623730950488016887242097 *
| >> -1.4142135623730950488016887242097 = 2.
| >
| > sqrt(2) is irrational. Carrying out to all those decimal places does
| > nothing to prove your point.
|
| An easy proof:
|
| Assume sqrt(2) = a/b, with a and b relatively prime integers.
| Since a^2/b^2 = 2, a has to be even. Write a = 2*c.
| c^2/b^2 = 1/2; b^2/c^2 = 2; b must therefore be even.
| Contradiction.
|
| Of course the OP should be aware that multiplication of the
| numeric approximations (m * 2^e) is done approximately,
| so it's entirely possible that the above approximate
| multiplication result is in fact 2. A rather naive
| implementation of this issue, with loss of precision
| ramifications, leads to 3.11 - 3.10 = 0.00 in a rather
| famous case involving a Windows calculator. Fortunately,
| it has since been fixed -- but it took them a very long
| time (probably because it wasn't all that high on their
| priority list).
|
| I got bitten by a variant of the approximation bug once,
| at work. The results weren't horribly pretty.
|
| It also turns out that, when represented in hex (standard IEEE754 stuff):
|
| 3.11: 3.11 = 4008e147ae147ae1
| 3.10: 3.1 = 4008cccccccccccd
| 3.11 - 3.10: 0.01 = 3f847ae147ae1400
|
| (note that sprintf() is doing it right!)
|
| but
|
| 1/100: 0.01 = 3f847ae147ae147b
|
| Definite loss of precision there.
|
| Also:
|
| M_SQRT2: 1.41421 = 3ff6a09e667f3bcd
|
| (M_SQRT2 is #defined in math.h)
|
| and
|
| sqrt(2): 1.41421 = 3ff6a09e667f3bcd
|
| which means these two numbers are equal in all relevant respects,
|
| but
|
| sqrt(2)^2: 2 = 4000000000000001
|
| which means the guard bit let its guard down. :-) (This on an Intel x86
| micro.)
|
| BTW, the OP's number is just a smidge off:
|
| $ gp
| GP/PARI CALCULATOR Version 2.1.5 (released)
| ...
| ? default("realprecision",200)
| realprecision = 202 significant digits (200 digits displayed)
| ? default("format","g0.200")
| format = g0.200
| ? sqrt(2)
| %1 = 1.41421356237309504880168872420969807...
| ^
|
| but then, any finite decimal representation of sqrt(2)
| will be a smidge off, for some value of "smidge". :-)
|
| I also note that
|
| 1.4142135623730950488016887242097^2 = 2.0000000000000000000
| 00000000000005434625658377656176426889574090000000000000000...
|
| so the smidge has bitten again. (They're nasty little math bugs,
| aren't they? :-) )
|
| >
| >
| >> Yep, I'm right.
| >>
| >> and applying the function sqrt(2). the sqrt is DEFINED as being
positive.
| >>
| >> Is it?
| >> if x = [-b +/- sqrt(b^2 - 4ac]/2a, is b always positive?
| >
| > Quadratic equation, moron. Learn to use it.
| >
| > x^2 = 2
| > x^2 - 2 = 0
| >
| > a = 1
| > b = ?
| > c = -2
| >
| > What is b? It's blindingly obvious that you haven't had any math past
| > algebra in high school.
|
| And maybe not even that; the quadratic solution, after all, can
| be derived by "completing the square":
|
| ax^2 + bx + c = 0
| x^2 + bx/a + c/a = 0
| x^2 + bx/a + b^2/(4a^2) + c/a = b^2/(4a^2)
| x^2 + bx/a + b^2/(4a^2) = b^2/(4a^2) - c/a = (b^2 - 4ac)/(4a^2)
|
| Recall that (c + d)^2 = c^2 + 2cd + d^2; therefore the left side
| is rewritable:
|
| (x + b/(2a))^2 = (b^2 - 4ac)/(4a^2)
|
| Carefully taking square roots, one gets:
|
| x + b/(2a) = +/- sqrt(b^2 - 4ac) / (2a)
|
| and the formula follows.

Goodness me! I'm told sqrt is always positive by Dinky the Deranged.
Where did the minus sign in front of it come from?

|
| An alternative, slightly more logical, derivation, might involve
|
| x^2 + bx/a + c/a = 0
| x^2 + bx/a = -c/a
|
| and then asking the question "How do I complete the square here?".
|
| Algebra, IIRC, is taught in 8th-9th grade level, so this wouldn't be
| that much of a stretch.
|
| >
| >
| >>
| >> | Otherwise how would equalities such as sin(Pi/4) = sqrt(2)/2 make any
| >> sense
| >> | at all? Surely you wouldn't claim that sin is dual-valued?
| >> That rather depends on whether you use (x, iy) or (x,y), doesn't it?
| >> Androcles.
| >
| > You know nothing of complex numbers.
|
| (x, iy)? Somebody's extremely confused. The usual representations
| are (x,y) (or, if one prefers, (Re(z), Im(z))) or x + iy = Re(z) +
i*Im(z).
| Or perhaps Re(z) + Im(z); I don't remember offhand whether Im(z) returns
| a multiple of sqrt(-1) or not. (I doubt it.)
|
| Of course completing the square works even for equations with
| b^2 - 4ac < 0; the result is, of course, a complex number.
|
| x^2 + 1 = 0 in particular has a = 1, b = 0, c = 1; b^2 - 4ac = -4;
| (-b + sqrt(b^2 - 4ac))/(2a) = +sqrt(-1) = i.
| (The other root is of course -i.)
|
| >
| >>
| >> |
| >> | / Jesper P
| >> |
| >> |
|
|
| --
| #191, ewill3@earthlink.net
| It's still legal to go .sigless.

Since we have mathematician in our midst, comments on
 http://www.androc1es.pwp.blueyonder.co.uk/Fundamental_rev_2.3.htm ?
Androcles


Quantcast