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

DM - Unit 3 (Counting) - Notes

Unit 3 of Discrete Mathematics focuses on counting techniques including the product and sum rules, permutations, combinations, and algorithms for generating these. It provides various examples illustrating how to apply these counting principles to solve problems in mathematics and computer science. Additionally, it discusses more complex counting problems that combine both rules to find solutions.

Uploaded by

rathod.31.hrishi
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)
5 views

DM - Unit 3 (Counting) - Notes

Unit 3 of Discrete Mathematics focuses on counting techniques including the product and sum rules, permutations, combinations, and algorithms for generating these. It provides various examples illustrating how to apply these counting principles to solve problems in mathematics and computer science. Additionally, it discusses more complex counting problems that combine both rules to find solutions.

Uploaded by

rathod.31.hrishi
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/ 28

Discrete Mathematics: Unit 3

Unit III: Counting 07 Hours


 The Basics of Counting, rule of Sum and Product,
 Permutations and Combinations, Binomial Coefficients and Identities,
 Generalized Permutations and Combinations, Algorithms for generating Permutations and
Combinations.
 Exemplar/ Case Studies: Study Sudoku solving algorithms and algorithm for generation
of new SUDOKU. Study Hank-shake Puzzle and algorithm to solve it.

 Introduction
 Suppose that a password on a computer system consists of six, seven, or eight characters.
Each of these characters must be a digit or a letter of the alphabet. Each password must
contain at least one digit. How many such passwords are there?
 The techniques needed to answer this question and a wide variety of counting problems
will be introduced in this section.
 Counting problems arise throughout mathematics and computer science.
 For example, we must count the successful outcomes of experiments and all the possible
outcomes of these experiments to determine probabilities of discrete events. We need to
count the number of operations used by an algorithm to study its time complexity.

 Product Rule:
 Suppose that a procedure can be broken down into a sequence of two tasks. If there are n
ways to do the first task and for each of these ways of doing the first task, there are m
ways to do the second task, then there are n*m ways to do the procedure.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 1


Discrete Mathematics: Unit 3

 Example 1: A new company with just two employees, rents a floor of a building with 12
offices. How many ways are there to assign different offices to these two employees?
Solution:
Step 1: Break the procedure into tasks
 Task 1: assigning an office to employee 1
 Task 2: assigning an office to employee 2
Step 2: Count different ways of doing each task and then use the product rule
 Task 1 can be done in 12 different ways and for each of these ways, Task 2 can be
done in 11 different ways.
 By product rule, There are 12·11 = 132 ways to assign offices to two employees.

 Example 2: The chairs of an auditorium are to be labeled with a letter and a positive
integer not exceeding 100. How many chairs can be labeled differently?
Solution:
Step 1: Break the procedure into tasks
 Task 1: assigning one of the 26 letters
 Task 2: assigning one of the 100 possible integers
Step 2: Count different ways of doing each task and then use the product rule
 Task 1 can be done in 26 different ways and for each of these ways, Task 2 can be
done in 100 different ways.
 By product rule, There are 26·100 = 2600 ways to assign labels to the chairs.

 Example 3: There are 32 microcomputers in a computer center. Each microcomputer has


24 ports. How many different ports to a microcomputer in the center are there?
Solution:
Step 1: Break the procedure into tasks
 Task 1: First picking a microcomputer from 32 microcomputers
 Task 2: 24 ways to choose the port no matter which microcomputer
Step 2: Count different ways of doing each task and then use the product rule
 Task 1 can be done in 32 different ways and for each of these ways; Task 2 can be
done in 24 different ways.
 By product rule shows that there are 32·24=768 ports.

 Example 4: An office building contains 27 floors and has 37 offices on each floor. How
many offices are there in building?

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 2


Discrete Mathematics: Unit 3

Solution: By product rule: There are 27 • 37 = 999 offices.

 Example 5: There are 18 mathematics majors and 325 computer science majors at a
college. In how many ways can two representatives be picked so that one is mathematics
major and the other is a computer science major?
Solution: By product rule: There are 18 • 325= 5850 ways to pick the two
representatives.

 Example 6: Six different airlines fly from New York to Denver and seven fly from
Denver to San Francisco. How many different pairs of airlines can you choose on which
to book a trip from New York to San Francisco via Denver, when you pick an airline for
the flight to Denver and an airline for the continuation flight to San Francisco?
Solution: By the product rule: flight is determined by choosing an airline for the flight
from New York to Denver (which can be done in 6 ways) and then choosing an airline for
the flight from Denver to San Francisco (which can be done in 7 ways).
Therefore there are 6 • 7 = 42 different possibilities for the entire flight.

 Extended version of the product rule


 A procedure can be broken down into a sequence of tasks T1, T2, …, Tm.
 Assume each task Ti (i=1,2,…,m), can be done in ni different ways, regardless of how the
previous tasks were done.
 The procedure can be done in n1n2…nm different ways.

 Example 7: How many different bit strings of length seven are there?
Solution:
Step 1: Break the procedure into tasks
 Task 1: assigning bit 1 to 0 or 1
 Task 2: assigning bit 2 to 0 or 1
 …
 Task 7: assigning bit 7 to 0 or 1
Step 2: Count different ways of doing each task and then use the product rule
 Each task can be done in 2 different ways.
 By product rule, there are 27= 128 different bit strings of length seven.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 3


Discrete Mathematics: Unit 3

 Example 8: How many different license plates are available if each plate contains a
sequence of three letters followed by 3 digits?
Solution:
Step 1: Break the procedure into tasks
 Task 1: choose letter 1 (26 possible ways)
 Task 2: choose letter 2 (26 possible ways)
 Task 3: choose letter 3 (26 possible ways)
 Task 4: choose digit 1 (10 possible ways)
 Task 5: choose digit 2 (10 possible ways)
 Task 6: choose digit 3 (10 possible ways)
Step 2: Count different ways of doing each task and then use the product rule
 There are 26 choices for each of the three uppercase English letters and ten
choices for each of the three digits. Hence, by the product rule there are a total of
26·26·26·10·10·10= 17,576,000 possible license plates.

 Example 9: A particular brand of shirt comes in 12 colors, has a male & a female
