MATH 22 MORE ABOUT FUNCTIONS. Lecture M: 10/14/2003. Form follows function. Louis Henri Sullivan

Similar documents
Functions. How is this definition written in symbolic logic notation?

Functions. Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A.

Chapter 3. Set Theory. 3.1 What is a Set?

Cardinality Lectures

Comparing sizes of sets

Functions 2/1/2017. Exercises. Exercises. Exercises. and the following mathematical appetizer is about. Functions. Functions

Sets 1. The things in a set are called the elements of it. If x is an element of the set S, we say

CSE 20 DISCRETE MATH. Fall

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

Notes on metric spaces and topology. Math 309: Topics in geometry. Dale Rolfsen. University of British Columbia

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

CHAPTER 8. Copyright Cengage Learning. All rights reserved.

Relations I. Margaret M. Fleck. 7 November 2008

CSC Discrete Math I, Spring Sets

Grade 6 Math Circles November 6 & Relations, Functions, and Morphisms

MATH 271 Summer 2016 Assignment 4 solutions

Introduction to Sets and Logic (MATH 1190)

Material from Recitation 1

EDAA40 At home exercises 1

Slides for Faculty Oxford University Press All rights reserved.

9.5 Equivalence Relations

AXIOMS FOR THE INTEGERS

2/18/14. Uses for Discrete Math in Computer Science. What is discrete? Why Study Discrete Math? Sets and Functions (Rosen, Sections 2.1,2.2, 2.

Functions and Sequences Rosen, Secs. 2.3, 2.4

CHAPTER 7. Copyright Cengage Learning. All rights reserved.

Cardinality of Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Cardinality of Sets Fall / 15

Let A(x) be x is an element of A, and B(x) be x is an element of B.

2.3: FUNCTIONS. abs( x)

2. Functions, sets, countability and uncountability. Let A, B be sets (often, in this module, subsets of R).

CSE 20 DISCRETE MATH. Winter

Cardinality of Sets. Washington University Math Circle 10/30/2016

TOPOLOGY, DR. BLOCK, FALL 2015, NOTES, PART 3.

Phil 320 Chapter 1: Sets, Functions and Enumerability I. Sets Informally: a set is a collection of objects. The objects are called members or

Lecture 25 : Counting DRAFT

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

Program Verification & Testing; Review of Propositional Logic

CS 341 Homework 1 Basic Techniques

Figure 1.1: This is an illustration of a generic set and its elements.

Set and Set Operations

2.1 Sets 2.2 Set Operations

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N

Announcements. CS243: Discrete Structures. Strong Induction and Recursively Defined Structures. Review. Example (review) Example (review), cont.

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103. Chapter 2. Sets

MITOCW watch?v=4dj1oguwtem

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS

1. Draw the state graphs for the finite automata which accept sets of strings composed of zeros and ones which:

Recursively Enumerable Languages, Turing Machines, and Decidability

ECS 20 Lecture 9 Fall Oct 2013 Phil Rogaway

Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS

Computation, Computers, and Programs. Administrivia. Resources. Course texts: Kozen: Introduction to Computability Hickey: Introduction to OCaml

CONNECTED SPACES AND HOW TO USE THEM

Proof Techniques Alphabets, Strings, and Languages. Foundations of Computer Science Theory

Power Set of a set and Relations

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

Chapter 1. Math review. 1.1 Some sets

MATHEMATICS 191, FALL 2004 MATHEMATICAL PROBABILITY Outline #1 (Countability and Uncountability)

Sets. Margaret M. Fleck. 15 September 2010

4 Mathematical Data Types

Relational Database: The Relational Data Model; Operations on Database Relations

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics


MA651 Topology. Lecture 4. Topological spaces 2

Technische Universität München Zentrum Mathematik

3. Determine whether f is a function from the set of all bit strings to the set of integers if

Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31

CS103 Spring 2018 Mathematical Vocabulary

Technische Universität München Zentrum Mathematik

A graph is finite if its vertex set and edge set are finite. We call a graph with just one vertex trivial and all other graphs nontrivial.

1. Relations 2. Equivalence relations 3. Modular arithmetics. ! Think of relations as directed graphs! xry means there in an edge x!

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ).

Solutions to Homework 10

Logic and Discrete Mathematics. Section 2.5 Equivalence relations and partitions

