Friday, February 9, 2007

Cold ears -> Winning Bets -> Game Theory

I haven't posted in a while but there's a reason. I was going to post on why my ears couldn't feel the cold. You see, one day I came home from work and my hands were freezing. I put my hand against my cheek and it was so cold, but when I touched my ear, my fingers didn't feel cold at all. This led me to believe that ears couldn't feel cold and I was going to post on this matter but then I thought that I'd think about it some more. I came to the conclusion that my ears were too numb to feel my cold fingers. Duh. So simple. That was an example of how dumb I am but here's an example where I'm not so dumb.

I love winning bets. Actually if it's something that I can control to win the bet, then you better believe that I'm gonna put in 1000% to win it. A guy at work made a bet w/ me that I couldn't un-wrap the text in a text file report and then put the text in the right columns because he had tried doing that many years ago and there were too many variables that made 100% accuracy impossible. And I agree, it is a pretty complicated report, but I took him up on the challenge. The secret is finding all the patterns in the data and then creating the code for each pattern type. At first glance, I couldn't find a pattern and thought he was right, but after staring at it and going through each line of data, I found a pattern! I felt like John Nash finding patterns in newspaper and magazine clippings (minus the made-up people in my head.. they're not made-up, they're real)! After you find the pattern, it's as simple as writing the code to manipulate the data the way you see it in your head. It's hard to explain, but when I was looking for a pattern in the report, I was actually thinking up loops and conditions in my head that would produce that result. And not just thinking them up but actually visualizing the steps to get what I need in the output. I tend to forget such thoughts easily so I had to go and draw out the flow of the program so I could refer to it when I'm actually coding.

Anyways, that probably bored 99.99% of you, but I think I got the code to work! Now my co-worker owes me lunch! Mendy's! And it's not a meal if I only order soup. Soup is not a meal... unless I crumble (my manager made that clear). Actually, I shouldn't put up the "Mission Accomplished" banner yet. I only got the code working with one set of data. I need my co-worker to send tons of reports to it to really test it. But if anything, I'm really close!

Let's go back to John Nash for a second. Was the coding example above an actual example of game theory? If there's an economics major reading this, please let me know. Wikipedia gives the following definition:

"Game theory is often described as a branch of applied mathematics and economics that studies situations where players choose different actions in an attempt to maximize their returns. The essential feature, however, is that it provides a formal modelling approach to social situations in which decision makers interact with other minds. Game theory extends the simpler optimization approach developed in neoclassical economics."

My co-worker made a decision to challenge me and also to tease me that I would never be able to do it (albeit jokingly). I made a decision to prove him wrong. Although he had one goal by putting up a challenge and insisting I couldn't get it to work and I had a goal to prove him wrong, the maximized return would be a correctly formatted report created in a short period of time. Is that or is that not a social situation in which decision makers interacted with other minds to maximize results? Or is that a stretch?

3 comments:

White Toast with Butter said...

I just asked Jim if he owed you lunch and he said...he would NEVER make a bet with you (that is a compliment). We also think you are frightening...if you could only use this fright for good.

Ankit said...

Haha, I don't get it.. What part frightened you?

White Toast with Butter said...

Frightening in a funny, weird, crack us up way.