version, & comes in 3 sizes for each sex. How many different types of this shirt are
made?
Solution: By product rule shows that there 12*2*3=72 different types of shirt.

 Example 10: How many functions are there from a set with m elements to a set with n
elements?
Solution:
Step 1: Break the procedure into tasks
 Task: Assign an element in codomain to element ai in domain. For all i=1,2,…,m.
 i.e for each of the m elements in the domain, there are n choices from the
codomain.
Step 2: Count different ways of doing each task and then use the product rule
 By product rule, there are n·n·n····n =nm different functions.

 Example 11: The format of telephone numbers in North America is specified by a


numbering plan called as North American numbering plan (NANP) specifies the format
of telephone numbers in the U.S., Canada, and many other parts of North America. Let X
denote a digit between 0 and 9. Let N denote a digit between 2 and 9. Let Y denote a digit
between 0 and 1. In the old plan, the format of telephone numbers is NYX-NNX-XXXX.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 4


Discrete Mathematics: Unit 3

In the new plan, the format of telephone numbers is NXX-NXX-XXXX. How many
North American telephone numbers are possible under the old plan and under the new
plan?
Solution: By the product rule, there are 8·2·10=160 area codes with format NYX and
8·10·10=800 area codes with format NXX.
Similarly, by the product rule, there are 8·8·10=640 office codes with format NNX.
The product rule also shows that there are 10·10·10·10=10,000 station codes with format
XXXX.
Consequently, applying the product rule again, it follows that under the old plan there are
160·640·10,000=1,024,000,000 different numbers available in North America.
Under the new plan, there are 800·800·10,000=6,400,000,000 different numbers available

 Example 12: In how many ways can we select 3 students from a group of 5 students to
stand in line for a picture? In how many ways can we arrange all 5 of these students in a
line for a picture?
Solution: Note that the order in which we select the students matters. There are five ways
to select the first student to stand at the start of the line. Once this student has been
selected, there are four ways to select the second student in the line. After the first and
second students have been selected, there are three ways to select the third student in the
line.
By the product rule, there are 5·4·3=60 ways to select three students from a group of five
students to stand in line for a picture.
To arrange all five students in a line for a picture, we select the first student in five ways,
the second in four ways, the third in three ways, the fourth in two ways, and the fifth in
one way. Consequently, there are 5·4·3·2·1 = 120 ways to arrange all five students in a
line for a picture.

 Sum Rule:

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 5


Discrete Mathematics: Unit 3

 If A and B are disjoint, i.e., if A ∩ B = Ø, then |A ∪ B| = |A| + |B|.


 If there are n ways for task one, and m ways for another task and the two tasks cannot
be done at the same time, then there are n + m ways to choose one of these tasks.

 Example 13: Suppose that either a member of the mathematics faculty or a student who
is mathematics major is chosen as a representative to a university committee. How many
different choices are there for this representative if there are 37 members of the
mathematics faculty and 83 mathematics majors and no one is both a faculty member and
a student?
Solution: There are 37 ways to choose a member of the mathematics faculty and there are
83 ways to choose a student who is mathematics major. Choosing a member of the
mathematics faculty is never the same as choosing a student who is mathematics major
because no one is both a faculty member and a student. By the sum rule it follows that
there are 37 + 83 = 120 possible ways to pick this representative.

 Extended version of the sum rule


 Suppose a task can be done in one of n1 ways, in one of n2 ways, …, or in one of nm
ways.
 Assume none of the set of ni ways of doing the task is the same as any of the set of nj
ways, for all pairs i and j with 1 ≤ i < j ≤ m.
 The task can be done in n1 + n2+…+ nm different ways,

 Example 14: A student can choose a computer project from one of three lists. The three
lists contain 23, 15, and 19 possible projects, respectively. No project is on more than one
list. How many possible projects are there to choose from?
Solution: The student can choose a project by selecting a project from the first list, the
second list, or the third list. Because no project is on more than one list, by the sum rule
there are 23 + 15 + 19 = 57 ways to choose a project.

 Example 15: A university consists only of 2 faculties, namely Science and Engineering.
On Tuesday at 11am there are 10 exams that can take place from the faculty of Science.
At the same time there are 5 exams that can take place from the faculty of Engineering.
How many possible exams can take place?
Solution: For University there are 10 + 5 = 15 exams that can take place.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 6


Discrete Mathematics: Unit 3

 More Complex Counting Problems (Combination of Both Rules)


 Example 16: In a version of the computer language BASIC, the name of a variable is a
string of one or two alphanumeric characters, where uppercase and lowercase letters are
not distinguished. (An alphanumeric character is either one of the 26 English letters or
one of the 10 digits.) Moreover, a variable name must begin with a letter and must be
different from the five strings of two characters that are reserved for programming use.
How many different variable names are there in this version of BASIC?
Solution:
Task 1: choose a one character long variable name.
Task 2: choose a two characters long variable name.
 Since the first character of the variable name must be a letter, task 1 can be done in 26
different ways.
 To choose a two characters long variable name, the first character can be a letter and
the second can be a letter or a digit.
 A two character long variable name must also be different from the five reserved
strings.
 By the product rule, task 2 can be done in 26 . 36 - 5 = 931 different ways.
 By the sum rule, there are 931+26= 957 different variable names.

 Example 17: In a computer system, each user has a password.


a) The password must be six to eight characters long.
b) Each character is an uppercase letter or a digit.
c) Each password must contain at least one digit.
How many possible passwords are there?
Solution:
Task 1: choose a six characters long password.
Task 2: choose a seven characters long password.
Task 3: choose a eight characters long password.
The number of task 1: the number of passwords of six characters where each character
can be an uppercase letter or a digit is 366 excluding the number of six characters long
passwords with no digits which is 266.
Task 1 can be done in 366- 266 = 1,867,866,560 ways.
The number of task 2: the number passwords of seven characters where each character
can be an uppercase letter or a digit is 367 excluding the number of seven characters long
passwords with no digits which is 267.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 7


Discrete Mathematics: Unit 3

Task 2 can be done in 367- 267 = 70,332,353,920 ways.


