## Counting principleThe counting principle is a fundamental rule of counting; it is usually taken under the head of the permutation rule and the combination rule. It states that if a work X can be done in m ways, and work Y can be done in n ways, then provided X and Y are mutually exclusive, the number of ways of doing both X and Y is m x n. For example, suppose a person (T) can go to the market from their home by bus, by foot, and by bicycle, i.e., T = 3 if he is returning home (B) by foot and by car, i.e., B = 2. So, TB can be done in 3*2 = 6 ways. ## The Rules of Sum and ProductThe rule of sum or addition principle and the rule of product or multiplication principle are given below.
If several tasks P1, P2, P3………, Pm can be done in K1, K2, K3…. Km Number of ways respectively in which no tasks can be performed simultaneously, the number of ways to perform one of these tasks is given by K1 + K2 + ………… + Km. Suppose two different tasks, P and Q, which are disjoint it means P ∩Q = Ø Mathematically,
If several tasks P1, P2, P3,…………, Pm can be done in K1, K2, K3,………..Km Number of ways respectively and every task comes after the occurrence of the previous task, the number of ways to perform one of these tasks is given by K1 x K2 x ………… x Km. Mathematically, If a task Q comes after a task P, then
An employee lives at location K and wants to go to the office at location G. From his home, K, he has first to reach location B and then B to G. He may go to K to B by either four metro routes or three buses routes. From there, he can either select six metro routes or four bus routes to reach location G. Find the no of ways to go from K to G.
He can go in 4 + 3 = 7 ways (Addition rule). After that, he can go B to G in 6 + 4 (10) ways (Addition rule). Hence from K to G, he can go in 7 * 10 = 70 ways (Multiplication rule) ## PermutationsPermutations refer to the arrangement of elements in a definite manner. For example We have to form a permutation of two-digit numbers from a set of numbers S = (5, 7). Different two digits numbers will be formed when we arrange the given numbers. The permutations will be = (5,7) and (7,5).
From a set S = (P, Q, R) by taking two at a time, all permutations are pq, qp, pr,rp,qr,rq
We have to form a permutation of two coins from a set of S = (H, T). Different two sides will be formed when we arrange the two sides. The permutations will be (H, T) and (T, H) ## Number of PermutationsThe number of permutations of n different objects taken r at a time is given by P(n,r) = n(n-1) (n-2)………(n-r-1) (n≥r) = n! / (n-r)! Where, n! = 1.2.….(n-1).n ## Note: n is always greater than or equal to r, which is also equivalence to n factorial divided by n minus r.## Proof of permutations formulaLet us suppose there are three vacant boxes, and you need to fill them in three different colors. There is n number of ways to fill up the first box. After filling the first box (n-1), the number of boxes is left. Hence, there are (n-1) ways to fill up the color in the second place. After filling the first and second place, (n-2) number of boxes is left. Hence, there are (n-2) ways to fill up the third place with different colors. Now, we can generalize the total number of ways to fill up the rth box as [n - (r-1)] = n-r+1 So, the total number of ways to fill up the box with color from the first place up to rth place is given by n n Hence, =n! /(n-r)! ## Points to remember in permutations- If there are 'n' different elements of which x1 are alkie of some kind, x2 are alike of another kind, X3 are alike of the third kind, and Xr is of rth kind, where
(x1 + x2 + x3+ …………. xr) = n Then, the number of permutations of these n objects is
**n! / [(x1! (x2!) …(xr!)]** - The number of permutations of n different elements taking "n" elements at a time
**n**_{pn}=n! - The number of permutations of n different elements taking r elements at a time, when m particular things always occupy the definite places
**n-m**_{pr-m} - The number of permutations of n different objects when r specified things always come together is given by
**r! (n-r+1)!** - The number of permutations of n different objects when r specified things never come together is given by
**n! - [r! (n-r+1)!]** - The number of circular permutations of n distinct objects taken x elements at the time
**n**_{px}/x - The number of circular permutations of n different things
**n**_{pn}/n
Let's understands this concept with the help of examples
In how many ways can the letters of the word "SCISSORS" be arranged?
There are eight letters word (4 S, 1 C, 1 I, 1 O 1 R) in the word SCISSORS The permutation will be = 8! / [(4!) (1!) (1!) (1!)] = 1680
In how many ways can the letters of the word "GOOD" be arranged?
There are 4 letters word (1 G, 2 O, 1 D) in the word GOOD The permutation will be = 4! / [(1!) (2!) (1!)] = 12
From a bunch of 4 different cards, how many ways can we permute it?
4
How can the letters of the word 'READER' be arranged so that the consonants occupy only the even positions?
There are 3 vowels and 3 consonants in the word 'READER'. Several ways of arranging the consonants among themselves 3 ## CombinationsA combination refers to selecting elements from a collection such that the order of selection does not matter, unlike permutation. In the combination generally, we prefer only selection. The ordering of the selected elements is not Important. Generally, the number of permutations exceeds the number of combinations. Each combination corresponds to many permutations. The combination of n different things taken r at a time is given by
Find the number of subsets of the set {1,2,3,4,5,6,7} having 4 elements.
The cardinality of the set is 7, and we have to select 4 elements from the set. Here, the ordering of the number does not matter. Hence the number of subsets will be n 7 = 7 * 6 * 5/ 3 *2 = 35
There is 8 Boy and 6 Girls who participated in a contest. In how many ways can we select 4 boys and 3 girls from the contest?
The number of ways to select 4 boys from 8 boys is 8 Hence, the total number of ways is 8 = 8 × 7 ×6 ×5/ 4 ×3 ×2 × 6×5×4 /3 ×2 = 70 × 20 = 1400
How many ways can you select 4 different groups of 2 students from a total of 8 students?
Suppose the number of groups is 1, 2, 3 and 4 For selecting 2 students for 1 The number of ways for selecting 2 students for the second group after selecting 1 The number of ways for selecting 2 students for the third group after selecting 1 The number of ways for selecting 2 students for the fourth group after selecting 1 Hence, the total number of ways 8 ## Pascal IdentityPascal's identity was first derived by Blaise Pascal in the 17 Mathematically, for any positive integers k and n, we can write the equation:
The Inclusion-Exclusion principle refers to a very basic theorem of counting, and various problems in various programming contests are based on it; a basic example of the inclusion-exclusion principle is given below. Consider A as a collection of elements and |A| as the number of elements in A and the same as for B. The cardinality of the collection of elements of both sets A and B (when both A and B are disjoint) can be stated as (for 2 finite sets):
Consider that case if the sets are disjoint. We have to subtract the common elements counted twice while calculating the cardinality of both A and B, and a new form will become:
Generalized formula: ## Example based on Inclusion-Exclusion Principle
How many integers from 1 to 100 are multiples of 5,6 but not both?
From 1 to 100, there are 100/5 = 20 numbers which are multiples of 5 And, there are 100/6 = 16 numbers which are multiples of 6. And, there are 100/30 = 3 numbers which are multiples of both 5 and 6 Therefore, |A| = 20 , |B| = 16 and |A∩B| = 3 We know that, |AUB| =|A|+|B|-|A∩B| = 20 + 16 -3 = 33
In a group of 60 employees, 32 like pizza and 38 like burgers, and each employee likes at least one of the two snacks. Find how many employees like both pizza and burgers?
Let P be the set of employees who like pizza and Q be employees who like a burger. Therefore, |P| = 32, |Q| = 38 and |PUQ| = 60 We know that, |AUB| =|A|+|B|-|A∩B| So, |P∩Q|=|P|+|Q|-|PUQ| = 32 + 38 - 60 = 70 - 60 = 10 |

For Videos Join Our Youtube Channel: Join Now

- Send your Feedback to [email protected]