You are on page 1of 25

CSC 413

Discrete Mathematics II
Course Instructors:
Dr. Victor T. Odumuyiwa
Dr. Ufuoma C. Ogude

Department of Computer Sciences


University of Lagos

•Lectures:
– E 304, Wednesday 10:00 am to 11:00 am
– Lab 203, Thursday 10:00 am to 12:00 am
Course Outline
We study topics in such areas as:
Sets and logic

proof techniques

relations and functions,

counting and combinatorics,

discrete probability,

graphs and trees and

NP-Completeness.
Course Material
Textbook

Discrete Mathematics
and Its Applications
by Kenneth H. Rosen

Use lecture notes as study guide.


Counting
and
Combinatorics
Presentation Outlines
Introduction

Basic Counting Principles


Sum Principle
Product Principle
Pigeonhole Principle

Combinatorial (ways to combine things)


Combinatorial analysis deals with
permutations
combinations
•binomial coefficients
•binomial Theorem
Combinatorics
Combinatorics the branch of discrete mathematics concerned with

determining the size of finite sets without actually enumerating each

element.

A combination is an arrangement of r objects chosen from n objects

regardless of order.

Order doesn't matter here so the combination 1, 2, 3 is not different

than 3, 2, 1 because they both contain the same numbers.


Combinations
To find the number of Combinations of n items
chosen r at a time, you can use the formula
n!
C  where 0  r  n .
n r r! ( n  r )!

5! 5!
5 C3   
3! (5  3)! 3!2!
5 * 4 * 3 * 2 * 1 5 * 4 20
   10
3 * 2 *1* 2 *1 2 *1 2
Combinations
Practice:

To play a particular card game, each


player is dealt five cards from a
standard deck of 52 cards. How
many different hands are possible?
Combinations
Practice: To play a particular card game, each
player is dealt five cards from a
standard deck of 52 cards. How
many different hands are possible?
52! 52!
52 C5   
5! (52  5)! 5!47!
52 * 51 * 50 * 49 * 48
 2,598,960
5* 4* 3* 2*1
Combinations
Practice:

A student must answer 3 out of 5


essay questions on a test. In how
many different ways can the
student select the questions?
Combinations
Practice: A student must answer 3 out of 5
essay questions on a test. In how
many different ways can the
student select the questions?

5! 5! 5 * 4
5 C3     10
3! (5  3)! 3!2! 2 * 1
Combinations
Practice:
A basketball team consists of two
centers, five forwards, and four
guards. In how many ways can the
coach select a starting line up of
one center, two forwards, and two
guards?
Combinations
Practice: A basketball team consists of two centers, five forwards,
and four guards. In how many ways can the coach select a
starting line up of one center, two forwards, and two
guards?
Center: Forwards: Guards:
2! 5! 5 * 4 4! 4 * 3
2 C1  25 2
C    10 4 C2   6
1!1! 2!3! 2 * 1 2!2! 2 * 1

2 C1 * 5 C 2 * 4 C 2

Thus, the number of ways to select the


starting line up is 2*10*6 = 120.
Combinatorial Analysis
• Combinatorial analysis deals with
permutations of a set or bag and also
combinations of a set, which lead to binomial
coefficients and the Binomial Theorem.
• Cardinality of set is denoted as |A|
• Example if A = {1,3,6} then |A|=3
Combinations of a Set
• The binomial coefficient, “n choose r” is written

n n!
  
 r  r!( n  r )!
Pascal’s Triangle

Beginning with row 0 and place 0, the number 20 appears in row 6, place 3. In
CafeOBJ we can check this.
red combCalc(6,3) . – gives 20
red combCalc(7,4) . – gives 35
red combCalc(7,3) . – gives 35
Special Combinations of a Set
n n
   1    1 Examples in CafeOBJ

0 red combCalc(5,0) . -- 1

n
red combCalc(2,0) . -- 1
red combCalc(5,5) . -- 1
red combCalc(5,1) . -- 5

n
red combCalc(5,4) . -- 5
n 
   n    n
1   n 1
Generally we label N choose R as:
Calculating  n  "n choose k".
 
8  8 7 k 
    28 n n!
 2  1 2 Simplifying   
9  98 7  6  r  r!( n  r )!
    126
 4  1 2  3  4
12  12  11 10  9  8
    792
5  1 2  3  4  5
Combinations of a Set
• (16.10) The number of r-combinations of n elements
is n n!
  
 r  r!( n  r )!
• A student has to answer 6 out of 9 questions on an
exam. How many ways can this be done?
 9  9! 9  8  7  6! 9  8  7
      84
6
  6!3! 6!3! 3  2  1
Combinations with repetitions of a Set
• An r-combination with repetitions of a set S of
size n is a bag of size r all of whose elements
are in S. An r-combination of a set is a subset
of that set;
• An r-combination with repetition of a set is a
bag, since its elements need not be distinct.
Combinations with repetitions of a Set
• (16.12) The number of r-combinations with
repetition of a set of size n is:

 n  r  1
 
Repetitions
 r  Combination
size
size
Combinations with repetitions of a Set
• Suppose 7 people each gets either a burger, a
cheese burger, or fish (3 choices). How many
different orders are possible? The answer is the
number of 7-combinations with repetition of a
set of 3 elements.

 3  7  1 9!
    36
 7  7!2!
Permutations of a bag
How many outcomes have one Head?
Permutation of a bag with 1 Head and four Tails.

5!
5
1!4!
Permutations of a bag
• How many outcomes contain at most one Head?
• One Head
5!
5
1!4!
• No Heads 5!
1
0!5!
• At most one Head 1 + 5 = 6 (rule of sums)
• Note 0!=1
Combinations of Set
• A chairman has to select a committee of 5 from a
facility of 25. How many possibilities are there?

 25  25!
    53130
5  5!20are
• How many possibilities ! there if the chairman
should be on the committee?

 24  24!
    10626
 4  4!20!

You might also like