Chapter 24. Making Life and Death Decisions with Perl
Richard Dice
Imagine a community in Canada’s far north, 1,000 people with not so much as a caribou between themselves and the North Pole. It’s suspected that this community might be experiencing an outbreak of a nasty disease called backslashitis, so the public health department has organized a general test of the population.
Backslashitis is fatal, but it can be successfully treated if caught in its earliest stage. However, the treatment is almost as bad as the disease. It’s painful, lengthy, expensive, and would require relocating the patient to the nearest major urban center— Edmonton, over two thousand kilometers away. Long-term studies have shown that contaminated regions tend to have one infected individual per thousand.
The test for backslashitis isn’t perfect, however. An infected individual will be correctly diagnosed 99 times out of 100, while a healthy individual will incorrectly register a positive test result 1 time in 1,000.
Now, we have to make a tough decision: based on the results of this test throughout the population of the community, what course of action will we recommend to people who test positive? Are we willing to advise them to leave their families for months and endure a great deal of hardship for the sake of curing a disease they might not even have?
We’ll examine this situation in two ways. First, with probability theory, and then with Perl. In this article, we work through the simple but often misunderstood ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access