The set consisting of all natural numbers that are in A and are in B is the set f1; 3; 5g;

SOFTWARE ENGINEERING DESIGN I

Announcements. Problem Set 3 due Friday, October 21. Alternate Midterm Times. Drop by office hours! Ask questions at

Introduction to Computer Architecture

2 A topological interlude

Antisymmetric Relations. Definition A relation R on A is said to be antisymmetric

T. Background material: Topology

To illustrate what is intended the following are three write ups by students. Diagonalization

Calculating Cardinalities

LECTURE 8: SETS. Software Engineering Mike Wooldridge

Proofwriting Checklist

Designing Computer Systems Boolean Algebra

CS100: DISCRETE STRUCTURES

Review of Sets. Review. Philippe B. Laval. Current Semester. Kennesaw State University. Philippe B. Laval (KSU) Sets Current Semester 1 / 16

Today s Topics. What is a set?

(Refer Slide Time 3:31)

COMP combinational logic 1 Jan. 18, 2016

Mathematically Rigorous Software Design Review of mathematical prerequisites

Lecture 2 Finite Automata

It is important that you show your work. There are 134 points available on this test.

Geometry Definitions, Postulates, and Theorems. Chapter 3: Parallel and Perpendicular Lines. Section 3.1: Identify Pairs of Lines and Angles.

Continuous functions and homeomorphisms

Binary Relations McGraw-Hill Education

M3P1/M4P1 (2005) Dr M Ruzhansky Metric and Topological Spaces Summary of the course: definitions, examples, statements.

Topology I Test 1 Solutions October 13, 2008

Transcription:

MATH 22 Lecture M: 10/14/2003 MORE ABOUT FUNCTIONS Form follows function. Louis Henri Sullivan This frightful word, function, was born under other skies than those I have loved. Le Corbusier D ora innanzi ogni cosa deve camminare alla perfezione. Benito Mussolini Copyright 2003 Larry Denenberg

Administrivia http://denenberg.com/lecturem.pdf Project 5 handed out today, due 10/21 in class. Exam 2: Monday 10/27, time & place TBA. Today: Much more about functions. From now on everything must function to perfection.

Review A binary relation on set S is a subset of S S, that is, it s just a set of ordered pairs. Every ordered pair in the relation consists of two things that stand in that relation to each other. Examples: <, is within 100 miles of. Binary relations can be reflexive, symmetric, transitive, or any combination of these (or none of these). A binary relation from set S to set T is a subset of S T. Example: is a city in ; S is {cities} and T is {states}. There are 2 S T binary relations from S to T. ======================================== A function (informally) is a rule that takes a value (the input, or preimage) from a set called the domain, and produces a new value (the output, or image) from a set called the codomain. We write this f : D Æ C. If A is a subset of the domain of f, then the image of A, written f(a), is the subset of the codomain consisting of those elements that are the image of some element of A. The image of the entire domain is called the range of f. ÎFloor, Èceiling, and truncate are functions on numbers.

Review, cont. A function that never collapses two inputs to the same output is called injective, or one-to-one. Formally, f is injective if f(a) = f(b) implies a = b. If f : A Æ B is injective, then A B (for finite sets) A function that hits each value in the codomain is called surjective, or onto. Formally, f is surjective if for each b Œ B there is an a Œ A such that f(a) = b. A function is surjective if and only if its range equals its codomain. (Onto-ness is sensitive to what we choose as codomain.) If f : A Æ B is surjective, then A B (for finite sets) A function that is both injective and surjective is called bijective, or a bijection, or one-one onto, or a one-to-one correspondence. It assigns each element of its domain to a distinct element of its codomain (since it s one-one) and hits the entire codomain (since it s onto). It perfectly matches up the domain and codomain. If f : A Æ B is bijective, then A = B (for finite sets)

Two Minor Points Theorem: Suppose f : S Æ T and A, B Õ S. Then f(a» B) = f(a)» f(b) f(a «B) Õ f(a) «f(b) (Why this asymmetry? We ll go through the proof and see. Then we ll fix it by pointing out that the second expression becomes an equality if f is injective.) Suppose f : A Æ B and A 1 Õ A. Then we can make a new function f 1 : A 1 Æ B in the obvious way: we define f 1 (a) to be f(a)! We call f 1 the restriction of f to A 1. For example, think of the +1 function which takes real numbers to real numbers. The restriction of this function to the integers is +1 function that takes integers as inputs. In the opposite direction, let A 2 be a set such that A Õ A 2 and let f 2 : A 2 Æ B be such that f 2 (a) = f(a) for every a Œ A. Then f 2 is said to be an extension of f to A 2. [As before: Why is f 1 the restriction of f to A 1, but f 2 is an extension of f to A 2?]

