Download as pdf or txt
Download as pdf or txt
You are on page 1of 86

Chapter 4: Sets, Combinatorics, and Probability

Tannaz R.Damavandi
Cal Poly Pomona

Credit for some of the slides in this lecture goes to Dr.Fang Tang
Outline
• 4.1– Sets
• 4.2- Counting
• 4.3- Principle of Inclusion and Exclusion; Pigeonhole Principle
• 4.4- Permutation and Combinations
• 4.5 – Binomial Theorem
• 4.6 - Probability

2
Section 4.1 – Sets
Set Theory
• A set is a collection of elements or objects, and an element is a
member of a set.
– Traditionally, sets are described by capital letters, and elements by lower
case letters
• The symbol  means belongs to:
– Used to represent the fact that an element belongs to a particular set.
– aA means that element a belongs to set A
– bA implies that b is not an element of A
• Braces {} are used to indicate a set
• Example: A = {2, 4, 6, 8, 10}
– 3A and 2A
4
Set Theory (Cont’d)
• Ordering is not imposed on the set elements.
• Each element of a set is listed only once; listing elements twice or
more is redundant.

• Two sets are equal if and only if they contain the same elements
 A = B means (x)[(xA  xB) Λ (xB  xA)]
• Finite and infinite set: described by number of elements
 Members of infinite sets cannot be listed but a pattern for
listing elements could be indicated

5
Various Ways To Describe A Set
Assume set S of all positive even integers:
1) List (or partially list) its elements:
S = {2, 4, 6, 8, …}
2) Use recursion to describe how to generate the set elements:
2  S, if n  S, then (n+2)  S
3) Describe a property P that characterizes the set elements
• in words: S = {x | x is a positive even integer}
• Use predicates: S = {x  P(x)} means (x)[(xS  P(x)) Λ (P(x) xS)] where P is the
unary predicate.
• Hence, every element of S has the property P and everything that has a property P is
an element of S.
6
Practice #1
• Describe each of the following sets by listing the elements:
a. {x | x is a month with exactly thirty days}
a. {April, June, September , November}

b. {x | x is an integer and 4<x<9}


b. {5,6,7,8}

7
Practice #2
• Describe each of the following sets by giving a characterizing
property.
a. {1,4,9,16}
a. {x| x is one of the first four squares}

b. {2,3,5,7,11,13,17,…}
b. {x| x is a prime number}

8
Standard Sets
• Some notations used for convenience of defining sets
• N = set of all nonnegative integers
• remember that 0  N
• Z = set of all integers
• Q = set of all rational numbers
• R = set of all real numbers
• C = Set of all complex numbers

• A set that has no members is called a null or empty set and is


represented by 
• S = {x | x  N and x < 0}
• Note that  is not the same as {}

