7.0 KiB
7.0 KiB
- #MA284 - Discrete Mathematics
- Previous Topic: Principle of Inclusion-Exclusion
- Next Topic: Combinatorial Proofs
- Relevant Slides:
-
Binary Strings & Lattice Paths
-
Binary Strings
- A bit is a "binary digit", e.g., 1 or 0.
- A bit string is a string (list) of bits, e.g., 1011010.
- What is the length of a string? #card
card-last-interval:: 31.36
card-repeats:: 4
card-ease-factor:: 2.8
card-next-schedule:: 2022-12-16T04:06:32.399Z
card-last-reviewed:: 2022-11-14T20:06:32.399Z
card-last-score:: 5
- The length of the string is the number of bits.
- An $n$-bit string has length
n
. - The set of all $n$-bit strings (for given
n
) is denotedB^n
.
- An $n$-bit string has length
- The length of the string is the number of bits.
- What is the weight of a string? #card
card-last-interval:: 33.64
card-repeats:: 4
card-ease-factor:: 2.9
card-next-schedule:: 2022-12-21T00:50:01.239Z
card-last-reviewed:: 2022-11-17T09:50:01.240Z
card-last-score:: 5
- The weight of the string is the number of 1s.
- The set of all $n$-bit strings of weight
k
is denotedB^n_k
.
- The set of all $n$-bit strings of weight
- The weight of the string is the number of 1s.
-
Lattice Paths
- What is a lattice? #card
card-last-interval:: 19.01
card-repeats:: 4
card-ease-factor:: 2.18
card-next-schedule:: 2022-12-03T20:05:46.936Z
card-last-reviewed:: 2022-11-14T20:05:46.936Z
card-last-score:: 3
- The (integer) lattice is the set of all points in the Cartesian plane for which both the
x
&y
coordinates are integers.
- The (integer) lattice is the set of all points in the Cartesian plane for which both the
- What is a lattice path? #card
card-last-interval:: 31.36
card-repeats:: 4
card-ease-factor:: 2.8
card-next-schedule:: 2022-12-16T04:11:02.220Z
card-last-reviewed:: 2022-11-14T20:11:02.220Z
card-last-score:: 5
- A lattice path is the ^^shortest possible path^^ connecting two points on the lattice, moving only horizontally & vertically.
- There can be multiple lattice paths, so long as they are of equally short length.
- A lattice path is the ^^shortest possible path^^ connecting two points on the lattice, moving only horizontally & vertically.
- The number of lattice paths from
(0,0)
to(3,2)
is the same as|B_3^5|
. - The number of lattice paths from
(0,0)
to(3,2)
is the same as the number from(0,0)
to(2,2)
, plus the number from(0,0)
to(3,1)
.
- The number of lattice paths from
- What is a lattice? #card
card-last-interval:: 19.01
card-repeats:: 4
card-ease-factor:: 2.18
card-next-schedule:: 2022-12-03T20:05:46.936Z
card-last-reviewed:: 2022-11-14T20:05:46.936Z
card-last-score:: 3
-
-
Binomial Coefficients
- What is the coefficient of say,
x^3y^2
in(x+y)^5
?- $$(x+y)^0=1
\newline
(x+y)^1=x+y
\newline
(x+y)^2=x^2+2xy+y^2
\newline
(x+y)^3=x^3+3x^2y+3xy^2+y^3
\newline
(x+y)^4=x^4+4x^3y+6x^2y^2+4xy^3+y^4
\newline
(x+y)^5=x^5+5x^4y+10x^3y^2+10x^2y^3+5xy^4+y^5
- So, by doing a lot of multiplication, we have worked out that the coefficient of
x^3y^2
is10
. - But, there is a more systematic way of answering this problem.
-
(x+y)^5=(x+y)(x+y)(x+y)(x+y)(x+y)
- We can work out the coefficient of
x^3y^2
in the expansion of(x+y)^5
by counting the number of ways we can choose3
$x$s &2
$y$s in-
(x+y)(x+y)(x+y)(x+y)(x+y)
-
- $$(x+y)^0=1
\newline
(x+y)^1=x+y
\newline
(x+y)^2=x^2+2xy+y^2
\newline
(x+y)^3=x^3+3x^2y+3xy^2+y^3
\newline
(x+y)^4=x^4+4x^3y+6x^2y^2+4xy^3+y^4
\newline
(x+y)^5=x^5+5x^4y+10x^3y^2+10x^2y^3+5xy^4+y^5
- The numbers that occurred in all of our examples are called binomial coefficients, and are denoted
-
\binom{n}{k}
-
- What are Binomial Coefficients? #card
card-last-interval:: 9.88
card-repeats:: 3
card-ease-factor:: 2.32
card-next-schedule:: 2022-11-24T13:42:42.079Z
card-last-reviewed:: 2022-11-14T16:42:42.079Z
card-last-score:: 3
- For each integer
n \geq 0
, and integerk
such that0 \leq k \leq n
, there is a number\binom{n}{k}
, read as "n
choose $k$".\binom{n}{k} = |B^n_k|
, the number of $n$-bit strings of weightk
.\binom{n}{k}
is the number of subsets of a set of sizen
, each with cardinalityk
.\binom{n}{k}
is the number of lattice paths of lengthn
containingk
steps to the right.\binom{n}{k}
is the coefficient ofx^k y^{n-k}
in the expansion of(x+y)^n
.\binom{n}{k}
is the number of ways to selectk
objects from a total ofn
objects.
- For each integer
- If we were to skip ahead, we would learn that there is a formula for
\binom{n}{k}
(that is, "n
choose $k$") that is expressed in terms of factorials.- Recall that the factorial of a natural number
n
is:-
n! = n \times (n-1) \times (n-2) \times (n-4) \times ... \times 2 \times 1
-
- We will eventually learn that
-
\binom{n}{k} = \frac{n!}{k!(n-k)!}
-
-
However, the formula
\displaystyle \binom{n}{k} = \frac{n!}{k!(n-k)!}
is not very useful in practice.
- Recall that the factorial of a natural number
- What is the coefficient of say,
-
Pascal's Triangle
- Earlier, we learned that if the set of all $n$-bit strings with weight
k
is writtenB^n_k
, then-
|b^n_k| = |B^{n-1}_{k-1}| + |B^{n-1}_k
-
- Similarly, we find that:
-
Pascal's Identity: A recurrence relation for
card-last-interval:: -1 card-repeats:: 1 card-ease-factor:: 2.7 card-next-schedule:: 2022-11-18T00:00:00.000Z card-last-reviewed:: 2022-11-17T09:47:25.425Z card-last-score:: 1\binom{n}{k}
#card-
\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}
-
- This is often presented as Pascal's Triangle
-
-
Permutations
- What is a permutation? #card
card-last-interval:: 33.64
card-repeats:: 4
card-ease-factor:: 2.9
card-next-schedule:: 2022-12-21T00:50:12.451Z
card-last-reviewed:: 2022-11-17T09:50:12.452Z
card-last-score:: 5
- A permutation is an arrangement of objects. Changing the order of the objects gives a different permutation.
- A permutation of a set must have the same cardinality as that set.
- Important: order matters!
- A permutation is an arrangement of objects. Changing the order of the objects gives a different permutation.
-
Number of Permutations
- How many permutations are there of
n
objects? #card card-last-interval:: 31.36 card-repeats:: 4 card-ease-factor:: 2.8 card-next-schedule:: 2022-12-16T04:21:54.886Z card-last-reviewed:: 2022-11-14T20:21:54.886Z card-last-score:: 5- There are
n!
(i.e.,n
factorial) permutations ofn
(distinct) objects.
- There are
- How many permutations are there of
k
objects fromn
? #card card-last-interval:: 31.36 card-repeats:: 4 card-ease-factor:: 2.8 card-next-schedule:: 2022-12-16T04:10:57.897Z card-last-reviewed:: 2022-11-14T20:10:57.897Z card-last-score:: 5- The number of permutations of
k
objects out ofn
,P(n,k)
is-
P(n,k) = \binom{n}{k} = n \times (n-1) \times ... \times (n - k + 1) = \frac{n!}{(n-k)!}
-
- The number of permutations of
- How many permutations are there of
-
The Binomial Coefficient Formula
- (1) We know that there are
P(n,k)
permutations ofk
objects out ofn
. - (2) We know that
-
P(n,k) = \frac{n!}{(n-k)!}
-
- (3) Another way of making a permutation of
k
objects out ofn
is to- (a) Choose
k
fromn
without order. There\binom{n}{k}
ways of doing this. - (b) Then count all the ways of ordering these
k
objects. There arek!
ways of doing this. - (c) By the Multiplicative Principle,
-
P(n,k) = \binom{n}{k}k!
-
- (a) Choose
- (4) So now we know that
-
\frac{n!}{(n-k)!} = \binom{n}{k}k!
-
- (5) This gives the formula
-
\binom{n}{k} = \frac{n!}{(n-k)!k!}
-
- (1) We know that there are
- What is a permutation? #card
card-last-interval:: 33.64
card-repeats:: 4
card-ease-factor:: 2.9
card-next-schedule:: 2022-12-21T00:50:12.451Z
card-last-reviewed:: 2022-11-17T09:50:12.452Z
card-last-score:: 5