Relations. Functions. Bijection and counting.

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

Systems of Linear Equations: Solving by Graphing

1.4 Cardinality. Tom Lewis. Fall Term Tom Lewis () 1.4 Cardinality Fall Term / 9

Sets & Functions. x A. 7 Z, 2/3 Z, Z pow(r) Examples: {7, Albert R., π/2, T} x is a member of A: x A

MATH 2050 Assignment 4 Fall Due: Thursday. u v v 2 v = P roj v ( u) = P roj u ( v) =

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

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

Mathematics Review for Business PhD Students

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

Section 4.4 Functions. CS 130 Discrete Structures

Discrete Mathematics. Kenneth A. Ribet. January 31, 2013

Mathematics Review for Business PhD Students Lecture Notes

2. Polynomials. 19 points. 3/3/3/3/3/4 Clearly indicate your correctly formatted answer: this is what is to be graded. No need to justify!

CSE 20 DISCRETE MATH. Fall

Propositional Logic, Predicates, and Equivalence

RELATIONS AND FUNCTIONS through

Practice Exam 1 CIS/CSE 607, Spring 2009

LESSON 35: EIGENVALUES AND EIGENVECTORS APRIL 21, (1) We might also write v as v. Both notations refer to a vector.

CS 455/555: Mathematical preliminaries

Section 3.1. ; X = (0, 1]. (i) f : R R R, f (x, y) = x y

Math Fall 2014 Final Exam Solutions

8. BOOLEAN ALGEBRAS x x

MATH 243E Test #3 Solutions

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

MATH 101: ALGEBRA I WORKSHEET, DAY #1. We review the prerequisites for the course in set theory and beginning a first pass on group. 1.

Section 7.2: One-to-One, Onto and Inverse Functions

What is the limit of a function? Intuitively, we want the limit to say that as x gets closer to some value a,

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).

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

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

Discrete Basic Structure: Sets

Introduction to Automata

Background for Discrete Mathematics

Algebra/Pre-calc Review

R = { } Fill-in-the-Table with the missing vocabulary terms: 1) 2) Fill-in-the-blanks: Function

Unit 12 Study Notes 1 Systems of Equations

Review of Functions. Functions. Philippe B. Laval. Current Semester KSU. Philippe B. Laval (KSU) Functions Current Semester 1 / 12

Chapter 6: Systems of Equations and Inequalities

Mathematics. Polynomials and Quadratics. hsn.uk.net. Higher. Contents. Polynomials and Quadratics 1. CfE Edition

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

SETS AND FUNCTIONS JOSHUA BALLEW

FUNCTIONS. Note: Example of a function may be represented diagrammatically. The above example can be written diagrammatically as follows.

Automata and Languages

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

Higher. Polynomials and Quadratics. Polynomials and Quadratics 1

Vertex. March 23, Ch 9 Guided Notes.notebook

MAT389 Fall 2016, Problem Set 2

Flows and Connectivity

Chapter 2 - Basics Structures

CS100: DISCRETE STRUCTURES

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

Constant 2-labelling of a graph

Sets. A set is a collection of objects without repeats. The size or cardinality of a set S is denoted S and is the number of elements in the set.

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

Three Profound Theorems about Mathematical Logic

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

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

12.1 Systems of Linear equations: Substitution and Elimination

Relations and Functions

Ch 3 Alg 2 Note Sheet.doc 3.1 Graphing Systems of Equations

Trigonometry Outline

COMP9020 Lecture 3 Session 2, 2016 Sets, Functions, and Sequences. Revision: 1.3

8.4 Inverse Functions

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 27

With Question/Answer Animations. Chapter 2

POL502: Foundations. Kosuke Imai Department of Politics, Princeton University. October 10, 2005

Automata Theory and Formal Grammars: Lecture 1

MATH STUDENT BOOK. 9th Grade Unit 8

CSCE 222 Discrete Structures for Computing

Course 15 Numbers and Their Properties

N E W S A N D L E T T E R S

Selected solutions to Discrete Mathematics and Functional Programming

( 7, 3) means x = 7 and y = 3. ( 7, 3) works in both equations so. Section 5 1: Solving a System of Linear Equations by Graphing

Math Review Packet #5 Algebra II (Part 2) Notes