9
Examples
• What are the elements in the following sets?
• A = {x| (y)(y {0,1,2} and x = y2}
A={0,1,4}
• B = {x| x  N and (y) (y  N and x <= y)}
B=N
• C = {x| x  N and (y) (y  N  x <= y)}
C={0}
• D = {x| (y)(z)(y{1,2} and z{2,3} and x=z–y)}
D= {0,1,2}
10
Open and Closed Interval
• {x  R | -2 < x < 3}
– denotes the set containing all real numbers between -2 and 3. This
is an open interval, meaning that the endpoints -2 and 3 are not
included. By all real numbers, we mean everything; 1.05, -3/4, and
every other real number within that interval.
• {x  R | -2  x  3}
– is a closed interval. It includes all the numbers in the open interval
described above, plus the endpoints.

11
Practice #3
Describe each following set.
• A = {x| x  N and (y) (y  {2,3,4,5}  x ≥y)}
A={x|x  N and x ≥5}

• B = {x| (y)(z)(y{1,2} and z{5,6} and x=y+2z)}


B= {11,12,13,14}

12
Relationships Between Sets: Subsets
For A={1,3,5,7} and B ={x| x is a positive odd number},
Every member of A is also a member of B. Therefore, A is said to be a
subset of B
• In formal logic: A  B : (x) (x  A → x  B).
If A  B and A  B, then there is at least one element of B that is not an
element of A, then A is a proper subset of B denoted by A  B.
• In formal logic:
A  B : (x) (x  A → x  B) Λ (y)[yB Λ (yA)’]

Any set is a subset of itself, but not a proper subset. (X ⊆ X is true, and X  X
is false for any set X.) The empty set { }, denoted by ∅, is also a subset of any
given set X. It is also always a proper subset of any set except itself.
13
Relationships Between Sets : Supersets
• A superset is the opposite of subset. If M is a subset of S, then S is a superset of
M, denoted S  M. Likewise, if M is a proper subset of S, then S is a proper
superset of M, denoted S  M.

• The cardinality of a set is simply the number of elements within the set; the
cardinality of S is denoted by |S|. Then by the above definition of subset, it is
clear that set M must have fewer members than S, which yields the following
symbolic representation:
• M  S  |M| < |S|
• M  S  |M| <= |S|

14
Example
Let
A = {1,7,9,15}
B = {7,9}
C = { 7,9,15,20}

Then the following statements are all true.


• BC
• BA
• BA
• A⊈ C
• 15  C
• {7,9}  B
• {7}  B
• C
15
Practice #4
A = {x| x  N and x  5}
B = {10, 12, 16, 20}
C = {x | (y)(y  N and x = 2y)}
Which of the following statements are true?
BC BA

AC 26  C

{11, 12, 13}  A {11, 12, 13}  C

{12}  B {12}  B

{x | x  N and x < 20} B 5A

{}  B  ∉A

16
Practice #4 Solution
A = {x| x  N and x  5}
B = {10, 12, 16, 20}
C = {x | (y)(y  N and x = 2y)}
Which of the following statements are true?
BC T BA T

AC F 26  C T

{11, 12, 13}  A T {11, 12, 13}  C F

{12}  B F {12}  B T

{x | x  N and x < 20} B T 5A F

{}  B F  ∉A T
17
Example
For the following sets, prove A  B
A = { x | x  R such that x2 – 4x + 3 = 0}
B = { x | x  N and 1 x  4}

Let x  A. Then x  R and x2 – 4x + 3 = 0, or (x-3)(x-1)=0, which gives =1


and x=3 .
A={1,3} (1)
B= {1,2,3,4} (2)
(x) (x  A → x  B) (1),(2)
Therefore, A  B

18
Set of Sets
• From every set, many subsets can be generated. A set whose
elements are all such subsets is called the power set.
• For a set S, (S) is termed as the power set.
• For a set S = {1, 2, 3} ;
(S) = { ,{1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}}
• For a set with n elements, the power set has 2n elements.
Note : ()={}

19
Set Operations
• Binary and unary operators
– Binary acts on two elements.
– Unary acts on a single element.

• An ordered pair of elements is written as (x,y) and is different


from (y,x)
• Two ordered pairs (a,b) and (c,d) are equal if and only if a = c and
b=d
• If S = {2,3}, the ordered pairs of this set are (2,2), (2,3), (3,2), (3,3)

20
Binary Operations
• Binary operation on a set S defined as follows:
–  is a binary operation if for every ordered pair (x,y) of elements of S, x  y exists,
and is unique, and is a member of S.
– The fact that x  y exists and is unique is the same as saying that the binary
operation  is well-defined.
– The fact that x  y always belongs to S means that S is closed under the
operation 

– A candidate  for an operation can fail to be a binary operation on a set S in any


of three ways:
1. There are elements x,y ∊ S for which x  y doesn’t exist.
2. There are elements x,y ∊ S which x  y gives more than one result
3. There are elements x,y ∊ S for which x  y doesn’t belong to S.

• The operator  is just a placeholder for the real operator like +, -, *, etc.
21
Examples
• +, - and * are all binary operators on Z.
• Is division a binary operation on Z and why? No, because X/0
does not exist.

• Is subtraction a binary operation on N?


No, because N is not closed under subtraction.
(For example, 1-10 ∉ N).

22
Examples
Define x◦y on N by :
1 if x ≥ 5
x◦y =
0 if x ≤ 5
Then by the first definition for ◦ , 5 ◦1 = 1, while by its second
definition 5 ◦1 = 0 . Thus, ◦ is not well defined on N because the
result of 5 ◦1 is not unique.

23
Unary Operation
• For # to be a unary operation on a set S, it must be true that for
any x S, x# is well-defined and S is closed under #; in other
words, for any x S, x# exists, it is unique and member of S.
• Let x^ = -x, so that x^ is the negative of x.
– Is ^ a unary operation on Z? Yes
– Is ^ a unary operation on N? No, because N is not closed under ^.

24
Practice #5

25
Operations On Sets
New sets can be formed in a variety of ways, and can be described
using:
• Set builder notation (union, intersection, complement, etc.)
• Venn diagrams.
 A rectangle marked by U is used to represent the universal set.
 Venn diagrams can be used to visualize the binary operations of union
and intersection.

26
Union and Intersection

27
Disjoint, Universal and Difference Sets

28
Example

29
Cartesian Product
• If A and B are subsets of S, then the Cartesian product or cross
product of A and B denoted symbolically by A  B is defined by:
• A  B = {(x,y) | x  A and y  B }

• The Cartesian product of 2 sets is the set of all combinations of


ordered pairs

• For example, given 2 sets A and B, where A = {a, b, c} and B = {1, 2, 3},
the Cartesian product of A and B can be represented as:
• A  B = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3), (c, 1), (c, 2), (c, 3)}
• Is A  B = B  A ?
30
Cartesian Product (Cont’d)
• Cross-product of a set with itself is represented as A  A or A2

