100% found this document useful (2 votes)
382 views50 pages

Session 16

Uploaded by

Nalam Ashika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
382 views50 pages

Session 16

Uploaded by

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

Session-16

Basics Of Counting

© 2016 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 1
CO -2
Elementary Combinatorics
COI 1 : Basics of Counting , Permutations
COI 1 : Combinations, Enumerations without Repetitions
COI 2 : Enumerations with Repetitions
COI 2 : Enumerations with Constrained Repetitions
COI 3 : Binomial Coefficient , Binomial Theorem and Multinomial
Theorem
COI 3 : Principle of Inclusion and Exclusion
Elementary Combinatorics
•Combinatorics is the branch of
mathematics dealing with
combinations of objects
belonging to a finite set in
accordance with certain
constraints.
Elementary Combinatorics
• For most of the computer applications to problems, one normally
needs to know , at least approximately , how much storage will be
required and about how many operations are necessary in assessing
the length of program execution time and thereby aid in determining
the potential cost of the computation.
• For that purpose we study different methods of computation

• The basic ideas, techniques, and concepts necessary for one to make
an assessment of the amount of storage and work that algorithms
entail is the topic of this elementary combinatorics.
Basics of Counting

Counting has many applications in computer science and mathematics.


For example,
• Counting the number of operations used by an algorithm to study its time
complexity
• Counting the successful outcomes of experiments
• Counting all the possible outcomes of experiments
Basics of Counting
• If ‘ X ‘ is a set, let us use |X| to denote the number of elements in X.
• There are two elementary principles can act as “building blocks “ for
all counting problems.
• Those are : SUM rule & PRODUCT rule.
Basics of counting Priciples :
Two basic counting principles
Sum rule: the principle of disjunctive counting
If a set X is the union of disjoint non empty subsets S1, S2,……. Sn then
|X|= |S1| + |S2| + …. + |Sn|
Product Rule: the principle of sequential counting
if S1, S2,……. Sn are non empty sets, then the number of elements in the
cartesian product S1 x S2 x …. x Sn is the product of ∏ni=1 |Si|
i.e. |S1 x S2 x S3 x ...... x Sn| = ∏ni=1 |Si|
The sum rule:

If a task can be done in n1 ways and a second task in


n2 ways, and if these two tasks cannot be done at the
same time, then there are n1 + n2 ways to do either
task.
SUM Rule -
Examples
The department will award a free computer to either a CSE student or
a CSE professor. How many different choices are there, if there are 530
students and 15 professors?

There are 530 + 15 = 545 choices.


Generalized sum rule:
If we have tasks T1, T2, …, Tm that can be done in n1, n2, …, nm ways,
respectively, and no two of these tasks can be done at the same time,
then there are n1 + n2 + … + nm ways to do one of these tasks.
SOLUTION
• The student can choose a project from the first list, the second list or
the third list.
• By the sum rule, there are 23+15+19=57 ways to choose a project.
Other examples-PLAYING CARDS
1) In how many ways can we draw a heart or spade from an ordinary deck of
playing cards?
Sol: 1 card from13 hearts in 13 ways
1 card from 13 spades in 13 ways

Finally 13+13=26 ways


2). In how many ways can we draw heart or an ace from an ordinary
deck of playing cards?
Sol: 1 card from13 hearts in 13 ways
1 card from 3 aces in 3 ways ( because 1 ace with
heart)

Finally 13+3=16 ways


3) In how many ways can we draw
a king or an ace?
Sol: 1 card from 4 kings in 4 ways
1 card from 4 aces in 4 ways

Finally 4 + 4 = 8ways
4). In how many ways can we draw a card numbered 2 through 10 ?
Sol :
9 numbered cards are there in each of the 4 suits ( diamonds, spades,
hearts, clubs)
Hence, we can draw a card numbered 2 through 10 in
9 + 9+ 9 +9 = 36 ways
5). In how many ways can we draw a card numbered and a king ?
Sol :
9 numbered cards are there in each of the 4 suits ( diamonds,
spades, hearts, clubs)
9 + 9+ 9 +9 = 36 ways
And 1 card from 4 kings in 4 ways
Finally 36+4 = 40ways
The product rule:

Suppose that a procedure can be broken down into


two successive tasks. If there are n1 ways to do the
first task and n2 ways to do the second task after the
first task has been done, then there are n1n2 ways to
do the procedure.
6). If 2 distinguishable dice are rolled, in how many ways can they fall
?
Sol:
The first dice can fall in 6 ways and the second dice can fall in 6 ways.

Thus there are 6*6 = 36 outcomes when two dice are rolled.
Example:
How many different license plates are there that
containing exactly three English letters ?
Solution:
There are 26 possibilities to pick the first letter,
then 26 possibilities for the second one, and 26
for the last one.

So there are 262626 = 17576 different license


plates.
The generalized product rule:

If we have a procedure consisting of sequential


tasks T1, T2, …, Tm that can be done in n1, n2, …,
nm ways, respectively, then there are n1  n2  … 
nm ways to carry out the procedure.
7). If 5 distinguishable dice are rolled, how many possible outcomes
are there?
Sol:
The first dice can fall in 6 ways.
The second dice can fall in 6 ways.
The third dice can fall in 6 ways.
The fourth dice can fall in 6 ways.
The fifth dice can fall in 6 ways.
Therefore, the no. of possible outcomes = 6.6.6.6.6 = 6 power 5
outcomes.
Problem

•How many different license plates are


available if each plate contains a sequence
of three letters followed by 3 digits?
Solution
8). The license plate of a certain state require 3 English letters followed by
4 digits.

a) How many different plates be manufactured if repetition of letters and


digits are allowed?
sol: ___ ____

26 * 26 * 26 * 10 * 10 * 10 * 10
b) How many different plates be manufactured if repetition of letters
and digits are not allowed?
sol : ___ ____

26 * 25 * 24 * 10 * 9 * 8 * 7
C) how many plates are possible if only the letters can be repeated?
Sol :

-------
26 * 26 * 26 * 10*9*8*7
9). how many plates are possible if only the digits can be repeated?
Sol :

-------
26 * 25 *24 * 10 *10*10*10

You might also like