MGF 1106: Exam 1 Solutions

Mathematics. Polynomials and Quadratics. hsn.uk.net. Higher. Contents. Polynomials and Quadratics 52 HSN22100

Linear Equations and Arithmetic Sequences

1. SET 10/9/2013. Discrete Mathematics Fajrian Nur Adnan, M.CS

MATRIX TRANSFORMATIONS

8.3 Zero, Negative, and Fractional Exponents

MA123, Chapter 1: Equations, functions and graphs (pp. 1-15)

Week Some Warm-up Questions

Functions Functions and Modeling A UTeach/TNT Course

Mathematical Structures Combinations and Permutations

Study sheet for Final CS1100 by Matt in Wed night class

MATH 215 DISCRETE MATHEMATICS INSTRUCTOR: P. WENG

Equivalence of Propositions

6 CARDINALITY OF SETS

Northwest High School s Algebra 2/Honors Algebra 2

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

Algorithms: Lecture 2

Math 205 April 28, 2009 Final Exam Review

Grade 7/8 Math Circles Winter March 20/21/22 Types of Numbers

Chapter 5: Integer Compositions and Partitions and Set Partitions

Chapter 18 Quadratic Function 2

8.1 Exponents and Roots

STEP Support Programme. Hints and Partial Solutions for Assignment 17

TURING MAHINES

CSE 20 DISCRETE MATH WINTER

Transcription:

Relations.. and counting.

s Given two sets A = {,, } B = {,,, 4} Their A B = {(, ), (, ), (, ), (, ), (, ), (, ), (, ), (, ), (, ), (, 4), (, 4), (, 4)} Question: What is the cartesian product of? ( is the set of all integers) p.

= (, ) (, 0) Origin (0, 0) All pairs of integers are in, for emaple (, ) (, ) p.

Is it a? p. 4

of p. 5

Is it a? p. 6

of = p. 7

Is it a? (, 0) (, 0) p. 8

Is it a? No (, 0) (, 0) R = (, ) ma(, ) = p. 9

Is it a? No (, 0) (, 0) A subset R of a Cartesian product is called a relation. p. 0

Relations Given an two sets A = {,,, } and B = {,,,...} Def. A subset R of the A B is called a relation from the set A to the set B. R = (, 99), (, 5), (, 0 5 ), (, ), (, 5) A B p.

Relations Eample of a relation: S = set of students C = set of classes R = {(s, c) student s takes class c} Alice Bob Eve Mark CS 50 CS 5 Math 54 Hist 5 Zack p.

Airline route map We connect two cities if the airline operates a flight from one to the other. Is it a relation? p.

Airline route map Routes Cities Cities p. 4

Airline route map p. 5

An subset of A B is a relation R R = (, ), (, ), (, ), (, ), (, ), (, ), (0, ), (, ), (, ) p. 6

An subset of A B is a relation (, ) R R = (, ) ( +) +( ) p. 7

A function is a relation too! R R = (, ) = f () p. 8

Relation {(, ) = } 0 0 p. 9

Relation {(, ) = rem } 0 0 p. 0

Def. A relation R A B is a function (a functional relation) if for ever a A, there is at most one b B so that (a, b) R. A = {,, }, B = {,,, 4} R = {(, ), (, ), (, )} R = {(, ), (, ), (, 4), (, ), (, 4), (, 4)} R = {(, ), (, ), (, 4)} Not a function 4 4 4 p.

Functional relation R A B defines a unique wa to map each element from the set A to an element from the set B. There is a well-known and convenient notation for functions: f (a) = b where a A and b B It maps elements from A to B: f : A B A f B p.

Def. For the function f : A B, set A is called domain, and set B is called codomain. 4 f : A B z domain(f ) = A = {,, z} codomain(f ) = B = {,,, 4} image(f ) = f (A) = {, } Def. f (a) is the image of a point a A. Def. The image of a function f, denoted b f (A), is the set of all images of all points a A f (A) = { a A (f (a) = )}. The image of a function is also called range. p.

Onto Def. A function f : A B is called onto if and onl if for ever element b B there is an element a A with f (a) = b. In other words, the image f (A) is the whole codomain B. f : A B is onto g : A B is not onto z 4 z 4 w w v v p. 4

