OFFSET
0,2
COMMENTS
"95% accurate" means the test result is correct 95% of the time symmetrically: the test failure rate is 5% when the test result should be positive and 5% when the result should be negative.
This perhaps-unexpected effect was demonstrated by Paulos with an example similar to the one below.
REFERENCES
John Allen Paulos, Innumeracy: Mathematical Illiteracy and Its Consequences, Hill and Wang, 1988.
FORMULA
a(n) = round(950*n/(9*n + 50)), 0 <= n <= 100.
In general, a(n, r) = round(100*r*n/(2*r*n - 100*r - 100*n + 10000)), 0 <= n <= 100, 0 <= r <= 100, where r is the accuracy rate in percent (r = 95 for this sequence).
EXAMPLE
If a test for a disease (that is relatively rare) is 95% accurate and is given once to a population of, say, 5000 individuals, when only 2% of them actually have the disease, the expected results are 245 (= 0.05 * 4900) false positives and 95 (= 0.95 * 100) true positives. Out of the 340 who test positive, 95 people have the disease and 95/340 = 19/68 = 0.279..., which rounds to 28%, so a(2) = 28 -- about 28% of the people who tested positive actually have the tested-for disease. On the other hand, only 5/4660 = 0.00107... or roughly 0.1% of the people who tested negative actually have the affliction.
PROG
(PARI) a(n) = if(n >= 0 && n <= 100, round(950*n/(9*n + 50)))
CROSSREFS
KEYWORD
nonn,fini,full
AUTHOR
Rick L. Shepherd, Jan 12 2017
STATUS
approved