The number of task3: the number passwords of eight characters where each character can
be an uppercase letter or a digit is 368 excluding the number of eight characters long
passwords with no digits which is 268 .
Task 3 can be done in 368- 268 = 2,612,282,842,880 ways.
By the sum rule, the numbers of possible passwords are the number of task 1 + the
number of task 2 + the number of task 3 = 2,684,483,063,360.

 The Subtraction Rule (Inclusion–Exclusion for Two Sets)


 If a task can be done in either n1 ways or n2 ways, then the number of ways to do the task
is n1 + n2 minus the number of ways to do the task that are common to the two different
ways.
 The subtraction rule is also known as the principle of inclusion–exclusion.

 Example 18: How many bit strings of length eight either start with a 1 bit or end with
two bits 00?
Solution:
Task 1: choose a bit string of length eight starts with 1.
Task 2: choose a bit string of length eight ends with 00.
 Since the first bit must be 1 in task 1, by the product rule, the number of task 1 is 27.
 Since the last two bits must be 00 in task 2, by the product rule, the number of task 2
is 26.
 The strings of length eight that start with 1 and end 00 are common in task 1 and task
2 and the number of them are 25.
 By inclusion-exclusion principles, the number of such strings is 27+ 26- 25 = 160.

 Example 19: |A∪B|?


Solution: Task 1: choose an element from A.
Task 2: choose an element from B.
 Since A has |A| elements, the number of task 1 is |A|.
 Since B has |B| elements, the number of task 2 is |B|.
 The elements that are in both A and B are common in task 1 and task 2 and the
number of them are |A∩B|.
 By inclusion-exclusion principles, the number of task 1 and task 2
|A∪B| = |A|+|B|- |A∩B|

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 8


Discrete Mathematics: Unit 3

 Example 20: A computer company receives 350 applications for a job. Suppose that 220
of them majored in computer science, 147 of them majored in business and 51 of them
majored both in computer science and business. How many of these applicants majored in
neither computer science nor business?
Solution:
First find the number of applicants that are majored in computer science or business, then
subtract it from the total number of applicants
Task 1: choose an applicant majored in computer science
Task 2: choose an applicant majored in business.
 The number of task 1 is 220.
 The number of task 2 is 147.
 The applicants that are majored both in computer science and business are common in
task 1 and task 2 and the number of them are 51.
 By inclusion-exclusion principles, the number of task 1 and task 2 is 220 + 147-51 =
316.
 So, the number of applicants majored in neither computer science and business is
350 - 316=34.

 Example 21: There are 18 mathematics majors and 325 computer science majors at a
college.
a) In how many ways can two representatives be picked so that one is a mathematics
major and the other is a computer science major?
b) In how many ways can one representative be picked who is either a mathematics
major or a computer science major?
Solution: a)
 There are 18 ways to choose the mathematics major.
 There are 325 ways to choose the computer science major.
 By the product rule, 18*325 = 5850 ways to pick the two representatives.
Solution: b)
 There are 18 ways to choose mathematics major, and there are 325 ways to choose a
computer science major.
 By sum rule, there are 18 + 325 = 343 ways to pick the representative.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 9


Discrete Mathematics: Unit 3

 Permutations
 The act of arranging all the members of a set into some sequence or order T. OR
 An arrangement in sequence of elements of a set is called a permutation of the element.
 In a permutation, the order that we arrange the objects in is important.
 Example 22: Consider arranging 3 letters: A, B, C. How many ways can this be done?
Solution: The possible permutations are:
ABC, ACB, BAC, BCA, CAB, CBA.
Hence, there are six distinct arrangements.
Another way of looking at this question is by drawing 3 boxes.

Any one of the A, B, C goes into the first box (3 ways to do this), and then the remaining
one of the two letters goes into the second box (2 ways to do this), and the last remaining
letter goes into the third box (only one way left to do this).
Hence, Total no of ways = 3 × 2 × 1 = 6.

 Theorem I: If n is a positive integer and r is an integer with 1 ≤ r ≤ n, then there are


P (n, r) = n (n − 1) (n – 2) ··· (n – r + 1) r-permutations of a set with n distinct
elements.
Proof:
 The first element of the permutation can be chosen in n ways because there are n
elements in the set.
 There are (n−1) ways to choose the second element of the permutation, because there
are (n−1) elements left in the set after using the element picked for the first position.
 Similarly, there are (n−2) ways to choose the third element, and so on, until there are
exactly n − (r − 1) = n − r + 1 ways to choose the rth element.
 Consequently, by the product rule, there are n (n − 1) (n – 2) ··· (n – r + 1).

 Depending on the nature of arrangement, there are four type of permutation.


A. Type I: Permutation with all object are distinct: A permutations of „n‟ different
objects taken „r‟ at a time is an arrangement of r objects out of n objects where 0 ≤ r ≤ n.
It is called r- permutations of n elements and its denoted by P(n,r) or nPr.
n
Pr = ( )

 Theorem II: Number of permutations of „n‟ different things taken „r‟ at a time is given
by:-

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 10


Discrete Mathematics: Unit 3

n
Pr = ( )
(n and r are integers with 0 ≤ r ≤ n)

Proof:
 Say we have „n‟ different things a1, a2……, an.
 Clearly the first place can be filled up in ‘n’ ways. Number of things left after filling-
up the first place = (n-1).
 So the second-place can be filled-up in (n-1) ways. Now number of things left after
filling-up the first and second places = (n – 2)
 Now the third place can be filled-up in (n-2) ways.
 Thus Number of ways of filling-up rth place = n – (r - 1) = n - r + 1
 By product rule of counting, total no. of ways of filling up, first, second rth place
together :- n (n-1) (n-2) ------------ (n - r + 1)
 Hence:
n
Pr = n (n-1)(n-2) --------------(n - r + 1)
 When n and r are integers with 1 ≤ r ≤ n, by Theorem 1 we have
P (n, r) = n (n − 1) (n – 2) ··· (n – r + 1) = n!/(n-r)!
Because n!/(n-0)! = n!/n! =1 whenever n is a nonnegative integer.
n
Pr = ( )
0≤r≤n Hence proved

 Theorem III: Number of permutations of „n‟ different things taken all at a time is given
