0% found this document useful (0 votes)
23 views43 pages

HelpSheet CS1231S Full

Uploaded by

26YiJie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views43 pages

HelpSheet CS1231S Full

Uploaded by

26YiJie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

Forewords

Hi, I’m Chee Xiang, also known as Pallon. I have created this help sheet for my own study, and it is the
treasure and culmination of my efforts. However, for some reason, I have decided to share this help sheet
with other students, including you. One of the main reasons is that I hope it can help you in your studies.
Another fun reason is to observe how my little help sheet can spread throughout our community. You can
think of it as me performing a Breadth-First Search (BFS) with myself as the root node, trying to find the
maximum depth.
I'm sure it will also be fun to keep a record of who is in our community. Therefore, I have created a
contributor list that records those who have progressively contributed to the improvement of this help sheet
(of course, it starts with only me). If you're bored or interested, you can also check their LinkedIn profiles (if
they have provided them) to connect with them. You can find the contributor list here:
https://docs.google.com/spreadsheets/d/1r2SgdThPMcMoWAEyFPwaqrq1CjQ87ZfKuwDy0lADPJM/edit#
gid=0

Feel free to click on this link to provide me with feedback on this help sheet:
https://docs.google.com/forms/d/1taARJqNnGrxbzEunaVD6IhviVO5hTVbMv6D66nSnaJw/edit

Lastly, please note that this help sheet is not perfect, and it could contain errors or undergo changes in
versions, despite all the contributors and me doing our best to maintain its correctness. The latest version of
the help sheet can be retrieved at https://github.com/PallonCX/CS1231S-Helpsheet. Please use it at your
own risk.
Wishing you all the best in your studies!

Made by Tan Chee Xiang (Pallon)


Version 1.0
Lecture 1: Speaking Mathematically
Important Sets:
ℕ - Natural numbers (includes 0) | ℤ - Integers | ℚ - Rational numbers | ℝ - Real numbers [ℕ ⊆ ℤ ⊆ ℚ ⊆ ℝ]
Superscripts (Top) & Subscripts (Bottom):
ℤ+: Positive integers | ℝ-: Negative real numbers | ℤ≥12: Integers greater than or equal to 12 (0 is neither – or +)
Terminology:
Definition:
A precise and unambiguous description of the meaning of a mathematical term. It characterizes the meaning of a word
by giving all the properties and only those properties that must be true.
Axiom / Postulate:
A statement that is assumed to be true without proof.
Theorem:
A mathematical statement that is proved using rigorous mathematical reasoning.
Lemma:
A small theorem.
Corollary:
A result that is a simple deduction from a theorem.
Conjecture:
A statement believed to be true, but for which there is no proof (yet).
Basic Properties of Integers Lecture #1 Slides #26 ∀ 𝑥 ,𝑦 ,𝑧 ∈ ℤ:
Closure under + and x: 𝑥 + 𝑦 ∈ ℤ and 𝑥𝑦 ∈ ℤ
Commutativity: 𝑥 + 𝑦 = 𝑦 + 𝑥 and 𝑥𝑦 = 𝑦𝑥
Associativity: 𝑥 + 𝑦 + 𝑧 = (𝑥 + 𝑦) + 𝑧 = 𝑥 + (𝑦 + 𝑧) and 𝑥𝑦𝑧 = (𝑥𝑦)𝑧 = 𝑥(𝑦𝑧).
Distributivity: 𝑥(𝑦 + 𝑧) = 𝑥𝑦 + 𝑥𝑧 and (𝑦 + 𝑧)𝑥 = 𝑦𝑥 + 𝑧𝑥.
Trichotonomy: Exactly one of the following is true: 𝑥 = 𝑦, or 𝑥 < 𝑦, or 𝑥 > 𝑦.
Definition: Even and Odd integers Lecture #1 Slides #27:
If 𝑛 is an integer, then
𝑛 is even ⟺ ∃ an integer 𝑘 such that 𝑛 = 2𝑘.
𝑛 is odd ⟺ ∃ an integer 𝑘 such that 𝑛 = 2𝑘 + 1.
Assumption 1 Lecture #1 Slides #27:
Every integer is even or odd, but not both.

Definition: Divisibility Lecture #1 Slides #32:


If 𝑛, 𝑑∈ℤ and 𝑑≠0: 𝑑 | 𝑛 ⟺ ∃𝑘∈ℤ such that 𝑛 = 𝑑𝑘.
Thus, “𝑛 is a multiple of 𝑑”, or “𝑑 is a factor of 𝑛”, or “𝑑 is a divisor of 𝑛” or “𝑑 divides 𝑛”.
*𝑎|𝑏 is a statement, which is evaluated to true or false. It is not a numerical value.

Irrationality of √𝟐 Theorem 4.7.1 (5th: 4.8.1) : √2 is irrational.

Definition: Rational and irrational numbers Lecture #1 Slides #37:


!
𝑟 is rational ⟺ ∃ 𝑎, 𝑏 ∈ ℤ s.t. 𝑟 = and 𝑏 ≠ 0.
"
A real number that is not rational is irrational.

Definition: Fraction in lowest term Lecture #1 Slides #37:


A quotient of two integers with a nonzero denominator is also commonly known as a fraction. A fraction 𝑎/𝑏 (where
𝑏≠0) is said to be in lowest terms if the largest integer that divides both 𝑎 and 𝑏 is 1.

Assumption 2 Lecture #1 Slides #37:


Every rational can be reduced to a fraction in its lowest term.
Proposition 4.6.4 (5th: 4.7.4) : For all integers 𝑛, if 𝑛2 is even then 𝑛 is even.

Made by Tan Chee Xiang (Pallon)


Version 1.0
Tutorial #1 Question #10 : Let 𝑛 be an integer. Then 𝑛2 is odd if and only if 𝑛 is odd.

Definition: Colorful (Only for CS1231S) Lecture #1 Slides #44:


An integer 𝑛 is said to be colorful if there exists some integer 𝑘 such that 𝑛 = 3𝑘.
General pattern of proof:
Some tips:
1. Write the draft proof by
(1) Start of the proof: Let
(2) End of the proof: Thus (Conclusion)
2. Continue the remaining parts with logical arguments,
definitons or properties

Proofs:
Type of Proof Pattern Usage
Proof by construction 1. Let / Consider -When a specific value with some
(Direct proof) 2. Note that (The thing let above have some properties is required to suffice the
property) proof
3. Also, (With the property, we can conclude that) -To proof existential statement (Find
a specific value or give directions to
find)
Disproof by counter 1. Let -To show a statement is false (Often
example 2. Therefore, (With the property of the thing let for universal statement)
above, the statement is not true) -One counter-example is sufficient
Proof by exhaustion / 1. Let (Specific values from cases, such as 0, 1) -Number of cases is finite
Proof by cases / Proof 1.1 (Show that everything let above suffice the
by brute force statement)
2. Therefore, (Conclude)
Proof by deduction 1. Let (An abstract value, such as n, k) -Number of cases is infinite
(Direct proof) 1.1 (Show that the thing let above suffice the -General problem
statement)
2. Therefore, (Conclude)
Proof by contradiction 1. Suppose not, that is, (The negation of the -The statement to prove is absence
(Indirect proof) statement) of form
1.1 (Show that we can deduce something that -Direct proof is difficult
contradicts the assumption)
2. Therefore, the assumption that (The negation of
the statement) is false.
3. Hence (The statement we want to prove)
Proof by 1. Contrapositive statement: (The contraposition -Conditional statement that is hard to
contraposition of statement) prove in the original direction
2. (Prove the contrapositive statement)
3.Hence, (The original statement is true)
Proof by Mathematical 1. Let 𝑃(𝑛) ≡ … (Set up predicate.)
Induction 2. Basis step: …
3. Assume 𝑃(𝑘) is true for some 𝑘 (Inductive
Hypothesis)
4. Inductive step: (Start from k + 1, and use

Made by Tan Chee Xiang (Pallon)


Version 1.0
inductive hypothesis to support the proof)
5.Therefore, (Conclude statement)

Made by Tan Chee Xiang (Pallon)


Version 1.0
Lecture 2: The Logic of Compound Statements (aka Propositional Logic)
Definition: Statement Definition 2.1.1:
A statement (or proposition) is a sentence that is true or false, but not both.
Definition: Negation Definition 2.1.2:
If p is a statement variable, the negation of p is “not p” or “it is not the case that p” and is denoted ~ p.

Definition: Conjunction Definition 2.1.3:


If p and q are statement variables, the conjunction of p and q is “p and q”, denoted p Ù q.

Definition: Disjunction Definition 2.1.4:


If p and q are statement variables, the disjunction of p and q is “p or q”, denoted p Ú q.

Definition: Statement Form / Propositional Form Definition 2.1.5:


A statement form (or propositional form) is an expression made up of statement variables and logical connectives that
becomes a statement when actual statements are substituted for the component statement variables.

Definition: Logical Equivalence Definition 2.1.6:


Two statement forms are called logically equivalent if, and only if, they have identical truth values for each possible
substitution of statements for their statement variables. The logical equivalence of statement forms P and Q is denoted
by P º Q.
*To show logical equivalence: Show that truth table have identical truth values
*To show non-equivalence:
(1) Truth table method: Show that truth table have at least one row where truth values differ
(2) Counter-example method: Find a counter example such that one is true another is false.

Definition: Tautology Definition 2.1.7:


A tautology is a statement form that is always true regardless of the truth values of the individual statements
substituted for its statement variables. A statement whose form is a tautology is a tautological statement.
Definition: Contradiction Definition 2.1.8:
A contradiction is a statement form that is always false regardless of the truth values of the individual statements
substituted for its statement variables. A statement whose form is a contradiction is a contradictory statement.

Logical Equivalence Theorem 2.1.1: *Just quote the law name

*Implication law: p ® q º ~p Ú q
*Variant absorption laws: 𝑝∧(~𝑝∨𝑞)≡𝑝∧𝑞 or 𝑝∨(~𝑝∧𝑞)≡𝑝∨𝑞

Made by Tan Chee Xiang (Pallon)


Version 1.0
Definition: Conditional Definition 2.2.1:
If p and q are statement variables, the conditional of q by p is “if p then q” or “p implies q”, denoted p ® q. It is false
when p is true and q is false; otherwise it is true. We called p the hypothesis (or antecedent) of the conditional and q
the conclusion (or consequent).
* A conditional statement that is true when its hypothesis is false is often called vacuously true or true by default.
Definition: Contrapositive Definition 2.2.2:
The contrapositive of p ® q is ~q ®~p.

Definition: Converse Definition 2.2.3:


The converse of p ® q is q ® p.

Definition: Inverse Definition 2.2.4:


The inverse of p ® q is ~p ® ~q.
*Note that:
(1) Conditional statement º Its contrapositive | (2) Its converse º its inverse | (3) Statement ≢ Converse (Normally)

Definition: Only if Definition 2.2.5:


“p only if q” means “if not q then not p” or “~𝑞→~𝑝”. Or, equivalently, “if p then q” or “𝑝→𝑞”.
Definition: Biconditional Definition 2.2.6:
Given statement variables p and q, the biconditional of p and q is “p if, and only if, q” and is denoted p « q. It is true
if both p and q have the same truth values and is false if p and q have opposite truth values. The words if and only if
are sometimes abbreviated iff.
*p « q º (p ® q) Ù (q ® p)

Definition: Necessary and Sufficient Conditions Definition 2.2.7:


If r and s are statements, “r is a sufficient condition for s” means “if r then s” or “𝑟→𝑠”,
“r is a necessary condition for s” means “if not r then not s” or “if s then r” or “𝑠→𝑟”.
* r is a necessary and sufficient condition for s means “r if and only if s” or “𝑟↔𝑠”.

Logical Not / If-then / Implies: If and only if: And: Ù Or: Ú Exclusiv
connectiv Negation: ~ ® « *We use “but” e-or
es in English (Special)
sometimes
Truth (p Ú q) Ù
tables ~ (p Ù q)

Order or Performed Coequal (Performed last) Coequal (After negation) -


operation first *Use parentheses to disambiguate

Definition: Argument Definition 2.3.1:


An argument (argument form) is a sequence of statements (statement forms). All statements in an argument (argument
form), except for the final one, are called premises (or assumptions or hypothesis). The final statement (statement
form) is called the conclusion. The symbol •, which is read “therefore”, is normally placed just before the conclusion.
To say that an argument form is valid means that no matter what particular statements are substituted for the statement
variables in its premises, if the resulting premises are all true, then the conclusion is also true.
*Testing validity of argument form (Critical row method):
(1) Identify premises and conclusion
Made by Tan Chee Xiang (Pallon)
Version 1.0
(2) Construct truth table
(3) Find critical row (All premises are true), if conclusion in every critical row is true, then the argument form is valid
* Tutorial #1 Additional Notes Testing validity of argument form:
Given an argument:
𝑝1
𝑝2

𝑝𝑘
∴𝑞
where 𝑝1,𝑝2,…,𝑝𝑘 are the 𝑘 premises and 𝑞 the conclusion, we can say that “the argument is valid if and only if
(𝑝1∧𝑝𝑘∧⋯∧𝑝𝑘)⟶𝑞 is a tautology”.
Term: Syllogism Lecture #2 Slides #57:
An argument form consisting of two premises and a conclusion.

Term: Rule of inference Lecture #2 Slides #61:


A form of argument that is valid.
*Just quote the rule name

Term: Fallacy Lecture #2 Slides #69:


An error in reasoning that results in an invalid argument.
*Three common fallacies:
(1) Using ambiguous premises (2) Circular reasoning (Assume the conclusion) (3) Jumping to a conclusion
*Example:

Converse error / Fallacy of affirming the Inverse error Valid argument with a false
consequence premise (Logical problem in
premise)

Definition: Sound and Unsound Arguments Definition 2.3.2:


An argument is called sound if, and only if, it is valid and all its premises are true. An argument that is not sound is
called unsound.

Made by Tan Chee Xiang (Pallon)


Version 1.0
Some common questions:
(1) Which of the following statements is/are logically equivalent to … ?
(i) Try to transform the option into the given statement (ii) Substitute the statement variables with true and false
(2) What is/are the missing premise(s) to make the following argument valid?
(i) Try to transform the conclusion into a form that is the conjunction of all premises
Common questions:
(1) Simplify proposition – Change “implies” to “and” and “or”, remember to use ≡
(2) Mastermind –
(i) If 3 colour is correct, we can deduct the 4th colour is among those which’s not inside.
(ii) If those who have the 4th colour are all in the sequence, then only one among them have correct colour
(iii) Once get all the correct colour, refer to sequence which have only sink without hit to know some position
(iv) Lastly, use the answer to check all (Optional)

Made by Tan Chee Xiang (Pallon)


Version 1.0
Lecture 3: The Logic of Quantified Statements (aka Predicate Logic)
Definition: Predicate Definition 3.1.1:
A predicate is a sentence that contains a finite number of predicate variables and becomes a statement when specific
values are substituted for the variables. The domain of a predicate variable is the set of all values that may be
substituted in place of the variable.
*Ways to change predicate into statement:
(1) Assign specific values to all predicate variables
(2) Add quantifiers

Definition: Truth set Definition 3.1.2:


If P(x) is a predicate and x has domain D, the truth set is the set of all elements of D that make P(x) true when they are
substituted for x. The truth set of P(x) is denoted {x Î D | P(x)}.
* In set theory, the symbol | is used to mean “such that”.
*Sometimes we can narrow the domain to truth set in quantified statements.

Symbol: Universal quantifier / " denotes “for all” (or “for any”, “for every”, “for each”)

Definition: Universal Statement Definition 3.1.3:


Let Q(x) be a predicate and D the domain of x. A universal statement is a statement of the form “"xÎD, Q(x)” (May
omit commas). It is defined to be true iff Q(x) is true for every x in D. It is defined to be false iff Q(x) is false for at
least one x in D. A value for x for which Q(x) is false is called a counterexample.
*To check the truth and falsity:
(1) True: Method of exhaustion (Try every value in the domain) / Prove
(2) False: Find a counterexample
*Vacuous truth:
In general, a statement of the form "x ∈ D (P(x) → Q(x)) is called vacuously true or true by default if, and only if,
P(x) is false for every x in D.
As a special case, ∀𝑎 ∈ 𝑋, 𝑃(𝑎) is vacuously true if 𝑋 is an empty set.
*Usually in the form "x (P(x) → Q(x)), not "x (P(x) Ù Q(x))

Symbol: Existential quantifier / $ denotes “there exists”, “there is a”, “we can find a”, “there is at least one”, “for
some”, and “for at least one”.
* The words “such that” or “s.t.” are inserted just before the predicate. (May omit)
*$! is used to denote “there exists a unique” or “there is one and only one”.