• An represents the set of all n-tuples (x1, x2, …, xn) of elements


of A.

31
Practice #6
• Given A = {1,2} and B = {3,4} ; find
• AB;BA
• A2 and A3

A  B = {(1,3),(1,4),(2,3),(2,4)}
B  A = {(3,1),(3,2),(4,1),(4,2)}

A2 = {(1,1),(1,2),(2,1),(2,2)}

A3 = (1,1,1),(1,1,2),(1,2,1),(1,2,2),(2,1,1),(2,1,2),(2,2,1),(2,2,2)}

32
Basic Set Identities

33
More Set Identities
Union and Intersection with U
A∪U=U A∩U=A
Double Complement Law
(A) = A
Idempotent Laws
A∪A =A A∩A =A
Absorption properties
A ∪ (A ∩ B) = A A ∩ (A ∪ B) = A
Alternate Set Difference Representation
A - B = A ∩ B
Inclusion in Union
AA∪B BA∪B
Inclusion in Intersection
A∩BA A∩BB
Transitive Property of Subsets
if A  B, and B  C, then A  C
34
Practice #7
• Use the set identities to prove
[A ∪ (B ∩ C)] ∩ ([A ∪ (B ∩ C)] ∩ (B ∩ C)) = 

Proof :
[A ∪ (B ∩ C)] ∩ ([A ∪ (B ∩ C)] ∩ (B ∩ C))
= ([A ∪ (B ∩ C)] ∩ [A ∪ (B ∩ C)]) ∩ (B ∩ C) using ap
= ([(B ∩ C) ∪ A] ∩ [(B ∩ C) ∪ A]) ∩ (B ∩ C) using cp twice
= [(B ∩ C) ∪ (A ∩ A)] ∩ (B ∩ C) using dp
= [(B ∩ C) ∪ ] ∩ (B ∩ C) using comp
= (B ∩ C) ∩ (B ∩ C) using ip
= using comp

35
Section 4.2 – Counting
Counting
Combinatorics is a branch of mathematic that deals with counting. The idea
is to find out how many members are present in a finite set, that is, the
cardinality of the set.
Examples :
• How many rows are there in a truth table with n statement letters? 2n
• How many subsets are there in a set with n elements? 2n
Multiplication Principle
Multiplication principle: If there are n possible outcomes for a first event
and m possible outcomes for a second event, then there are n*m possible
outcomes for the sequence of the two events.

