Functions and Sequences Rosen, Secs. 2.3, 2.4

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.

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

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.

2.3: FUNCTIONS. abs( x)

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

Func%ons (Math) Func%on Defini%ons. Func%ons (Computer Sciences) Func%on = mappings or transforma%ons Math examples:

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

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

ECS 20 Lecture 9 Fall Oct 2013 Phil Rogaway

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

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

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

Computer Science and Mathematics. Part I: Fundamental Mathematical Concepts Winfried Kurth

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

EDAA40 At home exercises 1

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

W13:Homework:H07. CS40 Foundations of Computer Science W13. From 40wiki

CS: Formal Methods in Software Engineering

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

Comparing sizes of sets

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

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

CHAPTER 3 FUZZY RELATION and COMPOSITION

Algorithms Lecture 11. UC Davis, ECS20, Winter Discrete Mathematics for Computer Science

The Language of Sets and Functions

Program Verification (Rosen, Sections 5.5)

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

Proofs about Programs

CHAPTER 3 FUZZY RELATION and COMPOSITION

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

Lecture 17: Continuous Functions

1.5 Part - 2 Inverse Relations and Inverse Functions

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

2 Review of Set Theory

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

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Winter

CPSC 121: Models of Computation PART 1 REVIEW OF TEXT READING

Functions. Jason Filippou UMCP. Jason Filippou UMCP) Functions / 19

SET DEFINITION 1 elements members

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

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

Slides for Faculty Oxford University Press All rights reserved.

MA651 Topology. Lecture 4. Topological spaces 2

Func%onal Programming in Scheme and Lisp

W13:Homework:H08. CS40 Foundations of Computer Science W13. From 40wiki

Func%onal Programming in Scheme and Lisp

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

Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS

January 30, 2019 LECTURE 2: FUNCTIONS OF SEVERAL VARIABLES.

CHAPTER 7. Copyright Cengage Learning. All rights reserved.

Functions (4A) Young Won Lim 5/8/17

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

Skill 3 Relations and Functions

Sets. De Morgan s laws. Mappings. Definition. Definition

Math Analysis Chapter 1 Notes: Functions and Graphs

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

Functions (4A) Young Won Lim 3/16/18

1.3 Functions and Equivalence Relations 1.4 Languages

Discrete Mathematics

Unit 1 Algebraic Functions and Graphs

CS 1200 Discrete Math Math Preliminaries. A.R. Hurson 323 CS Building, Missouri S&T

2.1 Sets 2.2 Set Operations

Chapter 1. Math review. 1.1 Some sets

Number System. Introduction. Natural Numbers (N) Whole Numbers (W) Integers (Z) Prime Numbers (P) Face Value. Place Value

CHAPTER 4. COMPUTABILITY AND DECIDABILITY

Today s Topics. What is a set?

Math 5801 General Topology and Knot Theory

CS388C: Combinatorics and Graph Theory

Properties of a Function s Graph

Introduction II. Sets. Terminology III. Definition. Definition. Definition. Example

Math Analysis Chapter 1 Notes: Functions and Graphs

T. Background material: Topology

Introduction to Data Structure

A Public Key Crypto System On Real and Com. Complex Numbers

CS6702 GRAPH THEORY AND APPLICATIONS 2 MARKS QUESTIONS AND ANSWERS

Math 443/543 Graph Theory Notes

A B. bijection. injection. Section 2.4: Countability. a b c d e g

Chapter 4. Relations & Graphs. 4.1 Relations. Exercises For each of the relations specified below:

CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN. Lecture 1: Introduction

Inverse and Implicit functions

CSC Discrete Math I, Spring Sets

CS100: DISCRETE STRUCTURES

CCNY Math Review Chapter 2: Functions

Lecture 25 : Counting DRAFT

Cardinality Lectures

Boolean networks, local models, and finite polynomial dynamical systems

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

Discrete Mathematics SECOND EDITION OXFORD UNIVERSITY PRESS. Norman L. Biggs. Professor of Mathematics London School of Economics University of London

2.2 Graphs Of Functions. Copyright Cengage Learning. All rights reserved.

Standard Boolean Forms

The Pigeonhole Principle & Functions

COMS 1003 Fall Introduction to Computer Programming in C. Bits, Boolean Logic & Discrete Math. September 13 th

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

INTRODUCTION TO TOPOLOGY

Tutorial 3 Q&A. En la pregunta 7 de la sección 2.2 el cual dice: 7. Prove the domination laws in Table 1 by showing that: a)a U = U b)a =

Notation Index. Probability notation. (there exists) (such that) Fn-4 B n (Bell numbers) CL-27 s t (equivalence relation) GT-5.

Math 443/543 Graph Theory Notes

UNIVERSIDAD CARLOS III DE MADRID Escuela Politécnica Superior Departamento de Matemáticas

Transcription:

UC Davis, ECS20, Winter 2017 Discrete Mathematics for Computer Science Prof. Raissa D Souza (slides adopted from Michael Frank and Haluk Bingöl) Lecture 8 Functions and Sequences Rosen, Secs. 2.3, 2.4

Function: Formal DeOinition Def. For any sets A, B, we say that a func'on f (or mapping ) from A to B is a par3cular assignment of exactly one element f(x) B to each element x A. We can write f:a B For a A and b B, we can evaluate f(a)=b.

Important Function Terminology Def. Let f:a B, and f(a)=b (where a A & b B). Then 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 }.

Graphical Representations Func3ons can be represented graphically in several ways: f a b A B Like Venn diagrams f A B Bipartite Graph y (This has f:r -> R) x Plot Note: EVERY element of set A has to be mapped to ONE (and only one) element in B.

