Sunday, August 20, 2006

Thinking about Math

I love my job because it fits well with the way I think. Thinking in a logical and orderly fashion comes naturally to me.

These days, I spend most of my time at work writing and debugging programs. I come up with algorithms, implement them, and then figure out what went wrong.

I begin by determining what I want my algorithm to do. Then I do a simple example, and from there, try to generalize to an algorithm. After that, I try the algorithm on a more complicated example. If it doesn't work, I revise my algorithm until it does work. And then I keep thinking about possible counterexamples and amend the algorithm accordingly.

Eventually I get to the point where I can't come up with any more counterexamples and I go ahead and implement the algorithm in C++. (I enter this stage of the process with the understanding that there are probably still cases that I have not considered that will cause my algorithm to mess up.) After I get it to compile without errors, I run the algorithm on a simple example, and if it works, go ahead and try it on a more complicated case. If I'm really lucky, then these tests have worked and I try the algorithm on a simple real-life case. At this point I usually find that there is a flaw in my logic and I track it down using print statements and logical thinking.


I told my sister Laura once that what makes me such a good mathematician is that I'm "fair with the numbers." That is, I consider all sides and look for counterexamples before drawing a conclusion. For example, given the fact that 2 + 2 = 4, 2 × 2 = 4, and 22 = 4, it might appear that the addition, multiplication, and exponentiation operations are equivalent! (I know, this seems like a really stupid example, but bear with me.) A careless mathematician would draw the conclusion that the operations are the same. If I didn't know anything about these operations, but had a source that could give me the results of using these operations, here's how I would figure out whether they were the same or different.

First, I would generalize each operation. I would try to find a counterexample for x + y = x × y = xy. Here's one: x = 2, y = 3. 2+3 = 5, 2 × 3 = 6, 23 = 8. Okay, so these operations are not the same in general. But what about in the case where x = y? Maybe they are the same then. So I need to look for a counterexample. Here's one: x = y = 3. 3+3 = 6, 3 × 3 = 9, 33 = 27. From this I conclude that x = y = 2 is simply a special case in which the operations happen to yield the same result.

I know that this was a ridiculous example, because we all have an understanding of the addition, multiplication, and exponentiation operations. But in my line of work, I look at much more complicated operations, sometimes called "black box" functions, the inner workings of which are beyond my comprehension. The only data I have are the input and the resulting output. So the techniques I used on the simple operations above come in very handy when dealing with more difficult functions.


I think about most things in life in a similar fashion, and I find that it really helps me to make sense of the world. For example, my fellow human beings are classic black box functions. I have no idea what makes them tick. The only way that I have to understand them is the input and resulting output. So, based on previous data, I can say with some degree of certainty that if I buy some cream cheese for Laura, she will eat it, because I have seen this happen in the past. Or if I give her a hug, she will hug me back. I know her fairly well, so I have a lot of data on her.

Strangers, on the other hand, are more complicated. When I interact with someone for the first time, the only data I have is an approximation of how they may behave, based on my previous experience with other people and my reading of their body language. Usually I try to say something humorous, to make the other person laugh, because in my experience, humor is a good way to open doors with people. But, it doesn't always work, because of the differences between the person I am talking to and the sources of my other data points.

Someone not laughing at my jokes doesn't necessarily mean I'm not funny; it just means that given the input of my joke and the input of whatever else in their life, their black box doesn't compute "funny" in this case. Why did they not compute "funny?" Maybe they're having a bad day. Maybe they didn't hear me. Maybe they're preoccupied with something else. Maybe I inadvertently offended them. Maybe I'm ugly and my mother dresses me funny. Maybe I don't have a good sense of humor. There are many possibilities, and without more data, I can't be sure what it is. But, I can narrow it down based on nonverbal cues and past experience.

For example, in the vast majority of interactions, when I tell a joke, people laugh, so I don't think it's that I don't have a good sense of humor. I could be ugly, although most of the time people are able to look me in the eye, so I'm probably not that ugly; and my mother definitely has no say in what I wear. Maybe I have accidentally said something offensive: I try to consider this from every possible vantage point. My jokes are never racially-, gender-, or religiously-oriented, and very rarely politically-oriented, so this seems unlikely. I examine the nonverbal cues to see if anything stands out. I can usually tell if someone didn't hear me, because they get this certain look on their face. And I can often see evidence of a bad day or preoccupation in their eyes and mouth and mannerisms.

This sort of logical thinking helps me to take my interactions with others less personally, the bad interactions in particular. When I was younger, I thought that a bad interaction was something personal against me. Now that I'm older and understand that the other person is a real person responding to stimuli based on their own outlook and experience, I am able to take things less personally when things go wrong. For example, I have a seemingly unresolvable conflict with a close family member, but I am able to see why that person might take what I say in the wrong way, and instead of beating myself up over it, I do what I can to avoid further misunderstandings while remaining true to myself. It doesn't make things easy, but it does make things easier.

2 comments:

Anonymous said...

Heh. Scott refers to some people as having "buggy hardware". Like how our wireless router always crashes after we listen to a baseball game online -- we don't know why it does that, but it always does, and you learn to anticipate it.

Laura said...

Rach -- it's 'cause your computer knows that baseball is BORING! ha ha, joke. :-)

Becca -- I enjoyed this post. Your thinking is very elegant, really. Nice.