Monday, February 1, 2010

An Engineer's Logic



A software engineer's productivity is directly proportional to the amount of junk food consumed. This has been well documented elsewhere. Suffice it to say, yesterday as I was working on some code I needed junk food or my productivity would have come to a halt, and soon. I walked down the hall to the vending machine. Being the health-conscious junk food consumer I am, I selected one of the healthier choices presented, the Baked Lay's sour cream and onion chips (140 cal, 3.5g fat, 2g dietary fiber). The cost was 90 cents. I put a dollar in the machine and got in return the bag of chips and....AND...? Where was my dime? I was short changed 10 cents!

I began to think about the problem. Overpaying for the chips by 10 cents was clearly unacceptable. However, as I studied the problem a solution began to present itself. I returned to my office and got 90 cents in exact change (I was unwilling to risk losing 10 cents again). Walking back to the vending machine, I inserted the 90 cents and bought another bag of chips. Now I had two bags of chips, each of which had cost me an average of 95 cents. This was better than the dollar average after buying only one bag. Since I liked the direction this was going, I decided to repeat the process a third time. Now, I had three bags of chips which had cost me $2.80 total for an average of 93.3333~ cents per bag. Even better.

I think you see where I'm going with this. We can state that as the number of bags of chips purchased approaches infinity, the average amount of money overspent per bag approaches zero.

So, given enough bags purchased, my loss will be nearly completely wiped out. All I have to do is approach infinity in the number of bags purchased. I was planning to do that anyway.