Consider a situation where a child is choosing among $6$ flavours of icecreams with $3$ varieties of cones, or suppose you have 3 pairs of shoes and 5 pairs of socks, then in how many ways can you wear them? In these types of scenarios, we generally use a rule called the Fundamental Principle of Counting.

Let’s understand what is fundamental principle of counting and what are its rules and formulas with examples.

## What is Fundamental Principle of Counting?

The fundamental principle of counting or the basic principle of counting is a method or a rule used to calculate the total number of outcomes when two or more events occur together. This principle states that the total number of outcomes of two or more independent events is the product of the number of outcomes of each individual event.

In other words, it states that if there are $p$ ways to do one thing and $q$ ways to do another thing, then there are $p \times q$ ways to do both things.

Similarly, according to the fundamental principle of counting, the number of ways of doing three things together, if there are $p$ ways to do one thing, $q$ ways of doing the second thing, and $r$ ways of doing the third thing, then there are $p \times q \times r$ ways to do the three things together.

The fundamental principle of counting can be extended to $n$ different things if the number of ways of doing the $n$ things is $m_1$, $m_2$, $m_3$, …, $m_n$ ways respectively. In this case, the total number of ways will be $m_1 \times m_2 \times m_3 \times … m_n$.

Let’s now understand why the total number of ways of doing two things is $p \times q$, where the number of ways of doing one thing is $p$ and the number of ways of doing the second thing is $q$.

Consider an example of wearing a shirt and a neck-tie, if there are $3$ shirts and $2$ neck-ties.

Let’s call these shirts as $\text{S}_1$, $\text{S}_2$, and $\text{S}_3$.

And similarly, let the two ties be $\text{T}_1$, and $\text{T}_2$.

Now first, start with shirt $\text{S}_1$. With this shirt, you can tie either $\text{T}_1$, or $\text{T}_2$, so the number of ways is $2$, i.e., $\left(\text{S}_1, \text{T}_1 \right)$, and $\left(\text{S}_1, \text{T}_2 \right)$.

Again, with shirt $\text{S}_2$, you can tie either $\text{T}_1$, or $\text{T}_2$, so the number of ways is $2$, i.e., $\left(\text{S}_2, \text{T}_1 \right)$, and $\left(\text{S}_2, \text{T}_2 \right)$.

Similarly, with the third shirt $\text{S}_3$, the number of ways is $2$, i.e., $\left(\text{S}_3, \text{T}_1 \right)$, and $\left(\text{S}_3, \text{T}_2 \right)$.

Thus, the total number of ways of wearing a shirt and a neck-tie from $3$ shirts and $2$ ties is $\left(\text{S}_1, \text{T}_1 \right)$, and $\left(\text{S}_1, \text{T}_2 \right)$, $\left(\text{S}_2, \text{T}_1 \right)$, and $\left(\text{S}_2, \text{T}_2 \right)$, $\left(\text{S}_3, \text{T}_1 \right)$, and $\left(\text{S}_3, \text{T}_2 \right)$ which is equal to $6(3 \times 2)$.

### Examples of Fundamental Principle of Counting

**Example 1:** A child choosing among $6$ flavors of icecreams with $3$ varieties of cones. What is the total number of choices available to a child?

Number of flavours $p = 6$

Number of varieties of cone $q = 3$

Therefore, there will be $p \times q = 6 \times 3 = 18$ different choices of icecreams.

**Example 2:** You have $3$ pairs of shoes and $5$ pairs of socks. How many ways can you wear socks and shoes?

then there will be $3 \times 5 = 15$ different ways of wearing these socks and shoes.

Number of pairs of shoes $p = 3$

Number of pairs of socks $q = 5$

Therefore, there will be $p \times q = 3 \times 5 = 15$ different ways of wearing socks and shoes.

**Example 3:** Richa goes to a stationery shop to buy a pen, a pencil, and a notebook. There is a total of $9$ types of pens, $7$ types of pencils, and $4$ types of notebooks available in the shop. In how many ways can Richa buy a pen, pencil, and notebook?

Number of types of pen $p = 9$

Number of types of pencil $q = 7$

Number of types of notebook $r = 4$

Therefore, there will be $p \times q \times r = 9 \times 7 \times 4 = 252$ different ways Richa can buy a pen, pencil, and notebook.

