Bad math proves nothing and everything

Have you ever known someone who is always right?  They expect you to just take them at their word that they are right even though their theories are untested?  I’ve had employees who have thrust new programs into production without adequate testing.  Sometimes this works, but when it doesn’t, disaster can strike.

I read an article on thedailywtf.com where a programmer ‘fixed’ a bug and instead of running it through the simulator to verify the bug was fixed, placed it into production.  This was based upon his “proven” fix by a mathematical formula.  But, if it’s bad math, it proves nothing, or everything.

For example, I can “prove” 2=1.

2 = 1

1. Let a and b be equal non-zero quantities

a = b \,

2. Multiply through by a

a^2 = ab \,

3. Subtract b^2 \,

a^2 - b^2 = ab - b^2 \,

4. Factor both sides

(a - b)(a + b) = b(a - b) \,

5. Divide out (a - b) \,

a + b = b \,

6. Observing that a = b \,

b + b = b \,

7. Combine like terms on the left

2b = b \,

8. Divide by the non-zero b

2 = 1 \,

Problem is in line 5.  If a=b, then a-b is zero.  Division by zero is undefined.  So, while running the proof without real numbers seems to work, when you use real numbers to simulate real situations, it still fails.

See also:

The Proven Fix – The Daily WTF

Possibly Related Posts:


Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge

Subscribe by email

We would love it if you would subscribe to our little blog.

Enter your email address:

Please view our Privacy Policy. You will only receive an email when the blog is updated and no more than once per day.