Lecture adapted from CS3511,Discrete Methods Kees van Deemter

Slides:



Advertisements
Similar presentations
Functions Reading: Epp Chp 7.1, 7.2, 7.4
Advertisements

Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
(CSC 102) Discrete Structures Lecture 14.
Week 7 - Wednesday.  What did we talk about last time?  Set proofs and disproofs  Russell’s paradox.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Section 1.6: Sets Sets are the most basic of discrete structures and also the most general. Several of the discrete structures we will study are built.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Computing Fundamentals 1 Lecture 6 A Theory of Sets Lecturer: Patrick Browne Room K308 Based on Chapter 11. A Logical approach.
Functions Goals Introduce the concept of function Introduce injective, surjective, & bijective functions.
Sets. Copyright © Peter Cappello Definition Visualize a dictionary as a directed graph. Nodes represent words If word w is defined in terms of word.
CS 2210 (22C:019) Discrete Structures Sets and Functions Spring 2015 Sukumar Ghosh.
2012: J Paul GibsonTSP: Mathematical FoundationsMAT7003/L5- CountingAndEnumeration.1 MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul.
Survey of Mathematical Ideas Math 100 Chapter 2 John Rosson Thursday January 25, 2007.
Section 1.8: Functions A function is a mapping from one set to another that satisfies certain properties. We will first introduce the notion of a mapping.
22 March 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Formal.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Functions.
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Relation, function 1 Mathematical logic Lesson 5 Relations, mappings, countable and uncountable sets.
Sets Set Operations Functions. 1. Sets 1.1 Introduction and Notation 1.2 Cardinality 1.3 Power Set 1.4 Cartesian Products.
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
CS3518 Functions 9/21/2015Kees van Deemter1 Functions and infinite sets (Approx 2-3 lectures. Initial sections adapted from slides for a course by Michael.
Math 3121 Abstract Algebra I Section 0: Sets. The axiomatic approach to Mathematics The notion of definition - from the text: "It is impossible to define.
MATH 224 – Discrete Mathematics
INTRODUCTION TO THE THEORY OF COMPUTATION INTRODUCTION MICHAEL SIPSER, SECOND EDITION 1.
Functions. Copyright © Peter Cappello2 Definition Let D and C be nonempty sets. A function f from D to C, for each element d  D, assigns exactly 1 element.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
ICS 253: Discrete Structures I
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
4.1 CompSci 102© Michael Frank Today’s topics FunctionsFunctions – –Notations and terms – –One-to-One vs. Onto – –Floor, ceiling, and identity Reading:
1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl Module #4.
1.4 Sets Definition 1. A set is a group of objects . The objects in a set are called the elements, or members, of the set. Example 2 The set of positive.
Functions Reading: Chapter 6 (94 – 107) from the text book 1.
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Mathematical Induction
Relations, Functions, and Countability
CompSci 102 Discrete Math for Computer Science
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/18 Module.
Naïve Set Theory. Basic Definitions Naïve set theory is the non-axiomatic treatment of set theory. In the axiomatic treatment, which we will only allude.
Sets Goal: Introduce the basic terminology of set theory.
THEORY OF COMPUTATION Komate AMPHAWAN 1. 2.
Basic Structures: Sets, Functions, Sequences, and Sums.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Great Theoretical Ideas in Computer Science.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Notions & Notations (2) - 1ICOM 4075 (Spring 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Spring.
FUNCTIONS.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/18 Module.
Introduction to Set Theory (§1.6) A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different)
Functions Goals Introduce the concept of function
Chapter 2 Sets and Functions.
COT 3100, Spring 2001 Applications of Discrete Structures
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Lecture 7 Functions.
Discrete Mathematics and its Applications
Rosen 5th ed., §1.8 ~44 slides, ~2 lectures
Module #4.5, Topic #∞: Cardinality & Infinite Sets
Discrete Mathematics and its Applications
Lesson 5 Relations, mappings, countable and uncountable sets
Dept. of Mathematics 이산수학 Discrete Mathematics Dr. Chae, Gab-Byung
ICS 253: Discrete Structures I
Functions Rosen 6th ed., §2.3.
Discrete Mathematics and its Applications
Module #4.5, Topic #∞: Cardinality & Infinite Sets
Discrete Mathematics and its Applications
Discrete Mathematics and its Applications
Presentation transcript:

Lecture adapted from CS3511,Discrete Methods Kees van Deemter Discrete Mathematics and its Applications 3/28/2017 Lecture adapted from CS3511,Discrete Methods Kees van Deemter Slides originally adapted from Michael P. Frank’s Course Based on the Text Discrete Mathematics & Its Applications (5th Edition) by Kenneth H. Rosen A word about organization: Since different courses have different lengths of lecture periods, and different instructors go at different paces, rather than dividing the material up into fixed-length lectures, we will divide it up into “modules” which correspond to major topic areas and will generally take 1-3 lectures to cover. Within modules, we have smaller “topics”. Within topics are individual slides. The instructor can bring several modules to each lecture with him, to make sure he has enough material to fill the lecture, or in case he wants to preview or review slides from upcoming or recent past lectures. 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

Adaptation of Module #4: 1. Functions Rosen 5th ed., §1.8 ~45 slides, ~1 lecture 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Functions From calculus, you know the concept of a real-valued function f, which assigns to each number xR one particular value y=f(x), where yR. Example: f defined by the rule f(x)=x2 The notion of a function can be generalized to the concept of assigning elements of any set to elements of any set. Functions are also called operators. 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Functions Functions were the key concept in lambda calculus and Haskell: x.x+2 is the function that sends any appropriate argument x to the corresponding value x+2 After the Haskell definition f x = x+2, f denotes that same function x.x+2 Let’s be more precise about functions, working towards a classification of functions 3/28/2017 Michael P. Frank / Kees van Deemter

Function: Formal Definition A function f from (or “mapping”) A to B (f:AB) is an assignment of exactly one element f(x)B to each element xA. Generalizations: Functions of n arguments: f: (A1 x A2... x An)  B. A partial (non-total) function f assigns zero or one elements of B to each element xA. 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Graphs of Functions We can represent a function f:AB as a set of ordered pairs f ={(a,f(a)) | aA}. This makes f a relation between A and B: f is a subset of A x B. But functions are special: for every aA, there is at least one pair (a,b). Formally: aAbB((a,b)f) for every aA, there is at most one pair (a,b). Formally: a,b,c((a,b)f  (a,c)f  bc) A relation over numbers can be represent as a set of points on a plane. (A point is a pair (x,y).) A function is then a curve (set of points), with only one y for each x. 3/28/2017 Michael P. Frank / Kees van Deemter

Discrete Mathematics and its Applications 3/28/2017 Functions can be represented graphically in several ways: A B f • • f • • • • y • a b • Note that the inverses of the functions in the two diagrams on the left are not functions. Note also that the plot has gaps if the domain of the function is not the set R • • • x A B Bipartite Graph Plot Like Venn diagrams 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

Functions that you’ve seen before A set S over universe U can be viewed as a function from the elements of U to … 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Still More Functions A set S over universe U can be viewed as a function from the elements of U to … … {T, F}, saying for each element of U whether it is in S. (This is called the characteristic function of S) Suppose U={0,1,2,3,4}. Then S={1,3} S(0)=S(2)=S(4)=F, S(1)=S(3)=T. 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Still More Functions A set operator, such as  or , can be viewed as a function from … to … 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Still More Functions A set operator such as  or  can be viewed as a function … … from (ordered) pairs of sets, to sets. Example: (({1,3},{3,4})) = {3} 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter A new notation Sometimes we write YX to denote the set F of all possible functions f: XY. Thus, f  YX is another way of saying that f: XY. (This notation is especially appropriate, because for finite X, Y, we have |F| = |Y||X|. ) 3/28/2017 Michael P. Frank / Kees van Deemter

Some Function Terminology If f:AB, and f(a)=b (where aA & bB), then we say: A is the domain of f. B is the codomain of f. b is the image of a under f. a is a pre-image of b under f. In general, b may have more than 1 pre-image. The range RB of f is R={b | a f(a)=b }. We also say the signature of f is A→B. 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Range versus Codomain The range of a function may not be its whole codomain. The codomain is the set that the function is declared to map all domain values into. The range is the particular set of values in the codomain that the function actually maps elements of the domain to. (The range is the smallest set that could be used as its codomain.) 3/28/2017 Michael P. Frank / Kees van Deemter

Choosing the right (co)domain Consider the function f = λx.100/x Is f a (total) function from Int to R? f is a partial function from Int to R f is a (total) function from Int-{0} to R Consider g = λx.√x Is g a (total) function from R to R? g is a total function from R+ to RxR e.g. g(4)= (2,-2) 3/28/2017 Michael P. Frank / Kees van Deemter

Images of Sets under Functions Given f:AB, and SA, The image of S under f is the set of all images (under f) of the elements of S. f(S) : {f(s) | sS} : {b | sS: f(s)=b}. The range of f equals the image (under f) of ... 3/28/2017 Michael P. Frank / Kees van Deemter

Images of Sets under Functions Given f:AB, and SA, The image of S under f is the set of all images (under f) of the elements of S. f(S) : {f(s) | sS} : {b | sS: f(s)=b}. The range of f equals the image (under f) of f’s domain. 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter One-to-One Functions A function is one-to-one (1-1), or injective, or an injection, iff every element of its range has only 1 pre-image. Formally: given f:AB, “f is injective” : (x,y: xy  f(x)f(y)). In other words: only one element of the domain is mapped to any given one element of the range. In this case, domain & range have same cardinality. What about codomain? 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Codomain may be larger. 3/28/2017 Michael P. Frank / Kees van Deemter

One-to-One Illustration Are these relations one-to-one functions? • • • • • • • • • • • • • • • • • • • • • • • • • • • 3/28/2017 Michael P. Frank / Kees van Deemter

One-to-One Illustration Are these relations one-to-one functions? • • • • • • • • • • • • • • • • • • • • • • • • • • • One-to-one 3/28/2017 Michael P. Frank / Kees van Deemter

One-to-One Illustration Are these relations one-to-one functions? • • • • • • • • • • • • • • • • • • • • • • • • • • • Not one-to-one One-to-one 3/28/2017 Michael P. Frank / Kees van Deemter

One-to-One Illustration Are these relations one-to-one functions? • • • • • • • • • • • • • • • • • • • • • • • • • • • Not one-to-one Not even a function! One-to-one 3/28/2017 Michael P. Frank / Kees van Deemter

Sufficient Conditions for 1-1ness For functions f over numbers, we say: f is strictly increasing iff x>y  f(x)>f(y) for all x,y in domain; f is strictly decreasing iff x>y  f(x)<f(y) for all x,y in domain; If f is either strictly increasing or strictly decreasing, then f must be one-to-one. Does the converse hold? 3/28/2017 Michael P. Frank / Kees van Deemter

Onto (Surjective) Functions A function f:AB is onto or surjective or a surjection iff its range is equal to its codomain (bB, aA: f(a)=b). Consider “country of birth of”: AB, where A=people, B=countries. Is this a function? Is it an injection? Is it a surjection? 3/28/2017 Michael P. Frank / Kees van Deemter

Onto (Surjective) Functions A function f:AB is onto or surjective or a surjection iff its range is equal to its codomain Consider “country of birth of”: AB, where A=people, B=countries. Is this a function? Yes (always 1 c.o.b.) Is it an injection? No (many have same c.o.b.) Is it a surjection? Probably yes .. 3/28/2017 Michael P. Frank / Kees van Deemter

Onto (Surjective) Functions A function f:AB is onto or surjective or a surjection iff its range is equal to its codomain In predicate logic: 3/28/2017 Michael P. Frank / Kees van Deemter

Onto (Surjective) Functions A function f:AB is onto or surjective or a surjection iff its range is equal to its codomain. In predicate logic: bBaA f(a)=b 3/28/2017 Michael P. Frank / Kees van Deemter

Onto (Surjective) Functions A function f:AB is onto or surjective or a surjection iff its range is equal to its codomain (bBaA f(a)=b). E.g., for domain & codomain Z, the function x.x+1 is injective and surjective. 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Claim: if f:ZZ and f =x.x+1 then f is 1-to-1 and also onto. (Z is the set of all integers) Proof that f is onto: Consider any arbitrary element a of Z. We have f(a-1)=a, where a  Z. Proof that f is 1-to-1: Suppose f(u)=f(w)=a. In other words, u+1=a and w+1=a. It follows that u=a-1 and w=a-1, so u=w. 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Illustration of Onto Are these functions onto their depicted co-domains? • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Illustration of Onto Are these functions onto? • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Illustration of Onto Are these functions onto? • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • onto not onto onto not onto 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Illustration of Onto Are these functions 1-1? • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • onto not onto onto not onto 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Illustration of Onto Are these functions 1-1? • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • not 1-1 onto not 1-1 not onto 1-1 onto 1-1 not onto 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Bijections A function is said to be a one-to-one correspondence, or a bijection iff it is both one-to-one and onto. 3/28/2017 Michael P. Frank / Kees van Deemter

Two terminologies for talking about functions injection = one-to-one surjection = onto bijection = one-to-one correspondence 3 = 1&2 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Bijections For bijections f:AB, there exists a function that is the inverse of f, written f 1: BA Intuitively, this is the function that undoes everything that f does Formally, it’s the unique function such that ... 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Bijections For bijections f:AB, there exists an inverse of f, written f 1: BA Intuitively, this is the function that undoes everything that f does Formally, it’s the unique function such that (the identity function on A) 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Bijections Example 1: Let f: ZZ be defined as f(x)= x+1. What is f1 ? Example 2: Let g: ZN be defined as g(x)= |x|. What is g1 ? 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Bijections Example 1: Let f: ZZ be defined as f(x)=x+1. What is f1 ? f1 is the function (let’s call it h) h: ZZ defined as h(x)=x-1. Proof: h(f(x)) = (x+1)-1 = x 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Bijections Example 2: Let g: ZN be defined as g(x)=|x|. What is g1 ? This was a trick question: there is no such function, since g is not a bijection: There is no function h such that h(|x|)=x and h(|x|)=x (NB There is a relation h for which this is true.) 3/28/2017 Michael P. Frank / Kees van Deemter

The Diagonalisation Method Discrete Mathematics and its Applications 3/28/2017 The Diagonalisation Method Georg Cantor (1873): Can we compare the sizes of infinite sets? Example: card(N ) = card({0*1*})? Both are infinite But is one larger than the other? Cantor’s idea: The size (cardinality) of a set should not depend on the identity of its elements Two finite sets A and B have the same size if we can pair the elements of A with elements of B Formally: there exists a bijection between A and B 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

Correspondences (Cont’d) Discrete Mathematics and its Applications 3/28/2017 Correspondences (Cont’d) Example: Let N be the set of natural numbers {1, 2, 3, …} E be the set of even natural numbers {2, 4, 6, …} Using Cantor’s definition of size, we can show that N and E have the same size: Bijection (!): f (n) = 2n Intuitively, E is smaller than N, but Pairing each element of N with its corresponding element in E is possible, So we declare these two set to be the same size This even though E  N (E is a real subset of N ) 6 3 4 2 1 f (n) n … 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

Discrete Mathematics and its Applications 3/28/2017 Countable sets A set X is finite if it has n elements, for some n in N. A set is countable if either It is finite or It has the same size as N, the natural numbers For example, N is countable, and so are all its subsets: E is countable {0,1,2,3} is countable  is countable How about supersets of N? 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

An Even Stranger Example… Discrete Mathematics and its Applications 3/28/2017 An Even Stranger Example… Let Q be the set of positive rational numbers Q = { m/n | m,n  N } Just like E, the set Q has the same size as N ! We show this giving a bijection from Q to N Q is thus countable One way is to enumerate (i.e., to list) X’s elements. For example, for X=Q : Pair the first element of X with 1 from N And so on, making sure every member of Q appears only once in the list 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

An Even Stranger Example… (Cont’d) Discrete Mathematics and its Applications 3/28/2017 An Even Stranger Example… (Cont’d) To build a list with the elements of Q make inf. matrix with all positive rational numbers i -th row contains all numbers with numerator i j -th column has all numbers with denominator j i /j is in i -th row and j -th column 1/1 1/2 1/3 1/4 1/5 2/1 2/2 2/3 2/4 2/5 3/1 3/2 3/3 3/4 3/5 4/1 4/2 4/3 4/4 4/5 5/1 5/2 5/3 5/4 5/5 . . . 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

An Even Stranger Example… (Cont’d) Discrete Mathematics and its Applications 3/28/2017 An Even Stranger Example… (Cont’d) Now we turn the previous matrix into a list A bad way: begin list with first row Since rows are infinite, we will never get to 2nd row! 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

An Even Stranger Example… (Cont’d) Discrete Mathematics and its Applications 3/28/2017 An Even Stranger Example… (Cont’d) Instead, we list the elements along diagonals: 1/1 1/2 1/3 1/4 1/5 2/1 2/2 2/3 2/4 2/5 3/1 3/2 3/3 3/4 3/5 4/1 4/2 4/3 4/4 4/5 5/1 5/2 5/3 5/4 5/5 . . . We should, however, eliminate repeated elements 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

An Even Stranger Example… (Cont’d) Discrete Mathematics and its Applications 3/28/2017 An Even Stranger Example… (Cont’d) We list elements along diagonals w/o repetitions: 1/1 1/2 1/3 1/4 1/5 2/1 2/2 2/3 2/4 3/1 3/2 3/3 4/1 4/2 5/1 . . . 1/1, 2/1, 1/2, 3/1, 1/3, … 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

Discrete Mathematics and its Applications 3/28/2017 Uncountable sets Some sets have no correspondence with N These sets are simply too big! They are not countable: we say uncountable Theorem: The set of real numbers between 0 and 1 (e.g., 0.244, 0.3141592323....) is uncountable Call this set R0,1 (Some sets are even larger. “Serious” set theory is all about theorems that concern infinite sets. – Most of this is irrelevant for this course.) 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

Finally: diagonalisation Theorem: | R0,1 | > |N|. Proof strategy: | R0,1 |>=|N|. Suppose | R0,1 |=|N| and derive a contradiction: Each member of R0,1 can be written as a zero followed by a dot and a countable sequence of digits. Suppose there existed a complete enumeration of R, (using whatever order) <e1,e2,e3,...>. 3/28/2017 Michael P. Frank / Kees van Deemter

Cantor’s diagonalisation trick: (starting from an arbitrary list) e1. 0.0000000000000000000000.... e2. 0.0100000000000000000000.... e3. 0.8200000000000000000000.... e4. 0.1710000000000000000000.... ... 3/28/2017 Michael P. Frank / Kees van Deemter

Now construct a Real number n that’s not in the enumeration: n’s first digit (after the dot) = [e1’s first digit] + 1 n’s second digit = [e2’s second digit] + 1 ... General: n’s i-th difit = [e-i’s i-th digit] + 1 i: n differs from e-i in its i-th digit Contradiction: <e1,e2,e3,...> is not a (complete) enumeration after all. QED 3/28/2017 Michael P. Frank / Kees van Deemter

Adaptation of Module #3: 2. Sets and the Russell Paradox Rosen 5th ed., §1.6 especially ex. 30 on p. 86 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter Basic Set Notations Set enumeration {a, b, c} and set-builder {x|P(x)}.  relation, and the empty set . Set relations =, , , , , , etc. Venn diagrams. Cardinality |S| and infinite sets N, Z, R. Power sets P(S). 3/28/2017 Michael P. Frank / Kees van Deemter

Discrete Mathematics and its Applications 3/28/2017 Axiomatic set theory Various axioms, e.g., saying that the union of two sets is also a set One key axiom: Given a Predicate P, construct a set. The set consists of all those elements x such that P(x) is true. But, the resulting theory turns out to be logically inconsistent! This means, there exist set theory propositions p such that you can prove that both p and p follow logically from the axioms of the theory!  The conjunction of the axioms is a contradiction! This theory is fundamentally uninteresting, because any possible statement in it can be (very trivially) “proved” by contradiction! This is a nice exercise. We won’t worry about this particular inconsistency (Russell’s paradox) in this course, because the extra restrictions on the theory that need to be imposed to prevent the problem are of a rather esoteric and technical nature, and they don’t really affect anything about the way we apply sets in everyday practice. So, we will go ahead and just use naïve set theory with the understanding that all of our arguments could be replaced almost word-for-word by arguments based on some more well-founded version of set theory. One of the most popular set theories that has no known internal contradictions is Zermelo-Fraenkel (ZF) Set Theory. It is sometimes also augmented with an extra axiom called the “Axiom of Choice,” producing another widely-used set theory, ZFC (Zermelo-Fraenkel with Choice). However, the Axiom of Choice has been proven to be independent of the other axioms, which means that you could just as validly add the negation of the axiom of choice to ZF instead. In other words, not only is the axiom of choice not provable from ZF, but is has no inherent truth value within the context of ZF. We are free to make up whatever truth value we want for it, and then explore the resulting theory. This is just an illustration of the more general principle that what we are doing in mathematics is ultimately just inventing an arbitrary set of axioms to start out with, that have no inherent “truth” in and of themselves, and exploring what results from them. Ultimately, the only absolute mathematical “truths” are the tautologies saying that such-and-such consequence follows logically from such-and-such axioms. 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

This version of Set Theory is inconsistent Discrete Mathematics and its Applications 3/28/2017 This version of Set Theory is inconsistent Russell’s paradox: Consider the set that corresponds with the predicate x  x : S = {x | xx }. Now ask: is SS? Turn into exercise! See note about ZF in the earlier slide near the start of this module. Bertrand Russell was the guy who discovered this particular pathalogical example. The question of whether it is a member of itself is known as “Russell’s Paradox.” 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

Discrete Mathematics and its Applications 3/28/2017 Russell’s paradox Let S = {x | xx }. Is SS? If SS, then S is one of those objects x for which xx. In other words, SS With Proof by Contradiction, we have SS If SS, then S is not one of those objects x for which xx. In other words, SS With Proof by Contradiction, we have SS We conclude that both SS nor SS Paradox! Turn into exercise! See note about ZF in the earlier slide near the start of this module. Bertrand Russell was the guy who discovered this particular pathalogical example. The question of whether it is a member of itself is known as “Russell’s Paradox.” 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

Discrete Mathematics and its Applications 3/28/2017 To avoid inconsistency, set theory must somehow change Turn into exercise! See note about ZF in the earlier slide near the start of this module. Bertrand Russell was the guy who discovered this particular pathalogical example. The question of whether it is a member of itself is known as “Russell’s Paradox.” Bertrand Russell 1872-1970 3/28/2017 Michael P. Frank / Kees van Deemter (c)2001-2002, Michael P. Frank

One technique to avoid the problem: Given a set S and a predicate P, construct a new set, consisting of those elements x of S such that P(x) is true. You’ve seen this technique in use: Haskell’s list comprehensions allow us to write [x | x  [1..] , even x], but not simply [x | even x], 3/28/2017 Michael P. Frank / Kees van Deemter

Another technique to avoid the problem: Russell’s paradox arises from the fact that we can write xx (or xx, for that matter). Forbid such expressions using types. You’ve seen this technique in use: Haskell’s use of typing. Applied to the present case: give  a type that forbids it from relating two things of the same type. 3/28/2017 Michael P. Frank / Kees van Deemter

Our focus: computability We shall not worry about “saving” set theory from paradoxes like Russell’s Instead, we shall use the Russell paradox in a different setting Before we do this, we need to talk about computability and Turing Machines. 3/28/2017 Michael P. Frank / Kees van Deemter

Michael P. Frank / Kees van Deemter 3/28/2017 Michael P. Frank / Kees van Deemter