Discrete Mathematics – MATH 1006
Lecture 1
Colin Hill
Lecture 1 Discrete Mathematics – MATH 1006 1 / 31
The teaching team
Leanne Rylands
Subject coordinator
L.Rylands @ WesternSydney.edu.au
Colin Hill
Lecturer, tutor
c.hill @ WesternSydney.edu.au
Charles Zworestine
Campbelltown tutor
c.zworestine @ WesternSydney.edu.au
Chad Clark
Parramatta tutor
chad.clark @ WesternSydney.edu.au
Sherwin Bagheri
Penrith, Parramatta tutor
Lecture 1 Discrete Mathematics – MATH 1006 2 / 31
Assessment and other information
The Discrete Mathematics learning guide contains
information about assessment,
the schedule for the semester,
many other important bits and pieces.
Check regularly for announcements on the Discrete Mathematics
vUWS site in case there are changes.
Note that anything in grey text is not examinable.
Lecture 1 Discrete Mathematics – MATH 1006 3 / 31
Lecture outline
This week
Catalan numbers
Sets
Eugène Charles Catalan Leonardo Fibonacci
Lecture 1 Discrete Mathematics – MATH 1006 4 / 31
Chapter 1.
Counting Problem 1 (Fibonacci numbers)
You want to climb up a staircase with 10 stairs.
For each step you take, you can go up either 1 or 2 stairs.
In how many ways could you climb to the top?
What if there were 1000 stairs?
What if there were n stairs?
The answer is written as Fn , the nth Fibonacci number.
One way: Another way: Another way:
Lecture 1 Discrete Mathematics – MATH 1006 5 / 31
Chapter 1.
F1 = 1:
F2 = 2:
F3 = 3:
F4 = 5:
What is F0 ?
What is F10 ? F1000 ? Fn ?
Lecture 1 Discrete Mathematics – MATH 1006 6 / 31
Chapter 1.
Imagine climbing up a staircase with n steps (with n ≥ 2).
You can begin by (a) going up one step or (b) going up two:
(a) (b)
In case (a), there are Fn−1 ways to climb the remaining n − 1 steps.
In case (b), there are Fn−2 ways to climb the remaining n − 2 steps.
So Fn = Fn−1 + Fn−2 .
That is, “to get the next number, add the previous two”.
Lecture 1 Discrete Mathematics – MATH 1006 7 / 31
Chapter 1.
Assorted facts about Fibonacci numbers
The Fibonacci sequence F0 , F1 , F2 , F3 , . . . is A000045 on the
Online Encycopedia of Integer Sequences: oeis.org
The first few terms are 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, . . .
The sequence is determined by F0 = F1 = 1 and the
recurrence relation
Fn = Fn−1 + Fn−2 for n ≥ 2.
There is a general formula:
√ !n+1 √ !n+1
1 1+ 5 1− 5
Fn = √ − .
5 2 2
Lecture 1 Discrete Mathematics – MATH 1006 8 / 31
Chapter 1. Catalan numbers
Counting Problem 2 (Catalan numbers)
A ladder has n rungs.
Every half a second, we step up (U) or down (D).
We begin and end at ground level, and climb for n seconds.
This is called an n-second walk.
How many n-second walks are there?
We write cn for the number of n-second walks.
cn is the nth Catalan number.
We would like to find a formula for cn .
Even a method for calculating Catalan numbers one-by-one
would be nice.
Lecture 1 Discrete Mathematics – MATH 1006 9 / 31
Chapter 1. Catalan numbers
There are many ways to describe an n-second walk:
List the sequence of up (U) and down (D) steps: e.g.,
UUDUUDDD
Visualise by graphing height vs time: e.g. (continuted),
h
4
1 2 t
3 4
Note 1: must have same number of U’s and D’s. Why?
Note 2: at any point along the “word”,
number of U’s so far ≥ number of D’s so far. Why?
Lecture 1 Discrete Mathematics – MATH 1006 10 / 31
Chapter 1. Catalan numbers
There is only one 1-second walk (i.e., c1 = 1):
h
1
t
1
There are two 2-second walks (i.e., c2 = 2):
h h
2 2
1 1
1 t
2 1 2 t
How many 3-second walks are there? i.e., what is c3 ?
c4 = 14. Can you find all 4-second walks?
What is c0 ?
Lecture 1 Discrete Mathematics – MATH 1006 11 / 31
SLIDE 8 CHANGE ORDER F and RR....
Lecture 1 Discrete Mathematics – MATH 1006 12 / 31
Chapter 1. Catalan numbers
Assorted facts about Catalan numbers (proved later)
The Catalan sequence c0 , c1 , c2 , c3 , . . . is A000108 on the
Online Encycopedia of Integer Sequences: oeis.org
The first few terms are 1, 1, 2, 5, 14, 42, 132, 429, 1430, . . .
The sequence is determined by the recurrence relation:
c0 = 1
cn+1 = c0 cn + c1 cn−1 + c2 cn−2 + · · · + cn c0 for n ≥ 1.
We often abbreviate the latter using Sigma notation:
Xn
cn+1 = ck cn−k .
k=0
Lecture 1 Discrete Mathematics – MATH 1006 12 / 31
Chapter 1. Catalan numbers
Assorted facts about Catalan numbers (proved later)
There is a general formula:
1 2n (2n)!
cn = = .
n+1 n (n + 1)!n!
Here, 2n
n is a binomial coefficient (more in Week 5):
n
= nCk = number of ways to choose k things from n things
k
n!
= .
k!(n − k)!
Here, n! = n · (n − 1) · (n − 2) · · · 3 · 2 · 1 is “n factorial”.
4n
There is an asymptotic formula: cn ≈ √ .
n πn
Lecture 1 Discrete Mathematics – MATH 1006 13 / 31
Chapter 1. Catalan numbers
Exercises
1 Find all 3-second walks.
2 Use the recurrence relation to find c4 .
3 Find all 4-second walks.
4 Use the recurrence relation to find c5 .
Lecture 1 Discrete Mathematics – MATH 1006 14 / 31
Chapter 1. Catalan numbers
Counting Problem 3 (Catalan numbers again)
We wish to move 3 wagons from A to B (via C ) along the
tracks, as pictured below.
Wagons can’t back-track, but they can wait at C while
another wagon moves.
What are the possible orderings on wagons once they are all
at B? How many orderings are there? What if there were n
wagons?
C
A 1 2 3 B
Lecture 1 Discrete Mathematics – MATH 1006 15 / 31
Chapter 1. Catalan numbers
C
A 1 2 3 B
Possible arrangements:
123 213 321 132 312
Can’t do 231!
So there are only 5 possible arrangements.
Lecture 1 Discrete Mathematics – MATH 1006 16 / 31
Chapter 1. Catalan numbers
C
A 1 2 3 B
Later we’ll prove that the number of wagon arrangements
with n wagons is equal to cn .
For now, let’s just observe a connection:
3-second walk UDUDUD −→ wagon arrangement 123.
3-second walk UDUUDD −→ wagon arrangement 213.
Lecture 1 Discrete Mathematics – MATH 1006 17 / 31
Chapter 1. Catalan numbers
Catalan numbers can be used to count many many more things
(all images from Wikipedia):
We will often return to the Catalan numbers during Discrete
Mathematics.
Lecture 1 Discrete Mathematics – MATH 1006 18 / 31
Chapter 2. Sets
In this unit, we will be doing lots of counting.
In order to formalise this, we use the language of set theory.
Definition (set)
A set is a collection of objects.
The objects of a set are called its elements.
The symbols x ∈ A mean “x is an element of the set A”,
or “x is in A”, or “x belongs to A”, or “A contains x”, etc.
The symbols x 6∈ A mean “x is not an element of the set A”.
We can also write A 3 x, A 63 x, etc.
Lecture 1 Discrete Mathematics – MATH 1006 19 / 31
Chapter 2. Sets
To describe a set, we sometimes list all the elements,
enclosing them between braces: { and }.
For example, A = {1, 2, 3}.
Here, the set is called A, and its elements are 1, 2 and 3.
So 1 ∈ A and 3 ∈ A but 4 6∈ A.
We could also write A = {3, 2, 1}. Order doesn’t matter.
All that matters is what the elements are, not how we choose
to list them.
We could also write A = {1, 2, 3, 1}. Repetition doesn’t matter.
All that matters is what the elements are, not how many
times we choose to list them.
n R π/2 o
We could also write A = 1, 42 , 22 , 3, 0 cos(x)dx .
Lecture 1 Discrete Mathematics – MATH 1006 20 / 31
Chapter 2. Sets
Sometimes it is not appropriate (or possible) to list all the
elements of a set.
We can use dots (. . .) if the pattern is obvious enough: e.g.,
B = {1, 2, 3, . . . , 1000},
C = {2, 4, 6, . . . , 1000},
D = {7, 8, 9, . . . , 1000},
E = {a, b, c, . . . , z}.
We can do this with infinite sets, too: e.g.,
N = {0, 1, 2, 3, . . .} — the set of natural numbers
Z = {. . . , −3, −2, −1, 0, 1, 2, 3, . . .} — the set of integers
Or we can use words: e.g., “F is the set of all square numbers
between 2 and 70” describes F = {4, 9, 16, 25, 36, 49, 64}.
Lecture 1 Discrete Mathematics – MATH 1006 21 / 31
Chapter 2. Sets
Definition (cardinality)
The cardinality (or size) of a set is the number of elements it has.
We write |A| for the cardinality of the set A.
For the sets we have discussed so far:
|A| = 3, |C | = 500, |E | = 26, |N| = ∞,
|B| = 1000, |D| = 994, |F | = 7, |Z| = ∞.
Actually, it’s common for mathematicians to write |N| = |Z| = ℵ0 .
“ℵ” is the Hebrew letter “aleph”.
It is often used to specify the size of infinite sets.
Strangely, some infinite sets are “bigger” than others!
ℵ0 < ℵ1 < ℵ2 < · · · < ℵLecture
ω < 1ℵω+1Discrete
< · · Mathematics
· < ℵω2 < · · · < ℵ ω < 22· ·/·31
– MATH 1006 ω
Chapter 2. Sets
Some sets can’t be described using dots.
For example, Q =“the set of all rational numbers”
For example, = {all rational numbers}
= ba : a, b ∈ Z, b > 0 .
For example,
This uses set builder notation.
We read “A = {blah blah blah : yada yada yada}” as:
“A is the set of all blah blah blah such that yada yada yada”.
e.g., a : a ∈ N, a2 < 10 = {0, 1, 2, 3}.
This is sometimes abbreviated to a ∈ N : a2 < 10 .
e.g., a ∈ Z : a2 < 10 = {−3, −2, −1, 0, 1, 2, 3}.
Lecture 1 Discrete Mathematics – MATH 1006 23 / 31
Chapter 2. Sets
The real numbers are much harder to define precisely.
But we still intuitively understand them (e.g., as points on the
real number line).
We write R for the set of all real numbers.
Note that N, Z, Q and R are all infinite.
But strangely, |N| = |Z| = |Q| < |R|.
|N| = |Z| = |Q| = ℵ0 but |R| = 2ℵ0 — Georg Cantor, 1870s.
Does 2ℵ0 = ℵ1 ? Nobody knows! Nobody can know!
For more information, see:
https://en.wikipedia.org/wiki/Real number
https://en.wikipedia.org/wiki/Dedekind cut
https://en.wikipedia.org/wiki/Georg Cantor
https://en.wikipedia.org/wiki/Continuum hypothesis
Lecture 1 Discrete Mathematics – MATH 1006 24 / 31
Chapter 2. Sets
Definition (subset)
If A and B are both sets, we say A is a subset of B if every
element of A is an element of B.
We write A ⊆ B to indicate that A is a subset of B.
We write A 6⊆ B to indicate that A is not a subset of B.
i.e., at least one element of A is not an element of B.
not: every element of A is not an element of B.
For example, let
A = {1, 2, 3} C = {2, 4, 6, . . . , 1000}
B = {1, 2, 3, . . . , 1000} D = {7, 8, 9, . . . , 1000}
Then A ⊆ B, A 6⊆ C , C ⊆ B, B ⊇ C , C 6⊆ D, D 6⊆ C , C 6⊇ D.
Lecture 1 Discrete Mathematics – MATH 1006 25 / 31
Chapter 2. Sets
Note that N ⊆ Z and Z ⊆ Q and Q ⊆ R.
We sometimes abbreviate this to N ⊆ Z ⊆ Q ⊆ R.
We can represent this diagramatically:
N Z Q R
7
√
7∈N −7 6∈ N 3 6∈ N 2 6∈ N
7
√
7∈Z −7 ∈ Z 3 6∈ Z 2 6∈ Z
7
√
7∈Q −7 ∈ Q 3 ∈Q 2 6∈ Q
7
√
7∈R −7 ∈ R 3 ∈R 2∈R
So N 6⊇ Z 6⊇ Q 6⊇ R.
Lecture 1 Discrete Mathematics – MATH 1006 26 / 31
Chapter 2. Sets
Theorem (Pythagoras, around 550 BCE)
√
2 is irrational.
Proof. We use proof by contradiction.
√
Assume 2 = ba . Write it so no simplification possible.
a2
Squaring gives 2 = b2
. Rearranging gives a2 = 2b 2 .
So a2 is even. Thus, a is even. So a = 2c for some c. Then
2b 2 = a2 = (2c)2 = 4c 2 ⇒ b 2 = 2c 2 .
So b 2 is even. Thus, b is even. So b = 2d for some d.
√
But then 2 = ba = 2d 2c
= dc . i.e., ba can be simplified.
√
Our assumption ( 2 = ba ) must be wrong. Contradiction!
Lecture 1 Discrete Mathematics – MATH 1006 27 / 31
Chapter 2. Sets
Theorem (much harder!)
π is irrational.
Theorem (also very hard!)
e is irrational.
Theorem
At least one of e + π or e × π is irrational.
They might both be, or just one of them.
Nobody knows!
Lecture 1 Discrete Mathematics – MATH 1006 28 / 31
Chapter 2. Sets
Facts about subsets
Every set is a subset of itself: A ⊆ A.
Every set has a special subset called the empty set.
The empty set has no elements.
The empty set is written as ∅ or {}.
e.g., the set of all elephants in this room is empty.
e.g., the set of all your lecturer’s Ferraris is empty :-(
Lecture 1 Discrete Mathematics – MATH 1006 29 / 31
Chapter 2. Sets
Definition (power set)
If A is a set, we can form the power set of A.
This is the set of all subsets of A.
The power set of A is written as P(A).
So P(A) = {B : B ⊆ A}.
Note that the elements of P(A) are sets.
Sometimes P(A) is written as 2A .
Lecture 1 Discrete Mathematics – MATH 1006 30 / 31
Chapter 2. Sets
Exercises
Write down the power sets of the following sets:
1 A = {1}, 3 C = {1, 2, 3}, 5 E = ∅.
2 B = {1, 2}, 4 D = {a, b, c},
Exercise
1 If |A| = n, then what is |P(A)|?
2 Show that |P(A)| > |A| if A is finite.
(Actually, |P(A)| > |A| is also true if A is infinite — Cantor!)
Lecture 1 Discrete Mathematics – MATH 1006 31 / 31