From the multiplication principle, it follows that for 2 sets A and B,


|A x B| = |A|x|B|
• A x B consists of all ordered pairs with first component from A and second
component from B.

The multiplication principle is useful for counting the total number of


possible outcomes for a task that can be broken down into a sequence of
successive subtasks.
38
Example
Let’s revisit our previous “How many” questions and answer them using
multiplication principle.
• How many rows are there in a truth table with n statement letters? Each
statement letter has two possible values (True or False), for n statement
letters, there are 2n rows in a truth table.
• How many subsets are there in a set with n elements? Each member in a
set has two possible value (chosen or not chosen for a subset), for n
member in a set: 2n possible subset.
Example
The last part of your phone number contains four digits. How many
such four-digit numbers are there if :
a) Repetition is allowed?
b) Repetition is not allowed?

Solution:
We can construct four-digit numbers by performing a sequence of
subtasks: choose the first digit, then the second, the third, and finally
the fourth.
a) 10.10.10.10 =10000
b) 10.9.8.7 = 5040

40
Practice #8
If a man has 4 suits, 8 shirts and 5 ties, how many outfits can he
put together?
Sequence of tasks:
Choose a suit
Choose a shirt
Choose a tie
(4)(8)(5)= 160

41
Addition Principle
Addition Principle: If A and B are disjoint events with n and m
outcomes, respectively, then the total number of possible
outcomes for event “A or B” is n+m
• If A and B are disjoint sets, then |A ∪ B| = |A| + |B| using the
addition principle.

• The addition principle is useful whenever we want to count the


total number of possible outcomes for a task that can be broken
down into disjoint cases.

42
Example
A customer wants to purchase a vehicle from a dealer. The dealer
has 23 autos and 14 trucks in stock. How many selections does the
customer have?
The customer wants to choose a car or a truck. These are disjoint
events; therefore, by addition principle customer has 37 choices:
23+14=37

43
More On Addition Principle
• If A and B are disjoint sets, then |A ∪ B| = |A| + |B| (1)

Prove that if A and B are finite sets then


a) |A - B| = |A| - |A ∩ B| and b) |A-B| = |A| - |B| if B  A
To prove the first equality:
|A - B| + |A ∩ B| = |A|
(A - B) ∪ (A ∩ B) (1)
= (A ∩ B) ∪ (A ∩ B)
= A ∩ (B ∪ B)
=A∩U
=A
Also, A-B and A ∩ B are disjoint sets, therefore using the addition principle,
|A| = | (A-B) ∪ (A ∩ B) | = |A-B| + |A ∩ B| , so |A-B| = |A| - |A ∩ B|

The second equation follows the first, If B  A, then A ∩ B = B


44
Using the Principles Together
Frequently the addition principle is used in conjunction with
multiplication principle.
Example:
How many four-digit numbers begin with a 4 or a 5?
• Solution1:
numbers begin with 4 : 1*10*10*10 =1000
numbers begin with 5 : 1*10*10*10 =1000
numbers begin with 4 or 5 = 1000+1000 = 2000

• Solution2 :
numbers begin with 4 or 5 : 2*10*10*10 = 2000

45
Practice #9
Suppose the last four digit of a telephone number must include at least one
repeated digit. How many such numbers are there?
Hint: use subtraction

Although it is possible to do this problem by using the addition principle directly, it is difficult
because there are so many disjoint cases to consider depends on which two digits are alike.
Instead, we solve the problem by noting that numbers with repetitions and numbers with no
repetitions are disjoint sets whose union equals all four-digit numbers.
Total numbers = numbers with repetition + numbers w/o repetition
Total numbers = 10*10*10*10 =10000
Numbers with no repetition = 10*9*8*7 = 5040
Numbers with repetition = 10000 – 5040 = 4960

46
Practice #10
• How many three-digit integers (numbers between 100 and 999 inclusive) are
even?

