0% found this document useful (0 votes)
301 views

DM Unit 1

The document discusses counting principles in combinatorics, specifically the rule of sum and rule of product. The rule of sum states that if there are x choices for one action and y choices for another mutually exclusive action, there are x + y total choices. Examples demonstrate counting outfits, pets, and cards using this principle. The rule of product states that if there are x ways to do one thing and y ways to do another thing after, there are x * y total ways to perform both actions. Examples demonstrate ways to travel and seating arrangements using this principle. The document also covers permutations and provides examples of counting permutations of letters in words and numbers of arrangements under certain conditions.

Uploaded by

Rushikesh Shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
301 views

DM Unit 1

The document discusses counting principles in combinatorics, specifically the rule of sum and rule of product. The rule of sum states that if there are x choices for one action and y choices for another mutually exclusive action, there are x + y total choices. Examples demonstrate counting outfits, pets, and cards using this principle. The rule of product states that if there are x ways to do one thing and y ways to do another thing after, there are x * y total ways to perform both actions. Examples demonstrate ways to travel and seating arrangements using this principle. The document also covers permutations and provides examples of counting permutations of letters in words and numbers of arrangements under certain conditions.

Uploaded by

Rushikesh Shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Counting:

Rule of Sum

The rule of sum is a basic counting approach in combinatorics. A basic statement of the rule is
that if there are choices for one action, and choices for another action and the two actions cannot
be done at the same time, then there are ways to choose one of these actions.

The rule of sum only applies to choices that are mutually exclusive, meaning that only one of the
choices can be picked. To determine when to use the rule of sum try to rephrase the question. If
the question can be rephrased with the word "or," this usually indicates that the rule of sum
applies.

Example 1

Mary is wearing her lucky shirt today, and she has to choose among 3 red skirts and 4 blue skirts
to wear with the shirt. How many different outfit choices of one skirt and one shirt does she have
for the day?

Solution:

Since Mary can wear one of the 3 red skirts or one of the 4 blue skirts, the choices are mutually
exclusive and the rule of sum applies. This gives a total 3+4=7 of different outfit choices

Example 2:

Ravi goes to a pet shop and finds that the pet shop has reptiles, birds, rabbits, and fish. If Ravi
can only pick one animal as a pet, how many choices does Ravi have for a pet?

Since Ravi can choose a reptile or a bird or a rabbit or a fish, the rule of sum applies. Then

There are 3 ways to select a reptile.

There are 4 ways to select a bird.

There are 5ways to select a rabbit.

There are 6 ways to select a fish.

By the rule of sum,3+4+5+6=18 there are ways to select a pet.


Example 3:

Chris is playing a card game and the cards in his hand include three 5's, two Jacks, two Aces, one
9, and one King. If he has to choose one card to play in the next round, how many choices does
he have for a card to play?

Since Chris can choose to play a or a Jack or an ace or a 9 or a King, the rule of sum applies.
Then

There are 3ways to select a

There are 2ways to select a Jack.

There are 2ways to select an Ace.

There is 1 way to select a 9.

There is 1 way to select a King.

By the rule of sum, there are 3+2+2+1+1= 9 ways to select a card to play in the next roun

Rule of Product / Multiplication principle:

If there are ways of doing something, and ways of doing another thing after that, then there
are ways to perform both of these actions.

Example:

1. Calvin wants to go to Milwaukee. He can choose from bus services or train services to head
from home to downtown Chicago. From there, he can choose from 2 bus services or 3 train
services to head to Milwaukee. How many ways are there for him to get to Milwaukee?

Solution: Since Calvin can either take a bus or a train downtown , he has 3+2=5 ways to head
downtown (Rule of Sum). After which, he can either take a bus or a train to Milwaukee, hence
he has another 2+3=5 ways to head to Milwaukee (Rule of Sum). Thus in total, he
has 5X5=25 ways to head from home to Milwaukee .

2. Six friends Andy, Bandy, Candy, Dandy, Endy and Fandy want to sit in a row at the cinema.
If there are only six seats available, how many ways can we seat these friends?

