Puzzle for October 30, 2006

The Perfect Antivirus

by Dr. Solly

I shall now give you, free of charge, an antivirus that if used correctly, detects all past, present and future viruses, never gives a false alarm, and has a zero cost. Skeptical? Then watch carefully ...

program P1.BAT:
Echo %1 is infected by a virus!!!

You'll agree, I think, that P1.BAT will detect all past present and future viruses. That alone meets the “mathematically impossible” task! But, I hear you thinking, aren't there rather a lot of false alarms? Well, you didn't say you wanted a low false alarm rate....

OK, OK. I'm used to projects where the user specification changes in the middle. Never mind. I can deal with the false alarms ...

program P2.BAT:
Echo %1 is NOT infected by a virus!!!

You'll agree, I think, that P2.BAT will never, ever, tell you that you have a virus when you don't. Of course, it has a pretty poor detection rate. I admit that. But I can fix it. See here ...

program PERFECT.BAT:
Echo Is %1 a virus? (Y/N)

If the user types “Y”, you run P1.BAT. If the user types “N”, you run P2.BAT. Remember what I promised you? An antivirus that if used correctly, detects all past, present and future viruses, never gives a false alarm, and has a zero cost.

All very amusing, but what can we learn from this?

  1. If something is superb at detecting viruses, it's no use if it gives a lot of false alarms.
  2. Anything that relies on the user to make a correct decision, on matters that he is not likely to be able to decide about, is useless.
  3. You can receive something that is exactly what the salesman promised to deliver, and it's nevertheless useless.

You can also obtain a PDF version of this. Version of October 29, 2006 at 9:26 PM