Even numbers end in 0,2,4,6,8


Solution1:
• Numbers ending 0 = 9*10*1=90
• Numbers ending 2 = 9*10*1=90
• Numbers ending 4 = 9*10*1=90
• Numbers ending 6 = 9*10*1=90
• Numbers ending 8 = 9*10*1=90
• Total even numbers = 90+90+90+90+90 = 450
Solution2:
• Total even numbers : 9*10*5 = 450

47
Section 4.3 – Principle of Inclusion and Exclusion;
Pigeonhole Principle
Principle of Inclusion and Exclusion
If A and B are any subsets of a universal set S, then A – B, B – A, and A ∩ B are
mutually distinct.
• We can see that (A-B) ∪ (B-A) ∪ (A ∩ B) is exactly A ∪ B
• For three disjoint sets
 |(A-B) ∪ (B-A) ∪ (A ∩ B)| = |A-B| + |B-A| + |A ∩ B|
• |A-B| = |A| - |A ∩ B|
• |B-A| = |B| - |A ∩ B|
• We finally get:
 |A ∪ B| = |A| + |B| - |A ∩ B|

49
Inclusion and Exclusion
• |A ∪ B| = |A| + |B| - |A ∩ B|
• The above equation represents the principle of inclusion and
exclusion
• The name comes from the fact that to calculate the elements in
a union:
 We include the individual elements of A and B
 but exclude the elements common to A and B so that we don't count
them twice

50
Example
How many integers from 1 to 1000 are either multiples of 3 or multiples of 5 ?

• We assume that A = {set of all integers from 1-1000 that are multiples of 3}
• We assume that B = {set of all integers from 1-1000 that are multiples of 5}
• We have
A ∪ B = {set of all integers from 1 to 1000 that are multiples of either 3 or 5}
A ∩ B = {set of all integers that are both multiples of 3 and 5, which is 15}
• To use the inclusion/exclusion principle to obtain |A ∪ B| , we need
|A| ,|B| and |A ∩ B|

51
Example(Cont’d)
From 1 to 1000, every third integer is a multiple of 3,each of this multiple can be
represented as 3p, for any integer p from 1 through 333, Hence |A| = 333.

Similarly for multiples of 5, each multiple of 5 is of the form 5q for some integer q
from 1 through 200. Hence, we have |B| = 200

To determine the number of multiples of 15 from 1 through 1000, each multiple


of 15 is of the form 15r for some integer r from 1 through 66.

Hence, |A ∩ B| = 66
From the principle, we have the number of integer either multiples of 3 or
multiples of 5 from 1 to 1000 given by

|A ∪ B| = 333 + 200 – 66 = 467


52
Practice #11
A pollster queries 35 voters, all of whom support referendum 1, referendum 2, or
both, and finds that 14 voters support referendum 1 and 26 support referendum
2.How many voters support both referendums?

Assume A = {Voters who support referendum 1}


Assume B = {Voters who support referendum 2}
We have
A ∪ B = {Voters who support either referendum 1 or referendum 2}
A ∩ B = {Voters who support both referendums}
| A ∪ B |= 35 , |A| =14 , |B|= 26
| A ∪ B | = |A| + |B| - | A ∩ B |
35 = 14 + 26 - | A ∩ B |
53
|A∩B|=5
Inclusion/Exclusion Principle for 3 Sets
Inclusion/Exclusion principle can be easily applied to three sets as follow:
| A ∪ B ∪ C | = | A ∪ (B ∪ C) |
= |A| + | B ∪ C |- | A ∩ (B ∪ C)|
= |A| + |B| + |C| - | B ∩ C | - |(A ∩ B) ∪ ( A ∩ C )|
= |A| + |B| + |C| - | B ∩ C | - ( | A ∩ B | + | A ∩ C | - | A ∩ B ∩ C |)
= |A| + |B| + |C| - | B ∩ C | - | A ∩ B | - | A ∩ C | + | A ∩ B ∩ C |

