10.15.07
Posted in math at 8:35 pm by danvk
I learned a great brainteaser while hiking in Yosemite with many a Googler this weekend. It’s from a collection called “Seven Puzzles You Think You Must Not Have Heard Correctly” (PDF), and that title is particularly apt for this one.
Here’s the question:
The names of 100 prisoners are placed in 100 wooden boxes, one name to a box, and the boxes are lined up on a table in a room. One by one, the prisoners are led into the room; each may look in at most 50 boxes, but must leave the room exactly as he found it and is permitted no further communication with the others.
The prisoners have a chance to plot their strategy in advance, and they are going to need it, because unless every single prisoner finds his own name all will subsequently be executed.
Find a strategy for them which which has probability of success exceeding 30%.
Since each prisoner has a 50/50 shot at finding his own number, you’d expect their chances of survival to be (1/2)^100, which is tiny! But that’s not quite true. Here’s the reason it’s not impossible: the number of prisoners you expect to find their own number will always be 50 no matter what your strategy. But your strategy can skew the distribution. For example, if everyone looks at the same fifty lockers, you’ll always have exactly 50 prisoners find their own numbers. The problem is to find a strategy that skews the distribution towards the extremes: either it succeeds spectacularly or fails miserably.
There’s a solution in that link above, and I’ll post my own in a few days. Give it a shot!
Permalink
10.09.07
Posted in boggle, programming at 11:44 pm by danvk
I’ve always been a Java and Eclipse naysayer, but I’m afraid new experiences are forcing me to reevaluate my skepticism. The last time I used Java was JDK 1.3 on a Sparc workstation back in early 2004. Eclipse was hella slow on that hardware, and somehow my workspace wound up in a temporary directory. This was a very bad thing, because as soon as I logged out, my project was gone forever. So I had good reason to swear off Eclipse.
More generally, Java left off a mighty stink back in 2004. Any GUI that I ran on the Mac would look out of place and felt clunky. Performance was poor. But in retrospect, I suspect much of the rank Java smell was really coming from the design patterns gibberish I was being force-fed at the same time. Why use a simple array when you could use an AbstractListFactory that does the same thing with 10x code bloat?
Regular readers only get one guess what program I wrote to get in the swing of things.
Read the rest of this entry »
Permalink
09.19.07
Posted in personal at 10:03 pm by danvk
I made the big move up to San Francisco this past weekend. It’s something I’d been mulling over for many a month, but then the perfect opportunity presented itself. So here I am. I’m up in Russian Hill (I’ve yet to learn what that implies) at the intersection of Polk and Union. That’s an huge perk, since it’s a Google shuttle stop! Anyways, expect more San Francisco-related blog posts in the near future as I explore the city.
Blurry move-in pictures after the fold…
Read the rest of this entry »
Permalink
09.12.07
Posted in personal, tv at 10:05 pm by danvk
Back in 2001, I was in first period French class when the planes hit. A messenger came by and told my French teacher, but evidently she decided it wasn’t significant enough to merit interrupting class. I got a confused story of what had happened by my locker after class and was glued to the TV for the rest of the school day. I didn’t tune in to the news until after the first tower had collapsed. So I missed much of the initial reaction.
I’ve always wanted to watch the TODAY show broadcast from that day, to see the initial confusion as to what happened, then the realization of what was going on after the second plane hit. I’d scoured around online a few times before, but always come up empty. So I was thrilled to see that MSNBC was showing a “minimally-edited” replay of the 9/11/2001 TODAY show last night.
Read the rest of this entry »
Permalink
09.06.07
Posted in news, sports, tennis at 11:49 am by danvk
It’s time once again for a token Grand Slam post. The 2007 US Open is winding its way to the final weekend. There have been some surprises, like defending champ Maria Sharapova’s early exit, and some fun matches, like James Blake’s loss to Tommy Haas in a fifth-set tiebreak.
Last night’s match between Andy Roddick and Roger Federer was the most hyped of the tournament. The result was no surprise. Federer won in straights. The messaging on this match has been spectacularly consistent: Roddick played brilliantly, but there’s no shame in losing to the greatest player of all time. I think this is crap. People need to stop going so easy on Roddick. He’s 1-14 against Roger all-time and 0-9 since 2004. He hasn’t taken a set off the guy this year. Maybe if people stopped patting him on the back after every loss and telling him how close he came, then he’d be forced to regroup and find a way to deliver.
One highlight of the match was Andre Agassi’s debut as an announcer. Great players often make great announcers, and John McEnroe is the best in the business. Andre didn’t pipe up too frequently, but everything he said was interesting. Here’s one exchange:
When Roddick stared down Federer and bellowed after a 138 mph ace to get to 4-4 in the first set, Agassi said: “There’s a fine line between getting pumped up and waking a sleeping giant, I assure you.”
Another great moment came when Andre revealed how he used to deal with Boris Becker’s. He picked up on a tell — whenever Boris stuck his tongue out before a serve, he was sure to go down the middle. What an edge that would give you! I wonder if Roger’s picked up on anything like that. Andy’s serve just doesn’t seem to phase him.
My picks — Justine Henin beats Svetlana Kuznetsova in the Women’s final Saturday. On the men’s side, Novak Djokovic beats David Ferrer in the semis before losing a close final to the man himself, Roger Federer.
Permalink
« Previous Page — « Previous entries
Next entries » — Next Page »