Solution: For the first seat, we have a choice of any of the 6 friends. After seating the first
person, for the second seat, we have a choice of any of the remaining 5 friends. After seating the
second person, for the third seat, we have a choice of any of the remaining 4 friends. After
seating the third person, for the fourth seat, we have a choice of any of the remaining 3 friends.
After seating the fourth person, for the fifth seat, we have a choice of any of the remaining 2
friends. After seating the fifth person, for the sixth seat, we have a choice of only 1 of the
remaining friends. Hence, by the Rule of Product, there are 6x5x4x3x2x1=720 ways to seat
these 6 people. More generally, this problem is known as a Permutation.

3. How many positive divisors 2000=24X53 does have?

Solution: Any positive divisor of 2000 must have the form 2a5b, where a and b are integers
satisfying 0 <=a <=4, 0<=b<=3 . There are 5 possibilities for a and 4 possibilities for b , hence
there are 5X4=20 (Rule of Product) positive divisors of 2000 in all.

Permutations

The notion of permutation relates to the act of arranging all the members of a set into
some sequence or order, or if the set is already ordered, rearranging (reordering) its elements, a
process called permuting. These differ from combinations, which are selections of some
members of a set where order is disregarded. For example, written as tuples, there are six
permutations of the set {1,2,3}, namely: (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), and (3,2,1).
These are all the possible orderings of this three element set. As another example, an anagram of
a word, all of whose letters are different, is a permutation of its letters. In this example, the letters
are already ordered in the original word and the anagram is a reordering of the letters. The study
of permutations of finite sets is a topic in the field of combinatorics.

Permutations occur, in more or less prominent ways, in almost every area of mathematics. They
often arise when different orderings on certain finite sets are considered, possibly only because
one wants to ignore such orderings and needs to know how many configurations are thus
identified. For similar reasons permutations arise in the study of sorting algorithms in computer
science.

The number of permutations of n distinct objects is n factorial, usually written as n!, which
means the product of all positive integers less than or equal to n.

The different arrangements of a given number of things by taking some or all at a time, are called
permutations.
Examples:

All permutations (or arrangements) made with the letters a, b, c by taking two at a time are
(ab, ba, ac, ca, bc, cb).

All permutations made with the letters a, b, c taking all at a time are:
( abc, acb, bac, bca, cab, cba)

Number of Permutations:

Number of all permutations of n things, taken r at a time, is given by:

nPr = n(n - 1)(n - 2) ... (n - r + 1) =n!/(n - r)!

Problem 1: Find the number of words, with or without meaning, that can be formed with the
letters of the word ‘CHAIR’.

Solution:

‘CHAIR’ contains 5 letters.

Therefore, the number of words that can be formed with these 5 letters = 5! = 5*4*3*2*1 = 120.

Problem 2: Find the number of words, with or without meaning, that can be formed with the
letters of the word ‘INDIA’.

Solution:

The word ‘INDIA’ contains 5 letters and ‘I’ comes twice.

When a letter occurs more than once in a word, we divide the factorial of the number of all
letters in the word by the number of occurrences of each letter.

Therefore, the number of words formed by ‘INDIA’ = 5!/2! = 60.

Problem 3: Find the number of words, with or without meaning, that can be formed with the
letters of the word ‘SWIMMING?

Solution:

The word ‘SWIMMING contains 8 letters. Of which, I occurs twice and M occurs twice.

Therefore, the number of words formed by this word = 8! / (2!*2!) = 10080.


Problem 4: How many different words can be formed with the letters of the word ‘SUPER’ such
that the vowels always come together?

Solution:

The word ‘SUPER’ contains 5 letters.

In order to find the number of permutations that can be formed where the two vowels U and E
come together.

In these cases, we group the letters that should come together and consider that group as one
letter.

So, the letters are S,P,R, (UE). Now the number of words are 4.

Therefore, the number of ways in which 4 letters can be arranged is 4!

In U and E, the number of ways in which U and E can be arranged is 2!

Hence, the total number of ways in which the letters of the ‘SUPER’ can be arranged such that
vowels are always together are 4! * 2! = 48 ways.

Problem 5: Find the number of different words that can be formed with the letters of the word
‘BUTTER’ so that the vowels are always together.

Solution:

The word ‘BUTTER’ contains 6 letters.

The letters U and E should always come together. So the letters are B, T, T, R, (UE).

Number of ways in which the letters above can be arranged = 5!/2! = 60 (since the letter ‘T’ is
repeated twice).

