Week 7 - Friday.  What did we talk about last time?  Set disproofs  Russell’s paradox  Function basics.

Slides:



Advertisements
Similar presentations
Week 7 - Wednesday.  What did we talk about last time?  Set proofs and disproofs  Russell’s paradox.
Advertisements

Functions, Pigeonhole Principle Lecture 14: Nov 4 A B f( ) =
Discrete Structures Chapter 5 Pigeonhole Principle 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.
Pigeonhole.
Lecture ,3.3 Sequences & Summations Proof by Induction.
Copyright © Cengage Learning. All rights reserved.
1 Section 1.8 Functions. 2 Loose Definition Mapping of each element of one set onto some element of another set –each element of 1st set must map to something,
Discrete Mathematics Lecture 7 Harper Langston New York University.
CS 2210 (22C:019) Discrete Structures Sets and Functions Spring 2015 Sukumar Ghosh.
RMIT University; Taylor's College
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.
Fall 2015 COMP 2300 Discrete Structures for Computation
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sifth Edition, Mc Graw-Hill, 2007 Chapter 2: Basic Structures: Sets, Functions, Sequences.
2.1 Sets 2.2 Set Operations 2.3 Functions ‒Functions ‒ Injections, Surjections and Bijections ‒ Inverse Functions ‒Composition 2.4 Sequences and Summations.
Foundations of Discrete Mathematics Chapter 3 By Dr. Dalia M. Gil, Ph.D.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Lecture 6: Signal Processing III EEN 112: Introduction to Electrical and Computer Engineering Professor Eric Rozier, 2/25/13.
ICS 253: Discrete Structures I
1 Lecture 3 (part 3) Functions – Cardinality Reading: Epp Chp 7.6.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
Chapter 1 SETS, FUNCTIONs, ELEMENTARY LOGIC & BOOLEAN ALGEBRAs BY: MISS FARAH ADIBAH ADNAN IMK.
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.
Example Prove that: “IF 3n + 2 is odd, then n is odd” Proof by Contradiction: -p = 3n + 2 is odd, q = n is odd. -Assume that ~(p  q) is true OR -(p 
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.
Basic Structures: Functions Muhammad Arief download dari
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.1 and 7.2.
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.
Functions Section 2.3. Section Summary Definition of a Function. – Domain, Cdomain – Image, Preimage Injection, Surjection, Bijection Inverse Function.
Relations, Functions, and Countability
Discrete Mathematics R. Johnsonbaugh
2.1 Sets ‒Sets ‒Common Universal Sets ‒Subsets 2.2 Set Operations 2.3 Functions 2.4 Sequences and Summations 1.
MATH 224 – Discrete Mathematics
COMPSCI 102 Introduction to Discrete Mathematics.
INFIINITE SETS CSC 172 SPRING 2002 LECTURE 23. Cardinality and Counting The cardinality of a set is the number of elements in the set Two sets are equipotent.
Discrete Structures Li Tak Sing ( 李德成 ) Lectures
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.
CSC102 - Discrete Structures Functions
Lecture 4 Infinite Cardinals. Some Philosophy: What is “2”? Definition 1: 2 = 1+1. This actually needs the definition of “1” and the definition of the.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
FUNCTIONS COSC-1321 Discrete Structures 1. Function. Definition Let X and Y be sets. A function f from X to Y is a relation from X to Y with the property.
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.
Pigeonhole Principle. If n pigeons fly into m pigeonholes and n > m, then at least one hole must contain two or more pigeons A function from one finite.
Week 7 - Wednesday.  What did we talk about last time?  Proving the subset relationship  Proving set equality  Set counterexamples  Laws of set algebra.
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 10 - Monday.  What did we talk about last time?  Combinations  Binomial theorem.
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.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Discrete Mathematics Lecture 6
Discrete Mathematics Lecture 3 (and 4)
Discrete Mathematics CS 2610
Functions 1.
CS 2210:0001 Discrete Structures Sets and Functions
Discrete Mathematics Lecture 7
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Presentation transcript:

Week 7 - Friday

 What did we talk about last time?  Set disproofs  Russell’s paradox  Function basics

 A man has two 10 gallon jars  The first contains 6 gallons of wine and the second contains 6 gallons of water  He poured 3 gallons of wine into the water jar and stirred  Then he poured 3 gallons of the mixture in the water jar into the wine jar and stirred  Then he poured 3 gallons of the mixture in the wine jar into the water jar and stirred  He continued the process until both jars had the same concentration of wine  How many pouring operations did he do?

 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.2)?  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 + - {1} 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

 If there are two functions f: A  B and g: Y  Z such that the range of f is a subset of the domain of g, we can define a new function g o f: A  Z such that  (g o f)(x) = g(f(x)), for all x  A

 As before, we can show these functions for finite sets using arrow diagrams  What's the arrow diagram for (g o f)(x)? e e xyzxyz xyzxyz abcdabcd abcdabcd f g

 The identity function (on set X) maps elements from set X to themselves  Thus, the identity function i x : X  X is:  i X (x) = x  For functions f: X  Y and g: Y  X  What is (f o i X )(x)?  What is (i X 0 g)(x)?

 If functions f: X  Y and g: Y  Z are both one-to-one, then g o f is one-to-one  If functions f: X  Y and g: Y  Z are both onto, then g o f is onto  How would you go about proving these claims?

 If f: X  Y is one-to-one and onto with inverse function f -1 : Y  X, then  What is f -1 o f?  What is f o f -1 ?