Functions (formally) We ve tried to get an intuitive grasp of functions. But how shall we define them formally? It turns out that a function is a special kind of binary relation. A function f from A to B, written f : A Æ B, is a binary relation from A to B with the following special property: for each a Œ A there is exactly one b Œ B such that (a,b) Œ f. That is, a function like a binary relation is a set of ordered pairs. But any set of ordered pairs is a binary relation; for a set of ordered pairs to be a function it must satisfy the special property above. We can think of it as two properties: For every x in the domain, there must be an ordered pair (x,y) in the function, and For every ordered pair (x,y) in the function, there can t be any other ordered pair (x,z) in the function. The first of these properties guarantees that f produces some output for every input. The second guarantees that f produces a unique output for every input. All functions must have this property: for every input there must be exactly one output.

Terminology Reprise Now let s look at all the function terminology and see what it boils down to in the language of ordered pairs. A function f : X Æ Y, that is, a function with domain X and codomain Y, is a subset of X Y with the property that for each x Œ X there is exactly one y Œ Y such that (x,y) Œ f. [We just said this.] If (x,y) Œ f, then we say that y is the image of x under f and x is a preimage of y under f, and we write f(x) = y. If A Õ X, then the image f(a) of A under f is the set of all y Œ Y such that there is some (x,y) Œ f with x Œ A. The range of f is the set of all y Œ Y such that (x,y) Œ f for some x Œ X. Function f is injective if for every y Œ Y there is at most one pair (x,y) Œ f. Function f is surjective if for every y Œ Y there is at least one pair (x,y) Œ f. Function f is bijective if for every y Œ Y there is exactly one pair (x,y) Œ f.

Multiple Arguments So far we ve considered only functions of a single argument (like +1, or squaring, or father-of). How do we handle functions of multiple arguments, like the function + which takes two numbers in and produces one out? [E.g., +(3,7) = 10, more commonly written 3+7=10.] Answer: We force such functions to be functions of one argument by making them functions of ordered n-tuples! For example, we think of + as a function that takes a (single) ordered pair of (say) integers as input, and produces an integer as output. We write + : Z Z Æ Z. That is, it s not technically +(3,7), but +((3,7)). The same applies to functions of even more arguments. DON T CONFUSE THIS with the use of ordered pairs in the formal definition of a function, which is a distinct use of ordered pairs. As an example, let s look at + more closely. It s a subset of (Z Z) Z : + = { ((1,1), 2), ((3, 7), 10), ((4, 1), 5),... } The first here packages up two arguments into one, so that we can think of + as a function of one argument. (There could be more of these for a function of many arguments.) The second is the one connecting the domain with the codomain, that is, pairing the argument of the function with the value of the function.

Multiple Args, cont. Example: Consider the function that takes a student ID, a course ID, and an exam ID into a grade. E.g., Gr(502-33-1234, Math 22, Test1) = 96 If S is the set of students, C the set of courses, and E the set of exams, it s Gr : S C E Æ {0, 1, 2,..., 100} and we should write Gr((502-33-1234, Math 22, Test1)). A very important example: Suppose A and B are any two sets and D Õ A B. Then the function pr 1 : D Æ A is defined as follows: For any a Œ A and b Œ B, pr 1 (a, b) = a This function is called the first projection of D. Think of pr 1 as the function that ignores its second argument and outputs its first argument. Similarly, the second projection of D is the function pr 2 with pr 2 (a,b) = b. Generalization: The r th projection of any subset of A 1 A 2... A n is the function that takes the ordered n-tuple (a 1,a 2,..., a n ) into its r th component a r. [Why the word projection? Think of a twodimensional blob projected onto an axis. (Picture.)]