One-to-one Def. A function f : A B is said to be one-to-one if and onl if f () = f () implies that = for all, A. f : A B is one-to-one g : B C is not one-to-one z 4 4 /7 /6 w /5 0 0 p. 5

Def. The function f is a bijection (also called one-to-one correspondence) if and onl if it is both one-to-one and onto. f : A B is a bijection g : A B is not a bijection z 4 z 4 w w v 0 v 0 p. 6

f : A B is one-to-one, but not onto g : C D is onto, but not one-to-one z 4 z w w 0 v 0 So, both functions are not bijections. p. 7

. Observation Rule. Given two sets A and B, if there eists a bijection f : A B, then A = B. z w v 4 0 We can count the size of the set A, instead of the size of B! p. 8

Rule. Consider two similar problems: (a) How man bit strings contain eactl three s and two 0s? 00 (b) How man strings can be composed of three A s and five b s so that an A is alwas followed b a b? AbAbbAbb We show that this two problems are equivalent b constructing a bijection. p. 9

Rule. Let X be the set of bit strings X = {00,...} and Y be the set of A and b strings Y = {AbAbbAbb,...} We can construct a bijection f : X Y : gets replaced b Ab 0 gets replaced b b p. 0

Rule. f : 00 Ab Ab Ab b b 00 Ab Ab b Ab b 00 Ab Ab b b Ab 00 Ab b Ab Ab b 00 Ab b Ab b Ab 00 Ab b b Ab Ab 00 b Ab Ab Ab b 00 b Ab Ab b Ab 00 b Ab b Ab Ab 00 b b Ab Ab Ab Function f is one-to-one and onto, so it is a bijection. Therefore, the cardinalities of two sets are equal: X = Y = 5 = 0. p.

. Observation Observation For ever bijection f : A B, eists an inverse function f : B A f : A B z w v 4 0 The inverse function is a bijection too. p.

. Observation Observation For ever bijection f : A B, eists an inverse function f : B A f : A B f : B A z 4 4 z w w v 0 0 v The inverse function is a bijection too. p.

. Observation Given two bijections f : A B and g : B C. Consider their composition h() = g(f ()) f : A B g : B C z 4 4 4/5 /5 /5 w /5 h : A C is a bijection, and therefore A = C. p. 4

. Observation Given two bijections f : A B and g : B C. Consider their composition h() = g(f ()) f : A B g : B C h : A C z 4 4 4/5 z 4/5 /5 /5 /5 /5 w /5 w /5 h : A C is a bijection, and therefore A = C. p. 5

. Counting subsets Please, count the number of subsets of a set A = {a, b, c, d, e} b reducing the problem to counting bit strings. Let s find a bijection between the power set (A) = {, {a}, {b},...} and the set of bit stings of length 5: {0, } 5 = {00000, 0000, 0000, 000,...} p. 6

. Counting subsets Please, count the number of subsets of a set A = {a, b, c, d, e} b reducing the problem to counting bit strings. Let s find a bijection f between the power set (A) = {, {a}, {b},...} and the set of bit stings of length 5: {0, } 5 = {00000, 0000, 0000, 000,...} p. 7

. Counting subsets f : ({a, b, c, d, e}) {0, } 5 0s and s encode the membership of the five elements of {a, b, c, d, e} f : 00000 {a} 0000 {b} 0000 {a, b} 000 {c} 0000 {a, c} 000 {b, c} 000 {a, b, c} 00...skipping um.. subsets {a, b, c, d, e} The cardinalit {0, } 5 = 5 = Therefore, b the bijection rule, (A) = 5 p. 8

principle We remember the subtraction rule for the union of two sets A B = A + B A B Can it be generalized for a union of n sets Of course, it can! A... A n = A +... + A n something? p. 9

principle We remember the subtraction rule for the union of two sets A B = A + B A B Can it be generalized for a union of n sets Of course, it can! A... A n = A +... + A n something? p. 40

principle Union of three sets A A A = A + A + A A A A A A A + A A A {,, } {,, 4} {, 4, } = + + + = 4 p. 4

principle Union of n sets A... A n = the sum of the sizes of the individual sets minus the sizes of all two-wa intersections plus the sizes of all three-wa intersections minus the sizes of all four-wa intersections plus the sizes of all five-wa intersections etc. p. 4