Week 7 - Wednesday.  What did we talk about last time?  Proving the subset relationship  Proving set equality  Set counterexamples  Laws of set algebra.

Slides:



Advertisements
Similar presentations
Copyright © Cengage Learning. All rights reserved.
Advertisements

Sets Lecture 11: Oct 24 AB C. This Lecture We will first introduce some basic set theory before we do counting. Basic Definitions Operations on Sets Set.
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
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
Functions, Pigeonhole Principle Lecture 14: Nov 4 A B f( ) =
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Discrete Structures Chapter 5 Relations and Functions Nurul Amelina Nasharuddin Multimedia Department.
Terminology Domain: set which holds the values to which we apply the function Co-domain: set which holds the possible values (results) of the function.
Discrete Mathematics Lecture 7 Alexander Bukharovich New York University.
Terminology Domain: set which holds the values to which we apply the function Co-domain: set which holds the possible values (results) of the function.
Functions f( ) = A B Lecture 15: Nov 4.
CHAPTER 4 Decidability Contents Decidable Languages
Discrete Math for CS Chapter 5: Functions. Discrete Math for CS New Relation Operations: Given R, a relation on A x B, we define the inverse relation,
Copyright © Cengage Learning. All rights reserved.
1 Introduction to Computability Theory Lecture11: The Halting Problem Prof. Amos Israeli.
RMIT University; Taylor's College
Set Theory A B C.
Chapter 7 Functions Dr. Curry Guinn. Outline of Today Section 7.1: Functions Defined on General Sets Section 7.2: One-to-One and Onto Section 7.3: The.
1 CMSC 250 Chapter 7, Functions. 2 CMSC 250 Function terminology l A relationship between elements of two sets such that no element of the first set is.
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.
Functions A B f( ) =. This Lecture We will define a function formally, and then in the next lecture we will use this concept in counting. We will also.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Relation, function 1 Mathematical logic Lesson 5 Relations, mappings, countable and uncountable sets.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Week 7 - Friday.  What did we talk about last time?  Set disproofs  Russell’s paradox  Function basics.
Undecidable Languages (Chapter 4.2) Héctor Muñoz-Avila.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFunctions.
1 Annoucement n Skills you need: (1) (In Thinking) You think and move by Logic Definitions Mathematical properties (Basic algebra etc.) (2) (In Exploration)
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.
Agenda Week 10 Lecture coverage: –Functions –Types of Function –Composite function –Inverse of a function.
Week 7 - Monday.  What did we talk about last time?  Sets.
MATH 224 – Discrete Mathematics
CompSci 102 Discrete Math for Computer Science
Section 2.1. Section Summary Definition of sets Describing Sets Roster Method Set-Builder Notation Some Important Sets in Mathematics Empty Set and Universal.
Math 344 Winter 07 Group Theory Part 2: Subgroups and Isomorphism
Basic Structures: Sets, Functions, Sequences, and Sums.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Computability Universal Turing Machine. Countability. Halting Problem. Homework: Show that the integers have the same cardinality (size) as the natural.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
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.
Relations and Functions ORDERED PAIRS AND CARTESIAN PRODUCT An ordered pair consists of two elements, say a and b, in which one of them, say a is designated.
Functions CSRU1400 Spring 2008Ellen Zhang 1 CISC1400, Fall 2010 Ellen Zhang.
Section 2.1. Sets A set is an unordered collection of objects. the students in this class the chairs in this room The objects in a set are called the.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
1 Lecture 5 Functions. 2 Functions in real applications Curve of a bridge can be described by a function Converting Celsius to Fahrenheit.
Week 8 - Monday.  What did we talk about last time?  Properties of functions  One-to-one  Onto  Inverses  Cardinality.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Russell’s Paradox Is W in W? In words, W is the set that contains all the sets that don’t contain themselves. If W is in W, then W contains itself. But.
Discrete Mathematics Lecture 6
CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
CSE202: Introduction to Formal Languages and Automata Theory
Discrete Mathematics Lecture 7
MATH 224 – Discrete Mathematics
Relation and function.
Mathematical Background 1
Mathematical Background 1
Copyright © Cengage Learning. All rights reserved.
Formal Languages, Automata and Models of Computation
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Intro to Theory of Computation
Presentation transcript:

