Chapter Summary. Sets (2.1) Set Operations (2.2) Functions (2.3) Sequences and Summations (2.4) Cardinality of Sets (2.5) Matrices (2.

Similar documents
Chapter Summary. Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Computability

Section Summary. Definition of a Function.

A set is an unordered collection of objects.

With Question/Answer Animations. Chapter 2

Sec$on Summary. Definition of sets Describing Sets

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

Func%ons. function f to the element a of A. Functions are sometimes called mappings or transformations.

Sets McGraw-Hill Education

Sec$on Summary. Definition of a Function.

Section Summary. Definition of a Function.

Functions. Given a function f: A B:

2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R.

CS100: DISCRETE STRUCTURES

Propositional Logic, Predicates, and Equivalence

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60

Week Some Warm-up Questions

Chapter 2 - Basics Structures

0 Sets and Induction. Sets

Sets and Functions. MATH 464/506, Real Analysis. J. Robert Buchanan. Summer Department of Mathematics. J. Robert Buchanan Sets and Functions

Today s Topics. Methods of proof Relationships to logical equivalences. Important definitions Relationships to sets, relations Special functions

Theorem. For every positive integer n, the sum of the positive integers from 1 to n is n(n+1)

Chapter 1 : The language of mathematics.

SETS AND FUNCTIONS JOSHUA BALLEW

9/21/2018. Properties of Functions. Properties of Functions. Properties of Functions. Properties of Functions. Properties of Functions

Sets and Functions. (As we will see, in describing a set the order in which elements are listed is irrelevant).

n CS 160 or CS122 n Sets and Functions n Propositions and Predicates n Inference Rules n Proof Techniques n Program Verification n CS 161

Background for Discrete Mathematics

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth

ICS141: Discrete Mathematics for Computer Science I

Functions as Relations

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

MATH 220 (all sections) Homework #12 not to be turned in posted Friday, November 24, 2017

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

CS Discrete Mathematics Dr. D. Manivannan (Mani)

1.1 Introduction to Sets

CSI30. Chapter 2. Basic Structures: Sets, Functions, Sequences, Sums. 2.1 Sets and subsets 2.2 Sets of sets

Math 42, Discrete Mathematics

Discrete Mathematics. W. Ethan Duckworth. Fall 2017, Loyola University Maryland

Mathematics Review for Business PhD Students

2. Sets. 2.1&2.2: Sets and Subsets. Combining Sets. c Dr Oksana Shatalov, Spring

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

Mathematics Review for Business PhD Students Lecture Notes

Functions. Definition 1 Let A and B be sets. A relation between A and B is any subset of A B.

Review 1. Andreas Klappenecker

Selected problems from past exams

Discrete Mathematics. (c) Marcin Sydow. Sets. Set operations. Sets. Set identities Number sets. Pair. Power Set. Venn diagrams

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Math Fall 2014 Final Exam Solutions

MATH 215 Sets (S) Definition 1 A set is a collection of objects. The objects in a set X are called elements of X.

Section 4.4 Functions. CS 130 Discrete Structures

MAT115A-21 COMPLETE LECTURE NOTES

CHAPTER 1. Preliminaries. 1 Set Theory

Exclusive Disjunction

Cartesian Products and Relations

MATH 201 Solutions: TEST 3-A (in class)

Solutions to Homework Problems

LESSON RELATIONS & FUNCTION THEORY

Sets. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

A Semester Course in Basic Abstract Algebra

CSCE 222 Discrete Structures for Computing

1 Chapter 1: SETS. 1.1 Describing a set

Discrete Basic Structure: Sets

Notes. Functions. Introduction. Notes. Notes. Definition Function. Definition. Slides by Christopher M. Bourke Instructor: Berthe Y.

Sets. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

4. Sets The language of sets. Describing a Set. c Oksana Shatalov, Fall Set-builder notation (a more precise way of describing a set)

Sets. Introduction to Set Theory ( 2.1) Basic notations for sets. Basic properties of sets CMSC 302. Vojislav Kecman

4. Sets The language of sets. Describing a Set. c Oksana Shatalov, Fall

Discrete Mathematical Structures: Theory and Applications

COM S 330 Homework 05 Solutions. Type your answers to the following questions and submit a PDF file to Blackboard. One page per problem.

CS2742 midterm test 2 study sheet. Boolean circuits: Predicate logic:

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

BASIC MATHEMATICAL TECHNIQUES

1. Decide for each of the following expressions: Is it a function? If so, f is a function. (i) Domain: R. Codomain: R. Range: R. (iii) Yes surjective.

Math 13, Spring 2013, Lecture B: Midterm

Automata Theory and Formal Grammars: Lecture 1

Math 210 Exam 2 - Practice Problems. 1. For each of the following, determine whether the statement is True or False.

MATH 3300 Test 1. Name: Student Id:

0 Logical Background. 0.1 Sets

Numbers, sets, and functions

Section 0. Sets and Relations

Module 2: Language of Mathematics

REVIEW FOR THIRD 3200 MIDTERM

9/19/2018. Cartesian Product. Cartesian Product. Partitions

Set Theory. CPT Section D Quantitative Aptitude Chapter 7 Brijeshwar Prasad Gupta

AMB111F Notes 1: Sets and Real Numbers

Chapter 1. Sets and Mappings

9/21/17. Functions. CS 220: Discrete Structures and their Applications. Functions. Chapter 5 in zybooks. definition. definition

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

CS 220: Discrete Structures and their Applications. Functions Chapter 5 in zybooks

CS 173: Discrete Structures. Eric Shaffer Office Hour: Wed. 1-2, 2215 SC

CISC 1100: Structures of Computer Science

SET THEORY. 1. Roster or Tabular form In this form the elements of the set are enclosed in curly braces { } after separating them by commas.

Sets, Functions and Relations

Mathematical Preliminaries. Sipser pages 1-28

Topology. Xiaolong Han. Department of Mathematics, California State University, Northridge, CA 91330, USA address:

Copyright c 2007 Jason Underdown Some rights reserved. statement. sentential connectives. negation. conjunction. disjunction

Today s topics. Introduction to Set Theory ( 1.6) Naïve set theory. Basic notations for sets

Chapter 1. Sets and Numbers

Transcription:

Chapter 2

Chapter Summary Sets (2.1) Set Operations (2.2) Functions (2.3) Sequences and Summations (2.4) Cardinality of Sets (2.5) Matrices (2.6)

Section 2.1

Section Summary Definition of sets Describing Sets o Roster Method o Set-Builder Notation Some Important Sets in Mathematics Empty Set and Universal Set Subsets and Set Equality Cardinality of Sets Tuples Cartesian Product

Introduction Sets are one of the basic building blocks for the types of objects considered in discrete mathematics. Sets contains objects that have similar properties o Important for counting. o Programming languages have set operations. Set theory is an important branch of mathematics.

Sets Definition 1: A set is an unordered collection of objects. The objects in a set are called the elements, or members of the set. A set is said to contain its elements. o the students in this class o the chairs in this room The notation a A denotes that a is an element of the set A. If a is not a member of A, write a A Uppercase letters for sets, lowercase letters for elements.

Describing a Set: Roster Method List all the members of a set o S = {a,b,c,d} o Order not important S = {a,b,c,d} = {b,c,a,d} o Each distinct object is either a member or not; listing more than once does not change the set. S = {a,b,c,d} = {a,b,c,b,c,d} o Elipses ( ) may be used to describe a set without listing all of the members when the pattern is clear. S = {a,b,c,d,,z +

Roster Method Set of all vowels['vauəl] in the English alphabet: V = {a,e,i,o,u} Set of all odd positive integers less than 10: O = {1,3,5,7,9} Set of all positive integers less than 100: S = *1,2,3,..,99+ Set of all integers less than 0: S = *., -3,-2,-1}

Some Important Sets N = natural numbers = *0,1,2,3.+ Z = integers = *,-3,-2,-1,0,1,2,3, + Z+ = positive integers = *1,2,3,..+ R = set of real numbers R + = set of positive real numbers C = set of complex numbers. Q = set of rational numbers

Describing a Set: Set-Builder Notation Specify the property or properties that all members must satisfy: S = {x x is a positive integer less than 100} O = {x x is an odd positive integer less than 10} O = {x Z+ x is odd and x < 10} A predicate may be used: S = {x P(x)} Example: S = {x Prime(x)} Positive rational numbers: Q + = {x R x = p/q, for some positive integers p,q}

Interval Notation [a,b] = {x a x b} [a,b) = {x a x < b} (a,b] = {x a < x b} (a,b) = {x a < x < b} closed interval [a,b] open interval (a,b)

Universal Set and Empty Set The universal set U is the set containing everything currently under consideration. o Sometimes implicit o Sometimes explicitly stated. o Contents depend on the context. The empty set is the set with no elements. Symbolized, but {} also used. V a e i o u U Venn Diagram for the set of vowels

Some things to remember Sets can be elements of sets. o {{1,2,3},a, {b,c}} o {N,Z,Q,R} The empty set is different from a set containing the empty set. * + Definition 2: Two sets are equal if and only if they have the same elements. o Therefore if A and B are sets, then A and B are equal if and only if o We write A = B if A and B are equal sets. {1,3,5} = {3, 5, 1} {1,5,5,5,3,3,1} = {1,3,5}

Subsets Definition 3: The set A is a subset of B, if and only if every element of A is also an element of B. o The notation A B is used to indicate that A is a subset of the set B. o A B holds if and only if is true. THEOREM 1: For every set S, (i ) S and (ii ) S S. o Because x is always false, S,for every set S. o Because x S x S, S S, for every set S. If A B, but A B,. then we say A is a proper subset of B, denoted by A B. If A B, then is true

Showing a Set is (isn t) a Subset of Another Showing that A is a Subset of B: To show that A B, show that if x belongs to A, then x also belongs to B. Showing that A is not a Subset of B: To show that A is not a subset of B, A B, find an element x A with x B. (Such an x is a counterexample to the claim that x A implies x B.) Examples: 1. The set of all computer science majors at your school is a subset of all students at your school. 2. The set of integers with squares less than 100 is not a subset of the set of nonnegative integers.

Another look at Equality of Sets Recall that two sets A and B are equal, denoted by A = B, iff Using logical equivalences we have that A = B iff This is equivalent to A B and B A

The size of a Set Definition 4: Let S be a set. If there are exactly n distinct elements in S where n is a nonnegative integer, we say that S is a finite set and that n is the cardinality of S. The cardinality of S is denoted by S. Definition 5: A set is said to be infinite if it is not finite. Examples: o ø = 0 o Let S be the letters of the English alphabet. Then S = 26 o {1,2,3} = 3 o {ø} = 1 o The set of integers is infinite.

Power Sets DEFINITION 6: Given a set S, the power set of S is the set of all subsets of the set S. The power set of S is denoted by P(S). Example: o If A = {a,b} then o P(A) = {ø, {a},{b},{a,b}} If a set has n elements, then the cardinality of the power set is 2ⁿ. (In Chapters 5 and 6, we will discuss different ways to show this.)

Cartesian Product Definition 7: The ordered n-tuple (a 1, a 2,..., a n ) is the ordered collection that has a 1 as its first element, a 2 as its second element,..., and a n as its nth element. o Two n-tuples are equal if and only if their corresponding elements are equal. o 2-tuples are called ordered pairs. Definition 8: The Cartesian Product of two sets A and B, denoted by A B is the set of ordered pairs (a,b) where a A and b B. Example:A = {a,b} B = {1,2,3} o A B = {(a,1),(a,2),(a,3), (b,1),(b,2),(b,3)}

Cartesian Product Definition 9: The cartesian products of the sets A 1,A 2,,A n, denoted by A 1 A 2 A n, is the set of ordered n-tuples (a 1,a 2,,a n ) where a i belongs to A i for i = 1, n. Example: A B C where A = {0,1}, B = {1,2} and C = {0,1,2} Solution: o A B C = {(0,1,0), (0,1,1), (0,1,2),(0,2,0), (0,2,1), (0,2,2),(1,1,0), (1,1,1), (1,1,2), (1,2,0), (1,2,1), (1,1,2)}

Truth Sets of Quantifiers Given a predicate P and a domain D, we define the truth set of P to be the set of elements in D for which P(x) is true. The truth set of P(x) is denoted by Example: The truth set of P(x) where the domain is the integers and P(x) is x = 1 is the set {-1,1}

Section 2.2

Section Summary Set Operations o Union o Intersection o Complementation o Difference More on Set Cardinality Set Identities Membership Tables

Union Definition 1: Let A and B be sets. The union of the sets A and B, denoted by A B, is the set that contains those elements that are either in A or in B, or in both: Example: What is {1,2,3} *3, 4, 5+? o Solution: {1,2,3,4,5} Venn Diagram for A B U A B

Intersection Definition 2: The intersection of sets A and B, denoted by A B, is the set containing those elements in both A and B. Definition 3: Note if the intersection is empty, then A and B are said to be disjoint. Example: What is *1,2,3+ *3,4,5+? o Solution: {3} Example: What is *1,2,3+ *4,5,6+? o Solution: Venn Diagram for A B A B U

Difference Definition 4: Let A and B be sets. The difference of A and B, denoted by A B, is the set containing the elements of A that are not in B. The difference of A and B is also called the complement of B with respect to A. (sometimes denoted by A\B) A B = {x x A x B} = A B Example: the difference of set {1,3,5} and set {1,2,3} o Solution:{5} A B U Venn Diagram for A B

Complement Definition 5: Let U be the universal set. The complement of the set A, denoted by Ā, is the complement of A with respect to U. Therefore, the complement of the set A is U A. Ā = {x U x A} (The complement of A is sometimes denoted by A c.) Example: If U is the positive integers less than 100, what is the complement of {x x > 70} Venn Diagram for Complement o Solution: {x x 70} U Ā A

The Cardinality of the Union of Two Sets Inclusion-Exclusion A B = A + B - A B Example: o Let A be the math majors in your class and B be the CS majors. To count the number of students who are either math majors or CS majors, add the number of math majors and the number of CS majors, and subtract the number of joint CS/math majors.

Review Questions Example: U = {0,1,2,3,4,5,6,7,8,9,10} A = {1,2,3,4,5}, B ={4,5,6,7,8} 1. A B Solution: {1,2,3,4,5,6,7,8} 2. A B Solution: {4,5} 3. Ā Solution: {0,6,7,8,9,10} 4. B c Solution: {0,1,2,3,9,10} 5. A B Solution: {1,2,3} 6. B A Solution: {6,7,8}

Set Identities

Membership table

Example

Generalized Unions and Intersections Let A 1, A 2,, A n be an indexed collection of sets. We define: These are well defined, since union and intersection are associative. For i = 1,2,, let A i = {i, i + 1, i + 2,.}. Then,

Section 2.3

Section Summary Definition of a Function. o Domain, Cdomain o Image, Preimage One-to-one (Injection), onto (Surjection), Bijection Inverse Function Function Composition Graphing Functions Floor, Ceiling, Factorial

Functions Definition 1: Let A and B be nonempty sets. A function f from A to B, denoted f: A B is an assignment of each element of A to exactly one element of B. We write f(a) = b if b is the unique element of B assigned by the function f to the element a of A. Functions are sometimes called mappings or transformations. Carlota Rodriguez Students Grades A B Sandeep Patel Jalen Williams Kathy Scott C D F

Functions Given a function f: A B: o We say f maps A to B or f is a mapping from A to B. o A is called the domain of f. o B is called the codomain of f. If f(a) = b, then b is called the image of a under f. a is called the preimage of b. The range of f is the set of all images of points in A under f. We denote it by f(a). Two functions are equal when they have the same domain, the same codomain and map each element of the domain to the same element of the codomain.

Representing Functions Functions may be specified in different ways: o An explicit statement of the assignment. Students and grades example. o A formula. f(x) = x + 1 o A computer program. A Java program that when given an integer n, produces the nth Fibonacci Number (covered in the next section and also in Chapter 5).

Example f(a) =? o z The image of d is? o z The domain of f is? o A The codomain of f is? o B The preimage of y is? o b f(a) =? o {y,z} The preimage(s) of z is (are)? o {a,c,d} A a b c d B x y z

One-to-one function Definition 5: A function f is said to be one-to-one, or injunction, if and only if f(a) = f(b) implies that a = b for all a and b in the domain of f. Example: Determine whether the function f from {a, b, c, d} to {1, 2, 3, 4, 5} with f (a) = 4, f (b) = 5, f (c) = 1, and f (d) = 3 is oneto-one. Solution : yes.

Onto function Definition 7: A function f from A to B is called onto or surjection, if and only if for every element there is an element with. Example: Let f be the function from {a, b, c, d} to {1, 2, 3} defined by f (a) = 3, f (b) = 2, f (c) = 1, and f (d) = 3. Is f an onto function? Solution: Yes.

Bijections Definition 8: A function f is a one-to-one correspondence, or a bijection, if it is both one-to-one and onto (surjection and injection).

Showing that f is one-to-one or onto

Inverse Functions Definition 9: Let f be a bijection, from the set A to the set B. The inverse function of f is the function that assigns to an element b belonging to B the unique element a in A such that f (a) = b. The inverse function of f is denoted by f 1. Hence, f 1 (b) = a when f (a) = b. No inverse exists unless f is a bijection. Why?

Inverse Functions A a B A B f V a V b W b W c c d X d X Y Y

Example Example: Let f be the function from {a,b,c} to {1,2,3} such that f(a) = 2, f(b) = 3, and f(c) = 1. Is f invertible and if so what is its inverse? Solution: o The function f is invertible because it is a one-to-one correspondence. The inverse function f -1 reverses the correspondence given by f, so f -1 (1) = c, f -1 (2) = a, and f -1 (3) = b.

Example Example 2: Let f: Z Z be such that f(x) = x + 1. Is f invertible, and if so, what is its inverse? Solution: o The function f is invertible because it is a one-to-one correspondence. The inverse function f -1 reverses the correspondence so f -1 (y) = y 1. Example 3: Let f: R R be such that. Is f invertible, and if so, what is its inverse? Solution: o The function f is not invertible because it is not one-to-one.

Composition Definition 10: Let g : A B and let f :B C. The composition of the functions f and g, denoted for all a A by f o g, is defined by (f o g)(a) = f (g(a)).

Composition A B C a b c d g V W X Y f h i j A a b c d C h i j

Composition Example 1: If and, then and

Composition Questions Example 2: Let g be the function from the set {a,b,c} to itself such that g(a) = b, g(b) = c, and g(c) = a. Let f be the function from the set {a,b,c} to the set {1,2,3} such that f(a) = 3, f(b) = 2, and f(c) = 1. What is the composition of f and g, and what is the composition of g and f. Solution: o The composition f g is defined by o f g (a)= f(g(a)) = f(b) = 2. o f g (b)= f(g(b)) = f(c) = 1. o f g (c)= f(g(c)) = f(a) = 3. Note that g f is not defined, because the range of f is not a subset of the domain of g.

Composition Questions Example 2: Let f and g be functions from the set of integers to the set of integers defined by f(x) = 2x + 3 and g(x) = 3x + 2. What is the composition of f and g, and also the composition of g and f? Solution: o f g (x)= f(g(x)) = f(3x + 2) = 2(3x + 2) + 3 = 6x + 7 o g f (x)= g(f(x)) = g(2x + 3) = 3(2x + 3) + 2 = 6x + 11

Graphs of Functions Let f be a function from the set A to the set B. The graph of the function f is the set of ordered pairs {(a,b) a A and f(a) = b}.

Some Important Functions Definition 12: The floor function assigns to the real number x the largest integer that is less than or equal to x. The value of the floor function at x is denoted by. The ceiling function assigns to the real number x the smallest integer that is greater than or equal to x. The value of the ceiling function at x is denoted by. Example:

Floor and Ceiling Functions

Floor and Ceiling Functions

Factorial Function Definition: f: N Z +, denoted by f(n) = n! is the product of the first n positive integers when n is a nonnegative integer. f(n) = 1 2 (n 1) n, f(0) = 0! = 1 Examples: f(1) = 1! = 1 f(2) = 2! = 1 2 = 2 f(6) = 6! = 1 2 3 4 5 6 = 720 f(20) = 2,432,902,008,176,640,000.