54
Example
A group of students plans to order pizza. If 13 will eat sausage topping, 10 will eat
pepperoni, 12 will eat extra cheese, 4 will eat both sausage and pepperoni, 5 will
eat both pepperoni and extra cheese , 7 will eat both sausage and extra cheese,
and 3 will eat all three toppings, how many student are in the group?

A= {Students who will eat sausage}


B= {Students who will pepperoni}
C= {Students who will eat extra cheese}
Then |A|=13, |B|=10 , |C|=12 , |A ∩ B|=4 , |B ∩ C|=5 , |A ∩ C|=7 , |A ∩ B ∩ C|=3
| A ∪ B ∪ C | = |A| + |B| + |C| - |A ∩ B| - |B ∩ C|- |A ∩ C|+ |A ∩ B ∩ C|
= 13 + 10 + 12 – 4 – 5 – 7 + 3
= 22
We can solve this problem using Venn diagram but this approach gets much more complicated with more than
three sets.
55
Example
A produce stand sells only broccoli, carrots, and okra. One day the stand
Served 207 people . If 114 people purchased broccoli, 152 purchased carrots, 25
purchased okra, 64 purchased broccoli and carrots, 12 purchased carrots and okra, and 9
purchased all three, how many people purchased broccoli and okra?
Let A = {People who purchased broccoli}
B = {People who purchased carrots}
C = {People who purchase okra}
Then |A|=114, |B|=152 , |C|=25 , |A ∩ B|=64 , |B ∩ C|=12 ,
|A ∩ B ∩ C|=9 , and | A ∪ B ∪ C | = 207
| A ∪ B ∪ C | = |A| + |B| + |C| - |A ∩ B| - |B ∩ C|- |A ∩ C|+ |A ∩ B ∩ C|
207 = 114 + 152 +25 -64 -12 - |A ∩ C|-9
= 17
56
Practice #12
In a class of students undergoing a computer course the following were observed. Out
of a total of 50 students:
o 30 know Java,
o 18 know Python,
o 26 know C++,
o 9 know both Java and Python,
o 16 know both Java and C++,
o 8 know both Python and C++,
o 47 know at least one of the three languages.
Based on this determine
a. How many students know none of these languages ?
b. How many students know all three languages ?
57
Practice#12- Solution
a. We know that 47 students know at least one of the three languages in the class of
50. The number of students who do not know any of three languages is given by
the difference between the number of students in class and the number of
students who know at least one language. Hence, the students who know none of
these languages = 50 – 47 = 3

b. Assume:
A = {All the students who know Java in class}
B = {All the students who know Python in the class}
C = {All the students who know C++ in class}
So, we need to find |A ∩ B ∩ C|

58
Practice#12- Solution (Cont’d)
Then |A|=30, |B|=18 , |C|=26 , |A ∩ B|=9 , |B ∩ C|=8, |A ∩ C|=16,
and | A ∪ B ∪ C | = 47
| A ∪ B ∪ C | = |A| + |B| + |C| - |A ∩ B| - |B ∩ C|- |A ∩ C|+ |A ∩ B ∩ C|
47 = 30 + 18 + 26 – 9 – 8 - 16 + |A ∩ B ∩ C|
47 = 41 + |A ∩ B ∩ C|
|A ∩ B ∩ C| = 6

59
General Principle of Inclusion/Exclusion

60
Pigeonhole Principle
If more than k items are placed into k bins, then at least one bin has more than one
item.

from Wikipedia

61
Examples
How many people must be in a room to guarantee that two people have the last
name begin with the same initial?
26 alphabets hence, have to have 27 people.

How many times must a single die be rolled in order to guarantee getting the same
value twice?
6 possible outcomes, hence 7 times.

How many cards must be drawn from a standard 52-card deck to guarantee 2 cards
of the same suit?
4 suits (hearts, clubs, spades, diamonds), Hence 4+1= 5 draw

