Functions
Functions
Functions
CPE203
FUNCTIONS
A function is a mathematical rule that
assigns each input exactly one output.
The output produced by applying the
function to an input is referred to as the
image of that input.
Example: If 𝑓 is a function and 𝑥 is an
input, then 𝑓(𝑥) is the image of 𝑥.
Describing a Function
Domain: The complete set of possible inputs for a function.
Example: For f(x)=x^2+3, the domain is the set of natural numbers
N.
Codomain: The set of all allowable outputs that the function can
potentially produce.
Example: For f(x), the codomain is also N.
Notation: A function can be denoted as f : X → Y, where:
f: Name of the function.
X: Domain.
Y: Codomain.
Describing a Function
Domain: Natural numbers N = {1,2,3,...}.
Codomain: Also natural numbers N.
Rule: For any input x, the output is calculated as:
◦ Multiply x by itself (square it).
◦ Add 3 to the result.
Example Calculation: For x=2:
f(2) = 2^2 + 3 = 4 + 3 = 7
Describing a Function
Domain: Natural numbers N = {1,2,3,...}.
Codomain: Also natural numbers N.
Rule: For any input x, the output is calculated as:
◦ Multiply x by itself (square it).
◦ Add 3 to the result.
Example Calculation: For x=2:
f(2) = 2^2 + 3 = 4 + 3 = 7
Describing a Function
The function f(x) = x^2 + 3 can be applied to every
natural number.
All results are guaranteed to be natural numbers
(outputs are in the codomain).
Sample Outputs:
f(1) = 1^2 + 3 = 4
f(2) = 7
f(3) = 12
f(4) = 19
Range
The range is the actual set of outputs produced by the
function.
Outputs are all the natural numbers that are 3 more than
perfect squares (e.g., 0^2+3, 1^2+3, 2^2+3,...).
Importance of Function
Rules
A function must have exactly one output for
each input to qualify as a function.
The domain is the set {1, 2, 3}, the codomain is the set
{a, b, c} and the range is the set {a, c}.
Note that g(2) and g(3) are the same element of the
codomain. This is okay since each element in the
domain still has only one output.
Not Function
f : N → N defined by f (n) = n/2.
Domain:
Codomain:
Rule:
Range:
Example
f: R → R defined by f(x)=2x + 3
f: R → R defined by
DESCRIBING FUNCTIONS
Function:
An abstract mathematical entity that exists independently of how
we express it.
Example: The function f(x)=x^2 exists regardless of our
methods of communication.
Description:
The various methods used to convey information about a
function.
Essential for understanding and applying functions in different
contexts.
DESCRIBING FUNCTIONS
Functions can be described in four primary ways:
Algebraically:
◦ Using a formula or equation to define the relationship
between inputs and outputs.
◦ Example: f(x) = 2x + 3
Numerically:
◦ Presenting input-output pairs in a table format.
◦ Provides a clear view of how each input maps to an
output.
DESCRIBING FUNCTIONS
Graphically:
◦ Plotting points on a coordinate plane to visualize the
function's behavior.
◦ Useful for understanding trends and relationships.
In Words:
◦ Describing the function's behavior verbally.
◦ Helps clarify the purpose and application of the
function
DESCRIBING FUNCTIONS
In discrete math, the focus is primarily on functions with:
Domain:
The set of natural numbers N or finite subsets of N.
Importance:
Allows for specific analysis and applications in combinatorics and graph theory.