## Two Basic Principles** **in Counting

After understanding the fundamental principle of counting, let’s now understand the two most pivotal concepts for the fundamental principle of counting.

- Addition Principle
- Multiplication Principle

### Addition Principle (Rule of Sum)

The Sum Rule states that if a task can be performed in either two ways, where the two methods cannot be performed simultaneously, then completing the job can be done by the sum of the ways to perform the task.

Mathematically, the Sum Rule states that a task can be performed either in $n_1$ **OR** in $n_2$ ways, where the two tasks cannot be performed simultaneously, then there are $n_1 + n_2$ ways to perform the task.

#### Examples of Addition Principle

**Example 1:** A bakery has a selection of $20$ different cupcakes, $10$ different donuts, and $15$ different muffins. If you are to select a tasty treat, how many different choices of sweets can you choose from?

The number of types of cupcakes $n_1 = 20$.

The number of types of donuts $n_2 = 10$.

The number of types of muffins $n_2 = 15$.

Because we have to choose from either a cupcake **or** donut **or** muffin (notice the “**OR**”), we have $20 + 10 + 15 = 45$ treats to choose from.

### Multiplication Principle (Rule of Product)

The Product Rule states that if a task can be performed in a sequence of tasks, one after the other, then completing the job can be done by the product of the ways to perform the task.

Mathematically, the Product Rule states that a task performed consists of two components $\text{task}_1$ completed in $n_1$ ways and $\text{task}_2$ completed in $n_2$ ways. Then the task (i.e., $\text{task}_1$ **AND** $\text{task}_2$) can be completed in $n_1.n_2$ ways.

#### Examples of Product Principle

**Example 1:** Again considering the previous example, suppose a bakery has a selection of $20$ different cupcakes, $10$ different donuts, and $15$ different muffins, how many different orders are there?

What makes this question different from the first problem is that we are not asking how many total choices there are. We are asking how many different ways we can select a treat.

It’s possible that you only want one treat, but you can quite easily want more than one.

So how many different orders can you create, if you’re allowed to choose as few or as many as you like? This is the job of the product rule!

Because we can choose treats from a selection of cupcakes and donuts and muffins (notice the “**AND**”), we have $20 \times 10 \times 15 = 3000$ ordering options.

## Principle Of Inclusion Exclusion

The above rules now lead us to the Principle of Inclusion-Exclusion (PIE), sometimes called the subtraction rule. The Subtraction Rule(or Principle of Inclusion-Exclusion) states that if a task can be done in either $n_1$ or $n_2$ ways, the total number of ways to complete the task is $n_1 + n_2$ minus the number of ways to do the task that are common to both.

Mathematically, the rule can be stated as if a task can be done in either $p$ or $q$ ways, the total number of ways to complete the job is $p + q$ minus the number of ways to do the task that are common to both $p \text{ AND } q$, which alleviates the possibility of double counting.

The formula for the Principle of Inclusion-Exclusion (PIE) for two tasks = $p + q – (p \text{ AND } q)$.

Now, let’s see what about three sets? How can one evaluate $p \text{ or } q \text{ or } r $ ways knowing cardinalities of $p$, $q$, $r$, their intersections, etc.?

Look at the above picture on slide 145, and use the “colour” argument.

Consider the sum $p + q + r$ and try to adjust this number to get its number.

