The Silmarillion in 1000 Words

Camwyn@LiveJournal did a fairly good job of summarizing some very dense text.

AINULINDALE:

ILUVATAR: LA LA!

AINUR: LA LA!

MELKOR: This sucks. BUM BUM BA DUM!

AINUR: Um. . . la?

ILUVATAR: Ahem. LA!

MELKOR: Boop bop-a-doo-bop!

ILUVATAR: LA, dammit.

MELKOR: Bwam bardle ningle boom.

AINUR: . . .

ILUVATAR: Right, you’re out of the band.

Posted by Garrett on April 29th, 2004 in Uncategorized | No Comments

Sorting in Windows Explorer

Create a text file in Windows Explorer called “gf99999a.txt”.

Then create one called “gf100000.txt”

Then sort by name.

What is wrong with this picture? :-)

Update: Nothing. See the comments on this post of Raymond Chen’s.

Posted by Garrett on April 29th, 2004 in Uncategorized | No Comments

Sharing birthdays

Each of my daughters has been invited to a birthday party this weekend. I had read in the past that it took an absurdly low number of people to give better-than-even odds of sharing a birthday, but I had forgotten the number. FoxPro to the rescue!

lnProb = 1
lnCount = 1
DO WHILE lnProb > .50
lnProb = lnProb * (365-lnCount + 1) / 365
lnCount = lnCount + 1
ENDDO

? “Probability of ” + TRANSFORM(lnCount) + ” people sharing a birthday: ”
?? 1 - lnProb

With two people, the odds are 364/365 that they don’t share a birthday. With three people, rather than 363/365 that they don’t share, it’s actually (364/365)*(363/365). This number shrinks faster than you’d think: run the algorithm above in your favorite language to find the answer.

Update: fixed the backwards probability in the above code. Thanks, Ted!

Posted by Garrett on April 29th, 2004 in Uncategorized | No Comments