Definition: Existential Statement Definition 3.1.4:


Let Q(x) be a predicate and D the domain of x. An existential statement is a statement of the form “$xÎD such that
Q(x)”. It is defined to be true iff Q(x) is true for at least one x in D. It is defined to be false iff Q(x) is false for all x in
D.
*To check the truth and falsity:
(1) True: Find an example
(2) False: Prove
*Usually in the form $x (P(x) Ù Q(x)), not $x (P(x) → Q(x))

Negation of a Universal Statement Theorem 3.2.1:


~("x∈D, P(x)) º $x∈D such that ~P(x)

Negation of an Existential Statement Theorem 3.2.2:


~($x∈D such that P(x)) º "x∈D, ~P(x)

Relation among ", $, Ù, and Ú Lecture #3 Slides #35:


"xÎD, Q(x) ≡ Q(x1) Ù Q(x2) Ù … Ù Q(xn)
$xÎD, Q(x) ≡ Q(x1) Ú Q(x2) Ú … Ú Q(xn)

Made by Tan Chee Xiang (Pallon)


Version 1.0
Definition: Contrapositive, converse, inverse Definition 3.2.1:
Consider a statement of the form: "xÎD (P(x) → Q(x)). Its contrapositive is: "xÎD (~Q(x) → ~P(x)). Its converse is:
"xÎD (Q(x) → P(x)). Its inverse is: "xÎD (~P(x) → ~Q(x)).
*It follows that "xÎD (P(x) → Q(x)) ≡ "xÎD (~Q(x) → ~P(x)) and "xÎD (P(x) → Q(x)) ≢ "xÎD (Q(x) → P(x))

Definition: Necessary and Sufficient conditions, Only if Definition 3.2.2:


“" x, r(x) is a sufficient condition for s(x)” means “" x (r(x) → s(x))”. “
" x, r(x) is a necessary condition for s(x)” means “" x (~r(x) → ~s(x))” or, equivalently, “"x (s(x) → r(x))”.
“" x, r(x) only if s(x)” means “"x (~s(x) → ~r(x))” or, equivalently, “"x (r(x) → s(x))” .

Negations of Multiply-Quantified Statements Lecture #3 Slides #57:


∼(∀x ∈ D, ∃y∈E such that P(x, y)) ≡ ∃x∈D such that ∀y∈E, ∼P(x, y)
∼(∃x∈D such that ∀y∈ E, P(x, y)) ≡ ∀x∈D, ∃y∈E such that ∼P(x, y)
*Basically change the ∀ to ∃ and ∃ to ∀, and negates any predicate.

Order of Quantifier Lecture #3 Slides #61:


In a statement containing both " and $, changing the order of the quantifiers usually changes the meaning of the
statement. However, if one quantifier immediately follows another quantifier of the same type, then the order of the
quantifiers does not affect the meaning.
Definition: Valid Argument Form Definition 3.4.1:
No matter what particular predicates are substituted for the predicate symbols in its premises, if the resulting premise
statements are all true, then the conclusion is also true.

Universal Modus Universal Modus Converse Error Inverse Error Universal


Ponens Tollens (Quantified Form) (Quantified Form) Transitivity

Tutorial #2 Question #3:


(a) Integers are closed under division. (Disproved)
(b) Rational numbers are closed under addition. (Proved by deduction)
(c) Rational number are closed under division. (Disproved)

Tutorial #2 Question #7: ∀𝑥∈ℝ ((𝑥2>𝑥)→(𝑥<0)∨(𝑥>1)). (Proof by deduction)

Made by Tan Chee Xiang (Pallon)


Version 1.0
Tutorial #2 Question #10: If 𝑛 is a product of two positive integers 𝑎 and 𝑏, then 𝑎 ≤ 𝑛1/2 or 𝑏 ≤ 𝑛1/2 (Proof by
contraposition / contradiction)

Made by Tan Chee Xiang (Pallon)


Version 1.0
Lecture 4: Methods of Proof
Definition: Prime and Composite Lecture #4 Slides #6:
𝑛 is prime: (𝑛>1)∧∀𝑟,𝑠∈ℤ+, (𝑛=𝑟𝑠→(𝑟=1∧𝑠=𝑛)∨(𝑟=𝑛∧𝑠=1)).
𝑛 is prime: (𝑛>1)∧(∀𝑟,𝑠∈ℤ ((𝑟>1)∧(𝑠>1)→𝑟𝑠≠𝑛)).
𝑛 is composite: ∃𝑟,𝑠∈ℤ+ (𝑛=𝑟𝑠∧(1<𝑟<𝑛)∧(1<𝑠<𝑛)).

Definition: Prime Lecture #4 Slides #7:


𝑛 is prime: (𝑥≠1)∧∀𝑦,𝑧 (𝑥=𝑦𝑧→((𝑦=𝑥)∨(𝑦=1)))
Proving Existential Statement Constructive Proof
Disproving Universal Statement Counterexample (For conditional statement, find a value in domain for which
the hypothesis is true but the conclusion is false.
Proving Universal Statement (Finite) Method of exhaustion
(Infinite) Generalizing from the generic particular (To show that every element
of a set satisfies a certain property, suppose 𝑥 is a particular but arbitrarily
chosen element of the set, and show that 𝑥 satisfies the property.)

Theorem 4.2.1 (5th: 4.3.1): Every integer is a rational number. (Constructive Proof)

Theorem 4.2.2 (5th: 4.3.2): The sum of any two rational numbers is rational. (Constructive Proof)

Corollary 4.2.3 (5th: 4.2.3): The double of a rational number is rational.

A Positive Divisor of a Positive Integer Theorem 4.3.1 (5th: 4.4.1):


For all positive integers 𝑎 and 𝑏, if 𝑎 | 𝑏, then 𝑎≤𝑏. (Constructive Proof)

Divisors of 1 Theorem 4.3.2 (5th: 4.4.2):


The only divisors of 1 are 1 and -1. (Proof by division into cases)

Transitivity of Divisibility Theorem 4.3.3 (5th: 4.4.3):


For all integers 𝑎, 𝑏 and 𝑐, if 𝑎 | 𝑏 and 𝑏 | 𝑐, then 𝑎 | 𝑐. (Constructive Proof)

Theorem 4.6.1 (5th: 4.7.1): There is no greatest integer. (Proof by contradiction)

Proposition 4.6.4 (5th: 4.7.4): For all integers 𝑛, if 𝑛2 is even than 𝑛 is even. (Proof by contraposition)

Made by Tan Chee Xiang (Pallon)


Version 1.0
Lecture 5: Set Theory
Definition: Set Lecture #5 Slides #6:
Set is a unordered collection of objects. The objects are called members or elements of the set. Order and duplicate do
not matter, which means an element is only counted once regardless of the number of duplicate in the set.
Definition: Membership of a Set (Notation: ∈) Lecture #5 Slides #7:
If 𝑆 is a set, the notation 𝑥∈𝑆 means that 𝑥 is an element of 𝑆. (𝑥∉𝑆 means 𝑥 is not an element of 𝑆.)
Definition: Cardinality of a Set (Notation: |𝑆|) Lecture #5 Slides #7:
The cardinality of a set 𝑆, denoted as |𝑆|, is the size of the set, that is, the number of elements in 𝑆.

Term: Set-Roster Notation Lecture #5 Slides #6:


A set may be specified by writing all of its elements between braces. Examples: {1, 2, 3}, {1, 2, 3, …, 100}, {1, 2,
3, …}. (The symbol ⋯ is called an ellipsis and is read “and so forth”.)

Term: Set-Builder Notation Lecture #5 Slides #11:


Let 𝑈 be a set and 𝑃(𝑥) be a predicate over 𝑈. Then the set of all elements 𝑥∈𝑈 such that 𝑃(𝑥) is true is denoted
{𝑥∈𝑈 : 𝑃(𝑥)} or {𝑥∈𝑈 | 𝑃(𝑥)} which is read as “the set of all 𝑥 in 𝑈 such that 𝑃(𝑥) (is true)”.
*An object 𝑧 is an element of the set 𝑆 = {𝑥∈𝑈 : 𝑃(𝑥)} only if 𝑧∈𝑈 and 𝑃(𝑧) is true.

Term: Replacement Notation Lecture #5 Slides #12:


Let 𝐴 be a set and 𝑡(𝑥) be a term in a variable 𝑥. Then the set of all objects of the form 𝑡(𝑥) where 𝑥 ranges over the
elements of 𝐴 is denoted {𝑡(𝑥): 𝑥∈𝐴} or {𝑡(𝑥) | 𝑥∈𝐴} which is read as “the set of all 𝑡(𝑥) where 𝑥∈𝐴”.
* An object 𝑧 is an element of 𝑆={𝑡(𝑥) :𝑥∈𝐴} only if there is an 𝑥∈𝐴 such that 𝑡(𝑥)=𝑧.

Definition: Subset Lecture #5 Slides #13:


𝐴⊆𝐵 iff ∀𝑥 (𝑥∈𝐴⇒𝑥∈𝐵). “𝐴 is a subset of 𝐵” is same meaning as “𝐴 is contained in 𝐵”. We may also write 𝐵⊇𝐴
which reads as “𝐵 contains 𝐴” or “𝐵 includes 𝐴”.
* 𝐴⊈𝐵 ⇔ ∃𝑥 (𝑥∈𝐴∧𝑥∉𝐵).

Definition: Proper Subset Lecture #5 Slides #13:


𝐴⊊𝐵, iff 𝐴⊆𝐵 and 𝐴≠𝐵. In this case, we may say that the inclusion of 𝐴 in 𝐵 is proper or strict.

Definition: Empty Set Lecture #5 Slides #14:


A set with no element is an empty set, denoted as ∅ or {}.

Theorem 6.2.4: An empty set is a subset of every set, i.e. ∅⊆𝐴 for all sets 𝐴.

Definition: Singleton Lecture #5 Slides #14:


A set with exactly one element is called a singleton.
Definition: Ordered Pair Lecture #5 Slides #16:
An ordered pair is an expression of the form (𝑥,𝑦). Two ordered pairs (𝑎,𝑏) and (𝑐,𝑑) are equal iff 𝑎=𝑐 and 𝑏=𝑑.
Symbolically: (𝑎,𝑏)=(𝑐,𝑑)⇔(𝑎=𝑐)∧(𝑏=𝑑).

Definition: Cartesian Product Lecture #5 Slides #17:


Given sets 𝐴 and 𝐵, the Cartesian product of 𝐴 and 𝐵, denoted 𝑨×𝑩 and read “𝐴 cross 𝐵”, is the set of all ordered
pairs (𝑎,𝑏) where 𝑎 is in 𝐴 and 𝑏 is in 𝐵. Symbolically: 𝐴×𝐵={(𝑎,𝑏) : 𝑎∈𝐴∧𝑏∈𝐵}.
Definition: Set equality Lecture #5 Slides #19:
Given sets 𝐴 and 𝐵, 𝐴 equals 𝐵, written 𝑨=𝑩 iff every element of 𝐴 is in 𝐵 and every element of 𝐵 is in 𝐴.
Symbolically: 𝐴=𝐵⇔𝐴⊆𝐵∧𝐵⊆𝐴 or 𝐴=𝐵⇔∀𝑥 (𝑥∈𝐴⇔𝑥∈𝐵) Lecture #5 Slides #21
*To prove set equality:
[S1] Let sets 𝑋 and 𝑌 be given. To prove 𝑋 = 𝑌: [S2] (⊆) Prove that 𝑋⊆𝑌. (Take any element of X, prove it’s in Y)
[S3] (⊇) Prove that 𝑌⊆𝑋 (or 𝑋⊇𝑌). [S4] From (2) and (3), conclude that 𝑋=𝑌.

Made by Tan Chee Xiang (Pallon)


Version 1.0
Term: Universal set Lecture #5 Slides #24:
In a certain situation within some context, all sets being considered as a specific sets, for example sets of real numbers,
thus the sets of real numbers would be called universal set or a universe of discourse for the discussion.
Definition: Union, intersection, difference and complement Lecture #5 Slides #25:
Let 𝐴 and 𝐵 be subsets of a universal set 𝑈.
The union of 𝐴 and 𝐵, denoted 𝑨∪𝑩, is the set of all elements that are in at least one of 𝐴 or 𝐵.
𝐴∪𝐵={𝑥∈𝑈:𝑥∈𝐴∨𝑥∈𝐵}
The intersection of 𝐴 and 𝐵, denoted 𝑨∩𝑩, is the set of all elements that are common to both 𝐴 and 𝐵.
𝐴∩𝐵={𝑥∈𝑈:𝑥∈𝐴∧𝑥∈𝐵}
The difference of 𝐵 minus 𝐴 (or relative complement of 𝐴 in 𝐵), denoted 𝑩−𝑨, or 𝑩 \ 𝑨, is the set of all elements that
are in 𝐵 and not 𝐴. 𝐵 \ 𝐴={𝑥∈𝑈:𝑥∈𝐵∧𝑥∉𝐴}
The complement of 𝐴, denoted 𝐴̅, is the set of all elements in 𝑈 that are not in 𝐴. (Note: Epp uses the notation 𝐴c.)
𝐴̅ ={x∈𝑈 | 𝑥∉𝐴}.
*Sometimes 𝑈 is omitted in the definition
*𝑋i = 𝑈 \ 𝑋 Lecture #5 Slides #26

Notation: Interval of real numbers Lecture #5 Slides #27:


Given real numbers 𝑎 and 𝑏 with 𝑎≤𝑏:
(𝑎,𝑏)={𝑥∈ℝ :𝑎<𝑥<𝑏}, [𝑎,𝑏]={𝑥∈ℝ :𝑎≤𝑥≤𝑏}, (𝑎,𝑏]={𝑥∈ℝ :𝑎<𝑥≤𝑏}, [𝑎,𝑏)={𝑥∈ℝ :𝑎≤𝑥<𝑏}.
The symbols ∞ and −∞ are used to indicate intervals that are unbounded either on the right or on the left:
(𝑎,∞)={𝑥∈ℝ :𝑥>𝑎}, [𝑎,∞)={𝑥∈ℝ :𝑥≥𝑎}, (−∞,𝑏)={𝑥∈ℝ :𝑥<𝑏}, (−∞,𝑏]={𝑥∈ℝ :𝑥≤𝑏}.
Definition: Union & Intersection for more than two
sets Lecture #5 Slides #28:
⋃$#%& 𝐴# = 𝐴& ∪ 𝐴' ∪ ⋯ ∪ 𝐴$
⋂$#%& 𝐴# = 𝐴& ∩ 𝐴' ∩ ⋯ ∩ 𝐴$

Definition: Disjoint Lecture #5 Slides #29:


Two sets are disjoint iff they have no elements in
common. Symbolically: 𝐴 and 𝐵 are disjoint iff
𝐴∩𝐵=∅.

Definition: Mutually disjoint Lecture #5 Slides #29:


Sets 𝐴' , 𝐴( , 𝐴) , ⋯ are mutually disjoint (or pairwise
disjoint or nonoverlapping) iff no two sets 𝐴# and 𝐴*
with distinct subscripts have any elements in common, i.e. for all 𝑖, 𝑗 = 1,2,3, ⋯, 𝐴# ∩ 𝐴* = ∅ whenever 𝑖 ≠ 𝑗.

Definition: Partition:
Lecture #5 Slides #29 Division of set into nonoverlapping (or disjoint) pieces.
Lecture #5 Slides #30 If A is called a union of mutually disjoint subsets A1, A2, A3, and A4, then the collection of sets
{A1, A2, A3, A4} is said to be a partition of A.

The Quotient-Remainder Theorem Theorem 4.4.1:


Given any integer 𝑛 and positive integer 𝑑, there exist unique integers 𝑞 and 𝑟 such that 𝑛=𝑑𝑞+𝑟 and 0≤𝑟<𝑑.
*Usage: By the quotient-remainder theorem, every integer n can be written in exactly one of the three forms: n = 3k,
or n = 3k+1, or n = 3k + 2 for some integer k.

Definition: Power set Lecture #5 Slides #33:


Given a set 𝐴, the power set of 𝐴, denoted 𝒫(𝐴), is the set of all subsets of 𝐴.

Theorem 6.3.1: Suppose 𝐴 is a finite set with 𝑛 elements, then 𝒫(𝐴) has 2$ elements. In other words, |𝒫(𝐴)| = 2|,| .
(Proof by mathematical induction)

Made by Tan Chee Xiang (Pallon)


