All problems

How Often Does the Test Come Back Positive?

easyPythonBayes' Theorem

Northbeam Health has to book the follow-up clinics for its screening programmes, and the operations team needs one figure per programme before it can size the rota. Every positive result triggers a confirmatory appointment, a letter and a phone call - so what they need to know is what fraction of everyone who walks through the door will walk out holding a positive result. Note that this is not the same as the fraction of people who are ill.

Each programme is described by the same three rates: how common the illness is across the county, how often an ill person tests positive, and how often a healthy person is told they are positive anyway. The programmes differ enormously in all three, which is why the rota is sized from the figures rather than from last year's.

Task: Print the probability that a randomly chosen resident tests positive, 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 tests positive, then the chance a healthy person tests positive.

Output

One line holding the probability, rounded to 4 decimals and printed the way Python prints a float - 0.1085, and 0.525 rather than 0.5250.

Example:

Input:
0.01
0.95
0.1

Output:
0.1085

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…