Imagine the following situation:
- A new virus is discovered that is believed to have infected 20% of the population.
- Anyone infected with the virus has a chance of 50% of dying in their sleep every day.
- The virus has absolutely no symptoms to let anyone know whether they've been infected or not, before its too late.
- Bob wonders whether he has the virus or not.
Is it possible to calculate how many nights Bob need to survive for him to be 95% sure he does himself not have the virus?
The difficulty I have with this is:
- Survival bias: Noone with the virus will ever wake up and discover they are dead. E.g. Even if the infection rate was 100% you'd have a few random people still waking up after 30 days (1 in 2**30).
- Gamblers fallacy: If you do have the virus, then having survived X days does not make the probability higher than you will survive another day.
What you're describing as survival bias is really the possibility of a false negative, which you have to account for in your calculation. As for the gambler's fallacy, there's no fallacy here if you assume that for infected individuals 50% is always the probability of surviving another day, and that each night's sleep is independent of every other night.
To calculate, use Bayes' rule. Let $V$ be the event that a randomly selected individual has the virus, and let $S_n$ be the event that the person is alive after $n$ nights of sleep. You want to calculate $P(V^c\mid S_n)$ (where $V^c$ is the complement of event $V$), and to find the $n$ such that this probability exceeds $.95$. To apply Bayes, you write $$ P(V^c\mid S_n)={P(S_n\mid V^c)P(V^c)\over P(S_n\mid V^c)P(V^c) + P(S_n\mid V)P(V)} = { 1 \cdot (.8) \over 1 \cdot (.8) + (1/2)^n\cdot (.2)} $$