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

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Discrete Mathematics CS204 Lecture #7 September 18, 2009 at KAIST 1 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 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 Examples Modulus operator Definition If x, y ∈ Z and y > , 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...
View Full Document

Page1 / 15

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

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online