---
# System prepended metadata

title: Principle of Counting

---

---
title: "Principle of Counting"
tags: ""
---

# Combinational Analysis

Many probelems in probabilty theory can be solved by simply counting the number of combinations

> ### The basic Principle of counting
>
> Suppose two experiments are performed. If experiment 1 can have one of _n_ possible outcomes, and 2 can have one of _m_ possible outcomes then together bewteen 1 & 2, there are _nm_ possible outcomes of the two experiments

## Example

Suppose we have two fair dice, each numbered 1 through 6. Suppose we wanted to know what is the probability that when both dice are rolled we will have a sum of a number greater than 6. We can simply write out every possible combination of the die.

All the possible combinations of rolling two fair dice are as below
$$
\begin {pmatrix} 
(1,1)&(1,2)&(1,3)&(1,4)&(1,5)&(1,6)\\
(2,1)&(2,2)&(2,3)&(2,4)&(2,5)&(2,6)\\
(3,1)&(3,2)&(3,3)&(3,4)&(3,5)&(3,6)\\
(4,1)&(4,2)&(4,3)&(4,4)&(4,5)&(4,6)\\
(5,1)&(5,2)&(5,3)&(5,4)&(5,5)&(5,6)\\
(6,1)&(6,2)&(6,3)&(6,4)&(6,5)&(6,6)\\
\end {pmatrix}
$$ 

There are 36 possible combinations which also shows an example of the basic principle of counting dice one has $$n = 6$$ possible combinations and dice 2 has $$m = 6$$ possible combinations. So $$mn = 6*6 = 36$$. Said diffently: The probability of die 1 = 4 after rolling bother dice is 1/36 since it is one of 36 possible outcomes

We can see in the possible combominations that probability that the sum of two dice is $$\frac{21}{36}$$.

* * *

Its is important to remember that each dice being thrown is considered an experiment, and by that I mean that dice 1 is experiment $$E_1$$ and dice 2 is experiment $$E_2$$ even though they are being thrown at the same time.

> ### The generalized basic priciple of counting
>
> If $$r$$ experiments are performed such that there are $$n_1$$ possible outcomes for the first experiment, and for each of these outcomes there is a second experiment with $$n_2$$ number of outcomes, and for each of these outcomes is a third experiment with $$n_3$$ possible outcomes and so on, there are a total of $$n_1 * n_2 * n_3 * \ldots *n_r$$ possible outcomes for $$r$$ number of experiments.

## Example

Suppose we have 5 dogs, 6 cats, 3 birds, and 1 hamster and we wanted to pick one from each to take pictures of for a website. How many diffrent combinations are possible?

Choosing one from each animal is its own experiment, meaning we have 4 diffrent experiments.
$$E_{dog} = 5$$ possible outcomes, and for each of these outcomes $$E_{cat} = 6$$ diffrent outcomes and so on.

So the total possible outcomes we have for a photo is $$E_{dog} * E_{cat} * E_{bird} * E_{hamster} = 5 * 6 * 3 * 1 = 90$$ possible combinations
