{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

dm-lec8-Functions-s - Discrete Mathematics CS204 Lecture#7...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Discrete Mathematics CS204 Lecture #7 September 18, 2009 at KAIST 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
What is a function? The Blackbox Analogy - The mechanism that assigns to each input an output is ignored . - Two blackboxes are equivalent as functions if they produce identical outputs from the same inputs. - Defining a function is one thing and algorithmically implementing the function is another. 2
Background image of page 2
Definition Let X and Y be sets. A function f from X to Y is a subset of the Cartesian product X × Y having the property that for each x X , there is exactly one y Y with ( x, y ) f . Given a function f : X Y , for each x , f ( x ) denotes the element y Y such that ( x, y ) f . ( x, f ( x )) f for all x X - X is called the domain of f . - Y is called the codomain of f . - The set f [ X ] = { f ( x ) Y | x X } is called the range of f . 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Examples Modulus operator Definition If x, y Z and y > 0 , we define ( x mod y ) to be the remainder when x is divided by y . International Standard Book Numbers An ISBN is a code of 13 decimal digits, whose last digit is a check character. In an ISBN a 1 a 2 a 3 - a 4 - a 5 a 6 a 7 a 8 a 9 - a 10 a 11
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}