Number of ways in which U and E can be arranged = 2! = 2 ways

Therefore, total number of permutations possible = 60*2 = 120 ways.


Problem 6: Find the number of permutations of the letters of the word ‘REMAINS’ such that the
vowels always occur in odd places.

Solution:

The word ‘REMAINS’ has 7 letters.

There are 4 consonants and 3 vowels in it.

Writing in the following way makes it easier to solve these type of questions.

(1) (2) (3) (4) (5) (6) (7)

No. of ways 3 vowels can occur in 4 different places = 4P3 = 24 ways.

After 3 vowels take 3 places, no. of ways 4 consonants can take 4 places = 4P4 = 4! = 24 ways.

Therefore, total number of permutations possible = 24*24 = 576 ways.

Problem 7:

In how many different ways can the letters of the word 'CORPORATION' be arranged so that the
vowels always come together?

In the word 'CORPORATION', we treat the vowels OOAIO as one letter.

Thus, we have CRPRTN (OOAIO).

This has 7 (6 + 1) letters of which R occurs 2 times and the rest are different.

7!
Number of ways arranging these letters = = 2520.
2!

Now, 5 vowels in which O occurs 3 times and the rest are different, can be arranged

5!
in = 20 ways.
3!

Required number of ways = (2520 x 20) = 50400.


Problem 8:

In how many ways can the letters of the word 'LEADER' be arranged?

Solution:

The word 'LEADER' contains 6 letters, namely 1L, 2E, 1A, 1D and 1R.

6!
Required number of ways = = 360.
(1!)(2!)(1!)(1!)(1!)

Problem 9:

How many 3-digit numbers can be formed from the digits 2, 3, 5, 6, 7 and 9, which are divisible
by 5 and none of the digits is repeated?

Solution:

Since each desired number is divisible by 5, so we must have 5 at the unit place. So, there is 1
way of doing it.

The tens place can now be filled by any of the remaining 5 digits (2, 3, 6, 7, 9). So, there are 5
ways of filling the tens place.

The hundreds place can now be filled by any of the remaining 4 digits. So, there are 4 ways of
filling it.

Required number of numbers = (1 x 5 x 4) = 20


Cobinations:

A combination is a selection of items from a collection, such that (unlike permutations) the order
of selection does not matter. For example, given three fruits, say an apple, an orange and a pear,
there are three combinations of two that can be drawn from this set: an apple and a pear; an apple
and an orange; or a pear and an orange. More formally, a k-combination of a set S is a subset
of k distinct elements of S. If the set has n elements, the number of k-combinations is equal to
the binomial coefficient

nCr=n*(n-1)*(n-2)…1/(n-r)*(n-r-1)*(n-r-2)….1

which can be written using factorials as n!/r!(n-k)! whenever k<=n, and which is zero
when k>n.

Combinations refer to the combination of n things taken k at a time without repetition. To refer
to combinations in which repetition is allowed, the terms k-selection, k-multiset, or k-
combination with repetition are often used. If, in the above example, it were possible to have two
of any one kind of fruit there would be 3 more 2-selections: one with two apples, one with two
oranges, and one with two pears.

Examples:

Problem 1: Out of 7 consonants and 4 vowels, how many words of 3 consonants and 2 vowels
can be formed?

Solution: Number of ways of selecting 3 consonants from 7


= 7C3
Number of ways of selecting 2 vowels from 4
= 4C2

Number of ways of selecting 3 consonants from 7 and 2 vowels from 4


= 7C3 × 4C2
=(7×6×53×2×1)×(4×32×1)=210

Problem 2: in a group of 6 boys and 4 girls, four children are to be selected. In how many
different ways can they be selected such that at least one boy should be there?

Solution In a group of 6 boys and 4 girls, four children are to be selected such that at least one
boy should be there.
Hence we have 4 options as given below

We can select 4 boys


Number of ways to this = 6C4

We can select 3 boys and 1 girl ...(option 2)


Number of ways to this = 6C3 × 4C1

We can select 2 boys and 2 girls ...(option 3)


Number of ways to this = 6C2 × 4C2

We can select 1 boy and 3 girls ...(option 4)


Number of ways to this = 6C1 × 4C3

Total number of ways


