1

I have a software test which identifies if there is a virus inserted into a computer. However, there is 5% probability of false alarm (there is a 5% chance that the test will be positive when the virus is not inserted).

I run the test and comes out positive.

How can I conclude about whether the system is really infected or not?

2 Answers2

1

This looks like an application of Bayes theorem.

What you're looking for is $ P(\text{infected} \mid \text{positive}) $. In order to get this, apply Bayes theorem.

Let:

$$ P(\text{positive} \mid \text{clean}) = 0.05 $$

and therefore,

$$ P(\text{negative} \mid \text{clean}) = 0.95 $$

Since $$ P(\text{infected} \mid \text{positive}) = \frac{P(\text{positive} \mid \text{infected})P(\text{infected})}{P(\text{positive})} $$

you actually don't have enough information to solve this problem, since you need the prior probability of a virus being inserted into the computer. You don't really need $ P(\text{positive}) $ since each of these variables are binary, so you can simply normalize them at the end.

Kevin Li
  • 273
0

@KevInLi 's answer is correct, and I've upvoted it. I want to add to his observation that you don't have enough information.

Intuitively speaking, if virus infection is (very) rare then (most) many positive test results will be false positives. If infection is common then they are more likely to be true positives.

For a quantitative assessment you need to know or estimate the probability of infection. Is it $10\%$ or $1 \%$ or $0.01\%$?

See this answer for a way to do the calculations without explicitly invoking the formula for Bayes' rule. Applied Probability- Bayes theorem

Ethan Bolker
  • 95,224
  • 7
  • 108
  • 199