NEOCODE

๐Ÿงพ Principles of Counting

๐Ÿ”น Principal of Multiplication (AND Rule)

If one operation can be performed in m ways and another in n ways, both together can be performed in m ร— n ways.

๐Ÿ‘‰ Use when more than one task needs to be done in sequence.

๐Ÿ“Œ Example: 3 types of shirts and 2 pants. Total outfit combinations = 3 ร— 2 = 6
๐Ÿ”น Principal of Addition (OR Rule)

If only one operation out of several is to be performed, and one can be done in m ways and another in n ways, then total ways = m + n

๐Ÿ‘‰ Use when only one out of the possible tasks is done.

๐Ÿ“Œ Example: Choose a red or blue pen (3 red, 2 blue) = 3 + 2 = 5

๐Ÿ” Permutations (Order Matters)

๐Ÿ”น Definition

A permutation is an arrangement of n objects taken r at a time in a specific order.

๐Ÿ”น General Formula

nPr = n! / (n - r)!

๐Ÿ”น Linear Arrangement

For n distinct objects: n!

With repetition allowed: n^r

With p, q, r objects of same kind: n! / (p! q! r!...)

๐Ÿ“Œ Example: "BANANA" โ†’ Total = 6! / (3! ร— 2!) = 60
๐Ÿ”น Circular Arrangement

Distinct objects around a circle: (n โ€“ 1)!

Necklace/Garland (reflection counts as same): (n โ€“ 1)! / 2

k consecutive items around a circle:

If k < n โ†’ n

If k = n โ†’ 1

๐Ÿ“Œ Example: 7 friends around a table: (7 โ€“ 1)! = 720
๐Ÿ”น Polygon Arrangement

n items along r-sided regular polygon with n/r items per side = n! / r

If polygon is not regular: use permutation โ†’ nPr = n! / (n - r)!

๐Ÿ”น Special Cases

Repetition allowed in r places: n^r

People around a rectangular table with equal numbers on each side: n! / 2

Derangement (No item in original position):

Values:

D(2) = 1

D(3) = 2

D(4) = 9

D(5) = 44

๐Ÿ“ฆ Combinations (Order Doesn't Matter)

๐Ÿ”น Definition

A combination is the selection of r objects from a set of n without considering the order.

๐Ÿ”น Formula

nCr = n! / [r! (n - r)!]

๐Ÿ“Œ Example: From 5 students, select 3 for a team โ†’ 5C3 = 10
๐Ÿ”น Combination with Repetition

n+r-1Cr

Distribute n identical items among r groups:

With zero allowed: n+r-1Cr-1

At least one per group: n-1Cr-1

๐Ÿ“Œ Example: Ways to give 4 identical rings to 5 fingers (at least one per finger): n-1Cr-1 = 3C4 = Not possible With repetition allowed (zero permitted): 5^4 = 625
๐Ÿ”น Formulae

a) nC0 = 1 = nCn

b) nC1 = n = nCn-1

c) nCr = nCn-r

d) nCa = nCb, if a + b = n

e) nCr + nCr-1 = n+1Cr

f) โˆ‘nCr = 2^n

g) Sum of even nCr = sum of odd nCr = 2^(n-1)

๐Ÿ”ข Special Cases and Applications

๐Ÿ”น Sum of Numbers Formed

Without repetition:

Sum = (Sum of digits) ร— (111โ€ฆ up to r digits) ร— (nPr / n)

With repetition:

Sum = (Sum of digits) ร— (111โ€ฆ r digits) ร— n^(r - 1)

๐Ÿ”น Number of Ways

4 letters in 7 boxes (different) = 7^4 = 2401

4 identical rings on 5 fingers = 5^4 = 625

4 different rings on 5 fingers (repetition allowed) = 5 ร— 6 ร— 7 ร— 8 = 1680

๐Ÿ”น Lines and Triangles

Lines from n points (no 3 collinear): nC2

Triangles from n points: nC3

Diagonals in polygon = nC2 โ€“ n

๐Ÿ”ƒ Grouping and Distribution

๐Ÿ”น Distribute n distinct items among groups

If groups are distinct: = n! / (p! q! r!...)

If groups are indistinct but equal size: = n! / [(n/r)!]^r = If groups not distinct โ†’ divide further by r!

๐Ÿ“Œ Handy Trick Summary

Concept Formula
Linear Permutation (no repeat) nPr = n! / (n - r)!
Linear Permutation (repeat) n^r
Identical items in permutation n! / (p! q! โ€ฆ)
Circular Arrangement (n - 1)!
Necklace/Garland (n - 1)! / 2
Combination (no repeat) nCr = n! / [r!(n - r)!]
Combination (with repeat) n + r - 1Cr
Distribution of identical items n + r - 1Cr - 1
Derangements Dn = n! ร— [1 โ€“ 1/1! + 1/2! โ€“ โ€ฆ + (-1)^n/n!]
Lines from n points nC2
Triangles from n points nC3
Diagonals in polygon nC2 โ€“ n

๐ŸŽฏ Practice Example

โœ… Example 1: Find the number of ways to post 4 different letters in 7 different boxes. Answer: 7^4 = 2401
โœ… Example 2: Find the number of ways to give 4 identical rings to 5 fingers (at least one per finger). Answer: 5^4 = 625
โœ… Example 3: Find the number of ways to give 4 different rings to 5 fingers (repetition allowed). Answer: 5 ร— 6 ร— 7 ร— 8 = 1680
โœ… Example 4: Find the number of ways to arrange 7 friends around a table. Answer: (7 - 1)! = 720
โœ… Example 5: Find the number of ways to arrange 7 friends around a rectangular table with equal numbers on each side. Answer: n! / 2 = 720 / 2 = 360
โœ… Example 6: Find the number of ways to arrange 7 friends around a table with no restrictions. Answer: (7 - 1)! = 720
โœ… Example 7: Find the number of ways to arrange 7 friends around a table with 3 of them sitting together. Answer: (7 - 1)! = 720