by:- nPn = n!
n
Proof: We have Pr = n!/(n-r)! Putting r = n, we have,
n
Pn = n! / (n-n)! = n!/0! Since 0!= 1 we have
n
Pn = n! Hence proved

 Example 23: In how many ways can a supermarket manager display 5 brands of biscuits
in 3 spaces on a shelf?
Solution: This is asking for the number of permutations, since we don't want repetitions.
n
The number of ways is: Pr = n!/(n-r)! = 5!/(5-3)! = 5!/2! = 60

 Example 24: How many ways are there to select a first-prize winner, a second-prize
winner, and a third-prize winner from 100 different people who have entered a contest?
Solution: Because it matters which person wins which prize, the number of ways to pick
the three prize winners is the number of ordered selections of three elements from a set of
100 elements, that is, the number of 3-permutations of a set of 100 elements.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 11


Discrete Mathematics: Unit 3

Consequently, the answer is P(100,3)=100·99·98=970,200.

 Example 25: How many different number-plates for cars can be made if each number-
plate contains four of the digits 0 to 9 followed by a letter A to Z, assuming that no
repetition of digits is allowed?
Solution: There are 10 possible digits (0, 1, 2… 9) and we need to take them 4 at a time.
n
There are 26 letters in the alphabet. Pr = n!/(n-r)!
10
P4 * 26 = [10!/(10-4)! ] * 26 = 131040.
 Example 26: How many four digit number can be formed out of digits 1 to 9 if
a) No repetition is permitted & b) How many of these will be greater than 3000.
Solution: a) There are 9 possible digits (1, 2,…, 9) and we need to take them 4 at a time.
n
Pr = n!/(n-r)!
9
P4 = [9!/(9-4)! ] = 9!/5!= 3024
b) There is restriction that the four digit numbers so formed must be greater than 3000.
Therefore 1000th position can be filled with numbers 3,4,5,6,7,8,9 i.e. by 7 different ways,
100th position can be filled with 8 different ways, 10th place can be filled with 7 different
ways, Unit place can be filled with 6 different ways. Thus, 7 * 8 * 7 * 6 = 2352 ways.

 Example 27: How many permutations of the letters ABCDEFG contain


a) the string BCD? b) the string CFGA?
c) the strings BA and GF? d) the strings ABC and DE?
e) the strings ABC and CDE? f) the strings CBA and BED?
Solution: a) If BCD is to be a substring, then we can think of that block of letters as one
super letter, and the problem is to count permutations of five items-the letters A, E, F, and
G, and the super letter BCD. Therefore the answer is P(5, 5) = 5! = 120.
b) Reasoning as in part (a), we see that the answer is P(4,4) = 4! = 24.
c) As in part (a), we glue BA into one item and glue GF into one item. Therefore we need
to permute five items, and there are P(5, 5) = 5! = 120 ways to do it.
d) This is similar to part (c). Glue ABC into one item and glue DE into one item,
producing four items, so the answer is P(4,4) = 4! = 24.
e) If both ABC and CDE are substrings, then ABCDE has to be a substring. So we are
really just permuting three items: ABCDE, F, and G. Therefore the answer is P(3,3) = 3!
f) There are no permutations with both of these substrings, since B cannot be followed by
both A and E at the same time.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 12


Discrete Mathematics: Unit 3

B. Type II: Permutations with Repetition: The number of r-permutations of a set of n


objects with repetition allowed is nr. i.e.
The numbers of different permutations of n distinct objects taken r at a time when every
object is allowed to repeat any number of times is given by nr.

 Example 28: How many three digit numbers can be formed with the digits: 1, 2, 3, 4, 5?
Solution: n = 5 r = 3. The order of the elements does matter. The elements are repeated.
P(n,r)= nr i.e. P(5,3) = 53 = 125
 Example 29: How many 3 digit numbers can be formed with the digits: 0, 1, 2, 3, 4, 5?
Solution: n = 6 r = 3. The numbers must be separated into two blocks:
The first set, of one number, can occupy only one of 5 digits because a number does not
begin with zero (except for license plates and other special cases).
n=5 r=1
The second block, of two numbers, can occupy any digit. n = 6 r=2
P(n,r)= nr i.e. P(5,1). P(6,2) = 51 . 62 = 180.

C. Type III: Permutations with Indistinguishable Objects: The number of different


permutations of n objects of which r1 are of one kind, r2 are of a second kind, r3 are of
third kind….... rk are of kth kind and n = r1 + r2 + ... + rk is given by

 Example 30: How many ordered arrangements are there of the letters in the word
PHILIPPINES?
Solution: The number of ordered arrangements of the letters in the word PHILIPPINES
is:

 Example 31: The signal mast of a ship can raise nine flags at one time (three red, two
blue and four green). How many different signals can be communicated by the placement
of these nine flags?
Solution: n = 9 r1 = 3, r2 = 2, r3 = 4, r1 + r2 + r3 = 9.

 Example 32: How many nine-digit numbers can be formed with the numbers 2, 2, 2, 3, 3,
3, 3, 4, 4?

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 13


Discrete Mathematics: Unit 3

Solution: n = 9 r1 = 3, r2 = 4, r3 = 2, r1 + r2 + r3 = 9.
The order of the elements does matter. The elements are repeated.

 Example 33: Fifteen (15) animals are available to use in a study to compare three (3)
