VOOZH about

URL: https://www.geeksforgeeks.org/maths/fundamental-principle-of-counting/

⇱ Fundamental Principle of Counting - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Fundamental Principle of Counting

Last Updated : 16 Feb, 2026

The fundamental principle of counting is a basic concept used to determine the total number of possible outcomes in a situation where there are multiple independent events. It allows us to count a large number of possibilities without needing to list each one individually.

For example, consider guessing a 3-digit PIN. Each digit can be any number from 0 to 9, giving 10 possible choices for each digit. Thus, the total number of possible PIN combinations is 10 × 10 × 10 = 1000, which includes all combinations from 000 to 999.

Real World Example of Counting

The Fundamental Principle of Counting is very helpful in finding all the possible combinations in a particular situation. To understand this principle, let's consider some examples.

Example 1: A person wants to buy an apparel from 3 types: T-shirt, Shirt, and Vest. Each apparel is available in 3 colors and 3 sizes. How many different combinations of apparel can he choose?


So the fundamental principle of counting helps us to solve various problems of permutation and combination and helps us to make informed choices from all the available choices.

Example 2:  Say a person has 3 pairs of pants and 2 shirts and a question pops up, how many different ways are there in which can he dress? There are three different ways of choosing pants as there are three types of pants available. Similarly, there are two ways of choosing shirts.

Let's see all the different ways of dressing through a diagram. Considering P1, P2, and P3 as pants and S1, S2 as shirts. The tree is given below lists the range of possibilities

👁 Block Diagram of Fundamental Principle of Counting
Tree Diagram depicting the number of possibilities for the above example 

As shown in the figure, with each type of pant. There are two possible shirts that can be worn. So in total, there are 6 ways of dressing up.

In the problem stated above, the fundamental principle of counting is used to get the result. Here we have used the multiplication rule that states that if an event A can occur in x different ways and another event B can occur in y different ways, then both events can occur simultaneously in x × y different ways. We will learn further about the Multiplication rule further in the article.

Example: Count the number of possibilities when a coin is tossed 3 times.

Solution: 

A coin toss can have two outcomes, either Heads(H) or Tails(T), and in case of tossing three coins simultaneously the total number of ways in which this can happen is,

= Total Outcome of First Coin Toss × Total Outcome of Second Coin Toss × Total Outcome of Third Coin Toss

= 2 × 2 × 2

= 8

Thus, tossing three coins simultaneously can have 8 different possible outcomes.

“If an event can occur in m different ways, following which another event can occur in n different ways, then the total number of occurrences of the events in the given order is m × n.”

This principle can be extended to any finite number of events in the same way.

For three events, the total number of possible outcomes is m × n × p.

The fundamental principle of counting is studied under two headings that include,

  • Addition Rule
  • Multiplication Rule

Addition Rule

Addition Rule states that for two possible events A and B where A and B both are mutually exclusive events, i.e. they have no outcome in common and if event E is defined as occurring in either event A or event B then the possible number of ways in which event E can occur is,

n(E) = n(A) + n(B)

Where n(A), n(B), and n(E) are the number of events of A, B, and E respectively.

Multiplication Rule

Multiplication Rule states that for "n" mutually independent events, P1, P2, P3, ...Pn. Number of ways in which these events can occur is n(P1), n(P2), n(P3),... n(Pn) respectively. Now we define an event E such that it is happening all the events simultaneously then the number of ways this can happen is,

n(E) = n(P1) × n(P2) …….. × n(Pn)

This is called the multiplication rule of the Fundamental Principle of Counting.

Related Articles

Solved Examples on Fundamental Principle of Counting

Question 1: Find the number of four-letter words with or without meaning, which can be made out of letters of the word ROSE, where the repetition of letters is not allowed. 

Solution: 

Number of words that can be formed from these four-letter words is equal number ways in which we can fill __ __ __ __ with letters R, O, S, E. Note that repetition is not allowed. The first place can be filled with any of the four letters, after that second place can only be filled by three letters because we have already used one and repetition is not allowed. Third place can only be filled by two letters and last place will be filled with the last remaining letter. 

So, number of ways in which we can do this are. 4 × 3 × 2 × 1 = 24. 

Note: If the repetition of the letters was allowed we could have always used four letters to fill each place. So 4 × 4 × 4 × 4 = 256. 

Question 2: Given 6 flags of different colors, how many different signals can be generated, if a signal requires the use of 2 flags one below the other?

Solution: 

A signal can be seen like this. 

👁 Arrangement of Flags in Example 2

Here in each position we can use the different colors of flag we are given. So, in the first position we have 6 different choices to make to fill in the position of flag 1. So, in the second position we will have 5 positions to fill because we have already used one color. 

So, total number of ways to fill = 6 × 5 = 30. 

Question 3: How many 2-digit even numbers can be formed from the digits 1, 2, 3, 4, and 5 if the digits can be repeated?

Solution:

 There are five possibilities for putting numbers in each place since the numbers can be repeated. But a constraint is given in the questions which says that the number should be even.

So, all the even numbers have an even digit as the last digit. In the given numbers, only 2 and 4 are two even numbers. So, at the unit's place in the number, there are only two possibilities while their 5 possibilities for the tens place. 

So, Total number of possible even numbers = 5 × 2 = 10

Question 4: How many positive divisors do 1000 = 23 53 have?

Solution:

