0% found this document useful (0 votes)
20 views29 pages

CS221 04-Basic Counting Techniques

The document discusses basic counting techniques including the multiplication and addition rules, combinations, permutations, and Dirichlet's Box Principle. It provides intuitive principles for counting, illustrated with various example problems to demonstrate how to apply these techniques in different scenarios. The document emphasizes the importance of understanding the difference between permutations and combinations, and includes practical applications of these concepts.

Uploaded by

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

CS221 04-Basic Counting Techniques

The document discusses basic counting techniques including the multiplication and addition rules, combinations, permutations, and Dirichlet's Box Principle. It provides intuitive principles for counting, illustrated with various example problems to demonstrate how to apply these techniques in different scenarios. The document emphasizes the importance of understanding the difference between permutations and combinations, and includes practical applications of these concepts.

Uploaded by

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

BASIC COUNTING

TECHNIQUES
Basic Counting Techniques
• Multiplication Rule and Addition Rule
• Combination and Permutation
• Dirichlet’s Box Principle
Basic Counting Principle
• One way to formally introduce counting principles is through
countable sets, the cardinality of these sets, operations among sets,
and mappings between these sets. A more advanced treatment
would have used “generative functions and formal power series” – we
will not do this here (neither it is generally necessary).
Counting involves quantitative reasoning where intuition is the main
component. A proof is often times implicit.
There are two basic intuitive principles: (i) principle of sum & (ii)
principle of product.
Rule of Sum
If there are m ways to perform a task and n ways to perform an
unrelated task, then there are in total m + n ways to perform the
combined task
Rule of Product
If there are m ways to perform a task and n ways to perform a second
task, then there are m × n ways for the combined task that performs
first one and second the other task.
• Formally speaking, the principle of sum corresponds to the size of the
set C = A ∪ B, i.e. |A ∪ B|, of two disjoint sets |A| = m, |B| = n;
whereas the principle of product is just the size of the set C = A × B,
i.e. |A × B|, where A, B are not necessarily disjoint.

Before going further think of examples to which each principle applies.


EXAMPLE PROBLEM

Jessica has a jar of cookies. It has 3 chocolate and 3 peanut cookies in


it. Jessica only wants to eat one cookie. How many possible options
does Jessica have?

Solution:
Since Jessica only wants one cookie, she has to choose only one cookie
from 3 chocolate or 3 peanut cookies. The choices are mutually
exclusives, so by applying the rule of sum, we have 3+3=6 possible
options
EXAMPLE PROBLEM

Steve has to dress for a presentation. He has 3 different shirts,2


different pants, and3 different shoes available in his closet. Wearing the
Tie is optional. Calculate the total number of possible outfits.

Solution:
There are three types of shirts, two types of pants and three types of
shoes. While the tie is optional, the tie has two options, either “Yes” or
“No.” Total number of possible outfits =3×2×3×2=36.
EXAMPLE PROBLEM

• Harry went to a food restaurant, and he wants to order a combo deal that includes a pizza, drink,
and dessert. The following choices are available:

• Pizza: Chicken Fajita and Vegetable


• Drink: Pepsi and 7-Up
• Dessert: Ice-cream and Pie

Solution:
• Now solving it by counting principle, we have 2 options for pizza, 2 for
drinks and 2 for desserts so, the total number of possible combo deals
=2×2×2=8.
EXAMPLE PROBLEM

• Ellie went to a dress shop to purchase a single blue dress. The shop has 14 plain
blue dresses, 13 plain red dresses, 10 blue embroidered dresses, and 5 red
embroidered dresses. How many options does Ellie have?

Solution:
• Since Ellie wants to choose a blue dress so, we will eliminate all red
dresses. She can choose from 14 plain blue dresses or 10 blue
embroidered dresses. So, the total numbers of option are 14+10=24
EXAMPLE PROBLEM

• Harris went to a shop to buy some items of clothing. He can choose a shirt from 3
different colors or a T-shirt from 2 different colors. Also, he can either get a pair of
pants from 3 available colors or a pair of jeans from three available colors.

• How many possible outfits can Harris have?

Solution:
• Harris can take one shirt from the given 3 colors or T-shirts from the available 2
colors. So number of available shirts =3+2=5
• Similarly, he can choose a pair of pants from either 3 options or a pair of jeans from
three options. The number of available pairs of jeans/pants 3+3=6.
• So, we have 5 different shirts and 6 different pants, and the total number of
possible outfits will be 5×6=30.
EXAMPLE PROBLEM

• Steve wants to go to a job interview in another city. He can choose from 4 local
bus services or 3 taxi services to reach the other city. From there, he can choose
from 3 local bus services or 2 taxi services to reach the place of his interview.
How many possible routes/ways Steve can travel to his destination?

