2009 21 Dec

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

Share and Enjoy:
  • Print
  • Reddit
  • Digg
  • StumbleUpon
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Twitter
  • email
Published under From the 'netsend this post

Leave a Reply