Thursday, August 31, 2006

With Apologies to Bob Dylan

How many times must a woman go pee,
before her baby arrives?
How many aches will she get in her feet,
her ankles, her knees, and her thighs?
How much more weight will she gain before then;
her ankles will swell to what size?
The answer, my friend, is blowin' in the wind,
the answer is blowin' in the wind.

How many times will the baby kick me,
until he decides to come out?
How many days will it take me to lose
the weight that is making me stout?
And how good a mom will I turn out to be
and will I remain filled with doubt?
The answer, my friend, is blowin' in the wind,
the answer is blowin' in the wind.

Tuesday, August 29, 2006

Blog Haiku

Haiku2 for riebecca
can narrow it down
based on their own outlook
and experience
Created by Grahame

Busy B

I've had a busy week. Last week, I worked really hard at work. Then, on Friday, Laura came for a weekend visit. As a gift for Vinny, she came to help me sew for his nursery. It was a big help because thanks to my medial epicondylitis, I really can't do much sewing by hand. So we did the pieces that would require the most hand sewing first: the blanket and bumper. Thanks to Laura's excellent sewing skills, we finished both of those pieces. She also cut out all the pieces for all the other nursery pieces: the curtains, the valance, and the crib caddy. That was a big help because it's now a little bit hard for me to get on the floor, much less get up from the floor. So it's nice that all these pieces are ready for me to sew whenever I get to it.

The nursery theme is tropical fish. I looked at all the nursery themes at the store but was unhappy with them, so I decided to make my own instead. I found some great tropical fish fabric on the internet and went from there. The cost of the nursery is comparable to if we'd bought a set at the store, but it's more what we want. Plus it's made with love, so it's got to be better, right? :)

In addition to sewing, we also managed to talk a lot and have a good time. We took some time out to have fun, like going to what is the best Thai restaurant in East Tennessee, according to a friend of mine; eating delicious Mexican food cooked by Jody and delicious manicotti made by Jeff; and seeing a few sights around town. She also was kind enough to clean our gutters. I told her to come back any time!!!

I took Laura to the bus station early Monday morning, and then returned home and went back to bed. Then in the afternoon I went to the doctor because I was a little worried about the sudden swelling in my feet, hands, and face that I had developed. As it turns out, I'm just fine, but I wanted to make sure that I didn't have pre-eclampsia.

Today, they held a baby shower for me and Jeff at work. As part of the celebration, Jeff got to come to the shower. Since he had a visitor's pass that was good for the entire day, he just came to work with me and read while I worked. I took him to lunch to experience the disgusting cafeteria food, and after lunch we went to an awards ceremony during which my boss got an award for being a good mentor. I was not the one who nominated him for the award (it was a summer student), but I definitely think he is a very good boss and I can understand why the student nominated him.

The baby shower was at 2:00. Lois, our department secretary, was the one who organized it. She had evidently been listening to me when I babbled to her about the baby, because the shower theme was tropical fish, with a cake decorated with tropical fish, paper plates shaped like tropical fish, and a tropical fish tablecloth. All the attendees, except for one woman from upstairs, Lois, and myself, were men, and in fact some of them said it was the first baby shower they'd ever been to. Lois said they had to play one shower game, so she had a list of baby-related words that they had to unscramble, and whoever got the most in three minutes won a prize.

I think everybody got together and gave Lois a bunch of money and she went and bought a bunch of gifts for us. There was a lot of stuff, and it was really great. In addition, my boss gave us a gift card, which was really nice of him.

It made me feel really good to know that all those people cared enough about me to chip in for this baby shower. I haven't been here quite a year yet but I have made a lot of friends and put down some roots. I am always surprised to (re)discover that people really seem to like me, and today I was pleasantly reminded that I am not as unlikeable as I appear to myself.

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.

Sunday, August 13, 2006

Showered with Love