Student Lecture

 If n pigeons fly into m pigeonholes, where n > m, then there is at least one pigeonhole with two or more pigeons in it  More formally, if a function has a larger domain than co-domain, it cannot be one-to-one  We cannot say exactly how many pigeons are in any given holes  Some holes may be empty  But, at least one hole will have at least two pigeons

 A sock drawer has white socks, black socks, and red argyle socks, all mixed together,  What is the smallest number of socks you need to pull out to be guaranteed a matching pair?  Let A = {1, 2, 3, 4, 5, 6, 7, 8}  If you select five distinct elements from A, must it be the case that some pair of integers from the five you selected will sum to 9?

 If n pigeons fly into m pigeonholes, and for some positive integer k, n > km, then at least one pigeonhole contains k + 1 or more pigeons in it  Example:  In a group of 85 people, at least 4 must have the same last initial

 Cardinality gives the number of things in a set  Cardinality is:  Reflexive: A has the same cardinality as A  Symmetric: If A has the same cardinality as B, B has the same cardinality as A  Transitive: If A has the same cardinality as B, and B has the same cardinality as C, A has the same cardinality as C  For finite sets, we could just count the things to determine if two sets have the same cardinality

 Because we can't just count the number of things in infinite sets, we need a more general definition  For any sets A and B, A has the same cardinality as B iff there is a bijective mapping A to B  Thus, for any element in A, it corresponds to exactly one element in B, and everything in B has exactly one corresponding element in A

 Show that the set of positive integers has the same cardinality as the set of all integers  Hint: Create a bijective function from all integers to positive integers  Hint 2: Map the positive integers to even integers and the negative integers to odd integers

 A set is called countably infinite if it has the same cardinality as Z +  You have just shown that Z is countable  It turns out that (positive) rational numbers are countable too, because we can construct a table of their values and move diagonally across it, numbering values, skipping numbers that have been listed already 1/11/21/31/4 2/12/22/32/4 3/13/23/33/4 4/14/24/34/4

 We showed that positive rational numbers were countable, but a trick similar to the one for integers can show that all rational numbers are countable  The book gives a classic proof that real numbers are not countable, but we don't have time to go through it  For future reference, the cardinality of positive integers, countable infinity, is named  0 (pronounced aleph null)  The cardinality of real numbers, the first uncountable infinity (because there are infinitely many uncountable infinities), is named  1 (pronounced aleph 1)

 Relations (after Spring Break)  Exam 2 is the Monday after the Monday after Spring Break

 Work on Homework 5  Due on Monday after Spring Break  Look at Homework 6  Read Chapter 8 for after Spring Break