62
Section 4.4 -Permutations and Combinations
Permutations
• In our example of counting all possibilities for the last four digits of a telephone
number with no repetition, we see that order matters. For example 1234 is not the
same as 4321 or 3214.
• An ordered arrangement of objects is called a permutation.
• Each of these numbers (1234, 4321 ,…) is a permutation of 4 distinct objects chosen
from a set of 10 distinct objects (10 digits).
– Hence, a permutation of n distinct elements is an ordering of these n elements.
• P(n , r) denotes the number of permutations of r distinct objects chosen from n distinct
objects.
• A formula for P(n,r) can be written using the factorial functions, for 0≤ r ≤ n

n! n(n  1)...(n  r  1)(n  r )!


P(n, r )    n(n  1)...(n  r  1)
 n  r !  n  r !
64
Practice #13
n! n(n  1)...(n  r  1)(n  r )!
P(n, r )    n(n  1)...(n  r  1)
 n  r !  n  r !
Calculate the value of :

a) P(7,3)
b) P(9,6)
c) P(8,0)
d) P(5,5)
e) P(6,1)

65
Special cases of Permutation

66
Example

67
Example

68
Practice #14
Practice #15
In how many ways a librarian can arrange 4 books on Operating
systems, 7 on Programming, and 3 on Data structure on a shelf
given that all books on the same subject must be together?

(4! * 7! *3!)*3! = (24 *5040*6)* 6 = 4,354,560


Combinations
• Sometimes we want to select r objects from a set of n objects,
but we don’t care how they are arranged, we count the
number of combinations of r distinct objects chosen from n
distinct objects, denoted C(n, r).
• For each combination, there are r! ways of ordering those r
chosen objects, thus

P(n, r ) n!
C (n, r )  
r! r ! n  r  !

71
Practice #16
P(n, r ) n!
C (n, r )  
r! r ! n  r  !

Calculate the value of :


C(7, 3):
C(8, 8):
C(5, 1):
C(4, 0):

72
Special cases of Combinations

73
Important Note

In a counting problem, first ask yourself if order matters or


not. If it does, it is a permutation problem. If not, it is a
combination problem.

74
Examples

75
Examples

76
Examples

77
Practice #17

78
Eliminating Duplicates
• How many ways can a committee of 2 be formed from 4 men and 3
women and it must include at least 1 man
Incorrect answer : C(4,1)*C(6,1) , because group of m1 and m2 is the
same as m2 and m1

Correct answer:
C(7,2) – C(3,2) = C(4,1)*C(6,1) – C(4,2)
C(4,2) is the number of committees with 2 men on it. It has to be
subtracted since we are counting it twice in C(4,1)*C(6,1)
C(7,2) = all committees possible
C(3,2) = all committees with no men on it
79
Examples

80
General Formula

81
Permutations and Combinations with Repetitions
Our formulas for P(n, r) and C(n, r) assume that we select r objects out
of n objects using each object only once, therefore r ≤ n. Suppose,
however, that the n objects are available for reuse as many times as
desired. Hence r might be greater than n.
• Counting the number of permutations of r objects out of n distinct
objects with repetition: nr, for example the 4-digit telephone
example with repetition.

• Counting the number of combinations of r objects out of n distinct


objects with repetition, we need a clever idea!
82
The Jeweler Design Example

83
Combination with Repetition
• General principle of combination with repetition:
 If we want to select r objects out of n distinct objects with repetition
allowed, there must be n-1 markers.
 This gives r + (n-1) slots to fill.
 And we want to know the number of ways to select r of r + (n-1).
 Hence :
(r  n  1)! (r  n  1)!
C (r  n  1, r )  
r ! r  n  1  r  ! r ! n  1!

84
Practice #18

85
Counting Techniques
Count the number of… Technique to Try

Subsets of an n-element set Use formula 2n

Outcomes of successive events Multiplication principle

Outcomes of disjoint events Addition principle

Elements in overlapping sections of related sets Use principle of inclusion and exclusion

Ordered arrangements of r out of n distinct objects P(n, r)

Ways to select r out of n distinct objects C(n, r)

Ways to select r out of n distinct objects with C(r+n-1, r)


repetition

86

You might also like