Week 7 - Wednesday

 What did we talk about last time?  Proving the subset relationship  Proving set equality  Set counterexamples  Laws of set algebra

 Imagine you are in a completely dark room with a deck of cards containing 10 cards that are face up and the rest face down  How can you create two piles of cards (not necessarily the same height) that both contain the same number of face up cards?  If you fail, you'll be eaten by a grue

 Set theory is a slippery slope  We are able to talk about very abstract concepts  { x  Z | x is prime }  This is a well-defined set, even though there are an infinite number of primes and we don't know how to find the n th prime number  Without some careful rules, we can begin to define sets that are not well-defined

 Let a barber be the man in Elizabethtown who shaves the men in Elizabethtown if and only if they don't shave themselves.  Let T be the set of all men in Elizabethtown  Let B(x) be "x is a barber"  Let S(x,y) be "x shaves y"   b  T  m  T (B(b)  (S(b,m)  ~S(m,m)))  But, who shaves the barber?

 Bertrand Russell invented the Barber Paradox to explain to normal people a problem he had found in set theory  Most sets are not elements of themselves  So, it seems reasonable to create a set S that is the set of all sets that are not elements of themselves  More formally, S = { A | A is a set and A  A }  But, is S an element of itself?

 How do we make sure that this paradox cannot happen in set theory?  We can make rules about what sets we allow in or not  The rule that we use in class is that all sets must be subsets of a defined universe U  Higher level set theory has a number of different frameworks for defining a useful universe

 It turns out that the idea behind Russell's Paradox actually has practical implications  It wasn't new, either  Cantor had previously used a diagonal argument to show that there are more real numbers than rational numbers  But, unexpectedly, Turing found an application of this idea for computing

 A Turing machine is a mathematical model for computation  It consists of a head, an infinitely long tape, a set of possible states, and an alphabet of characters that can be written on the tape  A list of rules saying what it should write and should it move left or right given the current symbol and state A A

 If an algorithm exists, a Turing machine can perform that algorithm  In essence, a Turing machine is the most powerful model we have of computation  Power, in this sense, means the ability to compute some function, not the speed associated with its computation

 Given a Turing machine and input x, does it reach the halt state?  First, recognize that we can encode a Turing machine as input for another Turing machine  We just have to design a system to describe the rules, the states, etc.  We want to design a Turing machine that can read another

 Imagine we have a Turing machine H(m,x) that takes the description of another Turing machine m and its input x and returns 1 if m halts on input x and 0 otherwise  Now, construct a machine H’(m,x) that runs H(m,x), but, if H(m,x) gives 1, then H’(m,x) infinitely loops, and, if H(m,x) gives 0, then then H’(m,x) returns 1  Let’s say that d is the description of H’(m,x)  What happens when you run H’(d,d)?

 Clearly, a Turing machine that solves the halting problem doesn’t exist  Essentially, the problem of deciding if a problem is computable is itself uncomputable  Therefore, there are some problems (called undecidable) for which there is no algorithm  Not an algorithm that will take a long time, but no algorithm  If we find such a problem, we are stuck  …unless someone can invent a more powerful model of computation

 Gödel used diagonalization again to prove that it is impossible to create a consistent set of axioms that can prove everything about the set of natural numbers  As a consequence, you can create a system that is complete but not consistent  Or, you can create a system that is consistent but not complete  Either way, there are principles in math in general that are true but impossible to prove, at least with any given system  You might as well give up on math now

Student Lecture

 A function f from set X to set Y is a relation between elements of X (inputs) and elements of Y (outputs) such that each input is related to exactly one output  We write f: X  Y to indicate this  X is called the domain of f  Y is called the co-domain of f  The range of f is { y  Y | y = f(x), for some x  X}  The inverse image of y is { x  X | f(x) = y }

 Using standard assumptions, consider f(x) = x 2  What is the domain?  What is the co-domain?  What is the range?  What is f(3.2)?  What is the inverse image of 4?  Assume that the set of positive integers is the domain and co-domain  What is the range?  What is f(3)?  What is the inverse image of 4?

 With finite domains and co-domains, we can define a function using an arrow diagram  What is the domain?  What is the co-domain?  What are f(a), f(b), and f(c)?  What is the range?  What are the inverse images of 1, 2, 3, and 4?  Represent f as a set of ordered pairs abcabc abcabc XYf

 Which of the following are functions from X to Y? abcabc abcabc XYf abcabc abcabc XYg abcabc abcabc XYh

 Given two functions f and g from X to Y,  f equals g, written f = g, iff:  f(x) = g(x) for all x  X  Let f(x) = |x| and g(x) =  Does f = g?  Let f(x) = x and g(x) = 1/(1/x)  Does f = g?

 Functions can be defined from any well- defined set to any other  There is an identity function from any set to itself  We can represent a sequence as a function from a range of integers to the values of the sequence  We can create a function mapping from sets to integers, for example, giving the cardinality of certain sets

 You should know this already  But, this is the official place where it should be covered formally  There is a function called the logarithm with base b of x defined from R + to R as follows:  log b x = y  b y = x

 For a function of multiple values, we can define its domain to be the Cartesian product of sets  Let S n be strings of 1's and 0's of length n  An important CS concept is Hamming distance  Hamming distance takes two binary strings of length n and gives the number of places where they differ  Let Hamming distance be H: S n x S n  Z nonneg  What is H(00101, 01110)?  What is H(10001, 01111)?

 There are two ways in which a function can be poorly defined  It does not provide a mapping for every value in the domain  Example: f: R  R such that f(x) = 1/x  It provides more than one mapping for some value in the domain  Example: f: Q  Z such that f(m/n) = m, where m and n are the integers representing the rational number

 Let F be a function from X to Y  F is one-to-one (or injective) if and only if:  If F(x 1 ) = F(x 2 ) then x 1 = x 2  Is f(x) = x 2 from Z to Z one-to-one?  Is f(x) = x 2 from Z + to Z one-to-one?  Is h(x) one-to-one? abcabc abcabc XYh

 To prove that f from X to Y is one-to-one, prove that  x 1, x 2  X, f(x 1 ) = f(x 2 )  x 1 = x 2  To disprove, just find a counter example  Prove that f: R  R defined by f(x) = 4x – 1 is one-to-one  Prove that g: Z  Z defined by g(n) = n 2 is not one-to-one

 Let F be a function from X to Y  F is onto (or surjective) if and only if:   y  Y,  x  X such that F(x) = y  Is f(x) = x 2 from Z to Z onto?  Is f(x) = x 2 from R + to R + onto?  Is h(x) onto? abcabc abcabc XYh

 If a function F: X  Y is both one-to-one and onto (bijective), then there is an inverse function F -1 : Y  X such that:  F -1 (y) = x  F(x) = y, for all x  X and y  Y

 More on functions  One to one and onto  Cardinality

 Homework 5 is due Friday  Keep reading Chapter 7