Thursday, March 27, 2008

How do you create a round-robin schedule?

April 2008 - This year we've added two more teams, for a total of ten, to the golf league I run. Being our regular season is fourteen weeks, putting together a round-robin schedule in the past for eight teams was pretty easy. Each team plays each other twice. Now that we have ten teams, cramming us all in fourteen weeks is a bit more difficult.

I spent a few hours trying to figure out how to setup a round robin schedule. After frustrating the hell out of myself, I broke down and asked Wikipedia. The first search I ran, gave me the algorithm that I needed.

Thinking back on it, it's actually pretty simply. I started by creating a spread-sheet and matched up 1-2, 3-4, etc. Then I simply held the "1" team constant, and used the algorithm to rotate each team around in a circle. It looked something like this as I went through.
Week1





0102
0304
0506
0708
0910
Week2





0103
0502
0804
0906
1008


If you do this nine times, each team of the ten will play each other. When you do it the tenth time, you'll find yourself back at the beginning. Finding this exercise fun, I simply followed the algorithm a total of fourteen times to give us our regular season. That means each team will play each other once. Then you'll play five other teams twice. Not ideal, but it works.

Once I had the schedule in place, I had to assign team names to 1, 2, 3, etc. I thought about drawing numbers out of hat like last year, but my wife was uninterested in helping me out and when trying a sample drawing with my seven-month-old son, he started to eat the numbers. Being I've spent a significant amount of my career and education working with technology, I fired up the spread-sheet program again and used a random number generator to rank the teams. Mentally Handicap came in at the lowest (0.378373293) which made them team "1". Brad Smith's new team, Missing Links, was the highest (9.788895237) and thus was the "10" team.

At this point I needed a cold beverage to celebrate. As I cracked a cold Surly, my wife said "why does the "1" team always golf first?" She had a point; our tee-times needed to be ranked. To do this I went back to the random number generator and created a ranking for each week. The lowest random number got the first tee-time (3:44) while the highest got the last (4:48). Now you'd think that a random number generator would equally space each team so we don't have the same teams always teeing off at the same time. Apparently this is tougher than expected though so I had to manually adjust five to six times so that we didn't have Noonan! teeing off at 3:44 every week.

After ranking the tee-times, I started sipping on my Surly, admired the creation and started thinking about all the shots I plan on shanking. Happy golf season!

Monday, March 03, 2008

What causes inflation?

March 2008 - This morning I heard a local bread baker say their flower prices have went from nine dollars a bag (not sure how big the bag is) to twenty nine dollars a bag in the past year. This confirms my local pizza guy's claim when he said their food costs have doubled in the past year. So this got me wondering, what causes these prices to inflate?

Appropriately enough, I'm taking a class called World Economy from the University of Minnesota. The first section covered how the Federal Reserve Board works. The second section is on inflation. Could my registration in this class be fate?

From what we've learned, inflation is when the value of a monetary representation (e.g. dollar) looses purchasing power. Remember that age old saying "a dollar today is worth more than a dollar tomorrow?" It's kind of annoying, but all too true. Every day, money looses value due to inflation. The percentage that is lost, fluctuates. Let's look at why.

Governments love to spend money. Defense, welfare presidential parties; they call cost money and someone has to pay for them. Similar to a fiscally responsible person or family, a fiscally responsible government will spend only what it can afford. We all know that the government is hardly ever fiscally responsible though, and so they have a propensity to run deficits.

Once a government has a deficit they have to pay for it. This can only be done on two ways; raise taxes or print money. Everyone knows how political raising taxes is. Many of us Republicans will vote a person out of office for even thinking of such a thing. And though I don't agree with the Republicans all the time, raising taxes will harm growth.

The other way to pay for a deficit is to print money. Basically this means increasing the money supply. Wouldn't it be nice if it was that easy? Just print money and everything is kosher again. Bills are paid and we can start spending once again. Sound too good to be true? It is.

When the money supply is increased, the value of existing money goes down. That's a fundamental of economics. Supply goes up, price goes down. Money is no different.

So where does this leave us? The U.S. government is running a deficient right now. In the long-term we can pay for this by raising taxes or printing more money. In the short term, we're paying by borrowing. Borrowing will only last so long. At some point, we'll need to pay.

Since raising taxes is so political, the only way to deal with our growing deficit is to increase the money supply. Meaning that our free government's free spending will eventually lead to higher inflation. Looks like that pizza guy down the road might have to raise prices even more in the near future.