Yesterday Jeff and I went to a baby shower in our honor that was hosted by fearless relatives Ginger, Rhonda, and Liz, at the home of some of Jeff's cousins. We drove up to Kentucky on Friday night, spending the night with Dad and Marvis before continuing on to the shower the next day.

The shower was a lot of fun. We got to see a lot of relatives and friends that we hadn't seen in a long time, including Jeff's Aunt Mary and Uncle Wayne, who drove all the way up from Harlan; my cousin Elizabeth, a journalist temporarily assigned to work in Louisville; and my high school friends Carrie, Tabitha, and Chris, and Tabitha and Chris' daughter Samantha, whom I met for the first time.

There were more people there than I could count, but I would still say that it was a finite number, definitely less than 100, and probably under 50. I'm not the world's most outgoing person, so the sheer numbers of people and the resulting loudness was a bit much, but I tried not to let it overwhelm me.

Ginger came up with some wonderful games, including one where the object was to make as many words as you can from the letters of the baby's name. Thanks to the very long name that we have chosen for him and Ginger's word and spelling abilities, she came up with over 150 words that were contained in his name! She showed me her list, and the one that made me laugh the hardest was "tirade." If he inherits anything from either of his parents, we're going to hear a lot of those in the future!

Jeff made a very clever movie trailer about our baby, using his Father's Day gift video camera and the awesome software that comes standard on a Mac, and burned it onto a DVD. He gave one copy to Dad and Marvis, and another copy to his parents. But he also showed it at the baby shower. I can't really describe it without completely giving it away, and I want two of my fans to see it and enjoy it (I'm thinking of you, Rachel and Laura!) so I don't want to give anything away. Suffice it to say that the movie generated a lot of laughs and people really got a kick out of it.

Of course we also opened lots of gifts. Mostly we got stuff that we had registered for, but highlights from off the list include an afghan handmade by Jeff's mom, a UK outfit to counteract the UT onesie Jeff sacrilegiously bought for our son, and a hat handmade by bonus sister Vaughan. In total, we came out of there with a lot of loot. My dad used his packing SUPERPOWERS to fill every single nook and cranny in the trunk of our car, while dad-in-law and John Rice used their talents to fill the back seat, and by defying the Pauli Exclusion Principle, they fit all of it into the car.

I mustn't forget the amazing cake, brought by Rhonda. I am so bad about taking pictures and now I wish I had one of the cake, because it is hard to describe. It was a beautifully decorated cake with the baby's name, blocks with his initials, and two baby booties made of frosting. Under the icing, half of the cake was chocolate and the other half was white cake. The cake was specially ordered from a particular bakery in Winchester and it was really outstandingly decorated, and delicious too!

We drove home after the shower and got in just before midnight, because today we are going out to dinner with some friends. A graduate school classmate of mine, his wife, and their one-year-old son are in town visiting his parents, and they graciously agreed to take some time away from the family to see us. He currently works at Sandia but because of the dire financial situation there is looking for a job after his term of employment ends. He's interested in working here, because this is the happening place, evidently. No, seriously, national labs have their ups and downs, and right now Oak Ridge is on the upturn, while Sandia is on the decline. Ten years ago, ORNL wasn't such a great place for computational science, but now, we are becoming the center for leadership computing, we have attracted great people from elsewhere, and more and more money keeps flowing in. So I seem to be in the right place at the right time.

Tuesday, August 08, 2006

Interesting Math Links

Because I know that sometimes the mathematical content on this blog is a bit sparse, I have found two interesting math links for you to peruse. The first is a blog written by a professor in the math department at Northeastern University. Professor Bridger is an unpaid consultant for the popular television series Numb3rs, and he gets to review the scripts before they begin filming. The blog is mostly dedicated to Numb3rs episodes and a discussion of the math in each episode.

I'd have to say that Numb3rs is one of my favorite shows on television. I don't watch much TV, but if I see that Numb3rs is on, I will watch it. It's usually on at 10 p.m. Friday nights on CBS.

The premise of the show is that the younger brother of an FBI agent is a mathematician and he uses his math skills to help the FBI solve crimes. It's a mathematically accurate show. The writers take their inspiration from real-life cases solved using mathematics, and they employ many mathematics consultants to make sure that the math is right. Sometimes they go a bit overboard with gratuitous equations on the chalkbord that serve only to impress the television audience. But overall, the math content is very good and it serves to show people that math isn't just boring equations and esoteric theorems. Math is important and applicable.

The second math link is the website of actress/mathematician Danica McKellar. Ms. McKellar is probably best known for her portrayal of "Winnie" on "The Wonder Years," but she is also an accomplished mathematician. As an undergraduate math major at UCLA, she was the co-author of a mathematical proof. After college she continued her acting career, but she is still an advocate for math education and for women in mathematics. She's coming out with a book aimed at encouraging girls to pursue mathematical studies, entitled Math Doesn't Suck. For more details about her accomplishments, see this article.

Friday, August 04, 2006

The Calculus of Voting

Yesterday Jeff and I did our patriotic duty and voted. It was strange because not only was it a Thursday, but this election was a general election for county offices and a primary for state and national offices (e.g. state senator, governor, and U.S. senator). We used these newfangled electronic voting machines. As a computer scientist, I have some reservations about electronic voting machines, particularly systems that do not have a paper backup. I don't think we have the notoriously bad machines here, but I still feel skeptical about their fairness.

The security issues of electronic voting machines could be a post of its own, but of course I know that my vast audience comes here for the math, not the computer science. So instead I am going to discuss another way in which elections may not be completely fair, even assuming the votes are counted perfectly.

Ideally, we should use a voting scheme that selects the most preferred candidate as winner. This would be the candidate who always win in a run-off between himself/herself and any other candidate. The most preferred candidate is also known as the Condorcet winner. In a vote between two opponents, selecting the most preferred candidate is simple: people vote for their favorite candidate, and whoever gets the most votes wins. But for a race with more than two opponents, selecting the Condorcet winner is complicated, and sometimes, there may not be a Condorcet winner.

With the voting system that we use, unless one candidate is clearly preferred over all the others, the Condorcet winner may not win. In fact, the Condorcet loser may end up being selected. A classic example of this is the presidential election of 1860. This was the year that Abraham Lincoln was elected president. That year, there were four candidates: Lincoln, Breckinridge, Bell, and Douglas. Lincoln carried most of the northern states, and the three other candidates split the remaining states. Let's pretend for the sake of argument that the winner of the popular vote would win the election. (In reality, Lincoln got 40% of the popular vote but 59% of the electoral college, so in some sense he won the majority of the vote.) Here are the election results, in percentages:
Lincoln: 40%
Douglas: 29%
Breckinridge: 18%
Bell: 13%

So Lincoln received the most votes, but he did not receive the majority of votes. Would he have won a runoff against every opposing candidate? Probably not. Chances are, if the people who voted for Breckinridge or Bell had to pick between Lincoln and Douglas, 99.9% of them would have selected Douglas, so Douglas would have won that race 60% to 40%. Similarly, Lincoln supporters would have probably preferred Douglas over Breckinridge or Bell. Douglas was almost certainly the Condorcet winner of that election.

In yesterday's primaries, there were a plethora of candidates for nearly every position. In the Democratic race for United States Senator, there were five candidates. As it turns out, one candidate, Harold Ford, Jr., got 79% of the votes, so there is no doubt that he was the Condorcet winner of that primary. But for the Republican race, there were four candidates, with the highest vote-count going to Bob Corker with only 48% of the vote. (Is it just me, or does that name make you laugh?) Anyhow, it is possible, although unlikely, that Bob Corker was actually the least preferred candidate, despite winning the election. Let's call his opponents X, Y, and Z. It could be that all supporters of X would choose Y over Bob and Z over Bob, and all supporters of Y would choose X or Z over Bob, and all supporters of Z would choose X or Y over Bob. I'm not trying to pick on poor Bob Corker, but I think you get the idea. The point is, Bob's supporters could be very overzealous about him and only him, but the supporters of X, Y, and Z could prefer anyone but Bob. This means that Bob was actually the least preferred candidate, despite the fact that he got the most votes out of anyone.

How can we be sure that the Condorcet winner is always elected? As I hinted above, we can't always be sure that there is a Condorcet winner. We could have a three-candidate cycle, for example. If we have three people (1, 2, and 3) voting in an election between three candidates (A, B, and C), the voters might have the following preferences:
1: A > B > C
2: B > C > A
3: C > A > B

So, if we ran A vs B, A would win 2-1; A vs C, C would win 2-1; and B vs C, B would win 2-1. So no candidate wins all the runoffs they are in; therefore there is no Condorcet winner.

But, assuming there is a Condorcet winner, there is a simple way to find it, and that is by having the voters rank the candidates in order of preference. From this data, a computer can compute the outcomes of all the runoffs, and determine the Condorcet winner. If the Condorcet winner does not exist, there must be some sort of tie-breaking method agreed upon ahead of time so that the election will have a winner.

Unfortunately, Condorcet voting methods are rarely used. Even in places like Europe where there are multiple political parties, the instant-runoff or Borda count methods are usually used, and neither are guaranteed to elect the Condorcet winner (assuming it exists).

Personally, I would like to see Condorcet voting methods implemented in the American election system. Now that our voting is becoming computerized, I don't see a problem with implementing these methods. It would take a computer very little time to find the Condorcet winner. And if one candidate garners over 50% of the vote, no computations would be needed!

If you are interested in learning more about Condorcet voting methods, may I recommend the Wikipedia article on the topic. Also, I got my information on the election of 1860 from the Wikipedia article on the United States Presidential Election of 1860.

At Arm's Length

Update about my left elbow and the shot I received on Tuesday:

I've been icing it down every night, just like the doctor told me to. I'm supposed to ice it down every night for at least ten nights. I also need to find my counterforce brace and wrist brace and wear them during the day when I'm using my left arm.

On Wednesday and Thursday, I had a tough time bending my elbow more than 90 degrees, which made life rather interesting. For example, I needed help fastening my bra. Doing my own hair was challenging too, so I had two really bad hair days. Another thing was that I couldn't move my arm fluidly enough to eat, so I had to eat completely right-handed.

Today it was less stiff but still not great. But I was able to get dressed on my own and I didn't look like I'd used a five-year-old as a hairdresser. I was even able to write a little bit with my left hand! So it is definitely getting better.

Still, I'm trying to take it easy with the left hand, because the shot won't last forever. I'm definitely going to need that elbow for much more important things, such as holding my baby, in roughly 60 days. So I'm still trying to eat right-handed and do as many things as I can without using my left hand.

Tuesday, August 01, 2006

Elbow Grease (part 2)

Today I saw the orthopedist again. I don't think that the occupational therapy had really helped very much. Unfortunately, there are not two parallel universes, one in which I had occupational therapy and another in which I did not, so I can't say for sure whether it helped. For all I know, I could be a lot worse now if I hadn't done it. In any case, things have not improved, so I went back for another appointment with the doctor. He decided to let me have another shot in the elbow. So I took him up on that.

Before the anesthetic wore off, it felt like I had a new elbow. Now it feels worse than it felt before the shot. But I know that after my elbow heals up from having a gigantic needle stuck in it, it will feel much better.

If it hurts more after the baby is born, he told me to come back again. He said it was reasonable to give me a shot at most once a year, but if I need it more often than that, then he really needs to try something else. He talked about surgery, and seemed open to the idea of doing it, after I was no longer pregnant and assuming the problem came back. He did remark that I had a pretty bad case of medial epicondylitis. Hopefully (worst case) this injection will tide me over for the next few months and then I can have the surgery if I need it.