170 likes | 342 Views
Math Review . CSC 351. Sets: Basic Operations. Set: a collection of elements, no imposed structure S1 = {0,1,2,3,4,5} S2={0,2,4,6,8,10} S3 = {i : i > 0, i is even} S1 U S2 = S1 ∩ S2 = S1 – S2 = S3 =. Sets: Basics Cont’d. Ø = { } (null set or empty set)
E N D
Math Review CSC 351
Sets: Basic Operations • Set: a collection of elements, no imposed structure • S1 = {0,1,2,3,4,5} S2={0,2,4,6,8,10} • S3 = {i : i > 0, i is even} • S1 U S2 = • S1 ∩ S2 = • S1 – S2 = • S3 =
Sets: Basics Cont’d • Ø = { } (null set or empty set) • U = Universal set, or all possible elements • Subsets: • Proper subsets • Sets with no common elements are disjoint • Number of elements in a set |S|
Sets: Powerset • S = {0,1} • Powerset of S is
Sets: Cartesian Product • S1 X S2 = {(x,y) : x is in S1 and y is in S2} • S1 = {2,4} S2 = {1,2,3} • S1 X S2 =
Functions • Function: assigns elements of one set uniquely to elements of another set • Domain: first set • Range: “another” set • f: S1 S2 (S1 is domain, S2 is range) • f(x: x is in S1) has only one possibility • If all members in the domain are mapped, the function is a total function. Otherwise, it is a partial function.
Function Growth Rates Huh?!?
Function Growth Rates exponential quadratic linear logarithmic constant
Relations • Mapping from one set to another without restrictions • Equivalence relation • Reflexive x Ξ x • Symmetric x Ξ y implies y Ξ x • Transitive x Ξ y and y Ξ z implies x Ξ z
Graphs • Graph: a picture with vertices and edges • Digraph: a graph with arrows for edges (directed graph) • Walk: path from one vertex to another in a graph • Simple path: no repeated vertices • Cycle: path from one vertex back to itself
Trees • Directed graph with no cycles, with one root node such that there is a path from root to every other node • Leaves: nodes with no outarcs • Parent/Child nodes: edge connects from parent node to child node • Level of a node: length of path from root to node • Height: length of longest path from root to leaf
Proof Techniques: Proof by contradiction • Want to prove that P is true • Assume that P is not true • Arrive at an impossible conclusion
Proof by Contradiction Given: n is even iff n=2k for some integer k. Also: n is odd iff n = 2k – 1 for some integer k. Prove: If n2 is an even integer, then n is an even integer. Assume: n2 is an even integer and n is odd. n = 2k -1 n2 = (2k -1)2 = 4k2 -4k +1 = 2(2k2 -2k) -1 Since 2k2 -2k is an integer, n2 is odd. But that contradicts the assumption that n2 is even. So n must be even.
Proof Techniques: Proof by Induction • Prove base case: proposition is true for some number. (Base) • Assume that the proposition is true for some n >= the base case (Assume) • Show that the proposition holds for n+1. (Show) (Why does this work??)
Proof by Induction • Prove that the sum of the first n positive integers is • Base case: k =1; • 0+1= =1 • Assume sum of first k positive integers is • Then, sum of first k+1 integers is