MATH 213 Chapter 2: Basic Structures Dr. Eric Bancroft Fall 2013 Dr. Eric Bancroft MATH 213 Fall 2013 1 / 60
Chapter 2 - Basics Structures 2.1 - Sets 2.2 - Set Operations 2.3 - Functions 2.4 - Sequences and Summations 2.5 - Cardinality 2.6 - Matrices Dr. Eric Bancroft MATH 213 Fall 2013 2 / 60
2.1 - Sets Definitions and Notation Definition (Set) Notation We ll typically use uppercase letters to denote sets: S, A, B,... When listing out the elements in a set (what the book calls the roster method ) we ll use braces, e.g., S = {2, red, water, {1}} Membership: x S means x / S means Note: Order and repetition do not matter when listing the elements of a set. For example, {5, 3, 2, 7, 3, 8, 2, 2, 2} is the same set as {2, 3, 5, 7, 8}. Dr. Eric Bancroft MATH 213 Fall 2013 3 / 60
2.1 - Sets Examples Let S be the set of people in this room. Some standard sets of numbers: N is the set of natural numbers, {0, 1, 2, 3,... }. Note: Some books define N to be {1, 2, 3,... } (the counting numbers ). Z is the set of all integers Q is the set of all rational numbers. R is the set of all real numbers. C is the set of all complex numbers. Z + is the set of all positive integers (sometimes written Z + ). You may also see this sort of notation to denote other subset of certain sets of numbers, such as Z <0, Z 0, R + (or R + ), Q +, etc. Note: positive does not include 0, but saying nonnegative does include 0. Dr. Eric Bancroft MATH 213 Fall 2013 4 / 60
2.1 - Sets Set-Builder Notation Often we will write sets using set-builder notation; the general form is {x P (x)} or {x : P (x)} for some predicate P (x). The or : is read such that. Example 1. {x x is a left-handed guitar player} 2. {x x R and 1 x 2} We can also use set-builder notation to make the domain(s) explicit: Example {x R : x 2 < 10} {x N : x 2 < 10} {x Z : x 2 < 10} Dr. Eric Bancroft MATH 213 Fall 2013 5 / 60
2.1 - Sets Examples 1. The set of all integers that are perfect squares. 2. {2, 4, 6} Dr. Eric Bancroft MATH 213 Fall 2013 6 / 60
2.1 - Sets Venn Diagrams The universal set is the set of all objects under consideration (similar to the domain previously). We denote it by U and draw a rectangle in the Venn Diagram. In a Venn Diagram we picture a set, say A, as a restricted portion of the universal set: Dr. Eric Bancroft MATH 213 Fall 2013 7 / 60
2.1 - Sets The Empty Set Definition Empty Set Question Is = { }? Dr. Eric Bancroft MATH 213 Fall 2013 8 / 60
2.1 - Sets Subsets Notation Predicate Definition We can define subset using predicates: Questions For all sets S, 1. Is S? 2. Is S S? Dr. Eric Bancroft MATH 213 Fall 2013 9 / 60
2.1 - Sets Subsets and Equality To show that A B, we show that if x A then x B. To show that A B, we find at least one x A such that x / B. Two set A and B are equal if and only if: Dr. Eric Bancroft MATH 213 Fall 2013 10 / 60
2.1 - Sets Sundry Definitions Proper subsets: Cardinality of a set: Finite sets: Infinite sets: Dr. Eric Bancroft MATH 213 Fall 2013 11 / 60
2.1 - Sets New Sets From Old The Power Set: Cartesian Products:. Dr. Eric Bancroft MATH 213 Fall 2013 12 / 60
2.1 - Sets Examples Let B = {1, 2} and C = {a, b, c}. Find the following: 1. P ( ) 2. P ({ }) 3. P (B) 4. B C 5. B C 6. B B Dr. Eric Bancroft MATH 213 Fall 2013 13 / 60
2.2 - Set Operations Union Definition (Union) The union of two sets A and B is the set of all elements which are either in A or in B Notation Venn Diagram Dr. Eric Bancroft MATH 213 Fall 2013 14 / 60
2.2 - Set Operations Intersection Definition (Intersection) The intersection of two sets A and B is the set of all elements which are in both A and B. Notation Venn Diagram Dr. Eric Bancroft MATH 213 Fall 2013 15 / 60
2.2 - Set Operations Generalized Unions and Intersections Both unions and intersections are associative, so their generalizations are well-defined. Notation Dr. Eric Bancroft MATH 213 Fall 2013 16 / 60
2.2 - Set Operations More Definitions Disjoint Sets: Mutually Disjoint Collections of Sets: Principle of Inclusion/Exclusion: Set Difference Dr. Eric Bancroft MATH 213 Fall 2013 17 / 60
2.2 - Set Operations Set Complement Definition (Complement of a Set) Venn Diagram Dr. Eric Bancroft MATH 213 Fall 2013 18 / 60
2.2 - Set Operations Set Identities I Identity A U = A A = A A U = U A = A A = A A A = A (A) = A A B = B A A B = B A Name Identity Laws Domination Laws Idempotent Laws Complementation Law Commutative Laws Dr. Eric Bancroft MATH 213 Fall 2013 19 / 60
2.2 - Set Operations Set Identities II A (B C) = (A B) C A (B C) = (A B) C A (B C) = (A B) (A C) A (B C) = (A B) (A C) A B = Ā B A B = Ā B A (A B) = A A (A B) = A A Ā = U A Ā = Associative Laws Distributive Laws De Morgan s Laws Absorption Laws Complement Laws Dr. Eric Bancroft MATH 213 Fall 2013 20 / 60
2.2 - Set Operations Proving Set Identities I Example Prove the Second Absorption Law: A (A B) Dr. Eric Bancroft MATH 213 Fall 2013 21 / 60
2.2 - Set Operations Proving Set Identities II Example Prove the first part of De Morgan s Law: A B = (Ā B) Dr. Eric Bancroft MATH 213 Fall 2013 22 / 60
2.3 - Functions Definition (Function) Given nonempty sets A and B, a function f from A to B is an assignment of exactly one element of B to each element of A. We write f(a) = b where b is the unique element of the set B to which f maps the element a of the set A. Functions are also called mappings, transformations, or assignments. Example 1. Each student in this room is assigned to exactly one seat. 2. Each person is assigned to exactly one birth mother. 3. Each nonnegative real number is assigned exactly one square root. Dr. Eric Bancroft MATH 213 Fall 2013 23 / 60
2.3 - Functions Notation If f is a function from A to B, we write this as f : A B. If A and B are relatively small sets, we can draw the function: Dr. Eric Bancroft MATH 213 Fall 2013 24 / 60
2.3 - Functions More terminology Given a function f : A B, Domain and Codomain: Range: Image: Pre-Image: Arithmetic on Functions: If f 1 and f 2 are functions whose codomain is the real numbers, then we can define f 1 + f 2 and f 1 f 2 as... Dr. Eric Bancroft MATH 213 Fall 2013 25 / 60
2.3 - Functions Image of a Set Suppose f : A B and S A. Then f(s) = Example Let A = {1, 2, 3, 4, 5} and B = {a, b, c, d}, and S = {2, 3, 4} and T = {1, 5}, and let f(1) = b, f(2) = c, f(3) = a, f(4) = d, and f(5) = b. Find 1. f( ) 2. f(s) 3. f(t ) Dr. Eric Bancroft MATH 213 Fall 2013 26 / 60
2.3 - Functions One-to-One and Onto Definition (One-to-One) A function f : A B is said to be one-to-one (abbreviated 1-1 ) or injective if and only if... Definition (Onto) A function f : A B is said to be onto or surjective if and only if... Dr. Eric Bancroft MATH 213 Fall 2013 27 / 60
2.3 - Functions Bijection and Inverse Definition (Bijection) A function f : A B is said to be a bijection or one-to-one correspondence if and only if it is both injective and surjective. Definition (Inverse) The inverse (when it exists) of a function f : A B is the function... Dr. Eric Bancroft MATH 213 Fall 2013 28 / 60
2.3 - Functions Cardinality and Functions If f : A B is 1-1, then A B. If f : A B is onto, then A B. If f : A B is a bijection, then A B. Dr. Eric Bancroft MATH 213 Fall 2013 29 / 60
2.3 - Functions Monotonic Functions A function f is said to be increasing if and only if x < y implies that... A function f is said to be decreasing if and only if x < y implies that... A function f is said to be strictly increasing if and only if x < y implies that... A function f is said to be strictly decreasing if and only if x < y implies that... Dr. Eric Bancroft MATH 213 Fall 2013 30 / 60
2.3 - Functions Proofs Involving Functions I Example Show that f : R R defined by f(x) = 3x + 4 is a bijection. Dr. Eric Bancroft MATH 213 Fall 2013 31 / 60
2.3 - Functions Proofs Involving Functions II Example Let A be the set of even integers and B be the set of odd integers. Define f : A B as f(x) = x + 1. Determine whether f is a bijection. Dr. Eric Bancroft MATH 213 Fall 2013 32 / 60
2.3 - Functions Compositions of Functions Definition Given two functions f : B C and g : A B, we define the composition of f and g to be... Dr. Eric Bancroft MATH 213 Fall 2013 33 / 60
2.3 - Functions The Graph of a Function Definition The graph of a function f : A B is the set of all ordered pairs (a, b) for which f(a) = b. Dr. Eric Bancroft MATH 213 Fall 2013 34 / 60
2.3 - Functions One last thing... Definition (Floor and Ceiling Functions) x x Example Dr. Eric Bancroft MATH 213 Fall 2013 35 / 60
2.4 - Sequences and Summations Sequences Definition (Sequence) A sequence is a function from some subset of the integers (usually N or Z + ) into R. Instead of writing f(i) for the function value, we instead use subscripts to denote the ith function value and write a i. Notation The notation for an infinite sequence looks like a 0, a 1, a 2,... or = {a i } or = {a i } i=0 Note: Although we use braces as our delimiters, a sequence is not the same as a set because the order of a sequence matters! Unless otherwise noted: if the function is defined at 0 then we assume our sequence starts at the index 0; if the function is not defined at 0 then we assume the sequence starts at the index 1. Dr. Eric Bancroft MATH 213 Fall 2013 36 / 60
2.4 - Sequences and Summations Progessions Definition (Geometric Progression) A geometric progression is a sequence of the form a, ar, ar 2,..., ar n,... where a, r R. a is called the initial term and r is called the common ratio. Definition (Arithmetic Progression) An arithmetic progression is a sequence of the form a, a + d, a + 2d,..., a + nd,... where a, d R. a is called the initial term and d is called the common difference. Dr. Eric Bancroft MATH 213 Fall 2013 37 / 60
2.4 - Sequences and Summations Examples Find the pattern in each of the following: 1. 3, 10, 31, 94,... 2. 1 2, 1 4, 1 8, 1 16,... 3. 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4,... Dr. Eric Bancroft MATH 213 Fall 2013 38 / 60
2.4 - Sequences and Summations Strings Finite sequences of the form a 1, a 2,..., a n are sometimes viewed and written as strings: a 1 a 2... a n The empty string is denoted by λ. Dr. Eric Bancroft MATH 213 Fall 2013 39 / 60
2.4 - Sequences and Summations Summations and Summation Notation The sum of the first n terms of a sequence {a n } is denoted by... Reindexing Suppose we want to change the starting index of a sum... Dr. Eric Bancroft MATH 213 Fall 2013 40 / 60
2.4 - Sequences and Summations Finite Geometric Series The sum of a finite geometric series (finite geometric progression) is n a ar n+1 ar i if r 1 = 1 r i=0 (n + 1)a if r = 1 Other Useful Sums n n(n + 1) k = 2 k=1 ar k = k=0 a 1 r for r < 1 (See the book for other summation formulae.) Dr. Eric Bancroft MATH 213 Fall 2013 41 / 60
2.4 - Sequences and Summations Summation Over Members of a Set Let A = {0, 2, 4}, f : A R given by f(i) = a i = 3 i. Then a i = i A Double Summation 3 4 (i j) i=1 j=1 Dr. Eric Bancroft MATH 213 Fall 2013 42 / 60
2.4 - Sequences and Summations Recurrence Relations Definition (Recurrence Relation) A recurrence relation for the sequence {a n } is a recursive definition for the terms of the sequence which expresses a n in terms of one or more of the previous terms of the sequence. Definition (Solution) A solution of a recurrence relation is a sequence whose terms satisfy the recurrence relation. A closed formula solution of a recurrence relation is a non-recursive solution of the recurrence relation. Definition (Initial Conditions) The initial conditions of a recursively defined sequence specify the terms that precede the first terms where the recurrence relation takes effect. Dr. Eric Bancroft MATH 213 Fall 2013 43 / 60
2.4 - Sequences and Summations Example Let a 0 = 1, a n = 3a n 1 + 1. Find the first 5 terms in the sequence, and show that a n = 3n+1 1 2 is a closed formula solution. Dr. Eric Bancroft MATH 213 Fall 2013 44 / 60
2.4 - Sequences and Summations Example Determine whether the sequences a n = 2 n and a n = n 4 n are solutions of the recurrence relation a n = 8a n 1 16a n 2 Dr. Eric Bancroft MATH 213 Fall 2013 45 / 60
2.4 - Sequences and Summations The Towers of Hanoi Suppose we have n disks of different sizes and three pegs, and the disks are stacked on one of the pegs 1 in order of size with the largest at the bottom of the peg. If we are only allowed to move one disk at a time and cannot put a larger disk on a smaller one, then how many moves are needed to move the entire tower to a new peg? 1 Drill a hole in each disk, if needed. Dr. Eric Bancroft MATH 213 Fall 2013 46 / 60
2.5 - Cardinality Definition Two sets A and B have the same cardinality if and only if there exists a bijection between them. When this is the case, we write A = B. Definition If there is a 1-1 function from A to B, then the cardinality of A is less than or equal to the cardinality of B, and we write A B. When A B and A and B have different cardinality, then the cardinality of A is less than the cardinality of B, and we write A < B. Definition A set is countable if it is finite or there exists a bijection between the set and Z +. A set that is not countable is uncountable. When an infinite set S is countable, we denote the cardinality of S by ℵ 0 (read aleph-null or aleph-nought ) and write S = ℵ 0. Dr. Eric Bancroft MATH 213 Fall 2013 47 / 60
2.5 - Cardinality Example A graphical proof that Q has cardinality ℵ 0 : Dr. Eric Bancroft MATH 213 Fall 2013 48 / 60
2.6 - Matrices Definitions Definition (Matrix, pl. Matrices) A matrix is a rectangular array of numbers. A matrix with m rows and n columns is called an m n (read m by n ) matrix; if m = n then we say that the matrix is a square matrix. Two matrices are equal if and only if the corresponding entries in every position are equal. Example Notation The book uses boldface uppercase letters to denote matrices; typically normal font uppercase letters are used in handwritten work. The book uses brackets as delimiters, but parentheses are also commonly used. Dr. Eric Bancroft MATH 213 Fall 2013 49 / 60
2.6 - Matrices Definitions Let a 11 a 12... a 1n a 21 a 22... a 2n A =... a m1 a m2... a mn The ith row of A is the 1 n row matrix [ ] a i1 a i2... a in ; the jth column of A is the m 1 column matrix a 1j a 2j. a mj is denoted by a ij, and we may write A = [a ij ]. The ijth element of A Dr. Eric Bancroft MATH 213 Fall 2013 50 / 60
2.6 - Matrices Matrix Addition Let A = [a ij ] and B = [b ij ] both be m n matrices. The sum of A and B is the matrix A + B = [a ij + b ij ]. So, we simply add corresponding elements of each matrix. Note: if the matrices are different sizes, then the sum is undefined! Example Let A = [ ] 1 2 3, B = 4 5 6 [ ] 1 0 1, C = 2 3 2 1 0 1 2. 3 2 Dr. Eric Bancroft MATH 213 Fall 2013 51 / 60
2.6 - Matrices Matrix Scalar Multiplication Let A = [a ij ] and α R. Then αa = [α a ij ], i.e., we multiply each element of the matrix by α. Example 1 0 Let α = 2, C = 1 2. 3 2 Dr. Eric Bancroft MATH 213 Fall 2013 52 / 60
2.6 - Matrices Matrix Multiplication Let A = [a ij ] be an m k matrix and B = [b ij ] be a k n matrix. The product of A and B is AB = [c ij ], where c ij = a i1 b 1j + a i2 b 2j + + a ik b kj 2 Note: Matrix multiplication is not commutative! Example Let A = [ ] 1 2 3, B = 4 5 6 [ ] 1 0 1, C = 2 3 2 1 0 1 2. 3 2 2 This is the dot product of the ith row of A with the jth column of B. Dr. Eric Bancroft MATH 213 Fall 2013 53 / 60
2.6 - Matrices Definition (Identity) The identity matrix is the n n matrix I n which has 1s on the diagonal and 0s everywhere else: 1 0... 0 0 1... 0 I n =... 0 0... 1 If we multiply a matrix A by an appropriately sized identity matrix, then the product is still A. Dr. Eric Bancroft MATH 213 Fall 2013 54 / 60
2.6 - Matrices Definition (Inverse) The inverse of a square n n matrix is the n n matrix A 1 such that AA 1 = A 1 A = I n For 2 2 matrices we have the following formula for the inverse: [ ] 1 a b = c d 1 ad bc [ d ] b c a Dr. Eric Bancroft MATH 213 Fall 2013 55 / 60
2.6 - Matrices Transpose of a Matrix Definition (Transpose) Let A = [a ij ] be an m n matrix. The transpose of A is the matrix A t = [a ji ] This means that the rows of A become the columns of A t (this also means that the columns of A become the rows of A t ). Definition (Symmetric) A matrix A is said to be symmetric if A = A t Note: If A is symmetric then it must be square. Dr. Eric Bancroft MATH 213 Fall 2013 56 / 60
2.6 - Matrices Zero-One Matrices I A zero-one matrix is one whose entries are all either zeros or ones. We can combine zero-one matrices using Boolean operations: Meet: A B Join: A B Dr. Eric Bancroft MATH 213 Fall 2013 57 / 60
2.6 - Matrices Zero-One Matrices II Boolean product: A B Dr. Eric Bancroft MATH 213 Fall 2013 58 / 60
2.6 - Matrices Powers of a Matrix If A is a square matrix, then we can define I n if r = 0 A r = AA }{{... A} if r Z + r times If A is a square zero-one matrix, then we can define the rth Boolean power of A as I n if r = 0 A [r] = A A A }{{} if r Z + r times Dr. Eric Bancroft MATH 213 Fall 2013 59 / 60
2.6 - Matrices Examples Dr. Eric Bancroft MATH 213 Fall 2013 60 / 60