Solution:
• Steve can choose to take either a local bus or a taxi to reach the other city. So, the
possible numbers of vehicles that can be used to reach the city are 4+3=7.
Similarly, Steve can either choose from 3 local bus services or 2 taxi services to
reach the location of the interview from the city. Number of possible option
3+2=5. Now, the total number of ways/vehicles Steve can use to reach his
interview destination is 7×5=35
Combination and Permutation
• Permutation and combination are the ways to select certian objects from
a group of objects to form subsets with or without replacement. It defines
the various ways to arrange a certain group of data. When we select the
data or objects from a certain group, it is said to be permutations, whereas
the order in which they are represented is called combination.
What is Permutation?

• In mathematics, permutation relates to the act of arranging all the members of a set
into some sequence or order. In other words, if the set is already ordered, then the
rearranging of its elements is called the process of permuting. 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.
What is Permutation?

• A permutation is the choice of r things from a set of n things without replacement and
where the order matters.
What is a Combination?

• The combination is a way of selecting items from a collection, such that (unlike
permutations) the order of selection does not matter. In smaller cases, it is possible
to count the number of combinations. Combination refers 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 or k-combination with repetition are often used.
What is a Combination?

• A combination is the choice of r things from a set of n things without replacement and
where order does not matter.
Difference Between Permutation and Combination
Example Problem
• A locker is locked with a four-digit password. The password only contains numbers from
0−6. How many different password options will you have if the order of numbers does that
matter?

SOLUTION:

We have seven numbers to choose from and we have to make a 4 digit password, hence n=7 and
r=4, in this case. The total number of combinations
Example Problem
• Suppose 5 boys A, B, C, D, and E are to be seated on a couch in a row. Then in how many possible
ways can they be seated? Suppose that Boy A=event A, Boy B=event B and so on. So, for event A,
we have five possible options, for the event B, we have four possible options, for the event C, we
have three possible options, for the event D, we have two possible options and one option for the
event E.

SOLUTION:

By the rule of counting principle to calculate the total number of ways, we multiply the possibilities
of each event. In this case the total number of possible outcomes is 5×4×3×2×1=120. This is also
known as permutation, and it is an application of the counting principle
Example Problem
• Calculate the number of ways in which digits from 0−9 can be arranged.

SOLUTION:
• There are total numbers of 10 digits. The number of ways in which the first digits can be arranged
is 10. Similarly, for the second digit, we have 9 available options and so on for the rest of the
digits. The total numbers of possible ways 10!=10×9×8×7×6×5×4×3×2×1=3628800.
Example Problem
• For instance, you may have 10 books, and you'd like to find the number of ways to combine 6 of
those books on your shelf. In this case, you don't care about order - you just want to know which
groupings of books you could display, assuming you only use any given book once.
Example Problem
• Calculate the number of ways in which four digits can be selected from 0−9.

SOLUTION:
• There are total numbers of 10 digits, and we have to select only four from the available 10 digits.
Here n=10 while r=4
Dirichlet's Box Principle

A.k.a. the pigeonhole principle. Given n boxes and m>n objects, at least
one box must contain more than one object. This statement has important
applications in number theory and was first stated by Dirichlet in 1834.
Pigeonhole Principle
Example

Suppose that a flock of 20 pigeons flies into a set of 19 pigeonholes to roost. Because there
are 20 pigeons but only 19 pigeonholes, at least one of these 19 pigeonholes must have at
least two pigeons in it. To see why this is true, note that if each pigeonhole had at most one
pigeon, at most 19 pigeons, one per hole, could be accommodated. This illustrates a
general principle called the pigeonhole principle, which states that if there are more pigeons
than pigeonholes, there must be at least one pigeonhole with at least two pigeons.
Example 2: A bag contains 10 red marbles, 10 white marbles, and 10 blue marbles.
What is the minimum no. of marbles you have to choose randomly from the bag to
ensure that we get 4 marbles of same color?

Answer:

10
Pigeonhole Principle Strong Form Theorem

Let q1, q2, . . . , qn be positive integers. If q1+ q2+ . . . + qn – n + 1 objects are put into n

boxes, then either the 1st box contains at least q 1 objects, or the 2nd box contains at least

q2 objects, . . ., the nth box contains at least qn objects. Application of this theorem is more
important, so let us see how we apply this theorem in problem solving.
• Example 1: In a computer science department, a student club can be
formed with either 10 members from first year or 8 members from second
year or 6 from third year or 4 from final year. What is the minimum no. of
students we have to choose randomly from department to ensure that a
student club is formed?

Solution:

We can directly apply from the above formula where, q1 =10, q2 =8, q3 =6, q4 =4 and n = 4
Therefore the minimum number of students required to ensure department club to be
formed is 10 + 8 + 6 + 4 – 4 + 1 = 25

You might also like