different diets. Each of the diets (let's say, A, B, C) is to be used on five randomly
selected animals. In how many ways can the diets be assigned to the animals?
Solution: Well, one possible assignment of the diets to the animals would be for the first
five animals to be placed on diet A, the second five animals to be placed on diet B, and
the last 5 animals to be placed on diet C. That is:
A A A A A B B B B B C C C C C
Another possible assignment might look like this:
A B C A B C A B C A B C A B C
Upon studying these possible assignments, we see that we need to count the number of
distinguishable permutations of 15 objects of which 5 are of type A, 5 are of type B, and 5
are of type C. Using the formula, we see that there are:

ways in which 15 animals can be assigned to the 3 diets.

 Example 34: A ship's captain sends signals by arranging 4 orange and 3 blue flags on a
vertical pole. How many different signals could the ship's captain possibly send?
Solution. If the flags were numbered 1, 2, 3, 4, 5, 6 and 7, then the orange flags and blue
flags would be distinguishable among themselves. In that case, the ship's captain could
send any of 7! = 5,040 possible signals.
The flags are not numbered, however. That is, the four orange flags are not
distinguishable among themselves, and the 3 blue flags are not distinguishable among
themselves. We need to count the number of distinguishable permutations when the two
colors are the only features that make the flags distinguishable. The ship's captain has 4
orange flags and 3 blue flags. Using the formula for the number of distinguishable
permutations, the ship's captain could send any of:

 Example 35: Suppose we toss a gold dollar coin 8 times. What is the probability that the
sequence of 8 tosses yields 3 heads (H) and 5 tails (T)?
Solution: Two such sequences, for example, might look like this:

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 14


Discrete Mathematics: Unit 3

H H H T T T T T or this HTHTHTTT
Assuming the coin is fair, and thus that the outcomes of tossing either a head or tail are
equally likely, we can use the classical approach to assigning the probability. The Product
Rule: 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 = 256 possible outcomes in the sample space of 8
tosses.
Now, when counting the number of sequences of 3 heads and 5 tails, we need to
recognize that we are dealing with arrangements or permutations of the letters, since order
matters, but in this case not all of the objects are distinct. We can think of choosing (note
that choice of word!) r = 3 positions for the heads (H) out of the n = 8 possible tosses.
That would, of course, leave then n − r = 8 − 3 = 5 positions for the tails (T). Using the
formula for a combination of n objects taken r at a time, there are therefore:

Distinguishable permutations of 3 heads (H) and 5 tails (T). The probability of tossing 3
heads (H) and 5 tails (T) is thus 56/256 = 0.22.

 Example 36: In how many ways can 4 married couples attending a concert be seated in a
row of 8 seats:
a) if there are no restrictions as to where the 8 people can sit?
b) if each married couple is seated together?
c) if members of the same sex are all seated next to each other
Solution: a) Here are the eight seats:
If we arbitrarily name the people A, B, C, D, E, F, G, and H, then one possible seating
arrangement is ABCDEFGH. Another is DGHCAEBF.
These examples suggest that we have to place 8 people into 8 seats without repetition. i.e,
one person can't occupy two seats!
The Product Rule: 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 40,320 possible seating arrangements.
b) Here are the eight seats shown as four paired seats:
If we arbitrarily name the people A1, A2, B1, B2, C1, C2, D1, and D2, then one possible
seating arrangement is B2, B1, A1, A2, C2, C1, D1, D2. Another such assignment might
be B1, B2, A2, A1, C1, C2, D1, D2. These two examples illustrate that counting here is a
two-step process.
Permuting 4 items (couples) 4 at a time... there are 4! Ways.
Then, we have to arrange the partners within each couple. Well, couple A can be
arranged 2! ways. We can even list the ways... they can sit either as A1, A2 or as A2, A1.
Likewise, couple B can be arranged in 2! ways, as can couples C and D. The Product

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 15


Discrete Mathematics: Unit 3

Rule then tells us to multiply all the numbers together. Four married couples can be
seated in a row of 8 seats in: 4! × 2! × 2! × 2! × 2! = 384 ways if each married couple is
seated together.
c) If we arbitrarily name the people M1, M2, M3, M4 and F1, F2, F3, F4, then one
possible seating arrangement is M1, M2, M4, M3, F2, F1, F3, F4. Another such
assignment might be F1, F2, F4, F3, M2, M1, M4, M3.
Again, these two examples illustrate that counting here is a two-step process. First, we
have to figure out how many ways the genders M and F can be arranged. There are, of
course, 2 ways... the males in the seats on the left and females in the seats on the right or
the females in the seats on the left and the males in the seats on the right. Then, we have
to arrange the people within each gender. Let's take the females first. Permuting 4 items
(females) 4 at a time... there are 4! ways. Likewise, there are 4! ways of arranging the
males within their 4 seats. The Product Rule then tells us to multiply all the numbers
together. Four married couples can be seated in a row of 8 seats in: 4! × 4! × 2 = 1,152
ways if the members of the same sex are seated next to each other.

D. Type IV: Circular Permutation:


 If clockwise and anti-clock-wise orders are different, and then total number of circular-
permutations is given by (n-1)!
 If clock-wise and anti-clock-wise orders are taken as not different, then total number of
circular-permutations is given by ( )

 Example 37: In how many ways can 6 people be seated at a round table?
Solution: The number of ways will be (6 – 1)!, or 120.

 Example 38: Find the number of ways in which 5 people A,B,C,D,E can be seated at a
round table, such that
(i) A and B must always sit together. And (ii) C and D must not sit together.
Solution: (i) If we wish to seat A and B together in all arrangements, we can consider
these two as one unit, along with 3 others. So effectively we‟ve to arrange 4 people in a
circle, the number of ways being (4 – 1)! or 6.
But in each of these arrangements, A and B can themselves interchange places in 2 ways.
Therefore, the total number of ways will be 6 x 2 = 12.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 16


Discrete Mathematics: Unit 3

(ii) The number of ways in this case would be obtained by removing all those cases (from
the total possible) in which C & D are together. The total number of ways will be (5 – 1)!
or 24.
Similar to (i) above, the number of cases in which C & D are seated together, will be 12.
Therefore the required number of ways will be 24 – 12 = 12.
 Example 39: In how many ways can 3 men and 3 ladies be seated at around table such
that no two men are seated together?
Solution: Since we don‟t want the men to be seated together, the only way to do this is to
make the men and women sit alternately.
We‟ll first seat the 3 women, on alternate seats, which can be done in (3 – 1)! or 2 ways,
as shown below. (We‟re ignoring the other 3 seats for now)
That is, if each of the women is shifted by a seat in any direction, the seating arrangement
remains exactly the same. i.e why we have only 2 arrangements, Now that we‟ve done
this, the 3 men can be seated in the remaining seats in 3! or 6 ways. Note that we haven‟t
used the formula for circular arrangements now. This is so because, after the women are
seated, shifting the each of the men by 2 seats, will give a different arrangement. After
fixing the position of the women (same as „numbering‟ the seats), the arrangement on the
remaining seats is equivalent to a linear arrangement.
Therefore the total number of ways in this case will be 2! X 3! = 12.

 Example 40: Suppose that there are eight runners in a race. The winner receives a gold
