Strange Brouhaha

Monday, February 06, 2006

Math Problem

Postulate a list of 50 million or so prime numbers--all of the prime numbers between 1 and 1000000000. (That's one billion.) This list, all 500+ MB of it, was generated by a program you believe to be accurate.

Postulate a second list of 50 million or so prime numbers, the same ones. This second list, all 500+ MB of it, was generated by a program that you wrote. Your code is not nearly as efficient, but it gets the job done, and a diff shows that your list matches the third-party program's list EXACTLY.

Imagine now that you are attempting to solve a problem that requires you to display a very large number of primes in a very short amount of time. Your code returns "Wrong Answer." How is this possible? I do not understand, and there is no feedback other than "This answer is wrong." It's not that the program took too long...it's that it doesn't match the expected output.

I have no explanation. I suppose I just have to live with the knowledge that whatever mistake I made, someone a lot smarter than me made the same one.

0 Comments:

Post a Comment

<< Home