0% found this document useful (0 votes)
14 views18 pages

Functions Student Version

Uploaded by

4r28cbt99j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views18 pages

Functions Student Version

Uploaded by

4r28cbt99j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Functions

Mathematics for Computing – MATH10025


Winter 2025
Sheridan College

Dr. Tarek El Salti

1
2

Reference
 Rosen, H., K. (2019). Discrete Mathematics
and Its Applications, 8th edition.
3

Agenda
 Definition of a Function.
 Injection, Surjection, Bijection
4

Functions
Definition: Let A and B be nonempty sets. A
function f from A to B, denoted f: A → B is an
assignment of each element of A to exactly one
element of B. We write f(a) = b if b is the unique
element of B assigned by the function f to the
element a of A.
 Functions are sometimes Students Grades
called mappings or A
transformations. Carlota Rodriguez
B

Sandeep Patel C

Jalen Williams D

F
Kathy Scott
5

Functions
A function f: A → B can also be defined as
a subset of A×B (a relation). This subset is
restricted to be a relation where no two
elements of the relation have the same
first element.
 Specifically, a function f from A to B
contains one, and only one ordered pair
(a, b) for every element a∈ A.
6

Functions
Given a function f: A → B:
 We say f maps A to B or
f is a mapping from A to B.
 A is called the domain of f.
 B is called the codomain of f.
 If f(a) = b,
 then b is called the image of a under f.
 a is called the preimage of b.
 The range of f is the set of all images of points in A under f.
We denote it by f(A).
 Two functions are equal when they have the same domain,
the same codomain and map each element of the
domain to the same element of the codomain.
7

Representing Functions
 Functions may be specified in different ways:
 An explicit statement of the assignment.
Students and grades example.
 A formula.
f(x) = x + 1
 A computer program
 A Python program
 Given a communication range value
 Given the number of network nodes
 A connected network is generated
8

Questions on Functions and Sets


f(a) = ? z A B
a
The image of d is ?
x

The domain of f is ? b
y
c
The codomain of f is ?
d z
The preimage of y is ?
f(A) = ?
The preimage(s) of z is (are) ?
9

Question on Functions and Sets

 If and S is a subset of A,
then
A B
f {a,b,c,} is ? a
x

b
f {c,d} is ? y
c

d z
10

Question on Functions and Sets

 Let R be the relation consisting of ordered


pairs (Brenda, 24), (Abdul, 22), (Carla, 21),
(Tom, 22), (Eddie, 24) and (Kathy, 22)
 Each pair consists of the student name
and his/her age.
 What is the function that this relation
determines?
11

Question on Functions and Sets

 Letf be the function that assigns the last


two bits of a bit string of length 2 or
greater to that string.
 The domain of f is ?
 The codomain and range are ?
12

Question on Functions and Sets

 Int floor(float real) {…}


 What are the domain and codomain for
this function?
13

Injections
Definition: A function f is said to be one-to-
one , or injective, if and only if f(a) = f(b)
implies that a = b for all a and b in the
domain of f.
A
a
B
x
v
b
y
c
z
d

w
14

Examples on Injections

 Determine whether the function f {a, b, c,


d} to {1, 2, 3, 4, 5} with f(a) = 4, f(b) = 5, f(c)
= 1 and f(d) = 3 is one-to-one.
15

Examples on Injections

 Determine whether the function f(x) = x2


from the set of integers to the set of
integers is one-to-one.
 Solution: ?

 Determine whether the function f(x) = x +


1 from the set of real numbers to itself is
one-to-one.
 Solution: ?
16

Surjections
Definition: A function f from A to B is called
onto or surjective, if and only if for every
element there is an element
with .

A B
a x

b
y
c
z
d
17

Bijections
Definition: A function f is a one-to-one
correspondence, or a bijection, if it is both
one-to-one and onto (surjective and
injective).
A B
a x

b
y
c

d z

w
18

Examples

You might also like