One-to-One or Injective functions Bipar3te (2-part) graph representa3ons of func3ons that are (or are not) one-to-one: One-to-one Not one-to-one ( Many-to-one instead) Not a function! Note domain codomain for 1-to-1

Onto or surjective functions Some func3ons that are, or are not, onto their codomains: Onto (but not 1-1) Not Onto (or 1-1) Both 1-1 and onto 1-1 but not onto Note domain codomain for onto

1-1 and onto = bijection/invertible Some func3ons that are, or are not, onto their codomains: Onto (but not 1-1) Not Onto (or 1-1) Both 1-1 and onto 1-1 but not onto

Bijections Def. A func3on f is said to be a bijec'on, (or a one-to-one correspondence, or reversible, or inver'ble,) iff it is both one-to-one and onto. Def. For bijec3ons f:a B, there exists an inverse of f, wriqen f -1 :B A, which is the unique func3on such that (where I A is the iden3ty func3on on A) Both 1-1 and onto f 1! f = I A Domain = Codomain = Range We can invert the function!!

Graphs of Functions We can represent a func3on f:a B as a set of ordered pairs {(a,f(a)) a A}. Note that a, there is only 1 pair (a,b). Later (ch.6): rela'ons loosen this restric3on. For func3ons over numbers, we can represent an ordered pair (x,y) as a point on a plane. A func3on is then drawn as a curve (set of points), with only one y for each x.

A Couple of Key Functions In discrete math, we will frequently use the following two func3ons over real numbers: Def. The floor func3on :R Z, where x ( floor of x ) means the largest (most posi3ve) integer x. Formally, x : max({ j Z j x}). Def. The ceiling func3on :R Z, where x ( ceiling of x ) means the smallest (most nega3ve) integer x. Formally, x : min({ j Z j x})

Visualizing Floor & Ceiling Real numbers fall to their floor or rise to their ceiling. Note that if x Z, -x - x & -x - x Note that if x Z, x = x = x. 3 2 1 0-1 -2-3 1.6-1.4... -3..... 1.6 =2 1.6 =1-1.4 = -1. -1.4 = -2-3 = -3 = -3

Plots with Oloor/ceiling: Example Plot of graph of func3on f(x) = x/3 : f(x) Set of points (x, f(x)) +2-3 -2 +3 x Note, the open dot denotes that in the limit the point is not on the curve, and the closed dot means it is on the curve.

Operators (general deoinition) Def. An n-ary operator over (or on) the set S is any func3on from the set of ordered n- tuples of elements of S, to S itself. Ex. If S={T,F}, can be seen as a unary operator, and, are binary operators on S. Ex. and are binary operators on the set of all sets. (See HW3 with i k nota3on)

Combining Function Operators +, ( plus, 3mes ) are binary operators over R. (Normal addi3on & mul3plica3on.) Therefore, we can also add and mul3ply func'ons Def. Let f, g: R R. (f + g): R R, where (f + g)(x) = f(x) + g(x) (f g): R R, where (f g)(x) = f(x) g(x)

Function Composition Operator Def. Let g:a B and f:b C. The composi'on of f and g, denoted by f g, is defined by (f g)=f(g(a)). A g B f C a g(a) f(g(a)) Remark. (like Cartesian, but unlike +,, ) is non-commu3ng. (Generally, f g g f.)

Review of 2.3 (Functions) Func3on variables f, g, h, Nota3ons: f:a B, f(a), f(a). Terms: image, preimage, domain, codomain, range, one-to-one, onto, strictly (in/de)creasing, bijec3ve, inverse, composi3on. Func3on unary operator f -1, binary operators +, -, etc., and. The R Z func3ons x and x.

2.4: Sequences, Strings, & Summations A sequence or series is just like an ordered n- tuple, except: Each element in the series has an associated index number. E.g., (a 1,a 2,, a k ) A sequence or series may be infinite. A string is a sequence of symbols from some finite alphabet. (e.g., words in a language) A summa'on is a compact nota3on for the sum of all terms in a (possibly infinite) series. k i : a j + a j + + 1... i= j a + a k

Sequences Def. A sequence or series {a n } is iden3fied with a genera'ng func'on f:s A for some subset S N and for some set A. Oien we have S= N or S=Z + = N -{0}.

Recognizing Sequences Some3mes, you re given the first few terms of a sequence and you need to find the sequence s genera3ng func3on, which is a procedure to enumerate the sequence. Examples: What s the next number? 1,2,3,4, 1,3,5,7,9, 2,3,5,7,11,... 5 (the 5th smallest number >0) 11 (the 6th smallest odd number >0) 13 (the 6th smallest prime number)

Sequence elements, a n Def. If f is a generating function for a series {a n }, then for n S, the symbol a n denotes f(n), also called term n of the sequence. The index of a n is n. (Or, often i is used.) A series is sometimes denoted by listing its first and/or last few elements, and using ellipsis ( ) notation. E.g., {a n } = 0, 1, 4, 9, 16, 25, is taken to mean n N, a n = n 2.

Sequence Examples Some authors write the sequence a 1, a 2, instead of {a n }, to ensure that the set of indices is clear. Be careful: oien nota3on leaves the indices ambiguous, but context makes it clear. Ex. An example of an infinite series: Consider the series {a n } = a 1, a 2,, where ( n 1) a n = f(n) = 1/n. Then, we have {a n } = 1, 1/2, 1/3,

Switch to blackboard mode