Download Week 4: Permutations and Combinations

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Addition wikipedia , lookup

Abuse of notation wikipedia , lookup

Wiles's proof of Fermat's Last Theorem wikipedia , lookup

Large numbers wikipedia , lookup

Georg Cantor's first set theory article wikipedia , lookup

Theorem wikipedia , lookup

Foundations of mathematics wikipedia , lookup

Laws of Form wikipedia , lookup

List of important publications in mathematics wikipedia , lookup

Discrete mathematics wikipedia , lookup

Factorization wikipedia , lookup

Recurrence relation wikipedia , lookup

Number theory wikipedia , lookup

Mathematical proof wikipedia , lookup

Random permutation statistics wikipedia , lookup

Elementary mathematics wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Binomial coefficient wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Transcript
(1/23)
MA204/MA284 : Discrete Mathematics
Week 4: Permutations and
Combinations
http://www.maths.nuigalway.ie/~niall/MA284/
28 and 30 September, 2016
1 Recall...
2
3
4
5
... Binomial coefficients
... Pascal’s triangle
Permutations
Combinations
A formula
Algebraic and Combinatorial Proofs
Exercises
These slides are based on §1.3 and §1.4 of Oscar Levin’s
Discrete Mathematics: an open introduction.
They are licensed under CC BY-SA 4.0
Reminder: Assignment 1
ASSIGNMENT 1 is now open!
To access the assignment, go to
https://webwork.nuigalway.ie/webwork2/1617-MA284
Your USERNAME is:
Your PASSWORD is:
There are 20 questions.
You may attempt each one up to 10 times.
This assignment contributes 10% to your final grade for Discrete
Mathematics.
Deadline: 5pm, Thursday 6th October.
(2/23)
Recall...
... Binomial coefficients (3/23)
Binomial coefficients
Binomial coefficients are the numbers that are coefficients in (x + y )n .
(x + y )0 = 1
(x + y )1 = x + y
(x + y )2 = x 2 + 2xy + y 2
(x + y )3 = x 3 + 3x 2 y + 3xy 2 + y 3
(x + y )4 = x 4 + 4x 3 y + 6x 2 y 2 + 4xy 3 + y 4
(x+y )5 = x 5 +5x 4 y +10x 3 y 2 +10x 2 y 3 +5xy 4 +y 5
One can find the coefficient of (for example) x 3 y 2 in (x + y )5 by doing a
lot of multiplication, or by thinking of it as the number of ways we can
choose three “x” terms in
(x + y )5 = (x + y )(x + y )(x + y )(x + y )(x + y ).
Recall...
... Binomial coefficients (4/23)
The numbersthat
appear as coefficients are binomial coefficients, and
n
are denoted
k
Binomial Coefficients
For each integer n ≥ 0, and integer k such that 0 ≤ k ≤ n, there is a
number
n
read as “n choose k”
k
1.
2.
n
k
n
k
n
k
= |Bnk |, the number of n-bit strings of weight k.
is the number of subsets of a set of size n each with cardinality k.
is the number of lattice paths of length n containing k steps to
the right.
4. kn is the coefficient of x k y n−k in the expansion of (x + y )n .
5. kn is the number of ways to select k objects from a total of n objects.
3.
Recall...
... Binomial coefficients (5/23)
n
This week, we will learn that there are two ways we can compute
k
n
n!
, or
(a) Using the formula,
=
k!(n − k)!
k
n
n−1
n−1
(b) the recurrence relation
=
+
k
k −1
k
We justified the recurrence relation in (b) last week. We’ll now revisit
that, and then later derive (a).
Recall...
... Pascal’s triangle (6/23)
Recurrence relation for
n
k
n
n−1
n−1
=
+
k
k −1
k
Is often presented as Pascal’s Triangle
0
0
1
0
2
0
3
0
4
0
1
1
2
1
3
1
4
1
2
2
3
2
4
2
3
3
4
3
4
4
Recall...
... Pascal’s triangle (7/23)
Example
The NUIG Animal Shelter has 4 cats.
(a) How many choices do we have for a
single cat to adopt?
Source: http://www.flickr.com/photos/35652310@
(b) How many choices do we have if we
want to adopt two cats?
N00/4139577452/.
(c) How many choices do we have if we
want to adopt three cats?
(d) How many choices do we have if we
want to adopt four cats?
Permutations
(8/23)
A permutation is an arrangement of objects. Changing the order of the
objects gives a different permutation.
Example: List all permutations of the letters A, R and T?
Important: order matters - “ART” 6= “TAR” 6= “RAT”.
Permutations
(9/23)
A permutation is an arrangement of objects. Changing the order of the
objects gives a different permutation.
We can also count the number of permutations of the letters A, R and T,
without listing them:
Permutations
(10/23)
More generally, recall that n! (read “n factorial”) is
n! = n × (n − 1) × (n − 2) × · · · × 2 × 1
E.g.,
1! = 1,
2! = 2,
10! = 3, 628, 800,
3! = 6,
4! = 24,
5! = 120,
6! = 720.
20! = 2, 432, 902, 008, 176, 640, 000 ≈ 2.43 × 1018 .
There are n! (i.e., n factorial) permutations of n (distinct) objects.
Permutations
(11/23)
Choosing the “backs” on a rugby team...
Suppose that the the Ireland Rugby Team has 5 backs: Hannah Casey,
Vikki McGinn, Alison Miller, Ashleigh Baxter, and Niamh Briggs.
All (we’ll say) can play in any of the Left Wing (11), Inside and Outside
Centre (12 & 13), Right Wing (14) and Full-back (15).
Example 1
How many choices do we have for assigning positions to these women?
(Note: picking
Casey at 11, McGinn at 12, Miller at 13, Baxter at 14 and Briggs at 15,
is different from picking
McGinn at 11, Casey at 12, Miller at 13, Baxter at 14 and Briggs at 15,
Permutations
Example 2
How many choices do we have for the back 3 (11, 14 & 15)?
(12/23)
Permutations
(13/23)
Permutations
The number of permutations of k objects out of n is denoted P(n, k). Its
formula is
P(n, k) = n × (n − 1) × · · · × (n − k + 1) =
Examples:
n!
(n − k)!
Combinations
(14/23)
Combinations
A combination is a selection of objects, where order does not matter.
That is, it is a set.
We have already seen that, if we have a set of n objects, there are kn
subsets of size k.
n
So the number of combinations of k objects out of n is
.
k
Now we want to find a formula for
n
.
k
Combinations
(15/23)
Choosing the “back 3” again...
Recall that our rugby team has 5 backs: Casey, McGinn, Miller, Baxter,
and Briggs. 5
There are
ways we can pick 3 of them for our team.
3
Once we have picked these three, there are 3! = 6 ways we can assign
them the Left wing, Right Wing and Full-back positions. That is
5
P(5, 3) =
3!.
3
However, we know P(5, 3), so this gives a formula for
5
3
.
Combinations
A formula (16/23)
We know there are P(n, k) permutations of k objects out of n.
We know that
P(n, k) =
n!
(n − k)!
Another way of making a permutation of k objects out of n is to
1
2
3
Choose k from n without order. There are kn ways of doing this.
Then count all the ways of ordering these k objects. There are k!
ways of doing this.
By the Multiplicative Principle,
!
n
P(n, k) =
k!
k
n!
n
=
k!
So now we know that
(n − k)!
k
n
n!
This gives the formula
=
k
(n − k)!k!
Algebraic and Combinatorial Proofs
(17/23)
Binomial coefficients have many
important properties.
Looking at their arrangement in
Pascal’s Triangle, several of these
are obvious:
Algebraic and Combinatorial Proofs
(18/23)
Proofs
Proofs of identities involving Binomial coefficients can be classified as
Algebraic: if they rely mainly on the formula for binomial
coefficients.
Combinatorical: if the involve counting a set in two different ways.
For our first example, we will give two proofs of the following fact:
n
n
=
.
k
n−k
Algebraic and Combinatorial Proofs
(19/23)
Algebraic proof of Pascal’s triangle recurrence relation
n
n−1
n−1
=
+
k
k −1
k
Algebraic and Combinatorial Proofs
(20/23)
Combinatorial proof of Pascal’s triangle recurrence
relation
n
n−1
n−1
=
+
k
k −1
k
Algebraic and Combinatorial Proofs
(21/23)
Which are better: algebraic or combinatorial proofs?
When we first study discrete mathematics, algebraic proofs make seem
easiest: they reply only on using some standard formulae, and don’t
require any deeper insight. Also, they are more “familiar”.
However,
Often algebraic proofs are quite tricky;
Usually, algebraic proofs give no insight as to why a fact is true.
Example
Give a combinatorial proof of the following fact
2 2 2
2 n
n
n
n
2n
+
+
+ ··· +
=
.
0
1
2
n
n
Algebraic and Combinatorial Proofs
We wish to show that
(22/23)
2 2 2
2 n
n
n
n
2n
+
+
+ ··· +
=
.
0
1
2
n
n
Exercises
(23/23)
All these are taken from Section 1.4 of Levin’s Discrete Mathematics.
Q1. Give a combinatorial proof for the identity 1 + 2 + 3 + · · · + n =
n+1
2
.
Q2. Give an algebraic proof, using induction, for the identity
1 + 2 + 3 + · · · + n = n+1
.
2
Q3. Give a combinatorial proof of the fact that x+y
− x2 − y2 = xy
2
n−2
Q4. Give a combinatorial proof of the identity n2 k−2
= kn k2 .
Q5. Consider the bit strings in B62 (bit strings of length 6 and weight 2).
(a) How many of those bit strings start with 01?
(b) How many of those bit strings start with 001?
(c) Are there any other strings we have not counted yet? Which ones,
and how many are there?
(d) How many bit strings are there total in B62 ?
(e) What binomial identity have you just given a combinatorial proof for?
Q6. Establish the identity below using a combinatorial proof.
! !
!
!
!
!
! !
2
n
3
n−1
4
n−2
n
2
+
+
+···+
=
2
2
2
2
2
2
2
2
!
n+3
.
5