Probability Of An Event Occurring X Number Of Times In A Sequence Of Events

So I'm interested in the probability that an event will occur a set number of times in a larger number of trials, when the odds of that event occurring are known. Here's an example, let's say that the odds of me pressing a random key on my keyboard and that key being a number or letter is 36/108, so 1/3. My question then is what is the probability of a number or letter being pressed an arbitrary number or times in a arbitrary number of attempts. As in, what are the odds that I press a number or letter eight times in thirteen attempts. I would assume the answer would be that it is not likely for this to occur, given that the theoretical probability suggests that a number or letter should be selected only four times in thirteen attempts, given 1/3 odds, but I want to know the exact probability. Up until know I've been able to determine probability of situations like, "What are the odds that the colour green is never chosen on a spinner in nine spins, when there is 1/5 odds for green to be chosen". I would solve this by simply saying P of no green being chosen in 9 attempts = (0.8 ^ 9) * 100 (percentage). Anyway, that is a really restrictive way of looking at probability and it doesn't work with the problem described earlier or anything more complex than that, so I would greatly appreciate some help with this. Thank you to anyone who responds in advance!

• Binomial distribution is what you need. Commented Jul 6, 2017 at 19:51
• Okay, that was very helpful, I read up on binomial distribution and I think I understand how to solve these problems now, from what I saw there is one formula that pretty much fits all these problems. Commented Jul 6, 2017 at 20:21

Given the success probability is $p = \frac{1}{3}$. In $n = 13$ trials, the probability that success occurs $x = 8$ times is given by the binomial pmf,

$$P(\text{#success} = x) = \binom{n}{x}p^x(1-p)^{n-x}$$

• So I found this link relating to binomial distribution, yet the formula you use here seems to differ from what they go on to describe: mathnstuff.com/math/spoken/here/2class/90/binom3.htm#ans Commented Jul 6, 2017 at 20:24
• $\binom{n}{x} = \frac{n!}{x!(n-x)!}$ and $q = 1-p$ Commented Jul 6, 2017 at 20:26
• Why exactly are you able to make those substitutions though? Commented Jul 6, 2017 at 20:30
• The first substitution is nothing but the shorthand of writing the expression on the RHS. $\binom{n}{x}$ means number of ways of choosing $x$ items from $n$ distint items. Some authors use $q$ to denote the probability of failure which is nothing but the probability of not success which is $1-p$. Commented Jul 6, 2017 at 20:33
• Oh, okay that clears things up quite a bit, thank you. Commented Jul 6, 2017 at 20:35

The probability for one of the cases is:

$$\underbrace{\left( \frac 13 \right) \left( \frac 13 \right)\left( \frac 13 \right)\left( \frac 13 \right)\left( \frac 13 \right)\left( \frac 13 \right)\left( \frac 13 \right) \left( \frac 13 \right)}_{\text{8 times}} \ \ \underbrace{\left( \frac 23 \right) \left( \frac 23 \right)\left( \frac 23 \right)\left( \frac 23 \right)\left( \frac 23 \right)}_{\text{5 times}}$$

However, first $8$ events do not have to be "pressing numbers".

$i.e.$ you can scramble these probabilities.

There are $\displaystyle \frac{13!}{8! \ 5!}$ ways to arrange these numbers.

So, the answer is $\displaystyle \frac{13!}{8! \ 5!} \left( \frac 13 \right)^8 \left( \frac 23 \right)^5 = \binom{13}{8} (1/3)^8 (2/3)^5$

• This doesn't seem to give a probability in the form of a number though. In fact, I don't really understand the point of this reasoning if only to state an already solved-for equation. Commented Jul 6, 2017 at 20:28