Version 1.0
Definition: Ordered 𝑛-tuples Lecture #5 Slides #36:
Let 𝑛 ∈ ℤ- and let 𝑥' , 𝑥( , ⋯ , 𝑥$ be (not necessarily distinct) elements. An ordered 𝒏-tuple is an expression of the
form (𝑥' , 𝑥( , ⋯ , 𝑥$ ). An ordered pair is an ordered 2-tuple; an ordered triple is an ordered 3-tuple. Equality of two
ordered 𝑛-tuples: (𝑥' , 𝑥( , ⋯ , 𝑥$ ) = (𝑦' , 𝑦( , ⋯ , 𝑦$ ) ⇔ 𝑥' = 𝑦' , 𝑥( = 𝑦( , ⋯, 𝑥$ = 𝑦$ .

Definition: Cartesian product Lecture #5 Slides #36:


Given sets 𝐴' , 𝐴( , ⋯ , 𝐴$ , the Cartesian product of 𝐴' , 𝐴( , ⋯ , 𝐴$ , denoted 𝐴' × 𝐴( × ⋯ × 𝐴$ , is the set of all
ordered 𝑛-tuples (𝑎' , 𝑎( , ⋯ , 𝑎$ ) where 𝑎' ∈ 𝐴' , 𝑎( ∈ 𝐴( , ⋯ , 𝑎$ ∈ 𝐴$ . 𝐴' × 𝐴( × ⋯ × 𝐴$ = {(𝑎' , 𝑎( , ⋯ , 𝑎$ ) : 𝑎' ∈
𝐴' ∧ 𝑎( ∈ 𝐴( ∧ ⋯ ∧ 𝑎$ ∈ 𝐴$ }. If 𝐴 is a set, then 𝐴$ = 𝐴 × 𝐴 × ⋯ × 𝐴 (n many 𝐴’s).

Some Subset Relations Theorem 6.2.1:


Inclusion of Intersection: For all sets A and B, (a)A ∩ B ⊆ A (b) A ∩ B ⊆ B
Inclusion in Union: For all sets A and B, (a)A ⊆ A ∪ B (b)B ⊆ A ∪ B
Transitive Property of Subsets: For all sets A, B and C, A ⊆ B ∧ B ⊆ C → A ⊆ C.
Procedural Versions of Set DefinitionsLecture #5 Slides #40:
Let 𝑋 and 𝑌 be subsets of a universal set 𝑈 and suppose 𝑎 and 𝑏 are elements of 𝑈.
(1) 𝑎 ∈ 𝑋 ∪ 𝑌 ⇔ 𝑎 ∈ 𝑋 ∨ 𝑎 ∈ 𝑌 (2) 𝑎 ∈ 𝑋 ∩ 𝑌 ⇔ 𝑎 ∈ 𝑋 ∧ 𝑎 ∈ 𝑌 (3) 𝑎 ∈ 𝑋 − 𝑌 ⇔ 𝑎 ∈ 𝑋 ∧ 𝑎 ∉ 𝑌
(4)𝑎 ∈ 𝑋i ⇔ 𝑎 ∉ 𝑋 (5) (𝑎, 𝑏) ∈ 𝑋 × 𝑌 ⇔ 𝑎 ∈ 𝑋 ∧ 𝑏 ∈ 𝑌

Set Identities Theorem 6.2.2: *Just quote law name

Tutorial #3 Question #5 : For all sets 𝐴,𝐵,𝐶, 𝐴∩(𝐵 \ 𝐶)=(𝐴∩𝐵) \ 𝐶.

Tutorial #3 Question #6 : For all sets 𝐴,𝐵,𝐶, 𝐴 \ (𝐵 \ 𝐶)=(𝐴 \ 𝐵)∪(𝐴∩𝐶).

Tutorial #3 Question #8 : Let 𝐴 and 𝐵 be set. 𝐴⊆𝐵 if and only if 𝐴∪𝐵=𝐵.

Assignment #1 Question #6 :
(a) 𝐴⊆𝐵⇔𝒫(𝐴)⊆𝒫(𝐵). (Proved)
(b) (𝐴∪𝐵=𝐴∪𝐶)⇒𝐵=𝐶. (Disproved)
(c) (𝐴∩𝐵=𝐴∩𝐶)⇒𝐵=𝐶. (Disproved)
(d) (𝐴∪𝐵=𝐴∪𝐶)∧(𝐴∩𝐵=𝐴∩𝐶)⇒𝐵=𝐶. (Proved)

Assignment #2 Question #4: 𝐴=(𝐴 \ 𝐵)∪(𝐴∩𝐵).

Common questions:
1. Find power set – Just list out, can check by number of element
2. Prove set equality – Noted does the question mention set operation (also called element method, which is the
definition of sets and some propositional logic) or set identities
3. Find partition – Non-empty subsets + Mutually disjoint + Every element in exactly one of the component
Made by Tan Chee Xiang (Pallon)
Version 1.0
Made by Tan Chee Xiang (Pallon)
Version 1.0
Lecture 6: Relations
Definition: Relation Lecture #6 Slides #6:
Let 𝐴 and 𝐵 be sets. A (binary) relation from 𝑨 to 𝑩 is a subset of 𝑨×𝑩. Given an ordered pair (𝑥,𝑦) in 𝐴×𝐵, 𝒙 is
related to 𝒚 by 𝑹, or 𝒙 is 𝑹-related to 𝒚, written 𝒙 𝑹 𝒚, iff (𝒙,𝒚)∈𝑹.
* 𝑥 𝑅 𝑦 means (𝑥, 𝑦) ∈ 𝑅, 𝑥 𝑅 𝑦 means (𝑥, 𝑦) ∉ 𝑅

Definition: Domain, Co-domain, Range Lecture #6 Slides #9:


Let 𝐴 and 𝐵 be sets and 𝑅 be a relation from 𝐴 to 𝐵. The domain of 𝑅, 𝐷𝑜𝑚(𝑅), is the set {𝑎∈𝐴 :𝑎𝑅𝑏 for some 𝑏∈𝐵}.
The co-domain of 𝑅, 𝑐𝑜𝐷𝑜𝑚(𝑅), is the set 𝐵. The range of 𝑅, 𝑅𝑎𝑛𝑔𝑒(𝑅) , is the set {𝑏∈𝐵:𝑎𝑅𝑏 for some 𝑎∈𝐴}.

Definition: Inverse of a Relation Lecture #6 Slides #12:


Let 𝑅 be a relation from 𝐴 to 𝐵. The inverse relation 𝑅.' from 𝐵 to 𝐴 is: 𝑅.' = {(𝑦, 𝑥) ∈ 𝐵 × 𝐴 : (𝑥, 𝑦) ∈ 𝑅}.
* ∀𝑥 ∈ 𝐴, ∀𝑦 ∈ 𝐵 ‡(𝑦, 𝑥) ∈ 𝑅.' ⇔ (𝑥, 𝑦) ∈ 𝑅ˆ

Definition: Relation on a Set Lecture #6 Slides #12:


A relation on a set 𝑨 is a relation from 𝐴 to 𝐴. In other words, a relation on a set 𝐴 is a subset of 𝐴×𝐴 (𝐴( ).
* In general, we may write 𝐴$ for 𝐴 × … × 𝐴 (𝑛 times).

Definition: Composition of Relations Lecture #6 Slides #16:


Let 𝐴, 𝐵 and 𝐶 be sets. Let 𝑅⊆𝐴×𝐵 be a relation. Let 𝑆⊆𝐵×𝐶 be a relation. The composition of 𝑅 with 𝑆, denoted 𝑆∘𝑅,
is the relation from 𝐴 to 𝐶 such that: ∀𝑥∈𝐴,∀𝑧∈𝐶(𝑥 𝑆∘𝑅 𝑧⇔(∃𝑦∈𝐵 (𝑥𝑅𝑦∧𝑦𝑆𝑧)))
* There is a “path” from 𝑥 to 𝑧 via some intermediate element 𝑦 ∈ 𝐵 in the arrow diagram.

Proposition: Composition is Associative Lecture #6 Slides #18 Tutorial #4 Question #6:


Let 𝐴, 𝐵, 𝐶, 𝐷 be sets. Let 𝑅 ⊆ 𝐴 × 𝐵, 𝑆 ⊆ 𝐵 × 𝐶 and 𝑇 ⊆ 𝐶 × 𝐷 be relations. 𝑇 ∘ (𝑆 ∘ 𝑅) = (𝑇 ∘ 𝑆) ∘ 𝑅 = 𝑇 ∘ 𝑆 ∘ 𝑅

Proposition: Inverse of Composition Lecture #6 Slides #18:


Let 𝐴, 𝐵 and 𝐶 be sets. Let 𝑅 ⊆ 𝐴 × 𝐵 and 𝑆 ⊆ 𝐵 × 𝐶 be relations. (𝑆 ∘ 𝑅).' = 𝑅.' ∘ 𝑆 .'

Definition: 𝑛-ary Relation Lecture #6 Slides #19:


Given 𝑛 sets 𝐴' , 𝐴( , ⋯ , 𝐴$ , an 𝒏-ary relation 𝑹 on 𝐴' × 𝐴( × ⋯ × 𝐴$ is a subset of 𝐴' × 𝐴( × ⋯ × 𝐴$ . The special
cases of 2-ary, 3-ary and 4-ary relations are called binary, ternary and quaternary relations respectively.

Definition: Reflexivity, Symmetry, Transitivity Lecture #6 Slides #19:


Let 𝑅 be a relation on a set 𝐴.
𝑅 is reflexive iff ∀𝑥 ∈ 𝐴 (𝑥𝑅𝑥). *Prove: Let 𝑎 and prove 𝑎 𝑅 𝑎. *If A has n elements, R has at least n elements
𝑅 is symmetric iff ∀𝑥, 𝑦 ∈ 𝐴 (𝑥𝑅𝑦 ⇒ 𝑦𝑅𝑥). *Prove: Let 𝑎 𝑅 𝑏 and prove 𝑏 𝑅 𝑎.
𝑅 is transitive iff ∀𝑥, 𝑦, 𝑧 ∈ 𝐴 (𝑥𝑅𝑦 ∧ 𝑦𝑅𝑧 ⇒ 𝑥𝑅𝑧). *Prove: Let 𝑎
𝑅 𝑏 and 𝑏 𝑅 𝑐 , then prove 𝑎 𝑅 𝑐.
*Properties of a relation, not properties of members of the set.

Definition: Transitive Closure Lecture #6 Slides #31:


Let 𝐴 be a set and 𝑅 a relation on 𝐴. The transitive closure of 𝑅 is the relation 𝑅/ on 𝐴 that satisfies the following
three properties: (1) 𝑅/ is transitive. (2) 𝑅 ⊆ 𝑅/ . (3) If 𝑆 is any other transitive relation that contains 𝑅, then 𝑅/ ⊆ 𝑆.
*The relation obtained by adding the least number of ordered pairs to ensure transitivity is called the transitive closure
of the relation.

Definition: Partition Lecture #6 Slides #35:


C is a partition of a set 𝐴 if the following hold:
(1) C is a set of which all elements are non-empty subsets of 𝐴, i.e., ∅ ≠ 𝑆 ⊆ 𝐴 for all 𝑆 ∈ C.
(2) Every element of 𝐴 is in exactly one element of C, i.e., ∀𝑥 ∈ 𝐴 ∃𝑆 ∈ C (𝑥 ∈ 𝑆) and ∀𝑥 ∈ 𝐴 ∃𝑆' , 𝑆( , ∈ C (𝑥 ∈ 𝑆' ∧
𝑥 ∈ 𝑆( ⇒ 𝑆' = 𝑆( ).
*Shorter definition: A partition of set 𝐴 is a set C of non-empty subsets of 𝐴 such that ∀𝑥∈𝐴 ∃!𝑆∈C (𝑥∈𝑆).
* Lecture #6 Slides #34 A partition of a set 𝐴 is a finite or infinite collection of nonempty, mutually disjoint subsets
whose union is 𝐴.
*Elements of a partition are called components of the partition.
Made by Tan Chee Xiang (Pallon)
Version 1.0
Definition: Relation Induced by a Partition Lecture #6 Slides #38:
Given a partition C of a set 𝐴, the relation 𝑅 induced by the partition is defined on 𝐴 as follows: ∀𝑥,𝑦∈𝐴, 𝑥𝑅𝑦⇔∃ a
component 𝑆 of C s.t. 𝑥,𝑦∈𝑆.

Relation Induced by a Partition Theorem 8.3.1:


Let 𝐴 be a set with a partition and let 𝑅 be the relation induced by the partition. Then 𝑅 is reflexive, symmetric, and
transitive.
Definition: Equivalence Relation (Symbol ~) Lecture #6 Slides #40:
Let 𝐴 be a set and 𝑅 a relation on 𝐴. 𝑅 is an equivalence relation iff 𝑅 is reflexive, symmetric and transitive.

Definition: Equivalence Class Lecture #6 Slides #43:


Suppose 𝐴 is a set and ~ is an equivalence relation on 𝐴. For each 𝑎 ∈ 𝐴, the equivalence class of 𝑎, denoted [𝒂] and
called the class of 𝒂 for short, is the set of all elements 𝑥 ∈ 𝐴 s.t. 𝑎 is ~-related to 𝑥. [𝑎]~ = {𝑥 ∈ 𝐴 : 𝑎~𝑥 }

Equivalence Classes Lemma Rel.1:


Let ~ be an equivalence relation on a set 𝐴. The following are equivalent for all 𝑥,𝑦∈𝐴.
(i) 𝑥~𝑦 (ii) [𝑥]=[𝑦] (iii) [𝑥]∩[𝑦]≠∅.
The Partition Induced by an Equivalence Relation Theorem 8.3.4:
If 𝐴 is a set and 𝑅 is an equivalence relation on 𝐴, then the distinct equivalence classes of 𝑅 form a partition of 𝐴; that
is, the union of the equivalence classes is all of 𝐴, and the intersection of any two distinct classes is empty.
Definition: Congruence Lecture #6 Slides #53:
Let 𝑎, 𝑏 ∈ ℤ and 𝑛 ∈ ℤ- . Then 𝑎 is congruent to 𝑏 modulo 𝑛 iff 𝑎 − 𝑏 = 𝑛𝑘 for some 𝑘 ∈ ℤ. In other words,
𝑛 | (𝑎 − 𝑏). In this case, we write 𝑎 ≡ 𝑏 (mod 𝑛).

Proposition: Lecture #6 Slides #54:


Congruence-mod 𝑛 is an equivalence relation on ℤ for every 𝑛 ∈ ℤ- .
*It will form n distinct equivalence classes.

Definition: Set of equivalence classes Lecture #6 Slides #56:


Let 𝐴 be a set and ~ be an equivalence relation on 𝐴. Denote by 𝐴/~ the set of all equivalence classes with respect to ~,
i.e., 𝐴/~ ={[𝑥]_~ :𝑥∈𝐴}. We may read 𝐴/~ as “the quotient of 𝐴 by ~”.
*Which is the partition induced by equivalence relation.
Equivalence classes form a partition Theorem Rel.2:
Let ~ be an equivalence relation on a set 𝐴. Then 𝐴/~ is a partition of 𝐴.

Definition: Antisymmetry Lecture #6 Slides #63:


Let 𝑅 be a relation on a set 𝐴. 𝑅 is antisymmetric iff ∀𝑥, 𝑦 ∈
𝐴 (𝑥 𝑅 𝑦 ∧ 𝑦 𝑅 𝑥 ⇒ 𝑥 = 𝑦).
*𝑅 is not antisymmetric iff ∃𝑥, 𝑦 ∈ 𝐴 (𝑥 𝑅 𝑦 ∧ 𝑦 𝑅 𝑥 ∧ 𝑥 ≠ 𝑦).
*Different with not symmetric

Definition: Partial Order Relation (Symbol ≼ (Curly less than or equal to)) Lecture #6 Slides #68:
Let 𝑅 be a relation on a set 𝐴. Then 𝑅 is a partial order relation (or simply partial order) iff 𝑅 is reflexive,
antisymmetric and transitive.
*May view as a set of tasks

Definition: Partially Ordered Set Lecture #6 Slides #68:


A set 𝐴 is called a partially ordered set (or poset) with respect to a partial order relation 𝑅 on 𝐴, denoted by (𝐴,𝑅).
Definition: Comparability Lecture #6 Slides #79:
Suppose ≼ is a partial order relation on a set 𝐴. Elements 𝑎 and 𝑏 of 𝐴 are said to be comparable iff either 𝑎≼𝑏 or
𝑏≼𝑎. Otherwise, 𝑎 and 𝑏 are noncomparable.

Made by Tan Chee Xiang (Pallon)


Version 1.0
Definition: Maximal, minimal, largest, smallest Lecture #6 Slides #80:
Let a set 𝐴 be partially ordered with respect to a relation ≼ and 𝑐∈𝐴.
(1) 𝑐 is a maximal element of 𝐴 iff ∀𝑥∈𝐴, either 𝑥≼𝑐, or 𝑥 and 𝑐 are not comparable. Alternatively, 𝑐 is a maximal
element of 𝐴 iff ∀𝑥∈𝐴 (𝑐≼𝑥⇒𝑐=𝑥.)
(2) 𝑐 is a minimal element of 𝐴 iff ∀𝑥∈𝐴, either 𝑐≼𝑥, or 𝑥 and 𝑐 are not comparable. Alternatively, 𝑐 is a minimal
element of 𝐴 iff ∀𝑥∈𝐴 (𝑥≼𝑐⇒𝑐=𝑥). (Nothing is below)
(3) 𝑐 is the largest element / greatest element / maximum of 𝐴 iff ∀𝑥∈𝐴 (𝑥≼𝑐).
(4) 𝑐 is the smallest element / least element / minimum of 𝐴 iff ∀𝑥∈𝐴 (𝑐≼𝑥). (Everything is above)

Proposition: A smallest element is minimal / A largest element is maximal. Lecture #6 Slides #83:
Consider a partial order ≼ on a set 𝐴. Any smallest element is minimal and any largest element is maximal.
Definition: Total Order Relations Lecture #6 Slides #86:
If 𝑅 is a partial order relation on a set 𝐴, and for any two elements 𝑥 and 𝑦 in 𝐴, either 𝑥 𝑅 𝑦 or 𝑦 𝑅 𝑥, then 𝑅 is a total
order relation (or simply total order) on 𝐴. 𝑅 is a total order iff 𝑅 is a partial order and ∀𝑥,𝑦∈𝐴 (𝑥 𝑅 𝑦 ∨𝑦 𝑅 𝑥).
*Hasse diagram of total order is one single line (chain)
Definition: Linearization of a partial order Lecture #6 Slides #87:
Let ≼ be a partial order on a set 𝐴. A linearization of ≼ is a total order ≼∗ on
𝐴 such that ∀𝑥, 𝑦 ∈ 𝐴 (𝑥 ≼ 𝑦 ⇒ 𝑥 ≼∗ 𝑦).
*Linearization of a total order is the total order itself.
*If two elements are not comparable, their order can be interchangeable as long
as does not violate the conditions.

Definition: Well-Ordered Set Lecture #6 Slides #91:


Let ≼ be a total order on a set 𝐴. 𝐴 is well-ordered iff every non-empty subset of 𝐴 contains a smallest element.
Symbolically, ∀𝑆 ∈ 𝒫(𝐴), 𝑆 ≠ ∅ ⇒ ‡∃𝑥 ∈ 𝑆 ∀𝑦 ∈ 𝑆 (𝑥 ≼ 𝑦)ˆ

Tutorial #4 Question #2: The following are logically equivalent:


(1) 𝑅 is symmetric, i.e. ∀𝑥,𝑦∈𝐴 (𝑥 𝑅 𝑦 ⇒𝑦 𝑅 𝑥). (2) ∀𝑥,𝑦∈𝐴 (𝑥 𝑅 𝑦 ⇔𝑦 𝑅 𝑥) (3) 𝑅=𝑅−1

Tutorial #4 Question #9:


(a) if 𝑥∈𝑆∈ C, then [𝑥]=𝑆. (b) 𝐴/~= C.

Definition: Reflexive closure Tutorial #5 Question #5:


Let 𝐴 be a set and 𝑅 a relation on 𝐴. It is the smallest relation on 𝐴 that is reflexive and contains 𝑅 as a subset.

Definition: Asymmetry Tutorial #5 Question #6:


∀𝑥,𝑦∈𝐴 (𝑥 𝑅 𝑦⇒𝑦 𝑅/ 𝑥).

Tutorial #5 Question #6: Every asymmetric relation is antisymmetric. (asymmetry property forces the antisymmetry
property to be vacuously true.)

Tutorial #5 Question #7: Consider a set 𝐴 and a total order ≼ on 𝐴. Show that all minimal elements are smallest.

Definition: Comparable, compatible Tutorial #5 Question #8:


We say 𝑎,𝑏 are comparable iff 𝑎≼𝑏 or 𝑏≼𝑎. We say 𝑎,𝑏 are compatible iff there exists 𝑐∈𝐴 such that 𝑎≼𝑐 and 𝑏≼𝑐.

Tutorial #5 Question #10: In all partially ordered sets, any two comparable elements are compatible.

Common questions:
1. Find relation – Use definition of relation, definition of inverse relation, definition of composition of relations
2. Find equivalence class – Use definition of equivalence class, definition of ~
3. Proof equivalence – Proof Reflexivity, Symmetry, Transitivity

Made by Tan Chee Xiang (Pallon)


Version 1.0
Type of Type Irreflexive Reflexive Symmetric Antisymmetric Asymmetric Transitive Antitransitive
relation
Equal Equivalence No Yes Yes Yes No Yes No
Relation on ℚ
Congruence- Equivalence No Yes Yes No No Yes No
mod 𝑛
Relation Equivalence No Yes Yes No No Yes No
Induced by a
Partition
Cardinality Equivalence No Yes Yes No No Yes No
Divisibility Partial order No Yes No Yes No Yes No
(For all (Not total
positive order)
integers)
Divisibility No Yes No No No Yes No
(For all
integers)
Less than or Partial order No Yes No Yes No Yes No
equal to (For (Total order)
natural (Well-
numbers or ordered)
any lower
bounded set)
Less than or Partial order No Yes No Yes No Yes No
equal to (For (Total order)
any non- (Not well-
lower ordered)
bounded set)
Less than Yes No No Yes Yes Yes No
(Rational
numbers)
Subset Partial order No Yes No Yes No Yes No
(Not total
order)
Proper Subset Yes No No Yes Yes Yes No
Empty Equivalence Yes Yes Yes Yes Yes Yes Yes
relation (on & partial
empty set) order (Total
order)
(Well-
ordered)
Empty Yes No Yes Yes Yes Yes Yes
relation (on
non-empty
set)

Arrow diagram Directed graph Hasse Diagrams


Represent the elements of 𝐴 as points Instead of representing 𝐴 as two For all distinct 𝑥, 𝑦, 𝑚 ∈ 𝐴: If 𝑥 ≼
in one region and the elements of 𝐵 separate sets of points, represent 𝐴 𝑦 and no 𝑚 ∈ 𝐴 is such that 𝑥 ≼
as points in another region. For each 𝑚 ≼ 𝑦, then 𝑥 is placed below 𝑦
Made by Tan Chee Xiang (Pallon)
Version 1.0
𝑥∈𝐴 and 𝑦∈𝐵, draw an arrow from 𝑥 only once, and draw an arrow from with a line joining them, else no
to 𝑦 iff 𝑥𝑅𝑦. each point of 𝐴 to its related point. line joins 𝑥 and 𝑦.
If a point is related to itself, a loop is
drawn that extends out from the
point and goes back to it.
For relation on two different sets For relation on a set For relation on a set (Partial order)

Made by Tan Chee Xiang (Pallon)


Version 1.0
Lecture 7: Functions
Definition: Function Lecture #7 Slides #7:
A function 𝑓 from a set 𝑋 to a set 𝑌, denoted 𝑓: 𝑋 → 𝑌, is a relation satisfying the following properties:
(1)∀𝑥 ∈ 𝑋 ∃𝑦 ∈ 𝑌 (𝑥, 𝑦) ∈ 𝑓.
(2) ∀𝑥 ∈ 𝑋 ∀𝑦' , 𝑦( ∈ 𝑌 ’‡(𝑥, 𝑦' ) ∈ 𝑓 ∧ (𝑥, 𝑦( ) ∈ 𝑓ˆ → 𝑦' = 𝑦( “. (That is, the 𝑦 in (1) is unique.)
*Alternatively: ∀𝑥 ∈ 𝑋 ∃! 𝑦 ∈ 𝑌 (𝑥, 𝑦) ∈ 𝑓.
*Informally: A function from 𝑋 to 𝑌 is an assignment to each element of 𝑋 exactly one element of 𝑌. Every element in
𝑋 relates to exactly one element in 𝑌.
*Arrow diagram for finite sets function:
(1) Every element of 𝑋 has an arrow coming out of it.
(2) No element of 𝑋 has two arrows coming out of it that point to two different elements of 𝑌.

Definition: Argument, image, preimage, input, output Lecture #7 Slides #11:


Let 𝑓: 𝑋 → 𝑌 be a function. We write 𝑓(𝑥) = 𝑦 iff (𝑥, 𝑦) ∈ 𝑓. We say that “𝑓 sends/maps 𝑥 to 𝑦” and we may also
2
write 𝑥 → 𝑦 or 𝑓: 𝑥 ⟼ 𝑦. Also, 𝑥 is called the argument of 𝑓. 𝑓(𝑥) is read “𝑓 of 𝑥”, or “the output of 𝑓 for the input
𝑥”, or “the value of 𝑓 at 𝑥”, or “the image of 𝑥 under 𝑓”. If 𝑓(𝑥) = 𝑦, then 𝑥 is a preimage of 𝑦.
*To summarise: 𝑥 is argument or input (of 𝑓) and preimage (of 𝑦). 𝑓(𝑥) is the output (of 𝑓 for 𝑥) and image (of 𝑥
under 𝑓)
Definition: Setwise image and preimage Lecture #7 Slides #12:
Let 𝑓: 𝑋 → 𝑌 be a function from set 𝑋 to set 𝑌.
If 𝐴 ⊆ 𝑋, then let 𝑓(𝐴) = {𝑓(𝑥) : 𝑥 ∈ 𝐴}.
If 𝐵 ⊆ 𝑌, then let 𝑓 .' (𝐵) = {𝑥 ∈ 𝑋 : 𝑓(𝑥) ∈ 𝐵}
We call 𝑓(𝐴) the (setwise) image of 𝐴, and 𝑓 .' (𝐵) the
(setwise) preimage of 𝐵 under 𝑓.
*Setwise preimage needs not be a function

Definition: Domain, co-domain, range Lecture #7 Slides #16:


Let 𝑓: 𝑋 → 𝑌 be a function. 𝑋 is the domain of 𝑓 and 𝑌 the co-domain of 𝑓. The range of 𝑓 is the (setwise) image of 𝑋
under 𝑓: {𝑦∈𝑌 :𝑦=𝑓(𝑥) for some 𝑥∈𝑋}.
* Range ⊆ Co-domain
Definition: Sequence Lecture #7 Slides #18:
A sequence 𝑎& , 𝑎' , 𝑎( , ⋯ can be represented by a function 𝑎 whose domain is ℤ3& that satisfies 𝑎(𝑛) = 𝑎$ for every
𝑛 ∈ ℤ3& . *In this sense, any function whose domain is ℤ34 for some 𝑚 ∈ ℤ represents a sequence.
Definition: Fibonacci Sequence Lecture #7 Slides #19:
The Fibonacci sequence 𝐹& , 𝐹' , 𝐹( , ⋯ is defined by setting, for each 𝑛 ∈ ℤ3& , 𝐹& = 0 and 𝐹' = 1 and 𝐹$-( = 𝐹$-' +
𝐹$ . *Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, …

Definition: String Lecture #7 Slides #20:


Let 𝐴 be a finite set with at least one element. A string or a word over 𝐴 is an expression of the form 𝑎& 𝑎' 𝑎( ⋯ 𝑎5.'
(finite sequence) where 𝑙 ∈ ℤ3& and 𝑎& , 𝑎' , 𝑎( , ⋯ , 𝑎5.' ∈ 𝐴. The elements of A are called characters of the string.
Here 𝑙 is called the length of the string. The empty string / null string 𝜀 is the string of length 0. Let 𝐴∗ denote the set
of all strings over 𝐴.

Equality of Sequences Lecture #7 Slides #21:


Given two sequences 𝑎& , 𝑎' , 𝑎( , ⋯ and 𝑏& , 𝑏' , 𝑏( , ⋯ defined by the functions 𝑎(𝑛) = 𝑎$ and 𝑏(𝑛) = 𝑏$ respectively
for every 𝑛 ∈ ℤ3& , we say that the two sequences are equal if and only if 𝑎(𝑛) = 𝑏(𝑛) for every 𝑛 ∈ ℤ3& .

Equality of Strings Lecture #7 Slides #21:


Given two strings 𝑠' = 𝑎& 𝑎' 𝑎( ⋯ 𝑎5.' and 𝑠( = 𝑏& 𝑏' 𝑏( ⋯ 𝑏5.' where 𝑙 ∈ ℤ3& , we say that 𝑠' = 𝑠( if and only if 𝑎# =
𝑏# for all 𝑖 ∈ {0,1,2, … , 𝑙 − 1}.

Made by Tan Chee Xiang (Pallon)


Version 1.0
Function Equality Theorem 7.1.1:
Two functions 𝑓: 𝐴 → 𝐵 and 𝑔: 𝐶 → 𝐷 are equal, i.e. 𝑓 = 𝑔, iff (i) 𝐴 = 𝐶 and 𝐵 = 𝐷, and (ii) 𝑓(𝑥) = 𝑔(𝑥) ∀𝑥 ∈ 𝐴.

Definition: Injection (one-to-one function) Lecture #7 Slides #25:


A function 𝑓: 𝑋 → 𝑌 is injective (or one-to-one) iff ∀𝑥' , 𝑥( ∈ 𝑋 (𝑓(𝑥' ) = 𝑓(𝑥( ) ⇒ 𝑥' = 𝑥( ). or, equivalently
(contrapositive), 𝑥' ≠ 𝑥( ⇒ 𝑓(𝑥' ) ≠ 𝑓(𝑥( ). An injective function is called an injection.
*Informally: Every element of 𝑋 has a unique image in 𝑌 such that no other element of 𝑋 has the same image.
*Every element of 𝑌 has at most one preimage.
*A function 𝑓: 𝑋 → 𝑌 is not injective iff ∃𝑥' , 𝑥( ∈ 𝑋 (𝑓(𝑥' ) = 𝑓(𝑥( ) ∧ 𝑥' ≠ 𝑥( ).
*To prove:
(1) Let 𝑥' , 𝑥( ∈ 𝑋 such that 𝑓(𝑥' ) = 𝑓(𝑥( ). (2) Show 𝑥' = 𝑥( .
Definition: Surjection (onto function) Lecture #7 Slides #27:
A function 𝑓: 𝑋 → 𝑌 is surjective (or onto) iff ∀𝑦 ∈ 𝑌 ∃𝑥 ∈ 𝑋 ‡𝑦 = 𝑓(𝑥)ˆ. Every element in the co-domain has a
preimage. So, range = co-domain. A surjective function is called a surjection.
*Every element of 𝑌 has at least one preimage.
*A function 𝑓: 𝑋 → 𝑌 is not surjective iff ∃𝑦 ∈ 𝑌 ∀𝑥 ∈ 𝑋 ‡𝑦 ≠ 𝑓(𝑥)ˆ.
*To prove:
(1) Let 𝑦 ∈ 𝑌. (2) Show 𝑦 = 𝑓(𝑥).
Definition: Bijection (one-to-one correspondence) Lecture #7 Slides #27:
A function 𝑓: 𝑋 → 𝑌 is bijective iff 𝑓 is injective and surjective, i.e. ∀𝑦 ∈ 𝑌 ∃! 𝑥 ∈ 𝑋 ‡𝑦 = 𝑓(𝑥)ˆ. A bijective function
is called a bijection or one-to-one correspondence.
*Every element of 𝑌 has exactly one preimage.
Definition: Inverse function Lecture #7 Slides #31:
Let 𝑓: 𝑋 → 𝑌. Then 𝑔: 𝑌 → 𝑋 is an inverse of 𝑓 iff ∀𝑥 ∈ 𝑋 ∀𝑦 ∈ 𝑌 ‡𝑦 = 𝑓(𝑥) ⇔ 𝑥 = 𝑔(𝑦)ˆ . We denote the inverse
of 𝑓 as 𝑓 .' .

Proposition: Uniqueness of inverses Lecture #7 Slides #34:


If 𝑔' and 𝑔( are inverses of 𝑓: 𝑋 → 𝑌, then 𝑔' = 𝑔( .
Theorem 7.2.3: If 𝑓: 𝑋 → 𝑌 is a bijection, then 𝑓 .' : 𝑌 → 𝑋 is also a bijection. In other words, 𝑓: 𝑋 → 𝑌 is bijective iff
𝑓 has an inverse.

Definition: Composition of Functions Lecture #7 Slides #39:


Let 𝑓: 𝑋 → 𝑌 and 𝑔: 𝑌 → 𝑍 be functions. Define a new function 𝑔 ∘ 𝑓: 𝑋 → 𝑍 as follows: (𝑔 ∘ 𝑓)(𝑥) = 𝑔‡𝑓(𝑥)ˆ ∀𝑥 ∈
𝑋. where 𝑔 ∘ 𝑓 is read “𝑔 circle 𝑓” and 𝑔‡𝑓(𝑥)ˆ is read “𝑔 of 𝑓 of 𝑥”. The function 𝑔 ∘ 𝑓 is called the composition of
𝑓 and 𝑔.

Definition: Identity function Lecture #7 Slides #41:


The identity function on a set 𝑋, 𝑖𝑑𝑋, is the function from 𝑋 to 𝑋 defined by 𝑖𝑑6 (𝑥) = 𝑥 for all 𝑥 ∈ 𝑋.

Composition with an Identity Function Theorem 7.3.1: Let 𝑓: 𝑋 → 𝑌. 𝑓 ∘ 𝑖𝑑6 = 𝑓 and 𝑖𝑑7 ∘ 𝑓 = 𝑓.

Composition of a Function with Its Inverse Theorem 7.3.2: Let 𝑓: 𝑋 → 𝑌. 𝑓 .' ∘ 𝑓 = 𝑖𝑑6 and 𝑓 ∘ 𝑓 .' = 𝑖𝑑7 .

Theorem: Associativity of Function Composition Lecture #7 Slides #47:


Let 𝑓: 𝐴 → 𝐵, 𝑔: 𝐵 → 𝐶 and ℎ: 𝐶 → 𝐷. Then (ℎ ∘ 𝑔) ∘ 𝑓 = ℎ ∘ (𝑔 ∘ 𝑓). Function composition is associative.
*Because a function is a relation.
*Noncommutativity of Function Composition Lecture #7 Slides #48: (𝑔 ∘ 𝑓)(𝑥) ≠ (𝑓 ∘ 𝑔)(𝑥)

Composition of Injections Theorem 7.3.3: If 𝑓: 𝑋 → 𝑌 and 𝑔: 𝑌 → 𝑍 are both injective, then 𝑔 ∘ 𝑓 is injective.

Composition of Surjections Theorem 7.3.4: If 𝑓: 𝑋 → 𝑌 and 𝑔: 𝑌 → 𝑍 are both surjective, then 𝑔 ∘ 𝑓 is surjective.

Made by Tan Chee Xiang (Pallon)


Version 1.0
Notation: Lecture #7 Slides #54:
The quotient ℤ/~$ where ~$ is the congruence-mod-𝑛 relation on ℤ, is denoted ℤ$ .

Definition: Addition and Multiplication on ℤ𝒏 Lecture #7 Slides #56:


Define addition + and multiplication ∙ on ℤ$ as follows: whenever [𝑥], [𝑦] ∈ ℤ$ , [𝑥] + [𝑦] = [𝑥 + 𝑦] and [𝑥] ∙ [𝑦] =
[𝑥 ∙ 𝑦]

Proposition: Addition on ℤ𝒏 is well defined Lecture #7 Slides #57:


For all 𝑛 ∈ ℤ- and all [𝑥' ], [𝑦' ], [𝑥( ], [𝑦( ] ∈ ℤ$ , [𝑥' ] = [𝑥( ] and [𝑦' ] = [𝑦( ] ⇒ [𝑥' ] + [𝑦' ] = [𝑥( ] + [𝑦( ].
*To prove addition well defined:
(1) Let [𝑥' ], [𝑦' ], [𝑥( ], [𝑦( ] ∈ ℤ$ such that [𝑥' ] = [𝑥( ] and [𝑦' ] = [𝑦( ].
(2) Then 𝑥' ≡ 𝑥( (mod 𝑛) and 𝑦' ≡ 𝑦( (mod 𝑛) by the definition of congruence. (Or other setting)
(3) …
(4) So 𝑥' + 𝑦' ≡ 𝑥( + 𝑦( (mod 𝑛). (Or other setting)
(5) Therefore, [𝑥' ] + [𝑦' ] = [𝑥' + 𝑦' ] = [𝑥( + 𝑦( ] = [𝑥( ] + [𝑦( ].
Proposition: Multiplication on ℤ𝒏 is well defined Lecture #7 Slides #58:
For all 𝑛 ∈ ℤ- and all [𝑥' ], [𝑦' ], [𝑥( ], [𝑦( ] ∈ ℤ$ , [𝑥' ] = [𝑥( ] and [𝑦' ] = [𝑦( ] ⇒ [𝑥' ] ∙ [𝑦' ] = [𝑥( ] ∙ [𝑦( ].
*To prove addition well defined:
(1) Let [𝑥' ], [𝑦' ], [𝑥( ], [𝑦( ] ∈ ℤ$ such that [𝑥' ] = [𝑥( ] and [𝑦' ] = [𝑦( ].
(2) Then 𝑥' ≡ 𝑥( (mod 𝑛) and 𝑦' ≡ 𝑦( (mod 𝑛) by the definition of congruence. (Or other setting)
(3) …
(4) So 𝑥' + 𝑦' ≡ 𝑥( + 𝑦( (mod 𝑛). (Or other setting)
(5) Therefore, [𝑥' ] ∙ [𝑦' ] = [𝑥' ∙ 𝑦' ] = [𝑥( ∙ 𝑦( ] = [𝑥( ] ∙ [𝑦( ]

Tutorial #6 Question #6: Let 𝑓:𝐵→𝐶. If function 𝑔 with domain 𝐶 such that 𝑔∘𝑓 is injective, 𝑓 is injective.

Tutorial #6 Question #7: Let 𝑓:𝐵→𝐶. If function 𝑒 with codomain 𝐵 such that 𝑓∘𝑒 is surjective, 𝑓 is surjective.

Tutorial #6 Question #9: Let 𝑓:𝐴→𝐵 be a function. Let 𝑋⊆𝐴 and 𝑌⊆𝐵. 𝑋⊆𝑓−1(𝑓(𝑋)). 𝑓(𝑓−1(𝑌))⊆𝑌.

Function (Generally, may have specific case) Injective Surjective Bijective


Linear function (On unbounded domain and codomain) Yes Yes Yes
Quadratic function (On unbounded domain and codomain) No No No

Common question:
1. Determine whether a relation is a function: Proof by the two condition of function or disproof by counterexample
2. Determine whether a function is bijection: Proof injective and surjective or Theorem 7.2.3: If 𝑓: 𝑋 → 𝑌 is a
bijection, then 𝑓 .' : 𝑌 → 𝑋 is also a bijection. In other words, 𝑓: 𝑋 → 𝑌 is bijective iff 𝑓 has an inverse.
3. Len(): Careful that the argument is element or set
4. Determine whether a function has inverse: Theorem 7.2.3: If 𝑓: 𝑋 → 𝑌 is a bijection, then 𝑓 .' : 𝑌 → 𝑋 is also a
bijection. In other words, 𝑓: 𝑋 → 𝑌 is bijective iff 𝑓 has an inverse.
5. Determine well-defined: Proof [𝑥1]*[𝑦1]=[𝑥2]*[𝑦2] by Lemma Rel.1.

Made by Tan Chee Xiang (Pallon)


Version 1.0
Made by Tan Chee Xiang (Pallon)
Version 1.0
Lecture 8: Mathematical Induction
Definition: Sequence and Terms Lecture #8 Slides #5:
A sequence is an ordered set with members called terms. Usually, the terms are numbers. A sequence may have
infinite terms.
*General form: 𝑎4 , 𝑎4-' , 𝑎4-( , ⋯ , 𝑎$ where 𝑚 ≤ 𝑛. The 𝑘 in 𝑎9 is called a subscript or index.
*Infinite sequence: 𝑎4 , 𝑎4-' , 𝑎4-( , ⋯
*An explicit formula for a sequence is a rule that shows how the values of 𝑎9 depend on 𝑘.
Definition: Summation Lecture #8 Slides #7:
If 𝑚 and 𝑛 are integers, 𝑚 ≤ 𝑛, the symbol ∑$9%4 𝑎9 is the sum of all the terms 𝑎4 , 𝑎4-' , 𝑎4-( , ⋯ , 𝑎$ . We say that
𝑎4 + 𝑎4-' + 𝑎4-( + ⋯ + 𝑎$ is the expanded form of the sum, and we write ∑$9%4 𝑎9 = 𝑎4 + 𝑎4-' + 𝑎4-( +
⋯ + 𝑎$ . We call 𝑘 the index of the summation, 𝑚 the lower limit of the summation and 𝑛 the upper limit of the
summation.
*Summation can be expressed using recursive definition. If 𝑚 is any integer, then ∑49%4 𝑎9 = 𝑎4 and
$ $.'
∑9%4 𝑎9 = ‡∑9%4 𝑎9 ˆ + 𝑎$ for all integers 𝑛 > 𝑚.
*An empty sum (eg: ∑$9%4 𝑎9 where 𝑚 > 𝑛) is equal to the additive identity 0.
*Some sums can be transformed into telescoping sums, which then can be rewritten as a simple expression.
*The index is dummy variable.
Definition: Product Lecture #8 Slides #11:
If 𝑚 and 𝑛 are integers, 𝑚 ≤ 𝑛, the symbol ∏$9%4 𝑎9 is the product of all the terms 𝑎4 , 𝑎4-' , 𝑎4-( , ⋯ , 𝑎$ . We write
∏$9%4 𝑎9 = 𝑎4 ∙ 𝑎4-' ∙ 𝑎4-( ∙ ⋯ ∙ 𝑎$ .
*Recursive definition for the product notation: If 𝑚 is any integer, then ∏4 $ $.'
9%4 𝑎9 = 𝑎4 and ∏9%4 𝑎9 = ‡∏9%4 𝑎9 ˆ ∙
𝑎$ for all integers 𝑛 > 𝑚.
*An empty product (eg: ∏$9%4 𝑎9 where 𝑚 > 𝑛) is equal to the multiplicative identity 1.

Properties of Summations and Products Theorem 5.1.1:


If 𝑎4 , 𝑎4-' , 𝑎4-( , ⋯ and 𝑏4 , 𝑏4-' , 𝑏4-( , ⋯ are sequences of real numbers and 𝑐 is any real number , then the
following equations hold for any integer 𝑛 ≥ 𝑚:
(1) ∑$9%4 𝑎9 + ∑$9%4 𝑏9 = ∑$9%4(𝑎9 + 𝑏9 ) (Proof by mathematical induction)
(2) 𝑐 ∙ ∑$9%4 𝑎9 = ∑$9%4 𝑐 ∙ 𝑎9 (generalized distributive law)
(3) (∏$9%4 𝑎9 ) ∙ (∏$9%4 𝑏9 ) = (∏$9%4(𝑎9 ∙ 𝑏9 ))

Definition: Arithmetic Sequence Lecture #8 Slides #18:


A sequence 𝑎& , 𝑎' , 𝑎( , ⋯ is called an arithmetic sequence (or arithmetic progression) iff there is a constant 𝑑 such
that 𝑎9 = 𝑎9.' + 𝑑 for all integers 𝑘 ≥ 1. If follows that, 𝑎$ = 𝑎& + 𝑑𝑛 for all integers 𝑛 ≥ 0.
*𝑑 is the common difference, 𝑎& the initial value.
$
*Summing an arithmetic sequence of 𝑛 terms: ∑$.' 9%& 𝑎9 = ( (2𝑎& + (𝑛 − 1)𝑑)

Definition: Geometric Sequence Lecture #8 Slides #19:


A sequence 𝑎& , 𝑎' , 𝑎( , ⋯ is called a geometric sequence (or geometric progression) iff there is a constant 𝑟 such that
𝑎9 = 𝑟𝑎9.' for all integers 𝑘 ≥ 1. If follows that, 𝑎$ = 𝑎& 𝑟 $ for all integers 𝑛 ≥ 0.
*𝑟 is the common ratio, 𝑎& the initial value.
'.: !
*Summing a geometric sequence of 𝑛 terms (𝑟 ≠ 1), ∑$.'
9%& 𝑎9 = 𝑎& ’ '.: “

Squares 1, 4, 9, 16, 25, 36, 49, …


Triangle numbers 1, 3, 6, 10, 15, 21, 28, …
Fibonacci numbers: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, …
Lazy Caterer’s Sequence: 1, 2, 4, 7, 11, 16, …

Definition: Principle of Mathematical Induction (PMI) Lecture #8 Slides #24:


Let 𝑃(𝑛) be a property that is defined for integers 𝑛, and let 𝑎 be a fixed integer. Suppose the following 2 statements

Made by Tan Chee Xiang (Pallon)


Version 1.0
are true: (1) 𝑃(𝑎) is true. (2) For all integers 𝑘 ≥ 𝑎, if 𝑃(𝑘) is true then 𝑃(𝑘 + 1) is true. Then the statement “for all
integers 𝑛 ≥ 𝑎, 𝑃(𝑛)” is true.

Weak (regular) induction (or 1PI) (1) 𝑃(𝑎) holds


(2) For every 𝑘 ≥ 𝑎, 𝑃(𝑘) ⇒ 𝑃(𝑘 + 1)
Strong induction (or 2PI) (1) 𝑃(𝑎) holds
(2) For every 𝑘 ≥ 𝑎, ‡𝑃(𝑎) ∧ 𝑃(𝑎 + 1) ∧ ⋯ 𝑃(𝑘)ˆ ⇒
𝑃(𝑘 + 1)
Strong induction (or 2PI) (variation – other variations (1) 𝑃(𝑎), 𝑃(𝑎 + 1), … , 𝑃(𝑏) hold
possible) (2) For every 𝑘 ≥ 𝑎, 𝑃(𝑘) ⇒ 𝑃(𝑘 + 𝑏 − 𝑎 + 1)

Sum of the First 𝒏 Integers Theorem 5.2.2 (5th: 5.2.1):


$($-')
For all integers 𝑛 ≥ 1, 1 + 2 + 3 + ⋯ + 𝑛 = (Proof by mathematical induction)
(

Sum of Geometric Sequence Theorem 5.2.3 (5th: 5.2.2)


: !"# .'
For any real number 𝑟 ≠ 1, and any integers 𝑛 ≥ 0, ∑$#%& 𝑟 # = (Proof by mathematical induction)
:.'

Definition: Closed Form Lecture #8 Slides #27:


If a sum with a variable number of terms is shown to be equal to a formula that does not contain either an ellipsis (…)
or a summation symbol (S), we say that it is written in closed form.

Proposition 5.3.1 (5th: 5.3.2) Lecture #8 Slides #29:


For all integers 𝑛 ≥ 0, 2($ − 1 is divisible by 3. (Proof by mathematical induction)

Proposition 5.3.2 (5th: 5.3.3) Lecture #8 Slides #30:


For all integers 𝑛 ≥ 3, 2𝑛 + 1 < 2$ (Proof by mathematical induction)

Term: Well-Ordering Principle for the Integers Lecture #8 Slides #43:


Every nonempty subset of ℤ3& has a smallest element. (Proof by contradiction & MI)

Definition: Recurrence relation Lecture #8 Slides #48:


A recurrence relation for a sequence 𝑎& , 𝑎' , 𝑎( , ⋯ is a formula that relates each term 𝑎9 to certain of its predecessors
𝑎9.' , 𝑎9.( , ⋯ , 𝑎9.# , where 𝑖 is an integer with 𝑘 − 𝑖 ≥ 0. If 𝑖 is a fixed integer , the initial conditions for such a
recurrent relation specify the values of 𝑎& , 𝑎' , 𝑎( , ⋯ , 𝑎#.' . If 𝑖 depends on 𝑘, the initial conditions specify the values
of 𝑎& , 𝑎' , 𝑎( , ⋯ , 𝑎4 , where 𝑚 is an integer with 𝑚 ≥ 0.
*Initial condition + Recurrence relation = Recursive definition

Term: Recursive definition of of a set 𝑺 Lecture #8 Slides #58:


(Base clause) Specify that certain elements, called founders, are in S: if 𝑐 is a founder, then 𝑐 ∈ 𝑆.
(Recursion clause) Specify certain functions, called constructors, under which the set 𝑆 is closed: if 𝑓 is a constructor
and 𝑥 ∈ 𝑆, then 𝑓(𝑥) ∈ 𝑆.
(Minimality clause) Membership for 𝑆 can always be demonstrated by (infinitely many) successive applications of the
clauses above.
Term: Structural induction over 𝑺 Lecture #8 Slides #58:
To prove that ∀𝑥 ∈ 𝑆 𝑃(𝑥) is true, where each 𝑃(𝑥) is a proposition, it suffices to:
(Basis step) Show that 𝑃(𝑐) is true for every founder 𝑐; and
(Induction step) Show that ∀𝑥 ∈ 𝑆 ’𝑃(𝑥) ⇒ 𝑃‡𝑓(𝑥)ˆ“ is true for every constructor 𝑓.
In words, if all the founders satisfy a property 𝑃, and 𝑃 is preserved by all constructors, then all elements of 𝑆 satisfy
𝑃.
Common questions:
1. Prove closed form
2. Prove inequality: In inductive step will get ≥ = ≥
Made by Tan Chee Xiang (Pallon)
Version 1.0
3. Proof about set: In inductive step try to take out one element and proof by divided into case
4. Proof divisibility: In inductive step, use the formula in inductive hypothesis
5. Proof something like ∀𝒏∈ℤ≥𝟖 ∃𝒙,𝒚∈ℕ (𝒏=𝟑𝒙+𝟓𝒚). Use 1PI or 2PI
6. Proof fibonacci: If the question didn’t specify induction, can don’t use
7. Structural induction and recursive definition: To proof element exists, use base clause and recursion clause;
To disproof element exist, use structural induction to find a property that the element doesn’t fulfil or use
recursion clause.
Lecture 9: Cardinality
Definition: Pigeonhole Principle Lecture #9 Slides #6:
Let 𝐴 and 𝐵 be finite sets. If there is an injection 𝑓: 𝐴 → 𝐵, then |𝐴| ≤ |𝐵|. Contrapositive: Let 𝑚, 𝑛 ∈ ℤ- with 𝑚 >
𝑛. If 𝑚 pigeons are put into 𝑛 pigeonholes, then there must be (at least) one pigeonhole with (at least) two pigeons.
Definition: Dual Pigeonhole Principle Lecture #9 Slides #6:
Let 𝐴 and 𝐵 be finite sets. If there is a surjection 𝑓: 𝐴 → 𝐵, then |𝐴| ≥ |𝐵|. Contrapositive: Let 𝑚, 𝑛 ∈ ℤ- with 𝑚 <
𝑛. If 𝑚 pigeons are put into 𝑛 pigeonholes, then there must be (at least) one pigeonhole with no pigeons.
Definition: Finite set and Infinite set Lecture #9 Slides #9:
Let ℤ$ = {1,2,3, … , 𝑛}, the set of positive integers from 1 to 𝑛. A set 𝑆 is said to be finite iff 𝑆 is empty, or there exists
a bijection from 𝑆 to ℤ$ for some 𝑛 ∈ ℤ- . A set 𝑆 is said to be infinite if it is not finite.
*We say that two finite sets whose elements can be paired by a bijection have the same size.

Definition: Cardinality Lecture #9 Slides #10:


The cardinality of a finite set 𝑆, denoted |𝑆|, is (1) 0 if 𝑆 = ∅, or (2) 𝑛 if 𝑓: 𝑆 → ℤ$ is a bijection.

Theorem: Equality of Cardinality of Finite Sets Lecture #9 Slides #10:


Let 𝐴 and 𝐵 be any finite sets. |𝐴| = |𝐵| iff there is a bijection 𝑓: 𝐴 → 𝐵.

Definition: Same Cardinality (Cantor) Lecture #9 Slides #12:


Given any two sets 𝐴 and 𝐵. 𝐴 is said to have the same cardinality as 𝐵, written as |𝐴| = |𝐵|, iff there is a bijection
𝑓: 𝐴 → 𝐵.

Theorem: Properties of Cardinality Lecture #9 Slides #13:


The cardinality relation is an equivalence relation. For all sets 𝐴, 𝐵 and 𝐶:
Reflexive: |𝐴| = |𝐴|. Symmetric: |𝐴| = |𝐵| → |𝐵| = |𝐴|. Transitive: (|𝐴| = |𝐵|) ∧ (|𝐵| = |𝐶|) → |𝐴| = |𝐶|.
Definition: Infinite Set Lecture #9 Slides #18 Tutorial #8 Question #7:
A set 𝐴 is infinite iff there exists a set 𝐵 such that (𝐵 ⊆ 𝐴) ∧ (𝐵 ≠ 𝐴) ∧ (|𝐵| = |𝐴|).

Definition: Cardinal numbers Lecture #9 Slides #22:


Define ℵ& = |ℤ- |. (Some author use ℕ instead of ℤ- .) ℵ is pronounced “aleph”, the first letter of the Hebrew alphabet.
This is the first cardinal number.

Definition: Countably infinite Lecture #9 Slides #22:


A set 𝑆 is said to be countably infinite (or, 𝑆 has the cardinality of natural numbers) iff |𝑆| = ℵ& .

Definition: Countable set and Uncountable set Lecture #9 Slides #22:


A set is said to be countable iff it is finite or countably infinite. A set is said to be uncountable if it is not countable.

Lecture #9 Slides #29 Theorem: ℤ- × ℤ- is countable.

Theorem: Cartesian Product Lecture #9 Slides #30:


If sets 𝐴 and 𝐵 are both countably infinite, then so is 𝐴 × 𝐵. (Proof by diagonal counting method)

Corollary: General Cartesian Product Lecture #9 Slides #30:


Given 𝑛 ≥ 2 countably infinite sets 𝐴' , 𝐴( , ⋯ , 𝐴$ , the Cartesian product 𝐴' × 𝐴( × ⋯ × 𝐴$ is also countably infinite.
(Proof by mathematical induction)
Made by Tan Chee Xiang (Pallon)
Version 1.0
Theorem: Unions Lecture #9 Slides #30:
The union of countably many countable sets is countable. That is, if 𝐴' , 𝐴( , ⋯ are all countable sets, then so is
⋃=
#%' 𝐴# . (Proof by diagonal counting method)

Proposition 9.1 Lecture #9 Slides #32:


An infinite set 𝐵 is countable if and only if there is a sequence 𝑏& , 𝑏' , 𝑏( , ⋯ ∈ 𝐵 in which every element of 𝐵 appears
exactly once.

Lemma 9.2: Countability via Sequence Lecture #9 Slides #33:


An infinite set 𝐵 is countable if and only if there is a sequence 𝑏& , 𝑏' , 𝑏( , ⋯ in which every element of 𝐵 appears.
Theorem 7.4.2 (Cantor): The set of real numbers between 0 and 1, (0,1) = {𝑥 ∈ ℝ | 0 < 𝑥 < 1} is uncountable.
(Proof by Cantor’s diagonalization process / Cantor’s Diagonalization Argument & Proof by contradiction)

Theorem 7.4.3: Any subset of any countable set is countable.

Corollary 7.4.4 (Contrapositive of Theorem 7.4.3): Any set with an uncountable subset is uncountable.

Proposition 9.3 Lecture #9 Slides #43: Every infinite set has a countably infinite subset.

Lemma 9.4: Union of Countably Infinite Sets. Lecture #9 Slides #44:


Let 𝐴 and 𝐵 be countably infinite sets. Then 𝐴 ∪ 𝐵 is countable.

Tutorial #8 Question #2: 𝐵 be a countably infinite set and 𝐶 a finite set. 𝐵 ∪ 𝐶 is countable.

Tutorial #8 Question #3: Suppose 𝐴1, 𝐴2, ⋯ are finite sets. Then ⋃n 𝑖=1 𝐴𝑖 is finite for any 𝑛 ≥ 2.

Tutorial #8 Question #4: Suppose 𝐴1,𝐴2,𝐴3,⋯ are countable sets. ⋃n 𝑖=1 𝐴𝑖 is countable for any 𝑛∈ℤ+.

Tutorial #8 Question #5: ⋃ 𝑖∈ℤ+ 𝐴𝑖 is countable.

Tutorial #8 Question #7: A set 𝐵 is infinite if and only if there is 𝐴⊊𝐵 such that |𝐴|=|𝐵|.

Tutorial #8 Question #8: ℂ (the set of complex numbers) is uncountable.

Tutorial #8 Question #9: If 𝐴 be a countably infinite set, 𝒫(𝐴) is uncountable.

Assignment #2 Question #4:


(a) 𝐴 and 𝐵 are sets. If 𝐴 is countably infinite and 𝐵 is finite, then 𝐴 \ 𝐵 is countably infinite.
(b) Suppose 𝐴,𝐵 and 𝐶 are sets such that 𝐴⊆𝐵⊆𝐶. If 𝐴 and 𝐶 are countably infinite, then 𝐵 is countably infinite
too.
Countably infinite (Countable,
Set Finite (Countable) Uncountable (Infinite)
infinite)
Yes (Proof: start in the middle and

work outward)
ℚ- Yes
Made by Tan Chee Xiang (Pallon)
Version 1.0
(>-?.()(>-?.')
- - Yes, 𝑓(𝑥, 𝑦) = +𝑥
ℤ ×ℤ (
(Diagonal counting method)
ℝ, ℂ Yes

Important notes for proving question in cardinality:


1. Pigeonhole Principle and Dual Pigeonhole Principle.
2. To show that a set S is finite, show 𝑆 → ℤ$ is a bijection.
3. If a set is certainly not finite (like ℤ), if it’s countable, it has to be countably infinite. (by definition of countable set)
4. To show that a set S is countably infinite, find a bijection from ℤ- to ℤ. (Start in the middle and work outward;
Diagonal counting method)
5. Theorem: Cartesian Product Lecture #9 Slides #30: If sets 𝐴 and 𝐵 are both countably infinite, then so is 𝐴 × 𝐵.
6. Corollary: General Cartesian Product Lecture #9 Slides #30:
Given 𝑛 ≥ 2 countably infinite sets 𝐴' , 𝐴( , ⋯ , 𝐴$ , the Cartesian product 𝐴' × 𝐴( × ⋯ × 𝐴$ is also countably infinite.
7. Theorem: Unions Lecture #9 Slides #30: The union of countably many countable sets, ⋃= #%' 𝐴# is countable.
8. Lemma 9.2: Countability via Sequence Lecture #9 Slides #33:
An infinite set 𝐵 is countable if and only if there is a sequence 𝑏& , 𝑏' , 𝑏( , ⋯ in which every element of 𝐵 appears.
9. To show that a set S is uncountable, prove by contradiction that there is no possibility of a bijection from that set to
ℤ- . (Cantor’s Diagonalization Argument)
10. Theorem 7.4.3: Any subset of any countable set is countable.
11.If 𝐵 be any subset of 𝐴, if 𝐴 is finite then 𝐵 must be finite. Lecture #9 Slides #40
OR Assignment #2 Question #4: Any subset of a finite set is finite.
12. Corollary 7.4.4 (Contrapositive of Theorem 7.4.3): Any set with an uncountable subset is uncountable.
13. Proposition 9.3 Lecture #9 Slides #43: Every infinite set has a countably infinite subset.
14. Lemma 9.4: Union of Countably Infinite Sets. Lecture #9 Slides #44:
Let 𝐴 and 𝐵 be countably infinite sets. Then 𝐴 ∪ 𝐵 is countable.

Made by Tan Chee Xiang (Pallon)


Version 1.0
Lecture 10: Counting and Probability I
Definition: Sample space & Event Lecture #10 Slides #8:
A sample space is the set of all possible outcomes of a random process or experiment. An event is a subset of a
sample space.
*A process is random means that when it takes place, one outcome from sample set is sure to occur, but it is
impossible to predict with certainty which outcome that will be.

Notation: Lecture #10 Slides #9:


For a finite set A, |A| denotes the number of elements in A.

Equally Likely Probability Formula Lecture #10 Slides #9:


If S is a finite sample space in which all outcomes are equally likely and E is an event in S, then the probability of E,
denoted P(E), is P(E) = The number of outcomes in E / The total number of outcomes in S = |E| / |S|

The Number of Elements in a List Theorem 9.1.1:


If m and n are integers and m £ n, then there are n – m + 1 integers from m to n inclusive.
The Multiplication / Product Rule Theorem 9.2.1:
If an operation consists of k steps and the first step can be performed in n1 ways, the second step can be performed in
n2 ways (regardless of how the first step was performed), … the kth step can be performed in nk ways (regardless
of how the preceding steps were performed), Then the entire operation can be performed in n1 n2 n3 … ´ nk
´ ´ ´
ways.

Theorem 5.2.4: Suppose 𝐴 is a finite set. Then |𝒫(𝐴)| = 2|,| .

Principle of Sum (or the Addition Principle) Lecture #10 Slides #31:
If we have m ways of doing something and n ways of doing another thing and we cannot do both at the same time,
then there are m+n ways to choose one of these actions.

Permutations Theorem 9.2.2:


A permutation of a set of objects is an ordering of the objects in a row. The number of permutations of a set with n (n
³ 1) elements is n!. (Proved by multiplication rule)
*0! is defined to be 1.

Definition: r-permutation Lecture #10 Slides #36:


An r-permutation of a set of n elements is an ordered selection of r elements taken from the set. The number of r-
permutations of a set of n elements is denoted P(n, r).
r-permutations from a set of n elements Theorem 9.2.3:
If n and r are integers and 1 £ r £ n, then the number of r-permutations of a set of n elements is given by the formula
P(n, r) = n(n – 1)(n – 2) … (n – r + 1) or P(n, r) = n! / (n – r)!

The Addition/Sum Rule Theorem 9.3.1:


Suppose a finite set A equals the union of k distinct mutually disjoint subsets A1, A2, …, Ak. Then |A| = |A1| + |A2| + … +
|Ak|.

The Difference Rule Theorem 9.3.2:


If A is a finite set and B Í A, then |A \ B| = |A| – |B|.

Formula for the Probability of the Complement of an Event Lecture #10 Slides #48:
If S is a finite sample space and A is an event in S, then 𝑃(𝐴̅) = 1 − 𝑃(𝐴)

The Inclusion/Exclusion Rule for 2 or 3 Sets Theorem 9.3.3:


If A, B, and C are any finite sets, then |𝐴 ∪ 𝐵| = |𝐴| + |𝐵| − |𝐴 ∩ 𝐵| and
|𝐴 ∪ 𝐵 ∪ 𝐶| = |𝐴| + |𝐵| + |𝐶| − |𝐴 ∩ 𝐵| −|𝐴 ∩ 𝐶| − |𝐵 ∩ 𝐶| + |𝐴 ∩ 𝐵 ∩ 𝐶|

Made by Tan Chee Xiang (Pallon)


Version 1.0
Definition: Pigeonhole Principle (PHP) Lecture #10 Slides #55:
A function from one finite set to a smaller finite set cannot be one-to-one: There must be at least 2 elements in the
domain that have the same image in the co-domain.
Definition: Generalized Pigeonhole Principle Lecture #10 Slides #62:
For any function f from a finite set X with n elements to a finite set Y with m elements and for any positive integer k, if
k < n/m, then there is some y Î Y such that y is the image of at least k + 1 distinct elements of X.

Definition: Generalized Pigeonhole Principle (Contrapositive Form) Lecture #10 Slides #65:
For any function f from a finite set X with n elements to a finite set Y with m elements and for any positive integer k, if
for each y Î Y, f –1({y}) has at most k elements, then X has at most km elements; in other words, n £ km.

Tutorial #9 Question #6: In general, the number of circular permutations of 𝑛 objects is (𝑛−1)!

Common question:
1. Possibilities for tournament play - Possibility tree
2. No. of Personal Identification Numbers (PINs) / Pick card - Multiplication rule (& addition rule or difference rule
sometimes)
3. No. of subset - Multiplication rule
4. No. of ways to choose people - Multiplication rule or Possibility tree
5. Permutations of the letters in a word - Permutation
6. Counting elements of a general union - Inclusion / Exclusion rule
7. Birthday problem / Last initial problem – PHP
8. Decimal expansions of fraction (the decimal expansion of any rational number either terminates or repeats.) – PHP
9. Student computer problem – PHP (Contrapositive)
10. Circular table problem – (S1) Put the first type of element in to permutation (S2) The space between the elements
are allowed to choose and permutatation *Treat empty chair as a person

Made by Tan Chee Xiang (Pallon)


Version 1.0
Lecture 11: Counting and Probability 2
Definition: r-combination Lecture #11 Slides #4:
Let n and r be non-negative integers with r £ n. An r-combination of a set of n elements is a subset of r of the n
elements. ‡$:ˆ , read “n choose r”, denotes the number of subsets of size r (r-combinations) that can be chosen from a
set of n elements.

Formula for ‡𝒏𝒓ˆ Theorem 9.5.1:


The number of subsets of size r (or r-combinations) that can be chosen from a set of n elements, ‡$:ˆ, is given by the
𝑷(𝒏, 𝒓) 𝒏!
formula ‡𝒏𝒓ˆ = 𝒓!
or, equivalently, ‡𝒏𝒓ˆ = 𝒓!(𝒏.𝒓)!
where n and r are non-negative integers with r £ n.

Permutations with Sets of Indistinguishable Objects Theorem 9.5.2:


Suppose a collection consists of n objects of which n1 are of type 1 and are indistinguishable from each other, n2 are of
type 2 and are indistinguishable from each other … nk are of type k and are indistinguishable from each other and
suppose that n1 + n2 + … + nk = n. Then the number of distinguishable permutations of the n objects is
𝒏!
’$$ “ ’$.$
$
#
“ ’$.$$# .$$“ ⋯ ’$.$# .$$$ .⋯.$&'# “ = 𝒏𝟏 !𝒏𝟐 !𝒏𝟑 !⋯𝒏𝒌 !
# $ % &

Definition: Multiset / r-Combinations with Repetition Allowed Lecture #11 Slides #18:
An r-combination with repetition allowed, or multiset of size r, chosen from a set X of n elements is an unordered
selection of elements taken from X with repetition allowed. If X = {𝑥' , 𝑥( , ⋯ , 𝑥$ }, we write an r-combination with
repetition allowed as ¥𝑥## , 𝑥#$ , ⋯ , 𝑥#, ¦ where each 𝑥#- is in X and some of the 𝑥#- may equal each other.

Number of r-combinations with Repetition Allowed Theorem 9.6.1:


The number of r-combination with repetition allowed (multisets of size r) that can be selected from a set of n elements
is: ‡𝒓-𝒏𝒓 .𝟏ˆ This equals the number of ways r objects can be selected from n categories of objects with repetitions
allowed.

Pascal’s Formula Theorem 9.7.1:


Let n and r be positive integers, r £ n. Then ‡𝒏-𝟏
𝒓
𝒏
ˆ = ‡𝒓.𝟏 ˆ + ‡𝒏𝒓ˆ
*Proof by (1) Algebraic proof (Using Formula for ‡𝒏𝒓ˆ Theorem 9.5.1) (2) Combinatorial proof (Consider the case of
presence and absence of an element in the set)

Term: Combinatorial Proof Lecture #11 Slides #27:


A combinatorial proof (or combinatorial argument) uses counting as the basis of the proof. It includes these types of
proof:
- Bijective proof. We have seen how to prove that two sets 𝑋 and 𝑌 have the same cardinality by deriving a bijective
function that maps each element in 𝑋 to each element in 𝑌.
- Proof by double counting. Counting the number of elements in two different ways to obtain the different expressions
in the identity.

Lecture #11 Slides #29: ‡$:ˆ = ‡$.:


$
ˆ

Lecture #11 Slides #31: 𝑘‡$9ˆ = 𝑛‡$.'


9.'
ˆ

Number of elements in a Power Set Theorem 6.3.1:


If a set X has n (n ³ 0) elements, then 𝒫(X) has 2n elements.

Lecture #11 Slides #32: ‡$&ˆ + ‡$'ˆ + ‡$(ˆ + ⋯ + ‡$$ˆ = 2$


Made by Tan Chee Xiang (Pallon)
Version 1.0
Binomial Theorem Theorem 9.7.2:
Given any real numbers a and b and any non-negative integer n, (𝒂 + 𝒃)𝒏 = ∑𝒏𝒌%𝟎‡𝒏𝒌ˆ 𝒂𝒏.𝒌 𝒃𝒌 = 𝒂𝒏 +
‡𝒏𝟏ˆ𝒂𝒏.𝟏 𝒃𝟏 + ‡𝒏𝟐ˆ𝒂𝒏.𝟐 𝒃𝟐 + ⋯ + ‡𝒏.𝟏 𝒏
ˆ𝒂𝟏 𝒃𝒏.𝟏 + 𝒃𝒏
*In algebra a sum of two terms, such as a + b, is called binomial.
* ‡$:ˆ is called binomial coefficient

Probability Axioms Lecture #11 Slides #39:


Let S be a sample space. A probability function P from the set of all events in S to the set of real numbers satisfies the
following axioms: For all events A and B in S,
(1)0 £ P(A) £ 1 (2) P(Æ) = 0 and P(S) = 1 (3) If A and B are disjoint events (A Ç B = Æ), then P(A È B) = P(A) + P(B)

Probability of a General Union of Two Events Lecture #11 Slides #41:


If A and B are any events in a sample space S, then P(A È B) = P(A) + P(B) – P(A Ç B).

Definition: Expected Value Lecture #11 Slides #43:


Suppose the possible outcomes of an experiment, or random process, are real numbers 𝑎' , 𝑎( , 𝑎) , ⋯ , 𝑎$ which occur
with probabilities 𝑝' , 𝑝( , 𝑝) , ⋯ , 𝑝$ respectively. The expected value of the process is ∑$9%' 𝑎9 𝑝9 = 𝑎' 𝑝' + 𝑎( 𝑝( +
𝑎) 𝑝) + ⋯ + 𝑎$ 𝑝$
*It is an average value, not an actual value
Linearity of Expectation Lecture #11 Slides #41:
The expected value of the sum of random variables is equal to the sum of their individual expected values, regardless
of whether they are independent. For random variables 𝑋' , 𝑋( , ⋯ , 𝑋$ and constants 𝑐' , 𝑐( , ⋯ , 𝑐$ , 𝐸[∑$#%' 𝑐# ∙ 𝑋# ] =
∑$#%'(𝑐# ∙ 𝐸[𝑋# ])

Definition: Conditional Probability Formula 9.9.1 Lecture #11 Slides #53:


Let A and B be events in a sample space S. If P(A) ¹ 0, then the conditional probability of B given A, denoted
J(,∩L)
P(B|A), is 𝑃(𝐵|𝐴) = J(,)
.

Formula 9.9.2 Lecture #11 Slides #53: 𝑃(𝐴 ∩ 𝐵) = 𝑃(𝐵|𝐴) ∙ 𝑃(𝐴)


J(,∩L)
Formula 9.9.3 Lecture #11 Slides #53: 𝑃(𝐴) =
J(L|,)

Bayes’ Theorem Theorem 9.9.1:


Suppose that a sample space S is a union of mutually disjoint events
B1, B2, B3, …, Bn. Suppose A is an event in S, and suppose A and all
the Bi have non-zero probabilities. If k is an integer with 1 £ k £ n, then
J(,|L )∙J(L )
𝑃(𝐵9 |𝐴) = JN𝐴O𝐵 P∙J(L )-JN𝐴O𝐵 &P∙J(L &)-⋯-J(,|L )∙J(L )
' # ( $ ! !

Definition: Independent Events Lecture #11 Slides #73:


If A and B are events in a sample space S, then A and B are independent, if and only if, P(A Ç B) = P(A) × P(B).

Definition: Pairwise Independent and Mutually Independent Lecture #11 Slides #79:
Let A, B and C be events in a sample space S. A , B and C are pairwise independent, if and only if, they satisfy
conditions 1 – 3 below. They are mutually independent if, and only if, they satisfy all four conditions below.
(1) P(A Ç B) = P(A) × P(B) (2) P(A Ç C) = P(A) × P(C) (3) P(B Ç C) = P(B) × P(C) (4) P(A Ç B Ç C) = P(A) × P(B) ×
P(C)

Definition: Mutually Independent Lecture #11 Slides #80:


Events A1, A2, …, An in a sample space S are mutually independent if, and only if, the probability of the intersection
of any subset of the events is the product of the probabilities of the events in the subset. P(A1 Ç A2 Ç … Ç An) = P(A1)
× P(A2) × … × P(An)
*Probabilities of the form ‡$9ˆ𝑝$.9 (1 − 𝑝)9 , where 0 ≤ 𝑝 ≤ 1, are called binomial probabilities.

Made by Tan Chee Xiang (Pallon)


Version 1.0
Common question:
1. Teams with members of two types - r-combination (sometimes with addition rule and difference rule)
2. Number of solutions for linear equation – r-combination with repetition allowed (make sure each variable is non-
negative integer)
3. Expected value of dice – Normal fair dice is 3.5 (sometimes with linearity of expectation)
4. False positive – A patient does not have the disease, the test indicates that the patient has the disease.
False negative - A patient does have the disease, the test indicates that the patient does not have it.
5. Gender of children – Conditional Probability
6. Balls in urn / Disease test – Bayes’ Theorem
7. Coin toss – Independent Events
8. Grid walk – Find the no. horizontal step and no. vertical step, then use Permutations with Sets of
Indistinguishable Objects Theorem 9.5.2

Made by Tan Chee Xiang (Pallon)


Version 1.0
Lecture 12: Graphs
Definition: Undirected Graph Lecture #12 Slides #7:
An undirected graph G denoted by 𝐺 = (𝑉, 𝐸) consists of 2
finite sets: a nonempty set V of vertices and a set E of edges,
where each (undirected) edge is associated with a set consisting
of either one or two vertices called its endpoints. An edge is said
to connect its endpoints; two vertices that are connected by an
edge are called adjacent vertices; and a vertex that is an
endpoint of a loop is said to be adjacent to itself. An edge is said
to be incident on each of its endpoints, and two edges incident
on the same endpoint are called adjacent edges. We write e = {v,
w} for an undirected edge e incident on vertices v and w.
*If v and w are a same vertex, we write it as { v , v }
Definition: Directed Graph Lecture #12 Slides #8:
A directed graph, or digraph, G, consists of 2 finite sets: a nonempty set V of vertices and a set E of directed edges,
where each (directed) edge is associated with an ordered pair of vertices called its endpoints. We write e = (v, w) for a
directed edge e from vertex 𝑣 to vertex 𝑤.

Conjecture: Four-Colour Conjecture Lecture #12 Slides #11:


Four colours are sufficient to colour any map in a plane, such that regions that share a common boundary do not share
the same colour.
Term: Vertex Colouring Lecture #12 Slides #13:
A vertex colouring of a graph is an assignment of colours to vertices so that no two adjacent vertices have the same
colour.

Definition: Simple Graph Lecture #12 Slides #19:


A simple graph is an undirected graph that does not have any loops or parallel edges. (That is, there is at most one
edge between each pair of distinct vertices.)
Definition: Complete Graph Lecture #12 Slides #20:
A complete graph on n vertices, n > 0, denoted Kn, is a simple graph with n vertices and exactly one
edge connecting each pair of distinct vertices.

Definition: Bipartite Graph Lecture #12 Slides #21:


A bipartite graph (or bigraph) is a simple graph whose vertices can be divided into two disjoint sets 𝑈 and 𝑉
such that every edge connects a vertex in 𝑈 to one in 𝑉.

Definition: Complete Bipartite Graph Lecture #12 Slides #21:


A complete bipartite graph is a bipartite graph on two disjoint sets 𝑈 and 𝑉 such that every vertex in 𝑈
connects to every vertex in 𝑉. If |𝑈| = 𝑚 and |𝑉| = 𝑛, the complete bipartite graph is denoted as 𝐾4,$ .

Definition: Subgraph of a Graph Lecture #12 Slides #22:


A graph H is said to be a subgraph of graph G if and only if every vertex in H is also a vertex in G, every edge in H is
also an edge in G, and every edge in H has the same endpoints as it has in G.
Definition: Degree of a Vertex and Total Degree of an Undirected Graph Lecture #12 Slides #23:
Let G be a undirected graph and v a vertex of G. The degree of v, denoted deg(v), equals
the number of edges that are incident on v, with an edge that is a loop counted twice. The
total degree of G is the sum of the degrees of all the vertices of G.

The Handshake Theorem Theorem 10.1.1:


If G is any graph, then the sum of the degrees of all the vertices of G equals twice the number of edges of G.
Specifically, if the vertices of G are v1, v2, …, vn, where n ³ 0, then, The total degree of G = deg(v1) + deg(v2) + … +
deg(vn) = 2 ´ (the number of edges of G).
Made by Tan Chee Xiang (Pallon)
Version 1.0
Corollary 10.1.2: The total degree of a graph is even.

Proposition 10.1.3: In any graph there are an even number of vertices of odd degree.

Definition: Indegree and outdegree of a Vertex of a Directed Graph Lecture #12 Slides #26:
Let G=(V,E) be a directed graph and v a vertex of G. The indegree of v, denoted deg-(v), is the number of directed
edges that end at v. The outdegree of v, denoted deg+(v), is the number of directed edges that originate from v. Note
that ∑Q∈S 𝑑𝑒𝑔. (𝑣) = ∑Q∈S 𝑑𝑒𝑔- (𝑣) = |𝐸|.

Definition: Walk, trail, path Lecture #12 Slides #32:


Let G be a graph, and let v and w be vertices of G. A walk from v to w is a finite alternating sequence of adjacent
vertices and edges of G. Thus a walk has the form v0 e1 v1 e2 … vn-1 en vn , where the v’s represent vertices, the e’s
represent edges, v0=v, vn=w, and for all i Î {1, 2, …, n}, vi-1 and vi are the endpoints of ei. The number of edges, n, is
the length of the walk. The trivial walk from v to v consists of the single vertex v. A trail from v to w is a walk from
v to w that does not contain a repeated edge. A path from v to w is a trail that does not contain a repeated vertex.
Definition: Closed walk, circuit, cyclic Lecture #12 Slides #33:
A closed walk is a walk that starts and ends at the same vertex. A circuit (or cycle) is a closed walk of length at least
3 that does not contain a repeated edge. A simple circuit (or simple cycle) is a circuit that does not have any other
repeated vertex except the first and last. An undirected graph is cyclic if it contains a loop or a cycle; otherwise, it is
acyclic.
*A path is not a closed walk (It has no repeated vertex)

Definition: Connectedness Lecture #12 Slides #35:


Two vertices v and w of a graph G=(V,E) are connected if and only if there is a walk from v to w. The graph G is
connected if and only if given any two vertices v and w in G, there is a walk from v to w. Symbolically, G is
connected iff " vertices v, w ÎV, $ a walk from v to w.

Lemma 10.2.1: Let G be a graph. (1) If G is connected, then any two distinct vertices of G can be connected by a path.
(2) If vertices v and w are part of a circuit in G and one edge is removed from the circuit, then there still exists a trail
from v to w in G.
(3) If G is connected and G contains a circuit, then an edge of the circuit can be removed without disconnecting G.

Definition: Connected Component Lecture #12 Slides #38:


A graph H is a connected component of a graph G if and only if
(1) The graph H is a subgraph of G; (2) The graph H is connected; and (3) No connected subgraph of G has H as a
subgraph and contains vertices or edges that are not in H.
Definition: Euler Circuit Lecture #12 Slides #41:
Let G be a graph. An Euler circuit for G is a circuit that contains every vertex and traverses every edge of G exactly
once.
Definition: Eulerian Graph Lecture #12 Slides #41:
An Eulerian graph is a graph that contains an Euler circuit.
Theorem 10.2.2: If a graph has an Euler circuit, then every vertex of the graph has positive even degree.

Contrapositive Version of Theorem 10.2.2: If some vertex of a graph has odd degree, then the graph does not have an
Euler circuit.
Theorem 10.2.3: If a graph G is connected and the degree of every vertex of G is a positive even integer, then G has
an Euler circuit.
Theorem 10.2.4: A graph G has an Euler circuit if and only if G is connected and every vertex of G has positive even
degree.

Made by Tan Chee Xiang (Pallon)


Version 1.0
Definition: Euler Trail Lecture #12 Slides #43:
Let G be a graph, and let v and w be two distinct vertices of G. An Euler trail/path from v to w is a sequence of
adjacent edges and vertices that starts at v, ends at w, passes through every vertex of G at least once, and traverses
every edge of G exactly once.
* Lecture #12 Slides #45 Adding an edge between the two vertices with odd degree will give us an Euler circuit.

Corollary 10.2.5: Let G be a graph, and let v and w be two distinct vertices of G. There is an Euler trail from v to w if
and only if G is connected, v and w have odd degree, and all other vertices of G have positive even degree.
Definition: Hamiltonian Circuit Lecture #12 Slides #49:
Given a graph G, a Hamiltonian circuit for G is a simple circuit that includes every vertex of G. (That is, every
vertex appears exactly once, except for the first and the last, which are the same.)
*Note that although an Euler circuit for a graph G must include every vertex of G, it may visit some vertices more
than once and hence may not be a Hamiltonian circuit.
*On the other hand, a Hamiltonian circuit for G does not need to include all the edges of G and hence may not be an
Euler circuit.
Definition: Hamiltonian Graph Lecture #12 Slides #49:
A Hamiltonian graph (also called Hamilton graph) is a graph that contains a Hamiltonian circuit.
Proposition 10.2.6: If a graph G has a Hamiltonian circuit, then G has a subgraph H with the following properties:
(1) H contains every vertex of G. (2) H is connected. (3) H has the same number of edges as vertices. (4) Every vertex
of H has degree 2.

Definition: Matrix Lecture #12 Slides #58:


An m ´ n (read “m by n”) matrix A over a set S is a rectangular array of elements of S
arranged into m rows and n columns. We write A = (𝑎#* ).
Lecture #12 Slides #59: If A and B are matrices, then A = B if, and only if, A and B
have the same size and the corresponding entries of A and B are all equal; that is,
𝑎#* = 𝑏#* for all 𝑖 = 1, 2, ⋯ , 𝑚 and 𝑗 = 1, 2, ⋯ , 𝑛.
Lecture #12 Slides #59: A matrix for which the numbers of rows and columns are
equal is called a square matrix.
Lecture #12 Slides #59: If A is a square matrix of size n ´ n, then the main diagonal
of A consists of all the entries 𝑎'' , 𝑎(( , ⋯ 𝑎$$ .

Definition: Symmetric Matrix Lecture #12 Slides #62:


An n ´ n square matrix A = (𝑎#* ) is called symmetric if, and only if, 𝑎#* = 𝑎*# for all
i, j = 1, 2, …, n.
Definition: Identity Matrix Lecture #12 Slides #69:
For each positive integer n, the n ´ n identity matrix, denoted In = (dij) or just I (if the size of the matrix is obvious
from context), is the n ´ n matrix in which all the entries in the main diagonal are 1’s and all other entries are 0’s. In
other words,
1, if 𝑖 = 𝑗
𝛿#* = ¯ for all 𝑖, 𝑗 = 1, 2, … , 𝑛.
0, if 𝑖 ≠ 𝑗

Definition: Adjacency Matrix of a Directed Graph Lecture #12 Slides #61:


Let G be a directed graph with ordered vertices v1, v2, … vn. The adjacency matrix of G is the n ´ n matrix A = (𝑎#* )
over the set of non-negative integers such that 𝑎#* = the number of arrows from vi to vj for all i, j = 1, 2, …, n.

Definition: Adjacency Matrix of an Undirected Graph Lecture #12 Slides #62:


Let G be an undirected graph with ordered vertices v1, v2, … vn. The adjacency matrix of G is the n ´ n matrix A =
(𝑎#* ) over the set of non-negative integers such that 𝑎#* = the number of edges connecting vi and vj for all i, j = 1,

Made by Tan Chee Xiang (Pallon)


Version 1.0
2, …, n.
*The matrix is symmetric.

Definition: Scalar Product Lecture #12 Slides #63:


Suppose that all entries in matrices A and B are real numbers. If the number of elements, n, in the ith row of A equals
the number of elements in the jth column of B, then the scalar product or dot product of the ith row of A and the jth
column of B is the real number obtained as follows:
𝑏'*
⎡ ⎤
𝑏
[𝑎#' 𝑎#( ⋯ 𝑎#$ ] ⎢ (* ⎥ = 𝑎#' 𝑏'* + 𝑎#( 𝑏(* + ⋯ + 𝑎#$ 𝑏$* .
⎢ ⋮ ⎥
⎣𝑏$* ⎦
Definition: Matrix Multiplication Lecture #12
Slides #64:
Let A = (aij) be an m ´ k matrix and B = (bij) an k
´ n matrix with real entries. The (matrix) product
of A times B, denoted AB, is that matrix (cij)
defined as follows: where 𝑐#* = 𝑎#' 𝑏'* + 𝑎#( 𝑏(* + ⋯ + 𝑎#9 𝑏9* = ∑9:%' 𝑎#: 𝑏:* . for all i = 1, 2, …, m and j = 1, 2, …, n.
* Lecture #12 Slides #67: Matrix multiplication is not commutative but associative.

Definition: nth Power of a Matrix Lecture #12 Slides #70:


For any n ´ n matrix A, the powers of A are defined as follows:
A0 = I where I is the n ´ n identity matrix; An = A An – 1 for all integers n ³ 1

Theorem 10.3.2: If G is a graph with vertices v1, v2, …, vm and A is the adjacency matrix of G, then for each positive
integer n and for all integers i, j = 1, 2, …, m, the ij-th entry of An = the number of walks of length n from vi to vj.

Definition: Isomorphic Graph Lecture #12 Slides #79:


Let 𝐺 = (𝑉T , 𝐸T ) and 𝐺 U = (𝑉T . , 𝐸TU ) be two graphs. 𝑮 is isomorphic to 𝑮′, denoted 𝐺 ≅ 𝐺′, if and only if there exist
bijections 𝑔: 𝑉T → 𝑉T . and ℎ: 𝐸T → 𝐸T . that preserve the edge-endpoint functions of 𝐺 and 𝐺′ in the sense that for all
𝑣 ∈ 𝑉T and 𝑒 ∈ 𝐸T , 𝑣 is an endpoint of 𝑒 Û 𝑔(𝑣) is an endpoint of ℎ(𝑒).
*Alternative definition: Let 𝐺 = (𝑉T , 𝐸T ) and 𝐺 U = (𝑉T . , 𝐸TU ) be two graphs. 𝑮 is isomorphic to 𝑮′ if and only if
there exists a permutation 𝜋: 𝑉T → 𝑉T . such that {𝑢, 𝑣} ∈ 𝐸T Û {𝜋(𝑢), 𝜋(𝑣)} ∈ 𝐸TU .

Graph Isomorphism is an Equivalence Relation Theorem 10.4.1:


Let S be a set of graphs and let ≅ be the relation of graph isomorphism on S. Then ≅ is an equivalence relation on S.

Definition: Planar Graph Lecture #12 Slides #82:


A planar graph is a graph that can be drawn on a (two-dimensional) plane without edges crossing.

Kuratowski’s Theorem: A finite graph is planar if and only if it does not contain a subgraph that is a subdivision of
the complete graph 𝐾V or the complete bipartite graph 𝐾),) .

Euler’s Formula: For a connected planar simple graph G = (V, E) with e = |E| and v = |V|, if we let f be the number of
faces or regions, then f = e – v + 2
Definition: Complement of graph Tutorial #10 Question #10:
If 𝐺 is a simple graph, the complement of 𝐺, denoted 𝐺̅, is obtained as follows: the vertex set of 𝐺̅ is identical to
the vertex set of 𝐺. However, two distinct vertices 𝑣 and 𝑤 of 𝐺̅ are connected by an edge if and only if 𝑣 and 𝑤
are not connected by an edge in 𝐺.

Definition: Irreflexive Tutorial #10 Question #11:


∀𝑎∈𝐴,(𝑎 𝑅/ 𝑎).

Made by Tan Chee Xiang (Pallon)


Version 1.0
Definition: Anti-symmetry Tutorial #10 Question #11:
∀𝑥,𝑦 (𝑥≠𝑦)⇒((𝑥,𝑦)∈𝑅)⇒((𝑦,𝑥)∉𝑅).

Definition: Strict partial order Tutorial #10 Question #11:


A relation is a strict partial order if and only if it is irreflexive, antisymmetric and transitive.
Definition: Chain Tutorial #10 Question #11:
Let ≺ be a strict partial order on a set 𝐴. A subset 𝐶 of 𝐴 is called a chain if and only if each pair of distinct
elements in 𝐶 is comparable, that is, ∀𝑎,𝑏∈𝐶 (𝑎≠𝑏)⇒(𝑎≺𝑏∨𝑏≺𝑎).

Definition: Maximal Chain Tutorial #10 Question #11:


A maximal chain is a chain 𝑀 such that 𝑡∉𝑀⇒𝑀∪{𝑡} is not a chain.
Common question:
1. Wedding Planner / Class Schedule / Radio Station / Traffic Signal – Vertex Colouring
2. Travelling Salesman Problem – Use Hamiltonian Circuit (Find all and compute total distance)
3. Proof about complement of graph: (Use graph to assist if have time) (S1) Assume a simple graph with n vertices
(S2) Consider Kn

Made by Tan Chee Xiang (Pallon)


Version 1.0
Lecture 13: Trees
Definition: Tree Lecture #13 Slides #4:
(The graph is assumed to be undirected here.) A graph is said to be circuit-free if and only if it has no circuits. A
graph is called a tree if and only if it is circuit-free and connected. A trivial tree is a graph that consists of a single
vertex. A graph is called a forest if and only if it is circuit-free and not connected.

Lemma 10.5.1: Any non-trivial tree has at least one vertex of degree 1. (Proof: Pick a vertex of tree and choose the
adjacent vertice without repetition until there’s no adjacent vertice. The algorithm must eventually terminate because
the set of vertices of the tree T is finite and T is circuit-free.)

Definition: Terminal vertex (leaf) and internal vertex Lecture #13 Slides #9:
Let T be a tree. If T has only one or two vertices, then each is called a terminal vertex (or leaf). If T has at least three
vertices, then a vertex of degree 1 in T is called a terminal vertex (or leaf), and a vertex of degree greater than 1 in T
is called an internal vertex.
Theorem 10.5.2: Any tree with n vertices (n > 0) has n – 1 edges. (Proof by Mathematical Induction: In the inductive
step, find a vertex with degree 1 and exclude it from the graph to use the inductive hypothesis)

Lecture #13 Slides #12: A non-trivial tree has at least 2 vertices of degree 1. (Prove with Theorem 10.5.2 and The
Handshake Theorem by contradiction)

Lemma 10.5.3: If G is any connected graph, C is any circuit in G, and one of the edges of C is removed from G, then
the graph that remains is still connected. (Same as Lemma 10.2.1(3))

Theorem 10.5.4: If G is a connected graph with n vertices and n – 1 edges, then G is a tree. (Proof: Since G is
connected, prove by contradiction that G is circuit-free: Use Lemma 10.5.3 to remove edges in circuit until the
subgraph is circuit-free, then by Theorem 10.5.2 it has n – 1 edges)

Definition: Rooted Tree, Level, Height Lecture #13 Slides #19:


A rooted tree is a tree in which there is one vertex that is distinguished from the others and is called the root. The
level of a vertex is the number of edges along the unique path between it and the root. The height of a rooted tree is
the maximum level of any vertex of the tree.
Definition: Child, Parent, Sibling, Ancestor, Descendant
Lecture #13 Slides #19:
Given the root or any internal vertex v of a rooted tree, the
children of v are all those vertices that are adjacent to v and
are one level farther away from the root than v. If w is a child
of v, then v is called the parent of w, and two distinct
vertices that are both children of the same parent are called
siblings. Given two distinct vertices v and w, if v lies on the
unique path between w and the root, then v is an ancestor of
w, and w is a descendant of v.

Definition: Binary Tree, Full Binary Tree Lecture #13 Slides #22:
A binary tree is a rooted tree in which every parent has at most two children. Each child is designated either a left
child or a right child (but not both), and every parent has at most one left child and one right child. A full binary tree
is a binary tree in which each parent has exactly two children.
Definition: Left Subtree, Right Subtree Lecture #13 Slides #22:
Given any parent v in a binary tree T, if v has a left child, then the left subtree of v is the binary tree whose root is the
left child of v, whose vertices consist of the left child of v and all its descendants, and whose edges consist of all those
edges of T that connect the vertices of the left subtree. The right subtree of v is defined analogously.

Full Binary Tree Theorem Theorem 10.6.1:


If T is a full binary tree with k internal vertices, then T has a total of 2k + 1 vertices and has k + 1 terminal vertices

Made by Tan Chee Xiang (Pallon)


Version 1.0
(leaves). (Proof: Every internal vertex has exactly two children, thus number of vertices that have a parent is 2k,
number of vertices = 2k + 1 (root), number of terminal vertices = vertices – internal vertices)

Theorem 10.6.2: For non-negative integers h, if T is any binary tree with height h and t terminal vertices (leaves), then
t £ 2h. Equivalently, log2 t £ h. (Proof by strong mathematical induction: In inductive step, assume one child and two
child cases)
Term: Tree traversal Lecture #13 Slides #36:
Tree traversal (also known as tree search) is the process of visiting each node in a tree data structure exactly once in a
systematic manner. There are two types of traversal: breadth-first search (BFS) or depth-first search (DFS).

Term: Breadth-First Search Lecture #13 Slides #37:


In breadth-first search (by E.F. Moore), it starts at the root and visits its adjacent
vertices, and then moves to the next level.

Term: Depth-first search Lecture #13 Slides #37:


(1) Pre-order: Print – Left – Right
(2) In-order: Left – Print – Right
(3) Post-order: Left – Right – Print

Definition: Spanning Tree Lecture #13 Slides #45:


A spanning tree for a graph G is a subgraph of G that contains every vertex of G and is a tree.

Proposition 10.7.1: (1) Every connected graph has a spanning tree. (2) Any two spanning trees for a graph have the
same number of edges.

Definition: Weighted Graph, Minimum Spanning Tree Lecture #13 Slides #48:
A weighted graph is a graph for which each edge has an associated positive real number weight . The sum of the
weights of all the edges is the total weight of the graph. A minimum spanning tree for a connected weighted graph
is a spanning tree that has the least possible total weight compared to all other spanning trees for the graph. If G is a
weighted graph and e is an edge of G, then w(e) denotes the weight of e and w(G) denotes the total weight of G.
*If some edges have the same weight, more than one minimum spanning tree can occur.
Definition: Self-complementary graph Tutorial #11 Definition #2:
A self-complementary graph is isomorphic with its complement.

Definition: Triangle Tutorial #11 Definition #3:


A simple circuit (cycle) of length three is called a triangle.

Lemma 10.5.5: Let 𝐺 be a simple, undirected graph. Then if there are two distinct paths from a vertex 𝑣 to a different
vertex 𝑤, then 𝐺 contains a cycle (and hence 𝐺 is cyclic).

Tutorial #11 Question#2: Let 𝐺 be a simple graph with 𝑛 vertices where every vertex has degree at least ⌊𝑛2⌋. 𝐺 is
connected. (Proof by contradiction)

Tutorial #11 Question#5: Let 𝐺 = (𝑉, 𝐸) be a simple, undirected graph. If 𝐺 is connected, then |𝐸| ≥ |𝑉| − 1.
(Proof by Proposition 10.7.1 and Theorem 10.5.2 )
Tutorial #11 Question#6: Let 𝐺 = (𝑉, 𝐸) be a simple, undirected graph. If 𝐺 is acyclic, then |𝐸| ≤ |𝑉| − 1. (Proof
by assuming connected and not connected, addition rule and Theorem 10.5.2 )
Tutorial #11 Question#7: Let 𝐺 = (𝑉, 𝐸) be a simple, undirected graph. 𝐺 is a tree if and only if there is exactly
one path between every pair of vertices.

Made by Tan Chee Xiang (Pallon)


Version 1.0
Common question:
1. Find all non-isomorphic trees with n vertices
(S1) By Theorem 10.5.2 any tree with n vertices has n – 1 edges.
(S2) By the Handshake Theorem, the tree has a total degree of 2n - 2.
(S3) By Lecture #13 Slides #12 every non-trivial tree has at least two vertices of degree 1.
(S4) The only possible combinations of degrees for the n vertices are: (Find all combination
starts with 1, 1, and the order does not matter)
*Find isomorphic copies – Use Permutation
2. Tree traversal (We need at least in-order and another to get the full tree)
Pre-order In-order Post-order
F, B, A, D, C, E, G, I, H A, B, C, D, E, F, G, H, I A, C, E, D, B, H, I, G, F
(S1) The first letter is main root (F) (S1) The first letter is the “most left” (S1) The first letter is the “most left”
(S2) The second letter is root of left element element
subtree, or root of right subtree (if (S2) The second element is the first (S2) The last letter is the main root
no left subtree) letter’s parent or right child (S3) The second last letter is the
main root of right subtree

3. Find all spanning trees – Idea: Break the circuit


4. Find minimum spanning tree
(1) Kruskal’s algorithm: (S1) List out all edges (S2) Clear the edges and start adding from the smallest weight edge,
skip those that will form a circuit. We will get n – 1 edges at last.
(2) Prim’s algorithm: (S1) Clear the edges, choose a vertex and it’s the starting subgraph (S2) Start adding from the
smallest weight edge that connects to the existing subgraph and a vertex that is not in the subgraph. We will get n – 1
edges at last.
5. Draw complement graph & Self-complementary graph: A self-complementary graph exists only if the number of
edges in complete graph of n vertices are even.
6. Draw binary tree: Fix the root

Made by Tan Chee Xiang (Pallon)


Version 1.0

You might also like