1
Lecture 14
CS336
Basics of Counting 1
Basic Counting Principles
•
Product rule: Suppose that a procedure can be broken
down into a sequence of two tasks where there are n
1
ways to do the first task and n
2
ways of doing the
second, then there are n
1
n
2
ways to do the procedure.
•
Sum rule: If a task can be done either in n
1
ways or n
2
way then there are n
1
+n
2
ways to do the task.
Example
A multiplechoice test contains 10 questions.
There are 4 possible answers for each question.
–
How many ways can a student answer the questions
on the test if the student answers every question?
–
How many ways can a student answer the test if the
student can leave answers blank?
Example
How many different threeletter initials
are there that begin with an A?
Example
How many bit strings are there of length
6 or less?
Example
How many strings of length eight English
letters are there
If letters can be repeated?
if no letter can be repeated?
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '08
 Myers
 Tuple, Finite set, Bijection

Click to edit the document details