medal, the second place finisher receives a silver medal, and the third-place finisher
receives a bronze medal. How many different ways are there to award these medals, if all
possible outcomes of the race can occur and there are no ties?
Solution: The number of different ways to award the medals is the number of 3-
permutations of a set with eight elements.
Hence, there are P(8, 3) = 8 · 7 · 6 = 336 possible ways to award the medals.

 Example 41: How many permutations of the letters ABCDEFGH contain the string ABC ?
Solution: Because the letters ABC must occur as a block, we can find the answer by
finding the number of permutations of six objects, namely, the block ABC and the
individual letters D, E, F, G, and H.
Because these six objects can occur in any order, there are 6! = 720 permutations of the
letters ABCDEFGH in which ABC occurs as a block.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 17


Discrete Mathematics: Unit 3

 Example 42: Suppose that a saleswoman has to visit eight different cities. She must
begin her trip in a specified city, but she can visit the other seven cities in any order she
wishes. How many possible orders can the saleswoman use when visiting these cities?
Solution: The number of possible paths between the cities is the number of permutations
of seven elements, because the first city is determined, but the remaining seven can be
ordered arbitrarily. Consequently, there are 7! = 7 · 6 · 5 · 4 · 3 · 2 · 1 = 5040 ways for the
saleswoman to choose her tour. If, for instance, the saleswoman wishes to find the path
between the cities with minimum distance, and she computes the total distance for each
possible path, she must consider a total of 5040 paths!

 Example 43: In how many ways can this diagram be coloured subject to the following
two conditions?
(i) Each of the smaller triangle is to be painted with one of three
colours: red, blue or green.
(ii) No two adjacent regions have the same colour.
Solution: These conditions are satisfied exactly when we do as
follows: First paint the central triangle in any one of the three colours. Next paint the
remaining 3 triangles, with any one of the remaining two colours.
By the fundamental principle of counting, this can be done in 3 × 2 × 2 × 2 = 24 ways.

 Example 44: How many numbers are there between 99 and 1000 having 7 in the units
place?
Solution: First note that all these numbers have three digits. 7 is in the unit‟s place. The
middle digit can be any one of the 10 digits from 0 to 9.
The digit in hundred‟s place can be any one of the 9 digits from 1 to 9.
Therefore, by the fundamental principle of counting, there are 10 × 9 = 90 numbers
between 99 and 1000 having 7 in the unit‟s place.

 Example 45: How many numbers are there between 99 and 1000 having atleast one of
their digits 7?
Solution: Total number of 3 digit numbers having atleast one of their digits as 7 = (Total
numbers of three digit numbers) – (Total number of 3 digit numbers in which 7 does not
appear at all).
= (9 × 10 × 10) – (8 × 9 × 9) = 900 – 648 = 252.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 18


Discrete Mathematics: Unit 3

 Example 46: How many ways are there to rearrange the letters in the word COMPUTER
Solution: There are 8 distinct letters in the word COMPUTER. Therefore, 8!

 Example 47: How many ways if you are required to keep the vowels in alphabetical
order in the word COMPUTER? (In other words, the consonants can be in any order at
all, but the vowels must appear in the order EOU, possibly with consonants in between
the vowels.)
Solution: There are 5 consonants and 8 positions to choose from. The number of ways to
permutate this is 8 × 7 × 6 × 5 × 4 = 6720. There is only 1 way to arrange the vowels in
the remaining 3 positions (namely, in the order E, O and U). Therefore, the
number of arrangements given the constraints is 6720.

 Example 48: How many ways if the consonants must be kept in alphabetical order in the
word COMPUTER?
Solution: 5! ways to permutate the consonants in the word. Therefore, the number of
ways to arrange COMPUTER, keeping the consonants in in alphabetical order is 8!/5!
= 336.

 Example 49: Find the number of ways in which 10 beads can be arranged to form a
necklace.
Solution: Let us fix the position of one bead. Now, we are left with the arrangement of
the remaining, 10 − 1 = 9 beads. These nine beads can arrange themselves in 9P9 = 9!
ways. As there is no dependency on the position of beads in a clockwise or anticlockwise
manner. The required number of ways = 1/2 (9!) = 181440.

 Example 50: In how many ways can 5 children be arranged in a line such that (i) two
particular children of them are always together (ii) two particular children of them are
never together.
Solution: (i) We consider the arrangements by taking 2 particular children together as
one and hence the remaining 4 can be arranged in 4! = 24 ways. Again two particular
children taken together can be arranged in two ways. Therefore, there are 24 × 2 = 48
total ways of arrangement.
(ii) Among the 5! = 120 permutations of 5 children, there are 48 in which two children
are together. In the remaining 120 – 48 = 72 permutations, two particular children are
never together.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 19


Discrete Mathematics: Unit 3

 Example 51: If all permutations of the letters of the word AGAIN are arranged in the
order as in a dictionary. What is the 49th word?
Solution: Starting with letter A, and arranging the other four letters, there are 4! = 24
words. These are the first 24 words.
Then starting with G, and arranging A, A, I and N in different ways, there are 4!/2!1!1!
= 12 words.
Next the 37th word starts with I. There are again 12 words starting with I. This accounts
up to the 48th word. The 49th word is NAAGI.

 Example 52: One hundred tickets, numbered 1, 2, 3, . . . , 100, are sold to 100 different
people for a drawing. Four different prizes are awarded, including a grand prize (a trip to
Tahiti).How many ways are there to award the prizes if
a) there are no restrictions?
b) the person holding ticket 47 wins the grand prize?
c) the person holding ticket 47 wins one of the prizes?
d) the person holding ticket 47 does not win a prize?
e) the people holding tickets 19 and 47 both win prizes?
f ) the people holding tickets 19, 47, and 73 all win prizes?
g) the people holding tickets 19, 47, 73, and 97 all win prizes?
h) none of the people holding tickets 19, 47, 73, and 97 wins a prize?
i) the grand prize winner is a person holding ticket 19, 47, 73, or 97?
j) the people holding tickets 19 and 47 win prizes, but the people holding tickets 73 and
97 do not win prizes?

 Combinations
 In mathematics, 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:

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 20