The positive divisor of 1000 will be in form 2a 5b.

Where, a and b will satisfy 0 ≤ a ≤ 3 and 0 ≤ b ≤ 3

It is clear that there are 4 possibilities of a and 4 possibilities of b.

Also, total number of positive divisors is: (a+1)(b+1) ,where a and b are exponents

so, (3+1)(3+1)=4×4=16

Hence, there are 16 positive divisors of 1000.

Question 5: A bookshelf contains 5 novels, 3 biographies, and 4 textbooks. In how many ways can you select 4 books if you must choose at least one of each type?

Solution:

There will be 3 different cases for selecting 4 books and atleast 1 from each type -

CASE 1: 1 Novel, 1 Biography, 2 Textbooks
Ways to choose 1 novel: C(5,1) = 5
Ways to choose 1 biography: C(3,1) = 3
Ways to choose 2 textbooks: C(4,2) = 6
Total ways = 5 × 3 × 6 = 90

CASE 2: 1 Novel, 2 Biographies, 1 Textbook
Ways to choose 1 novel: C(5,1) = 5
Ways to choose 2 biographies: C(3,2) = 3
Ways to choose 1 textbook: C(4,1) = 4
Total ways = 5 × 3 × 4 = 60

CASE 3: 2 Novels, 1 Biography, 1 Textbook
Ways to choose 2 novels: C(5,2) = 10
Ways to choose 1 biography: C(3,1) = 3
Ways to choose 1 textbook: C(4,1) = 4
Total ways = 10 × 3 × 4 = 120

So, Total number of ways = 90 + 60 + 120 = 270 ways

Question 6: At a party, there are 6 couples. If 4 people are randomly selected to play a game, what is the probability that exactly 2 of them are married to each other?

Solution:

Total people = 6 couples = 12 people

We must find the probability that exactly one married couple is selected among 4 people.

Total ways to select 4 people: C(12,4) = 495

Step 1: Choose 1 married couple

Ways to choose 1 couple: C(6,1) = 6

Step 2: Choose remaining 2 people from remaining 10 people (But they must NOT form another couple)

Total ways to choose 2 from 10: C(10,2) = 45

Among these, 5 selections are married couples (since 5 couples remain).

So valid ways = 45 − 5 = 40

Step 3: Total favourable ways = 6 × 40 = 240

Step 4: Finding Probability

Probability = Favourable / Total = 240 / 495 = 16 / 33

Question 7: How many different 7-digit phone numbers can be formed if the first digit cannot be 0 or 1, and no digit can be repeated?

Solution:

First digit: 8 choices (2 - 9)

Second digit: 9 choices (any except the first)

Third digit: 8 choices

Fourth digit: 7 choices

Fifth digit: 6 choices

Sixth digit: 5 choices

Seventh digit: 4 choices

Total = 8 × 9 × 8 × 7 × 6 × 5 × 4 = 483,840 numbers

Question 8: In a group of 30 people, 18 like coffee, 15 like tea, and 10 like both. How many people in the group don't like either coffee or tea?

Solution:

Let's use the inclusion-exclusion principle

People who like coffee or tea = 18 + 15 - 10 = 23

(We subtract 10 to avoid counting those who like both twice)

People who don't like either = Total - (Coffee or Tea)

30 - 23 = 7 people

Question 9: A bag contains 5 red marbles, 3 blue marbles, and 2 green marbles. If three marbles are drawn without replacement, what is the probability of drawing one of each color?

Solution:

Total ways to draw 3 marbles: C(10,3) = 120

Ways to draw 1 red, 1 blue, 1 green: 5 × 3 × 2 = 30

Probability = 30 / 120 = 1/4 = 0.25

Question 10: How many different ways can the letters of the word "STATISTICS" be arranged if all the S's must be together and all the T's must be together?

Solution:

Treat all S's as one unit and all T's as one unit

We now have 6 units to arrange: SSS, TTT, A, I, I, C

This is a permutation with repetition (2 I's)

Number of arrangements = 6! / 2! = 360

The S's can be arranged internally in 3! ways but they are identical so 3!/3!=1

Similarly, The T's can be arranged internally in 3! ways but they are identical so 3!/3!=1

Total arrangements = 360

Practice Questions on Fundamental Principle of Counting

Question 1: What is the possible number of sample space when two die are rolled together?

Question 2: In how many ways a 4 digit pin can be set up without repetition of digits.

Question 3: In a Felicitation Ceremony in how many ways two guests can shake hand with each other and top three rank holders?

Question 4: In how many many ways a six digit PIN Code can be created?

Question 5: A bookshelf contains 5 novels, 3 biographies, and 4 textbooks. In how many ways can you select 4 books if you must choose at least one of each type?

Question 6: At a party, there are 6 couples. If 4 people are randomly selected to play a game, what is the probability that exactly 2 of them are married to each other?

Question 7: How many different 7-digit phone numbers can be formed if the first digit cannot be 0 or 1, and no digit can be repeated?

Question 8: In a group of 30 people, 18 like coffee, 15 like tea, and 10 like both. How many people in the group don't like either coffee or tea?

Question 9: A bag contains 5 red marbles, 3 blue marbles, and 2 green marbles. If three marbles are drawn without replacement, what is the probability of drawing one of each color?

Question 10: How many different ways can the letters of the word "STATISTICS" be arranged if all the S's must be together and all the T's must be together?

Comment

Explore