The “blue” elements (sets $p − (q \text{ or } r)$, $q − (p \text{ or } r)$, $r − (p \text{ or } q)$ are counted once, the “red” elements (sets $(p \text {or } q) − r$, $(q \text{ or } r) − p$, $(p \text{ or } r) − q)$ are counted twice, the “green” ones (set $p \text{ or } q \text{ or } r)$ are counted three times.

Let us try this as an approximation to $p$ or $q$ or $r$:

$p + q + r − (p \text{ AND } q) −(q \text{ AND } r) − (p \text{ AND } r)$.

In this sum, all “blue” and all “red” elements have been counted once (which is good), but the “green” ones have been counted 0 times!

If $x \in p \text{ AND } q \text{ AND } r$, then $x$ has been counted in each of the six terms above: with “+” in $p$, $q$, and $r$, and with “−” in $p \text{ AND } q$, $q \text{ AND } r$, and $p \text{ AND } r$.

To compensate for this discrepancy we have to add $p \text{ AND } q \text{ AND } r$ back, which gives a formula of the Principle of Inclusion-Exclusion for three sets as $p + q + r − (p \text{ AND } q)−(q \text{ AND } r)− (p \text{ AND } r) + (p \text{ AND } q \text{ AND } r)$.

### Examples of Principle Of Inclusion Exclusion

**Example 1:** Among a group of students, 49 study Physics, and 21 study Biology. If 9 of these students study both Physics and Biology, find the number of students in the group.

Number of students studying Physics $n(\text{P}) = 49$

Number of students studying Biology $n(\text{B}) = 21$

Number of students studying Physics **AND** Biology $n(\text{P AND B}) = 9$

According to the principle of inclusion-exclusion, the number of students in the group = $n(\text{P}) + n(\text{B}) – n(\text{P AND B}) = 49 + 21 – 9 = 61$.

**Example 2:** Among a group of students, 49 study Physics, 37 studies English, and 21 study Biology. If 9 of these students study Physics, and English, 5 study English and Biology, 4 study Physics and Biology, and 3 study Physics, English, and Biology find the number of students in the group.

Here, $\text{P} = 49$, $\text{E} = 37$, $\text{B} = 21$

$\text{P} \text{ AND } \text{E} = 9$, $\text{E} \text{ AND } \text{B} = 5$, $\text{P} \text{ AND } \text{B} = 4$, $\text{P} \text{ AND } \text{E} \text{ AND } \text{B} = 3$

Now, according to the principle of inclusion-exclusion, the number of students in the group = $\text{P} + \text{E} + \text{B} − (\text{P} \text{ AND } \text{E})−(\text{E} \text{ AND } \text{B})− (\text{P} \text{ AND } \text{B}) + (\text{P} \text{ AND } \text{E} \text{ AND } \text{B})$

$ = 49 + 37 + 21 – 9 – 5 – 4 + 3 = 92$.

## Practice Problems

- To buy a computer system, a customer can choose one of 4 monitors, one of 2 keyboards, one of 4 computers, and one of 3 printers. Determine the number of possible systems that a customer can choose from.
- In a particular country, telephone numbers have 9 digits. The first two digits are the area code (03) and are the same within a given area. The last 7 digits are the local number and cannot begin with 0. How many different telephone numbers are possible within a given area code in this country?
- Babloo can take any one of three routes from school (S) to the town center (T), and can then take five possible routes from the town center to his home (H). He doesn’t retrace his steps. How many different possible ways can Babloo walk home from school?
- Shobha goes to her local pizza parlor and orders a pizza. She can choose either a large or a medium pizza, can choose one of seven different toppings, and can have three different choices of crust. How many different pizzas could Shobha order?
- Dinesh must choose a four-digit PIN number. Each digit can be chosen from 0 to 9. How many different possible PIN numbers can Dinesh choose?

## FAQs

### What are the three basic principles of counting?

The three basic principles of counting are the Rule of Sum, the Rule of Product, and the Rule of Subtraction(also known as the Principle of Inclusion-Exclusion (PIE)).

### What is an example of the principle of counting?

An example of the principle of counting is

A customer goes to her local pizza parlor and orders a pizza. She can choose either a large or a medium pizza, can choose one of seven different toppings, and can have three different choices of crust. How many different pizzas could she order?

### What is the Addition Principle?

The Addition Principle(or Sum Rule) states that if a task can be performed in either two ways, where the two methods cannot be performed simultaneously, then completing the job can be done by the sum of the ways to perform the task.

### What is the Multiplication Principle?

The Multiplication Principle(or Product Rule) states that if a task can be performed in a sequence of tasks, one after the other, then completing the job can be done by the product of the ways to perform the task.

## Conclusion

The fundamental principle of counting or the basic principle of counting is a method or a rule used to calculate the total number of outcomes when two or more events occur together. This principle states that the total number of outcomes of two or more independent events is the product of the number of outcomes of each individual event. Moreover, there are three more rules that are used in counting – the sum Rule(used when either of the tasks is performed), the Product Rule(when all tasks are performed in succession), and the Subtraction Rule(or Principle of Inclusion-Exclusion).