How Many Functions? How many functions are there from S to T (finite sets!)? Rather than counting sets of ordered pairs (as we did for relations), it s easier to think of creating a function as a sequence of choices. For each s ΠS we must pick some t ΠT to be the value of the function, and there are T possibilities. So we pick a t for s1, then a t for s2, etc., with T ways to choose each. And of course we make S such choices in all. By Rule of Product, there are T S ways to build a function from S to T. (Indeed, we use T S to denote the set of all functions from S to T.) How many injective functions are there from S to T? Almost the same problem. For the first element of S we have T choices, for the second we have T 1 choices (because we can t reuse the first choice) for the third we have T 2 choices, etc. The answer is T! / ( T S )! How many bijective functions are there from S to T? The trick here is to see that, for a bijection, we must have S = T, and any injective function is bijective if S = T. So the answer is T! = S! How many surjective functions are there from S to T? Turns out we need a new tool for this: Stirling numbers.

Binary Operations The domain of a multi-arg function can be the cross product of different sets, and the codomain can be yet another set, as we saw with Gr : S C T Æ Z. When a function has two arguments both from the same set, that is f : S S Æ T, we call f a binary operation. When the codomain is also the same set, f : S S Æ S, we call f a closed binary operation. (We ll have very little to do with binary operations that aren t closed.) If f is a binary operation, we write x f y to mean f(x,y). Example: + : Z Z Æ Z is a closed binary operation on the integers. We write a+b instead of +(a,b). Similarly *,, etc. But /, considered as a binary operation on the integers, is not closed, nor is on the positive integers. Example:» : S S Æ S is a closed binary operation on sets. We write A» B instead of»(a,b). Example: Ÿ : P P Æ P is a closed binary operation on propositions: it takes in two propositions and outputs a third. We write p Ÿ q. Sometimes we consider Ÿ as a binary operation on the set of truth values {t, f}.

Properties of Operations Now let * be some arbitrary closed binary operation on S (not multiplication). We use the following terminology: Operation * is commutative if a*b = b*a for all a,b Œ S. Operation * is associative if (a*b)*c = a*(b*c) for all a,b,c Œ S. (Comment: For associative operations we can write a*b*c, which doesn t make sense otherwise. We can also write a*b*c*...*z because any way of putting in the parentheses gives the same answer. It turns out that associativity is more important than commutativity; many operations aren t commutative, but few nonassociative operations are very interesting.) Operation * is idempotent if a*a = a for all a Œ S. (For example,» and «are idempotent. Arithmetics +,, and so forth aren t, but max and min are: max(x, x) = x. (Actually, some of this terminology applies even to binary operations that aren t closed. Which of these terms requires the binary operation to be closed?)

A Critical Property Let * be a binary operation on S. We say that e ΠS is an identity for * if for all x ΠS we have x*e = e*x = x. We know many examples: The operation + on numbers has identity 0. Multiplication has identity 1. The empty set is the identity for the union operation on sets. (What is the identity for the intersection operation? For symmetric difference?) Regarded as operations on truth values, has identity false and ٠has identity true. On the other hand, consider the binary operations min and max on numbers. These operations are commutative, associative, and idempotent. But neither has an identity element. Can a binary operation have more than one identity? Theorem: No. Proof: Suppose * is a binary operation on S with two identities e 1 and e 2. Since e 1 is an identity, e 1 * e 2 = e 2. But since e 2 is an identity, e 1 * e 2 = e 1. Since e 1 * e 2 can only have one value, we must have e 1 = e 2. So all identity elements are the same. (Question: Is this a proof by contradiction?)

Final Miscellany A function from S into S is called a unary relation on S. For example, is a unary operation on the integers (or the rationals, or the reals). Floor, ceiling, and set complement are other unary relations that we ve seen. Here s a very important example of a function: We know about sequences of numbers (or of anything) like <3, 7, 9, 0, 1, 3, 5, 5, 3, 0> Which is finite, and infinite sequences like <0, 1, 1, 2, 3, 5, 8, 13, 21, 34,... > (the so-called Fibonacci sequence). What are these, exactly? We can think of a sequence of objects from a set X as a function whose domain is some subset of the integers and whose codomain is X. For example, the Fibonacci sequence is really a function f : Z* Æ Z * where f(0) = 1, f(1) = f(2) = 1, f(3) = 2, f(8) = 21, etc. So it s no mystery that sequences can have duplicates; it s the same as saying that not all functions are injective! Grimaldi shows how to count the number of binary operations on S, the number of commutative binary operations on S, and the number of binary operations on S with given identity element. Read if interested.