Lecture 7 Functions.

Slides:



Advertisements
Similar presentations
Functions Reading: Epp Chp 7.1, 7.2, 7.4
Advertisements

Functions; Sequences, Sums, Countability
1 Diagonalization Fact: Many books exist. Fact: Some books contain the titles of other books within them. Fact: Some books contain their own titles within.
CSE115/ENGR160 Discrete Mathematics 02/22/11 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/21/12
Functions f( ) = A B Lecture 15: Nov 4.
1 Discrete Math CS 2800 Prof. Bart Selman Module Basic Structures: Functions and Sequences.
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,
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.
Functions, Sequences, and Sums
Cardinality of Sets Section 2.5.
Sequences & Summations CS 1050 Rosen 3.2. Sequence A sequence is a discrete structure used to represent an ordered list. A sequence is a function from.
Sequences Informally, a sequence is a set of elements written in a row. – This concept is represented in CS using one- dimensional arrays The goal of mathematics.
Sequences and Summations
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sifth Edition, Mc Graw-Hill, 2007 Chapter 2: Basic Structures: Sets, Functions, Sequences.
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
2.3 Functions A function is an assignment of each element of one set to a specific element of some other set. Synonymous terms: function, assignment, map.
February 12, 2015Applied Discrete Mathematics Week 2: Functions and Sequences 1Exercises Question 1: Given a set A = {x, y, z} and a set B = {1, 2, 3,
2.4 Sequences and Summations
Section 2.4. Section Summary Sequences. Examples: Geometric Progression, Arithmetic Progression Recurrence Relations Example: Fibonacci Sequence Summations.
ICS 253: Discrete Structures I
Chapter 2 Mathematical preliminaries 2.1 Set, Relation and Functions 2.2 Proof Methods 2.3 Logarithms 2.4 Floor and Ceiling Functions 2.5 Factorial and.
Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums (2)
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
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 
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Functions Section 2.3. Section Summary Definition of a Function. – Domain, Cdomain – Image, Preimage Injection, Surjection, Bijection Inverse Function.
COMPSCI 102 Introduction to Discrete Mathematics.
Basic Structures: Sets, Functions, Sequences, and Sums.
Great Theoretical Ideas in Computer Science.
CompSci 102 Discrete Math for Computer Science February 7, 2012 Prof. Rodger Slides modified from Rosen.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
Section 3.2: Sequences and Summations. Def: A sequence is a function from a subset of the set of integers (usually the set of natural numbers) to a set.
CS 285- Discrete Mathematics
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.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Basic Structure : Sets, Functions, Sequences, and Sums Sequences and Summations.
Section 2.5. Cardinality Definition: A set that is either finite or has the same cardinality as the set of positive integers (Z + ) is called countable.
Chapter 2 1. Chapter Summary Sets The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions and sequences.
Sequences Lecture 11. L62 Sequences Sequences are a way of ordering lists of objects. Java arrays are a type of sequence of finite size. Usually, mathematical.
ICS 253: Discrete Structures I
CSE15 Discrete Mathematics 03/01/17
Cardinality with Applications to Computability
Sets (2.1) A set is a collection or group of objects or elements or members. (Cantor 1895) A set is said to contain its elements. There must be an underlying.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Discrete Mathematics Lecture 6
Discrete Mathematics CS 2610
Relations, Functions, and Matrices
Applied Discrete Mathematics Week 2: Functions and Sequences
MATH 224 – Discrete Mathematics
Chapter 2 Sets and Functions.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
2.4 Sequences and Summations
Sequences and Summations
Cardinality of Sets Section 2.5.
Diagonalization Fact: Many books exist.
Discrete Structures for Computer Science
CSE15 Discrete Mathematics 02/27/17
CS100: Discrete structures
Lesson 5 Relations, mappings, countable and uncountable sets
ICS 253: Discrete Structures I
Lesson 5 Relations, mappings, countable and uncountable sets
Sequences and the Binomial Theorem
SE-561 Math Foundations of Software Engineering VIII. Functions
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Properties of Functions
Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007
Basic Structures: Functions and Sequences
Cardinality Definition: The cardinality of a set A is equal to the cardinality of a set B, denoted |A| = |B|, if and only if there is a one-to-one correspondence.
Discrete Mathematics CS 2610
Presentation transcript:

Lecture 7 Functions

Definition: Function

Terminology of Functions If f is a function from A to B, we say that A is the domain of f and B is the codomain of f. If f(a)=b, we say that b is the image of a and a is the pre-image of b. The range of f is the set of all images of element of A. If f is a function from A to B, we say that f maps A to B. a b=f(a) f A B

One-to-One and Onto Functions A function f is said to be one-to-one (or injective), if and only if f(x) = f(y) implies that x=y for all x and y in the domain of f. one-to-one onto A function f from A to B is called onto (or surjective), if and only if for every element b B there is an element a A with f(a) = b. both The function f is a one-to-one correspondence (or bijection), if it is both one-to-one and onto.

What Kind of Correspondence?

Inverse Functions Let f be a one-to-one correspondence from the set A to the set B (i.e. f is one-to-one and onto). The inverse function of f is the function that maps B to A. The inverse of f is denoted by f-1. Hence,

Composition of Functions Let g be a function mapping the set A to the set B and let f be a function mapping the set B to the set C. The composition of the functions f and g, denoted by f o g, is defined by,

Graphs of Functions

Floor and Ceiling Functions floor function ceiling function

Factorial Function f(1) = 1! = 1 f(2) = 2! = 1.2 = 2 :

Sequences A sequence is a function from a subset of the set of natural numbers N or non-negative integers Z* to a set S. We use the notation sn to denote the image of the integer n. We call sn a term of the sequence. N 1, 2, 3, 4, 5, ... S s1, s2, s3, s4, s5, ... Z* 0, 1, 2, 3, 4, ... S s0, s1, s2, s3, s4, ... It is important to be able to express the sequence S in closed form as a function. For example, S = { 1, 4, 9, 16, 25, ...} has a closed form sn = n2. S = { 1, 1/2, 1/3, 1/4, ...} is sn = 1/n. S = { 0, 4, 18, 48, 100, ...} is sn = ?

Special Integer Sequences 1, 1/2, 1/4, 1/8, . . . 1, 3, 5, 7, . . . 1, -1, 1, -1, . . . 0, 4, 18, 48, 100, . . . 2, 5, 10, 17, 26, 37, . . .

Example: Method of Finite Differences candidate for a Computer Program What is the next number in the sequence? 4 18 48 100 14 30 52 10 16 22 6 6 28 80 180 - - - -

candidate for a Computer Program An Algebraic Solution candidate for a Computer Program N S 1 2 3 4 5 6 2 5 10 17 26 37 3 5 7 9 11 2 2 2 2

Arithmetic Progression An arithmetic progression is a sequence of the form a, a+d, a+2d, . . . , a+nd where the initial term a and the common difference d are real numbers. An arithmetic progression is a discrete analogue of the linear function f(x) = dx + a. a a+d a+2d a+3d . . . a + nd d d d . . . the difference between any successive pair of terms is equal to d

Geometric Progression A geometric progression is a sequence of the form a, ar, ar2, ... , arn where the initial term a and the common ratio r are real numbers. A geometric progression is a discrete analogue of the exponential function f(x) = arx. a ar ar2 . . . ar(n-1) arn ar ar2 . . . arn a ar ar(n-1) r r . . . r the ratio of any successive pair of terms is equal to r

Building a Pyramid

Summations Summation notation below uses an integer variable i called the index of summation that runs through all integers starting with its lower limit m and ending with its upper limit n. The value of the term ai is computed for each i and added to the accumulating sum of all the terms Is is important to be able to express summations in closed forms as functions...

Geometric Series The sum of terms of a geometric progression is called a geometric series. The closed form for a geometric progression (when a and r are real and r is not zero), These are two important special cases of the geometric series... finite series infinite series

Binomial Identities m 1 n 2 3 1 4 2 3 4 5 Pascal's Triangle 1 2 3 4 n 1 2 3 4 5 Pascal's Triangle Recurrence Relation for Combinations

Power Series These series are used in calculators and computer CPU's to compute exponential and trigonometric functions. While the proofs of these formulae are the primary concern for mathematics, their computational complexity and the possibility of improving their efficiency are the primary concern in computer science... Exponential Trigonometric

Cardinality The sets A and B have the same cardinality if and only if there is a one-to-one correspondence from A to B. Note: It is not a requirement that the one-to-one correspondence be known or provable, just that it exists. For more info on the continuing controversy regarding unprovable theorems in discrete mathematics, search on Cantor's Diagonalization Theorem, large cardinal axiom, Borel Diagonalization Theorem, and Axiom of Choice. For example see, http://www.algebra.com/algebra/about/history/Talk:Axiom-of-choice.wikipedia A set that is either finite or has the same cardinality as the set of positive integers is called countable. A set that is not countable is called uncountable. 1 2 3 4 5 6 7 8 9 10 11 12 ... 1 3 5 7 9 11 13 15 17 19 21 23 ...

Rational Numbers are Countable There is a one-to-one correspondence between the natural numbers and the rational numbers (assuming that n/m and qn/qm are considered to be different rational numbers.

Cantor's Diagonalization "Proof" Cantor's proof requires the axiom of choice in which we assume that we can choose a value from a list in order to prove that the list does not exist. We wish to prove that the real numbers between 0.0 and 1.0 are not countable. We first assume that there is a one-to-one correspondence between the natural numbers and the reals in the interval (0.0,1.0) as shown below. N reals in (0.0, 1.0) 1 0.d11 d12 d13 d14 ... 2 0.d21 d22 d23 d24 ... 3 0.d31 d32 d33 d34 ... 4 0.d41 d42 d43 d44 ... : : where dij is the jth digit of the real number corresponding to the ith natural number. From this list we construct a number, 0.c1 c2 c3 c4 ... where, ci = (dii +1) mod 10. This number clearly lies in the interval (0.0, 1.0) but is not a member of the list above since its ith digit is different from the ith digit of the ith number for every number in the list.

Problems for Cantor's Proof First of all this proof is not just a proof by contradiction. It has the additional requirement that in order to prove the contraction there must exist an entity which cannot exist if the proof is valid. This is fundamentally different from demonstrating that if a statement S is true then a contradiction exists, which means that S must be false. In the case of Cantor's Proof we assume that the set of reals can be arranged into a list that contains all the members of the list. Then we assume that a value can be composed from the members of the list creating a new member in the set that is not in the list. Only if this impossible value exists can we prove that the list does not exist and, by extension the new member also cannot exist. This is one step removed from proof-by-contradiction and therefore requires an additional assumption (i.e. another axiom called the Axiom of Choice).* 0.4309411290814208725430924309842109... 0.7916109102982160219176902431932789... 0.2191190110012291029671642048275386... 0.1239010101902748657329873280783217... 0.4999999999999999999999999999999999... there is no well-ordering of the reals in this set... In this example the composite number is 0.499999... But we must assume that there are infinitely many numbers in the list that do not contain any 9's therefore 0.4 followed by all 9's could not be the composite number. Since there is nothing special about the use of 9's in this example, we can make a similar argument about any particular composite number (refuting the axiom of choice), and therefore we cannot generate a value not in the list... Which means that we cannot prove anything about the countability of the set of reals in the interval (0.0, 1.0) using this method. *http://www.recipeland.com/encyclopaedia/index.php/Axiom_of_choice

Double Summations with ada.integer_text_io; use ada.integer_text_io; procedure double_sum_demo is S : integer := 0; begin for i in 1..4 loop for j in 1..3 loop S := S + 3*i*j; end loop; put(S,0); end double_sum_demo;

Some Useful Summation Formulae

A Numeric Example

Candidate for a Computer Program Queuing Theory Candidate for a Computer Program Customers arrive randomly but at an average rate of l customers per unit time. A server provides service at at rate of m customers per unit time. If m>l then this system will reach a steady state. We will define the state of this system by the number of customers in the system. An empty system (no customers) is in state S0. When there is one customer the system is in state S1 and so on. In the steady state the rate at which customers enter the system is equal to the rate at which they leave the system.

Obtaining a Closed-Form Solution by repeated substitution of Eq n into Eq n-1 since the system must be in some state the sum of all probabilities must equal 1 l/m is strictly less than 1 so the closed form for the infinite series applies the average number of customers in the system again we apply the closed form the average time a customer spends in the system