# How to calculate the probability of an event occuring within n days, if we know the probability of it occuring per day

If an event can occur at most once per day, and the probability of it occurring is 10%.

What is the upper-bound on the probability that the event occurs in an interval of L days of a month (assuming 30 days per month).

ps: assume the events being independent of each other

EDIT after the comment from @Dougal

• (a) Fix L specific days, say days 1 through L, and ask whether it occurs exactly once during these L days?

• (b) The same, but whether it occurs at least once in these L days?

• (c) Whether it occurs on any L consecutive days out of the month?

I am asking for case c). But would be interested to understand the logic behind a) and b) too.

Since this is a self-study question I am want to understand the underlying basic probability and combinatorics concepts which are used to come up with the computation. So you are very welcome to be verbose.

• Does "occurs in an interval of $L$ days of a month" mean: (a) Fix $L$ specific days, say days 1 through $L$, and ask whether it occurs exactly once during these $L$ days? (b) The same, but whether it occurs at least once in these $L$ days? (c) Whether it occurs on any $L$ consecutive days out of the month? – Danica Sep 11 '16 at 22:21
• my question was for c). But now that you mentioned it would be interesting to understand the logic behind the calculation of the others too – Kristof Tak Sep 11 '16 at 22:23

There are $L$ days on which this event can occur, and each day it either occurs or it doesn't. Since the probability is the same for each day, and the days are independent, we can view this as a Binomial random variable.

On each day say a "success" is the event occuring, and that the number of days is the number of trials for this Binomial random variable. Then the probability it occurs once in this period of $L$ days is given by the Binomial pmf:

$P(X=1)=\frac{L!}{1!(L-1)!} \times p^1 \times (1-p)^{L-1}=L\times p \times (1-p)^{L-1}$

Where $p$ is the probability of it occurring on any one day. This result follows from the fact a Binomial random variable is a count of successes of a fixed number of independent trials which are either a "success" or "failure".

You can also view it this way. In order for you to have it occur once, it needs to occur on one day and not occur on the remaining $L-1$ days. This has probability $p(1-p)^{L-1}$, and this can occur $L$ different ways since there are $L$ days the event can occur on. Multiplying the probability by the number of ways it can occur gives you the above result.

Edit: If you're asking it occurs at least once, then you can simply find the probability by:

$P(X \geq 1) = 1-P(X=0)=1-(1-p)^L$.

Edit: If you want an upper bound on the probability it occurs at least once in a period of $L$ days, then note that as the number of days $L$ increases, so does the probability of it occuring at least once. If $L$ is capped at being 30, then clearly the highest probability of it occuring at least once in a period of $L$ days is when $L=30$ and so an upper bound for the probability of it occuring on any $L$ days is:
$1-(1-p)^{30}$
If $L$ is not capped at 30, then the probability only has an upper bound of $1$. As the number of days increases, the probability approaches 1.
• (+1) I think the question was asking about the probability that it occurs at least once, however. Or maybe on any run of length $L$, which is more complicated. – Danica Sep 11 '16 at 22:19
• If you want an upper bound, I would assume you mean the highest this probability can be depending on the number of days L. This probability of it occuring at least once would increase as you increase the number of days L. If the number of days is capped at 30, then the upper bound would be the probability when $L=30$ which you can find using the method in my answer. If not, then I'm still unsure how you interpret your question, sorry. – Patty Sep 11 '16 at 22:26
• @Patty Upper bounds in this context probably means finding a function $f(L)$ such that the probability of a run of length $L$ is at most $f(L)$. $f(L) = 1$ of course works; the problem is to find a tighter bound. – Danica Sep 11 '16 at 22:45
• @Patty How do you come up with $P(X \geq 1) = 1-P(X=0)=1-(1-p)^L$. Is that a standard transformation? – Kristof Tak Feb 8 '17 at 11:34