Mathematical Preliminaries Courtesy Costas Busch RPI 1 Mathematical
Mathematical Preliminaries Courtesy Costas Busch - RPI 1
Mathematical Preliminaries • Sets • Graphs • Proof Techniques Courtesy Costas Busch - RPI 2
SETS A set is a collection of elements We write Courtesy Costas Busch - RPI 3
Set Representations C = { a, b, c, d, e, f, g, h, i, j, k } C = { a, b, …, k } finite set S = { 2, 4, 6, … } infinite set S = { j : j > 0, and j = 2 k for some k>0 } S = { j : j is nonnegative and even } Courtesy Costas Busch - RPI 4
A = { 1, 2, 3, 4, 5 } U A 6 1 7 2 4 5 10 Universal Set: 8 3 9 all possible elements U = { 1 , … , 10 } Courtesy Costas Busch - RPI 5
Set Operations A = { 1, 2, 3 } B = { 2, 3, 4, 5} B A • Union A U B = { 1, 2, 3, 4, 5 } 2 3 1 4 5 • Intersection U A B = { 2, 3 } 2 3 • Difference A-B={1} 1 B - A = { 4, 5 } Venn diagrams Courtesy Costas Busch - RPI 6
• Complement Universal set = {1, …, 7} A = { 1, 2, 3 } 4 A = { 4, 5, 6, 7} A 1 5 A 2 6 3 7 A=A Courtesy Costas Busch - RPI 7
{ even integers } = { odd integers } Integers 1 odd 2 3 even 0 5 6 4 Courtesy Costas Busch - RPI 7 8
De. Morgan’s Laws U AUB=A B B=AUB Courtesy Costas Busch - RPI 9
Empty, Null Set: ={} SU =S S = U S- = Universal Set =S -S= Courtesy Costas Busch - RPI 10
Subset A = { 1, 2, 3} B = { 1, 2, 3, 4, 5 } B U Proper Subset: A U A B B A Courtesy Costas Busch - RPI 11
Disjoint Sets A = { 1, 2, 3 } A U A B = { 5, 6} B= B Courtesy Costas Busch - RPI 12
Set Cardinality • For finite sets A = { 2, 5, 7 } |A| = 3 (set size) Courtesy Costas Busch - RPI 13
Powersets A powerset is a set of sets S = { a, b, c } Powerset of S = the set of all the subsets of S 2 S = { , {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c} } Observation: | 2 S | = 2|S| ( 8 = 23 ) Courtesy Costas Busch - RPI 14
GRAPHS A directed graph e b node d a edge c • Nodes (Vertices) V = { a, b, c, d, e } • Edges E = { (a, b), (b, c), (b, e), (c, a), (c, e), (d, c), (e, b), (e, d) } Courtesy Costas Busch - RPI 15
Labeled Graph 2 6 a b 1 5 3 e 6 2 d c Courtesy Costas Busch - RPI 16
Walk e b d a c Walk is a sequence of adjacent edges (e, d), (d, c), (c, a) Courtesy Costas Busch - RPI 17
Path e b d a c Path is a walk where no edge is repeated Simple path: no node is repeated Courtesy Costas Busch - RPI 18
Cycle base a 3 2 e b 1 d c Cycle: a walk from a node (base) to itself Simple cycle: only the base node is repeated Courtesy Costas Busch - RPI 19
Euler Tour 8 b 4 a 7 3 6 5 base e 1 2 d c A cycle that contains each edge once Courtesy Costas Busch - RPI 20
Hamiltonian Cycle 5 b 4 a 3 base e 1 2 d c A simple cycle that contains all nodes Courtesy Costas Busch - RPI 21
Finding All Simple Paths e b d a c origin Courtesy Costas Busch - RPI 22
Step 1 e b d a c (c, a) origin (c, e) Courtesy Costas Busch - RPI 23
Step 2 e b d a (c, a), (a, b) c origin (c, e), (e, b) (c, e), (e, d) Courtesy Costas Busch - RPI 24
Step 3 e b d a (c, a), (a, b) c origin (c, a), (a, b), (b, e) (c, e), (e, b) (c, e), (e, d) Courtesy Costas Busch - RPI 25
Step 4 e b (c, a) d a c (c, a), (a, b), (b, e) origin (c, a), (a, b), (b, e), (e, d) (c, e), (e, b) (c, e), (e, d) Courtesy Costas Busch - RPI 26
root Trees parent leaf child Trees have no cycles Courtesy Costas Busch - RPI 27
root Level 0 Level 1 Height 3 leaf Level 2 Level 3 Courtesy Costas Busch - RPI 28
Binary Trees Courtesy Costas Busch - RPI 29
PROOF TECHNIQUES • Proof by induction • Proof by contradiction Courtesy Costas Busch - RPI 30
Induction We have statements P 1, P 2, P 3, … If we know • for some b that P 1, P 2, …, Pb are true • for any k >= b that P 1, P 2, …, Pk imply Pk+1 Then Every Pi is true Courtesy Costas Busch - RPI 31
Proof by Induction • Inductive basis Find P 1, P 2, …, Pb which are true • Inductive hypothesis Let’s assume P 1, P 2, …, Pk are true, for any k >= b • Inductive step Show that Pk+1 is true Courtesy Costas Busch - RPI 32
Example Theorem: A binary tree of height n has at most 2 n leaves. Proof by induction: let L(i) be the maximum number of leaves of any subtree at height i Courtesy Costas Busch - RPI 33
We want to show: L(i) <= 2 i • Inductive basis L(0) = 1 (the root node) • Inductive hypothesis Let’s assume L(i) <= 2 i for all i = 0, 1, …, k • Induction step we need to show that L(k + 1) <= 2 k+1 Courtesy Costas Busch - RPI 34
Induction Step height k k+1 From Inductive hypothesis: L(k) <= 2 k Courtesy Costas Busch - RPI 35
Induction Step height k L(k) <= 2 k k+1 L(k+1) <= 2 * L(k) <= 2 * 2 k = 2 k+1 (we add at most two nodes for every leaf of level k) Courtesy Costas Busch - RPI 36
Proof by Contradiction We want to prove that a statement P is true • we assume that P is false • then we arrive at an incorrect conclusion • therefore, statement P must be true Courtesy Costas Busch - RPI 37
Example Theorem: is not rational Proof: Assume by contradiction that it is rational = n/m n and m have no common factors We will show that this is impossible Courtesy Costas Busch - RPI 38
= n/m Therefore, 2 m 2 = 4 k 2 n 2 2 m 2 = n 2 is even m 2 = 2 k 2 n is even n=2 k m is even m=2 p Thus, m and n have common factor 2 Contradiction! Courtesy Costas Busch - RPI 39
- Slides: 39