= 6C4 + 6C3 × 4C1 + 6C2 × 4C2 + 6C1 × 4C3
= 6C2 + 6C3 × 4C1 + 6C2 × 4C2 + 6C1 × 4C1[∵ nCr = nC(n-r)]

=6×52×1+6×5×43×2×1×4=6×52×1+6×5×43×2×1×4 +6×52×1×4×32×1+6×4+6×52×1×4×32×1+
6×4

=15+80+90+24=209

Problem 3:From a group of 7 men and 6 women, five persons are to be selected to form a
committee so that at least 3 men are there in the committee. In how many ways can it be done?

Solution: From a group of 7 men and 6 women, five persons are to be selected with at least 3
men.

Hence we have the following 3 options.

We can select 5 men


Number of ways to do this = 7C5

We can select 4 men and 1 woman ...(option 2)


Number of ways to do this = 7C4 × 6C1

We can select 3 men and 2 women ...(option 3)


Number of ways to do this = 7C3 × 6C2

Total number of ways


= 7C5 + (7C4 × 6C1) + (7C3 × 6C2)
= 7C2 + (7C3 × 6C1) + (7C3 × 6C2)[∵ nCr = nC(n - r) ]

=7×62×1+7×6×53×2×1×6=7×62×1+7×6×53×2×1×6 +7×6×53×2×1×6×52×1+7×6×53×2×1×6×5
2×1

=21+210+525=756

Problem 4:A bag contains 2 white balls, 3 black balls and 4 red balls. In how many ways can 3
balls be drawn from the bag, if at least one black ball is to be included in the draw?

From 2 white balls, 3 black balls and 4 red balls, 3 balls are to be selected such that at least one
black ball should be there.

Hence we have 3 choices as given below

We can select 3 black balls


We can select 2 black balls and 1 non-black ball ...(option 2)
We can select 1 black ball and 2 non-black balls ...(option 3)

Number of ways to select 3 black balls


= 3C3
Number of ways to select 2 black balls and 1 non-black ball
= 3C2 × 6C1
Number of ways to select 1 black ball and 2 non-black balls
= 3C1 × 6C2

Total number of ways


= 3C3 + 3C2 × 6C1 + 3C1 × 6C2
= 3C3 + 3C1 × 6C1 + 3C1 × 6C2[∵ nCr = nC(n-r)]
=1+3×6+3×6×52×1=1+18+45=64
Problem 5: How many triangles can be formed by joining the vertices of an octagon

Number of triangles that can be formed by joining the vertices of a polygon of n sides
= nC3

Here n = 8

Hence, number of triangles that can be formed by joining the vertices of an octagon
= 8C3 =8×7×66=56

Problem 6:If there are 9 horizontal lines and 9 vertical lines in a chess board, how many
rectangles can be formed in the chess board?

Here m = 9, n = 9

Hence, number of rectangles that can be formed


= mC2 × nC2
= 9C2 × 9C2 = (9C2)2
=(9×82×1)2=362=1296=(9×82×1)2=362=1296

Binomial Theorem:

a+b is a binomial (the two terms are a and b)

Let us multiply a+b by itself using Polynomial Multiplication.

(a+b)(a+b) = a2 + 2ab + b2

Now take that result and multiply by a+b again:

(a2 + 2ab + b2)(a+b) = a3 + 3a2b + 3ab2 + b3

And again:

(a3 + 3a2b + 3ab2 + b3)(a+b) = a4 + 4a3b + 6a2b2 + 4ab3 + b4

The calculations get longer and longer as we go, but there is some kind of pattern developing.
That pattern is summed up by the Binomial Theorem:

where

There is another way to find the value of "nCr", and it's called "Pascal's Triangle". To make the
triangle, you start with a pyramid of three 1's, like this:

Then you get the next row of numbers by adding the pairs of numbers from above. (Where there
is only one number above, you just carry down the 1.)

Keep going, always adding pairs of numbers from the previous row.
To find, say, 6C4, you go down to the row where there is a "6" after the initial "1", and then go
over to the 5th (not the 4th) entry, to find that 6C4 = 15.

Generalized Permutations and Combinations

