?

Log in

No account? Create an account

Previous | Next

Geekiness revisited

Remember the knapsack problem from xkcd that I posted about a few weeks ago? I wrote a perl script to solve it, but screwed up on a floating point comparison so when I thought I had found the unique solution, there were actually two.

I never read the blog that Randall Munroe keeps on that site, but took a peek at it just now. Imagine my surprise to read that he made the exact same mistake I did and missed the second solution, thus blowing his own joke.

I feel.... vindicated. I wish I had seen his post much sooner; I might have chimed in.

On the other hand, check out the REALLY bizarre Perl scripts someone named Aristotle Pagaltzis wrote that solve the problem handily. I get the backtracking algorithm but honestly wouldn't have thought of this problem in terms of a depth-first search (on the other hand, CS 345 was twenty-four years ago for me). His second script... I'm not even sure I recognize that as Perl. Makes me feel unworthy.

Tags:

Profile

14L
szasz
Charley

Latest Month

July 2013
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
28293031