All problems

How Reliable Is a Negative Test Result?

easyPythonBayes' Theorem

A Northbeam Health screening programme sends out two kinds of letter, and by far the more common one says the result was clear. Before the clinical lead signs off the wording, she wants to know what a clear result is actually worth: if a resident is told the test came back negative, how confident can they be that they do not have the illness?

Each programme is described from the negative side: how common the illness is across the county, how often an ill person is wrongly read as negative, and how often a healthy person is correctly read as negative. She signs off the wording separately for every programme, and they range from very rare illnesses to ones most of the screened group already has.

Task: Print the probability that a resident who tested negative genuinely does not have the illness, as a single number rounded to 4 decimals. Round once, at the end.

Input

Three lines, each a decimal between 0 and 1: how common the illness is in the county, then the chance an ill person reads negative, then the chance a healthy person reads negative.

Output

One line holding the probability, rounded to 4 decimals and printed the way Python prints a float - 0.9994.

Example:

Input:
0.01
0.05
0.9

Output:
0.9994

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…