Permutations with Repeated Elements. Assume that we have an alphabet with k letters and we
want to write all possible words containing n1 times the first letter of the alphabet, n2 times the
second letter,. . . , nk times the kth letter. How many words can we write? We call this number
P(n; n1, n2, . . . , nk), where n = n1 + n2 + · · · + nk. Example: With 3 a’s and 2 b’s we can write
the following 5-letter words: aaabb, aabab, abaab, baaab, aabba, ababa, baaba, abbaa, babaa,
bbaaa. We may solve this problem in the following way, as illustrated with the example above.
Let us distinguish the different copies of a letter with subscripts: a1a2a3b1b2. Next, generate
each permutation of this five elements by choosing 1) the position of each kind of letter, then 2)
the subscripts to place on the 3 a’s, then 3) these subscripts to place on the 2 b’s. Task 1) can be
performed in P(5; 3, 2) ways, task 2) can be performed in 3! ways, task 3) can be performed in
2!. By the product rule we have 5! = P(5; 3, 2) × 3! × 2!, hence P(5; 3, 2) = 5!/3! 2!. In general
the formula is: P(n; n1, n2, . . . , nk) = n! /n1! n2! . . . nk!

Combinations with Repetition. Assume that we have a set A with n elements. Any selection of r
objects from A, where each object can be selected more than once, is called a combination of n
objects taken r at a time with repetition. For instance, the combinations of the letters a, b, c, d
taken 3 at a time with repetition are: aaa, aab, aac, aad, abb, abc, abd, acc, acd, add, bbb, bbc,
bbd, bcc, bcd, bdd, ccc, ccd, cdd, ddd. Two combinations with repetition are considered identical
if they have the same elements repeated the same number of times, regardless of their order.

Note that the following are equivalent: 1. The number of combinations of n objects taken r at a
time with repetition.

2. The number of ways r identical objects can be distributed among n distinct containers. 3. The
number of nonnegative integer solutions of the equation: x1 + x2 + · · · + xn = r . Example:
Assume that we have 3 different (empty) milk containers and 7 quarts of milk that we can
measure with a one quart measuring cup. In how many ways can we distribute the milk among
the three containers? We solve the problem in the following way. Let x1, x2, x3 be the quarts of
milk to put in containers number 1, 2 and 3 respectively. The number of possible distributions of
milk equals the number of non negative integer solutions for the equation x1 + x2 + x3 = 7.
Instead of using numbers for writing the solutions, we will use strokes, so for instance we
represent the solution x1 = 2, x2 = 1, x3 = 4, or 2 + 1 + 4, like this: ||+|+||||. Now, each possible
solution is an arrangement of 7 strokes and 2 plus signs, so the number of arrangements is

P(9; 7, 2) = 9!/7! 2! = ¡9 7 ¢ .

1.1 Listing Permutations and Combinations

_ Goal: List all permutations and/or combinations of a set

– Idea: Put some sort of order on permutations/combinations

1.2 Lexicographic Order

Lexicographic Order

Will use lexicographic order to list all permutations and/or combinations Similar to dictionary
(alphabetical) order IfWord A is shorter thanWord B, and every letter ofWord A occurs in the
same place in Word B, Word A comes before Word B (”compute” and ”computer”) If the first
letter that di_ers inWord A comes before the corresponding
letter in Word B, then Word A comes before Word B (”math” and”matter”)

For strings _ = s1s2s3 … sp and _ = t1t2t3 … tq taken from the set f1; 2; 3; : : : ; ng

– For example, _ = 1742 and = 18285 are strings over f1; 2; 3; 4; 5; 6; 7; 8g

1.We write α < β (_ is lexicographically less than _) provided that

2.p < q and si = ti for 1 <= i <= q (e.g., α = 1732 and _ = β 173245)

3.For the first i such that si , ti, si < ti (e.g., α = 28473 and = β 2848)

Lexicographic Order and Permutations

Example. For the following 4�permutations from the set f1; 2; 3; 4; 5; 6; 7g, find the
permutation that immediately follows them in lexicographic order

1. 1234 is followed by

2. 4567 is followed by

3. 5437 is followed by

4. 7654 is followed by

Lexicographic Order and Combinations

We will always list a given combinations the order s1 < s2 < _ _ _ < sp

Example. For the following 4 combinations from the set f 1; 2; 3; 4; 5; 6; 7, find the combination
that immediately follows them in lexicographic order

1. 1234 is followed by

2. 3467 is followed by

3. 4567 and so on.

You might also like