Discrete Mathematics: Unit 3

 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.
A. Type 1: The number of unordered subsets, called a combination of n objects taken r at a
time, is:
C(n, r) = ( )

 We say “n choose r.” and denoted by nCr or C(n,r) or occasionally .


Proof: The P (n, r) r-permutations of the set can be obtained by forming the C(n, r) r-
combinations of the set, and then ordering the elements in each r-combination, which can
be done in P(r, r) ways. Consequently, by the product rule, P (n, r) = C(n, r)·P(r, r)
This implies that

 When computing C(n, r), first note that when we cancel out (n − r)! from the numerator
and denominator of the expression for C(n, r) in Theorem I, we obtain

 Example 53: How many poker hands of five cards can be dealt from a standard deck of
52 cards? Also, how many ways are there to select 47 cards from a standard deck of 52
cards?
Solution: Because the order in which the five cards are dealt from a deck of 52 cards
does not matter, there are:

C(52, 5) = =
different poker hands of five cards that can be dealt from a standard deck of 52 cards.
Also,
C(52, 47) = =

different ways to select 47 cards from a standard deck of 52 cards.

 Property: Let n and r be nonnegative integers with r ≤ n. Then C(n, r) = C(n, n − r).
Proof: We have,
C(n, r) = ( )

Then,

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 21


Discrete Mathematics: Unit 3

Hence proved C(n, r) = C(n, n − r).

 Example 54: How many ways are there to select five players from a 10-member tennis
team to make a trip to a match at another school?
Solution: The answer is given by the number of 5-combinations of a set with 10
elements.
C(10, 5) =

 Example 55: A group of 30 people have been trained as astronauts to go on the first
mission to Mars. How many ways are there to select a crew of six people to go on this
mission (assuming that all crew members have the same job)?
Solution: The number of ways to select a crew of six from the pool of 30 people is the
number of 6-combinations of a set with 30 elements, because the order in which these
people are chosen does not matter. By Theorem 2, the number of such combinations is
C(30, 6) =

 Example 56: A standard deck of cards containing 13 face values (Ace, 2, 3, 4, 5, 6, 7, 8,


9, 10, Jack, Queen, and King) and 4 different suits (Clubs, Diamonds, Hearts, and
Spades) to play five-card poker. If you are dealt five cards, what is the probability of
getting a "full-house" hand containing three kings and two aces (KKKAA)?
Solution:
( )
Probability of (KKKAA) =( )

No of Sample = C(52, 5) =

No of Sample = C(52, 5) =

n(KKKAA) = C(4, 3) . C(4,2) = .


( )
Probability of (KKKAA) = ( )
=

 Example 57: In a lottery, each ticket has 5 one-digit numbers 0-9 on it.
a) You win if your ticket has the digits in any order. What are your chances of winning?
b) You would win only if your ticket has the digits in the required order. What are your
chances of winning?
Prof. S. B. Shinde [MES College of Engineering, Pune] Page 22
Discrete Mathematics: Unit 3

Solution:
There are 10 digits to be taken 5 at a time.

a) Using the formula: C(10, 5) = = 252

The chances of winning are 1 out of 252.


b) Since the order matters, we should use permutation instead of combination.
P(10, 5) = 10 x 9 x 8 x 7 x 6 = 30240
The chances of winning are 1 out of 30240.

B. Type II: Combination with Repetition: The number of ways to fill r slots from n
categories with repetition allowed is: C(r + n − 1, r) = C (r + n −1, n−1).

 Example 58: How many ways can I fill a box holding 100 pieces of candy from 30
different types of candy?
Solution: Here r = 100, n = 30, Therefore n-1 = 30-1 = 29
C(r + n − 1, r) = C (r + n −1, n−1).
C(100 + 29,100) = 129!/(100!29!) Different ways to fill the box.

 Example 59: What is the number of ways of choosing 4 cards from a pack of 52 playing
card? In how many of these
a) Four cards are of the same suit
b) Four cards belong to four different suit
c) Are face cards
d) Two are red cards and two are black cards
e) Cards of same colour
Solution: a) There are four suits and 13 cards of each suit
Cards Total No. of cards to be chosen No. of ways
Diamond 13 4 C(13, 4)
Spade 13 4 C(13, 4)
Heart 13 4 C(13, 4)
Club 13 4 C(13, 4)

Since, there are different cases, So, we add number of ways


The required number of ways choosing four cards of the same suit
= C(13, 4) + C(13, 4) + C(13, 4) + C(13, 4).
= 4 * C(13, 4) =4* = 2860 ways.
b) Four cards belong to four different suit

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 23


Discrete Mathematics: Unit 3

Cards Total No. of cards to be chosen No. of ways


Diamond 13 1 C(13, 1)
Spade 13 1 C(13, 1)
Heart 13 1 C(13, 1)
Club 13 1 C(13, 1)
Since, there are some cases, So, we multiply number of ways
= C(13, 1) * C(13, 1) * C(13, 1) *C(13, 1).
= (C(13, 1))4 = (13)4 = 13 * 13 * 13 * 13 = 28561 ways.
c) Are face cards
Number of face cards in one suit = 3
Total number of face cards = 4 * 3 = 12 i.e n =12
Number of card to be selected are = 4 i.e r = 4
Number of face cards chosen are = C(12,4) = 495 ways.
d) Two are red cards and two are black cards
Cards Total No. of cards to be chosen No. of ways
Red 26 2 C(26, 2)
Black 26 2 C(26, 2)

Total number of ways of choosing two are red cards and two are black cards
=C(26,2) * C(26,2) = (C(26,2))2 = 105625.
e) Cards of same colour
Cards Total No. of cards to be chosen No. of ways
Red 26 4 C(26, 4)
Black 26 4 C(26, 4)

Since Choosing Red or Black, they are different cases


So, we add numbers of ways
Total number of ways of selecting four of same color
= C(26,4) + C(26,4) = 2( C(26,4)) = 29900.
 Summary of Permutation and Combinations

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 24


Discrete Mathematics: Unit 3

 Generation of Permutation and Combination


 Step for finding the next Permutation
