Archive for August, 2008

Final Olympic Medal Race Results

A few days ago, when I wrote a post proposing a metric to rank countries in the 2008 Olympics, it wasn’t yet over. Now that we have final results, let’s see how we rank:

China   100%
United States   94%
Russia  60%
Britain 43%
Australia       38%
Germany 36%
South Korea     29%
France  29%
Italy   23%
Japan   21%

Leave a Comment

Who is Winning the Olympic Medal Race?

Several rankings have been proposed as to how to determine which country is winning the Olympic medal race.  Here I’m only going to look at the medals in isolation.  Folks have suggested dividing the medals by the countries’ populations, by the GDP or by the number of athletes.  You could factor in the sport popularity, fourth place rankings or time zone differences.  You could even rank the countries by how well they exceeded expectations on online betting sites.  I would like to see that.  But it’s too complicated to do here.

Back to the medals alone.  That means three numbers per country.

1) Using the total number of medals leaves out some important information.  3 golds is obviously better than 3 bronzes.
2) Using the number of golds leaves out some important information.  3 golds and 3 bronzes is obviously better than 3 golds.

I’m not the first one to suggest weighting the numbers.  It’s progress, but it punts on how to do it.  I’ve seen 4, 2 and 1. I’ve also seen 5, 3 and 1.  It’s pretty easy to make up numbers, but it’s more satisfying to have a rationale.  Here I propose the <i>distinguishing power</i> rationale.  There’s only one gold medal.  There’s also only one silver medal, but somebody else did better, so silver has half the distinguishing power of gold.  Similiarly, bronze has 1/3 of gold.  The actual weights don’t matter as long as the ratio is right.  6, 3 and 2 are the smallest integers that express the distinguishing power ratios.

And finally the rankings (today), as a percentage of the leader:

China   100%
United States   93%
Russia  49%
Britain 43%
Australia       36%
Germany 31%
South Korea     27%
Japan   24%
France  24%
Italy   20%

Comments (1)

Permutable Dates

Gregorus seems to have already posted about this, but I can post my solution. We came up with the puzzle of finding the 8-digit number (with zeros allowed at the beginning) which has the largest possible number of permutations that are possible dates. Some numbers like 99,999,999 don’t have any. Others like 01,234,567 have a lot (starting with 01/23/4567, and most of those digits can be swapped around).

I wrote my program in the Bash shell language and it has two lines.

Line One:

perl -e 'use  Date::Manip; my $d = ParseDate("01/01/0001");while(UnixDate("%Y") < 10000) {print UnixDate($d,"%m%d%Y\n"); $d = DateCalc($d, "+ 1 day");}' >> all-dates.txt

This just makes all the possible dates, one day at a time. Perl’s Date::Manip module is notoriously slow, and it took almost two hours to make all 3,652,059 dates in this millenium (not quite actually: the last year of the millenium has a five digit year). As for the delay, I rationalized that I had optimized my code for “programmer time”.

Line Two:

perl -ne 'print join("", sort (split("", $_)))' all-dates.txt | sort | uniq -c | sort -n

This sorts the digits in each date to make ordered digit clusters, then orders the clusters of digits by how many times they appear.

The results? 00,123,578 will make 2,472 dates! Of course, it is a 20,160-way tie, because any permutation of 00,123,578, such as 57,800,123 will make the same 2,472 dates.

Unfortunately, I can’t make any dates near to us from 00,123,578. The closest I can get on both sides is 07/08/2135 and 03/20/1875. Can anyone do better?

Comments (2)

Clockwork Powers

Here’s another problem I’ve been looking at lately:

Find a number $x$, such that if $j$ is any digit from 0 to 9, $x^{j}$ has $j$ as its first digit past the decimal point. For instance, 63.18 works for the first power $(63.18^{\b{1}} = 63.\b{1}8)$ and the third power $(63.18^{\b{3}} = 252196.\b{3}89432)$, but it doesn’t work for the second $(63.18^{\b{2}} = 3991.\b{7}124)$ where the first digit is 7 instead of 2.

Hint: The smallest such number is less than 10.

To prove that the problem is possible to solve quickly, I’ll provide the solution to a more complicated version. Suppose that the first two digits of $x^{j}$ must match $j$ instead of just the first one. This means that $x^{3}$ has “03” just to the right of the decimal point all way to up to $x^{99}$ having “99” just after the decimal point. Then the smallest solution is the following number:


The smallest solution’s digits actually never end so I had to cut it off somewhere. I choose the cut off point to be the first place where the remaining digits still worked. In other words, if you truncated the 4 off of the end, the number would be changed too much and would fail to meet all the conditions. Furthermore, I was forced to round up (because anything smaller doesn’t work).

Leave a Comment