









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The concepts of permutations and combinations. Permutations refer to ordered arrangements of elements, while combinations represent unordered selections. Formulas, examples, and properties of binomial coefficients.
Typology: Slides
1 / 17
This page cannot be seen from the preview
Don't miss anything!
r-permutation:
An ordered arrangement of r elements of a set of n distinct elements.
Example: S={1,2,3}:
3,2,1 is a permutation of S.
3,2 is a 2-permutation of S
Note: set is unordered, but permutation is ordered! (no curly brackets).
The number of r-permutation of n objects is:
P(n,r)=n(n-1)(n-2)...(n-r+1)=n! / (n-r)!
First object can be chosen in n ways, second in (n-1) ways etc. until n-r+1.
Use product rule to get the result.
(reminder: n! = n(n-1)(n-2)...1).
r-combination:
An unordered selection of r elements (or subset of size r) of a set of n elements.
Example: S={1 2 3 4}.
{ 3 2 1}={1 2 3} is a r-combination.
The total number of r-combinations of a set of size n is given by the
binomial coefficient: C(n,r)=n! / r! (n-r)! 0<=r<=n
Note that this is equal to P(n,r) / r!
The reason is that P(n,r) counts the total number of ordered arrangements.
However, we are only interested in unordered “arrangements” here.
For every subset of r elements one can exactly construct r! ordered arrangements,
everyone of which is included in P(n,r), but should be considered the same in C(n,r).
We thus overcounted by a factor r!, which we need to divide out.
Remark: the expression n! / (n-r)! r! is inefficient to compute.
However, we can rewrite as follows:
n! / (n-r)! r! = n (n-1) ... (n-r+1) / r (r-1) ... 1 if r < n-r
= n (n-1) ...(r+1) / (n-r) (n-r-1) ... 1 if r > n-r
This must always be an integer (which is not so clear from the equation).
Example:
C(4,2) = number of ways to select 2 objects among 4.
We need to place 4 1’s in 10 slots: C(10,4).
science to develop a discrete math course. There are 9 math candidates and
11 CS candidates.
Two seperate problems that need to be combined using the product rule.
C(9,3) possibilities for math AND C(11,4) possibilities for CS:
Total = C(9,3) C(11,4) = 27,720.
Note: C(n,r), P(n,r), n! etc have like 2^n the potential to grow
very fast with n.
C(12,r)
P(12,r)
r r
Behavior of C/P for fixed n=12 and growing r.
Examples:
I need to pick 12 x’s from 25 terms: C(25,12)=C(25,13).
First replace a=2x and b=-3y.
The coefficient of a^12 b^13 in (a+b)^25 is C(25,12).
thus it follows that: C(25,12) a^12 b^13 = C(25,12) 2^12 x^12 (-3)^13 y^
We already saw that the cardinality of the power-set of a set with
n elements has 2^n elements.
The total number of elements must be equal to the total number of
subsets with zeros elements (empty set) pus with 1 element, etc.
There are precisely C(n,j) ways to pick a subset of j elements from a set
with n elements, thus is follows that:
0
2
n
n
j
n
=
∑
alternative proof: we know:
Now set x=1, y=1....
0
n
n n j j
j
−
=
∑
Pascal’s identity:
1
, 0,
1
n n n
n j j n
j j j
+
= + ≥ ≤
−
Proof:
Denote T=set with n+1 elements, and S=T-{a} where a is some
arbitrary element.
The number of subsets of j elements of T is C(n+1,j).
This must be equal to the number of ways to pick j elements from T that
contain “a” plus the number of ways to pick j elements that do not contain “a”.
This number id equal to: C(n,j) (pick j elements from S) + C(n,j-1)
(pick j-1 elements from S and also pick “a”).
Hence C(n+1,j)=C(n,j)+C(n,j-1).
This leads to Pascal’s Triangle.
From this we see an easy way to generate all coefficients
recursively.
n
j r
Combinatorial proof using bit-strings:
Left: the number of bit-strings of length n=1 with r+1 one’s.
This must be equal to the following:
Start with all one’s s.t. last 1 is at position r+1. There is one way to do that.
Now all bitstrings s.t. last 1 is at r+2. There are C(r+1,r) ways to do that.
Generally: bitstrings s.t. last 1 is at r+k+1. There are C(r+k,r) ways to do that.
Repeat until r+k = n+1 : C(n,r) ways to do that.
Finally, all these possibilities are different, so we must add them to
get the final answer.
one possible path.
(m,n)
How many paths are there from (0,0) to (m,n) with right and up moves as the only
allowed moves?
We need exactly, m up moves and n right moves to end in (m,n).
Let “up” be a “1” and right be a “0”. Thus we need to count the total number
of bit-strings with exactly m 1’s and n 0’s. This is equal to C(m+n,n).