1. Traverse the given number from rightmost digit; keep traversing till you find a digit
which is smaller than the previously traversed digit. For example, if the input number
is “534976”, we stop at 4 because 4 is smaller than next digit 9. If we do not find such
a digit, then output is “Not Possible”.
2. Now search the right side of above found digit„d‟ for the smallest digit greater
than„d‟. For “534976″, the right side of 4 contains “976”. The smallest digit greater
than 4 is 6.
3. Swap the above found two digits; we get 536974 in above example.
4. Now sort all digits from position next to„d‟ to the end of number. The number that we
get after sorting is the output. For above example, we sort digits in bold 536974. We
get “536479” which is the next greater number for input 534976.

 Following are few observations about the next Permutation


 If all digits sorted in descending order, then output is always “Not Possible”. For
example, 4321.
 If all digits are sorted in ascending order, then we need to swap last two digits. For
example, 1234.
 For other cases, we need to process the number from rightmost side (why? because
we need to find the smallest of all greater numbers)
 You can now try developing an algorithm yourself.

 Example 60: Find the next Permutation of following:


1. Input: n = "218765" Output: "251678"
2. Input: n = "1234" Output: "1243"
3. Input: n = "4321" Output: "Not Possible"
4. Input: n = "534976" Output: "536479"

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 25


Discrete Mathematics: Unit 3

 Mixed Counting Problem

 More Examples:
 Example 1: In a class, there are 27 boys and 14 girls. The teacher wants to select 1 boy
and 1 girl to represent the class for a function. In how many ways can the teacher make
this selection?
Solution: Here the teacher is to perform two operations:
(i) Selecting a boy from among the 27 boys and
(ii) Selecting a girl from among 14 girls.
The first of these can be done in 27 ways and second can be performed in 14 ways. By the
fundamental principle of counting, the required number of ways is 27 × 14 = 378.

 Example 2: From 8 gentlemen and 5 ladies a committee of 6 is to be formed. In how


many ways can this be done, so that the committee contains at least 3 ladies?
Solution:
Total 8 gentlemen & 5 ladies.
Committee to be of 6 members & should contains at least 3 ladies.
First assumption: If there are 3 ladies in committee then possibilities are=
5C3 * 8C3 = (5*4*3/3*2*1) * (8*7*6/3*2*1) = 10* 56= 560
Second assumption: If there are 4 ladies in committee then possibilities are=
5C4 * 8C2 = (5*4*3*2/4*3*2*1) * (8*7/2*1) = 5* 28= 140
Third assumption: If there are 5 ladies in committee then possibilities are=
5C5 * 8C1 = (5*4*3*2*1/5*4*3*2*1) * (8/1) = 1* 8= 8
So total possibilities of a committee contains at least 3 ladies are= 560+140+8= 708.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 26


Discrete Mathematics: Unit 3

 Example 3: In how many ways 3 mathematics books, 4 history books, 3 chemistry books
and 2 biology books can be arranged on a shelf so that all books of the same subjects are
together.
Solution: First we take books of a particular subject as one unit. Thus there are 4 units
which can be arranged in 4! = 24 ways. Now in each of arrangements, mathematics books
can be arranged in 3! ways, history books in 4! ways, chemistry books in 3! ways and
biology books in 2! ways. Thus the total number of ways = 4! × 3! × 4! × 3! × 2! = 41472.

 Example 4: A student has to answer 10 questions, choosing atleast 4 from each of Parts
A and B. If there are 6 questions in Part A and 7 in Part B, in how many ways can the
student choose 10 questions?
Solution: The possibilities are: 4 from Part A and 6 from Part B or 5 from Part A and 5
from Part B or 6 from Part A and 4 from Part B. Therefore, the required number of ways
is: 6C4 × 7C6 + 6C5 × 7C5 + 6C6 × 7C4 = 105 + 126 + 35 = 266.

 Example 5: In a small village, there are 87 families, of which 52 families have atmost 2
children. In a rural development programme 20 families are to be chosen for assistance,
of which atleast 18 families must have at most 2 children. In how many ways can the
choice be made?
Solution: It is given that out of 87 families, 52 families have at most 2 children so other
35 families are of other type. According to the question, for rural development
programme, 20 families are to be chosen for assistance, of which at least 18 families must
have atmost 2 children. Thus, the following are the number of possible choices:
52C18*35C2 (18 families having atmost 2 children and 2 selected from other type of
families)
52C19*35C1 (19 families having atmost 2 children and 1 selected from other type of
families)
52C20 (All selected 20 families having atmost 2 children)
Hence, the total number of possible choices is = 52C18 × 35C2 + 52C19 × 35C1 + 52C20

 Example 6: A boy has 3 library tickets and 8 books of his interest in the library. Of these
8, he does not want to borrow Mathematics Part II, unless Mathematics Part I is also
borrowed. In how many ways can he choose the three books to be borrowed?
Solution: Let us make the following cases:
Case (i) Boy borrows Mathematics Part II, then he borrows Mathematics Part I also.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 27


Discrete Mathematics: Unit 3

So the number of possible choices is 6C1 = 6.


Case (ii) Boy does not borrow Mathematics Part II, then the number of possible choices is
7C3 = 35.
Hence, the total number of possible choices is 35 + 6 = 41.

 Example 7: Coin Flipping Model If I flip a coin 20 times, I get a sequence of Heads (H)
and tails (T).
How many different sequences of heads and tails are possible?
How many different sequences of heads and tails have exactly five heads?
How many different sequences have at most 2 heads?
How many different sequences have at least three heads?
Solution:
(a) There are 2 ways the first flip can come up; 2 more for the second and so on. Hence 2 ·
· · 2 = 2 20 = 1, 048, 576.
(b) The actual answer to our problem is C(20, 5) = 15, 504.
(c) C(20, 0) + C(20, 1) + C(20, 2) = 1 + 20 + 190 = 211
(d) C(20, 3) + C(20, 4) + · · · + C(20, 19) + C(20, 20).
OR 220 − [C(20, 0)+C(20, 1)+C(20, 2)] = 1, 048, 576−211 = 1, 048, 365.

Prof. S. B. Shinde [MES College of Engineering, Pune] Page 28

You might also like