### Relation & Function - STREE-KM

```What is a function?
What is a function?



A function relates an input to an output.
It is like a machine that has an input and an output.
And the output is related somehow to the input.
f(x)
"f(x) = ... " is the classic way of writing
a function.
And there are other ways, as you will
see!
Input, Relationship, Output
Input
Relationship
Output
0
×2
0
1
×2
2
7
Input, Relationship,
× 2 Output
14
10
×2
20
...
...
...
Names

first, it is useful to give a function a name.
The most common name is "f", but you can have other
names like "g" ... or even "marmalade" if you want.
But let's use "f":

You would say "f of x equals x squared"


Names








what goes into the function is put inside parentheses () after
the name of the function:
So f(x) shows you the function is called "f", and "x" goes in
And you will often see what a function does with the input:
f(x) = x2 shows you that function "f" takes "x" and squares
it.
Example: with f(x) = x2:
an input of 4
becomes an output of 16.
In fact we can write f(4) = 16.
The "x" is Just a Place-Holder!










Don't get too concerned about "x", it is just there to
show you where the input goes and what happens to it.
It could be anything!
So this function:
f(x) = 1 - x + x2
Would be the same function if I wrote:
f(q) = 1 - q + q2
h(A) = 1 - A + A2
w(θ) = 1 - θ + θ2
It is just there so you know where to put the values:
f(2) = 1 - 2 + 22 = 3
Sometimes There is No Function Name






Sometimes a function has no name, and you might just
see something like:
y = x2
But there is still:
an input (x)
a relationship (squaring)
and an output (y)
Relating



At the top I said that a function was like a machine. But a
function doesn't really have belts or cogs or any moving
parts - and it doesn't actually destroy what you put into
it!
A function relates an input to an output.
Saying "f(4) = 16" is like saying 4 is somehow related to
16. Or 4 → 16
Relating





Example: this tree grows 20 cm every year, so the height
of the tree is related to its age using the function h:
h(age) = age × 20
So, if the age is 10 years, the height is:
h(10) = 10 × 20 = 200 cm
Here are some example values:
age
h(age) = age × 20
0
0
1
20
3.2
64
15
300
...
...
A Function is Special






But a function has special rules:
It must work for every possible input value
And you can only have one relationship for each input
value
This can be said in one definition:
Formal Definition of a Function
A function relates each element of a set
with exactly one element of another set
(possibly the same set).
A Function is Special
The Two Important Things!




"...each element..." means that every element in X is
related to some element in Y.
We say that the function covers X (relates every element
of it). (But some elements of Y might not be related to
at all, which is fine.)
"...exactly one..." means that a function is single valued. It
will not give back 2 or more results for the same input.
So "f(2) = 7 or 9" is not right!
A Function is Special
The Two Important Things!
(one-to-many)
(many-to-one)
This is NOT OK in a function
But this is OK in a function
If a relationship does not follow those two rules then it is not a function ... it
would still be a relationship, just not a function.
Example: The relationship x → x2

Could also be written as a table:
X: x
Y: x2
3
9
1
1
0
0
4
16
-4
16
...
...
It is a function, because:
Every element in X is related to Y
No element in X has two or more relationships
So it follows the rules.
(Notice how both 4 and -4 relate to 16, which is allowed.)
Example: This relationship is not a
function:





It is a relationship, but it is not a function, for these
reasons:
Value "3" in X has no relation in Y
Value "4" in X has no relation in Y
Value "5" is related to more than one value in Y
(But the fact that "6" in Y is not related to does not
matter)
Vertical Line Test


On a graph, the idea of single valued means that no
vertical line would ever cross more than one value.
If it crosses more than once it is still a valid curve, but
it would not be a function.
Infinitely Many





My examples have just a few
values, but functions usually
work on sets with infinitely
many elements.
Example: y = x3
The input set "X" is all Real
Numbers
The output set "Y" is also all
the Real Numbers
I can't show you ALL the values,
so I just give a few as an
example:
X: x
Y: x3
-2
-8
-0.1
-0.001
0
0
1.1
1.331
3
27
and so on...
and so on...
Domain, Codomain and Range





In our examples above
the set "X" is called the Domain,
the set "Y" is called the Codomain, and
the set of elements that get pointed to in Y (the actual
values produced by the function) is called the Range.
We have a special page on Domain, Range and
Codomain if you want to know more.
So Many Names!


Functions have been used in mathematics for a very long
time, and lots of different names and ways of writing
Here are some common terms you should get familiar with:
Example:






Example: with z = 2u3:
"u" could be called the "independent variable"
"z" could be called the "dependent variable" (it depends
on the value of u)
Example: with f(4) = 16:
"4" could be called the "argument"
"16" could be called the "value of the function"
Ordered Pairs








I said I would show you many ways to think about
functions, and here is another way:
You can write the input and output of a function as an
"ordered pair", such as (4,16).
They are called ordered pairs because the input always
comes first, and the output second:
(input, output)
So it looks like this:
( x, f(x) )
Example:
(4,16) means that the function takes in "4" and gives out
"16"
Set of Ordered Pairs











function can then be defined as a set of ordered pairs:
Example: {(2,4), (3,5), (7,3)} is a function that says
"2 is related to 4", "3 is related to 5" and "7 is related 3".
Also, notice that:
the domain is {2,3,7} (the input values)
and the range is {4,5,3} (the output values)
But the function has to be single valued, so we also say
"if it contains (a, b) and (a, c), then b must equal c"
Which is just a way of saying that an input of "a" cannot produce
two different results.
Example: {(2,4), (2,5), (7,3)} is not a function because {2,4} and {2,5}
means that 2 could be related to 4 or 5.
In other words it is not a function because it is not single valued
A Benefit of Ordered Pairs



We can graph them...
... because they are also coordinates!
So a set of coordinates is also a function (if they follow
the rules above, that is)
A Function Can be in Pieces





You can create functions that behave differently
depending on the input value
Example: A function with two pieces:
when x is less than 0, it gives 5,
when x is 0 or more it gives x2
x
Here are some example values:
-3
y
5
-1
5
0
0
2
4
4
16
...
...
Explicit vs Implicit










Before I finish, I would like to mention the terms "explicit" and
"implicit".
"Explicit" is when the function shows you how to go directly from x
to y, such as:
y = x3 - 3
When you know x, you can find y
That is the classic y = f(x) style.
"Implicit" is when it is not given directly such as:
x2 - 3xy + y3 = 0
When you know x, how do you find y?
It may be hard (or impossible!) to go directly from x to y.
"Implicit" comes from "implied", in other words shown indirectly.
Graphing


The Function Grapher can only handle explicit functions,
The Equation Grapher can handle both types (but takes a
little longer, and sometimes gets it wrong).
Conclusion




a function relates inputs to outputs
a function takes elements from a set (the domain) and
relates them to elements in a set (the codomain).
all the outputs (the actual values related to) are together
called the range
a function is a special type of relation where:




every element in the domain is included, and
any input produces only one output (not this or that)
an input and its matching output are together called
an ordered pair
so a function can also be seen as a set of ordered pairs
GRAPH OF FUNCTIONS
TYPE OF FUNCTIONS
Functions are 2 type :
Algebraic function - ฟั งก์ชน
ั พีชคณิต
คือ ฟังกชั
ปตัวแปรและคา่
์ นทีเ่ ขียนอยูในรู
่
คงตัว โดยมีการบวก ลบ คูณ หาร ยกกาลัง
หรือถอดกรณฑ ์

transcendental function - ฟั งก์ชน
ั อดิสยั
คือ ฟังกชั
์ นทีไ่ มใช
่ ่ ฟังกชั
์ นทีไ่ มใช
่ ่ ฟังกชั
์ น
พีชคณิต

Algebraic function

ฟังก์ชนั เชิงเส้น (Linear function)
ทีม
่ เี งือ
่ นไขในรูป
คือ ฟังกชั
์ น

ฟังก์ชนั คงตัว (constant function)

ฟังก์ชนั ค่าสัมบูรณ์ (absolute value function)
คือ ฟังกชั
์ น
ทีม
่ เี งือ
่ นไขในรูป f(x) = c เมือ
่ c ∈ R เป็ น
ลักษณะเฉพาะชนิดหนึ่งของฟังกชั
์ นเชิงเส้น
ทีม
่ ค
ี วามชัน (m) เป็ นศูนย ์
คือ
ฟังกชั
่ เี งือ
่ นไขในรูปคาสั
่ มบูรณ์ f(x) = |ax
์ นทีม
+ b| โดย a , b ∈ R
Algebraic function

2 + bx + c
เงือ
่ นไขเขียนไดในรู
ป
f(x)
=
ax
้
ฟังกชั
์ นที่
เมือ
่ a, b , c ∈ R และ a ≠ 0 จะให้กราฟเป็ นรูป
พาราโบลา ซึง่ มีลก
ั ษณะ ดังนี้
ถา้ a > 0 จะไดกราฟรู
ปพาราโบลาหงาย มี
้
−
2
4ac−b2
4a
จุดตา่ สุด
,
ถา้ a < 0 จะไดกราฟรู
ปพาราโบลาควา่ มี
้
จุดสูงสุด
−
2
,
4ac−b2
4a
Algebraic function

ฟังก์ชนั เอกลักษณ์ (Identity function) คือ
ฟังกชั
่ นไขเขียนไดในรู
ป f(x) = x ซึง่
้
์ นทีเ่ งือ
ให้กราฟรูปเส้นตรงผานจุ
ดเริม
่ ตนท
่
้ ามุม 45
องศา กับแกน X ทวนเข็มนาฬิ กา

ฟังก์ชนั เศษส่วน (rational function) คือ
()
()
ฟังกชั
์ น
ทีเ่ ขียนในรูป
เมือ
่ P(x) และ Q(x) ตาง
่
เป็ นฟังกชั
์ นพหุนาม
Transcendental function

ฟังก์ชนั ตรีโกณมิติ (trigonometric function) คือ
ฟังกชั
์ นทีเ่ ขียนในรูปฟังกชั
์ นตรีโกณมิต ิ
 เช่น f(x) = sin x , f(x) = cos x

ฟังก์ชนั เอกซ์โพเนนชียล (exponential function)
x โดย
คือ ฟังกชั
น
ที
ม
่
เ
ี
งื
อ
่
นไขในรู
ป
f(x)
=
a
์
a เป็ นจานวนจริงบวกคงทีไ่ มเท
่ ากั
่ บ 1

ฟังก์ชนั ลอการิทึม (logarithmic function) คือ
ฟังกชั
์ นทีเ่ ขียนในรูป f(x) = logax โดย a เป็ น
Common functions Reference
Linear Function:
Square Function:
Cube Function:
f(x) = x2
f(x) = mx + b
f(x) = x3
Common functions Reference
Square Root Function:
Absolute Value Function:
f(x) = √x
f(x) = |x|
Reciprocal Function
f(x) = 1/x
Common functions Reference
Exponential Function:
f(x) = ex
Logarithmic Function:
f(x) = ln(x)
Common functions Reference
Floor and Ceiling Function:
The Floor Function
Common functions Reference
Sine Function:
Cosine Function:
Tangent Function:
Dance Moves
Equation of a Straight Line



The equation of a straight line is usually written this way:
y = mx + b
(or "y = mx + c" in the UK see below)
Y Intercept
y = how far up
x = how far along
m = Slope or Gradient (how steep the line is)
b = the Y Intercept (where the line crosses the Y axis)
Equation of a Straight Line



How do you find "m" and "b"?
b is easy: just see where the line crosses the Y axis.
m (the Slope) needs some calculation:
Equation of a Straight Line

Example 1
b = 1 (where the line crosses the Y-Axis)
Therefore y = 2x + 1
With that equation you can now ...
... choose any value for x and find
the matching value for y
For example, when x is 1:
y = 2×1 + 1 = 3
Check for yourself
that x=1 and y=3 is actually on the
line.
Or we could choose another value
for x, such as 7:
y = 2×7 + 1 = 15
And so when x=7 you will
have y=15
Equation of a Straight Line
Country Note:
Different Countries teach different "notation" (as sent to me by kind readers):
In the US,Australia, Canada, Egypt, Eritrae, Iran,Mexico, Portugal, Philippines and Saudi
Arabia the notation is:
y = mx + b
In the UK, Australia (also), Bahamas, Bangladesh, Belgium, Brunei, Bulgaria, Cyprus, Germany,
Ghana, India, Indonesia, Ireland, Jamaica, Kenya, Kuwait, Malaysia, Malawi, Malta, Nepal,
Netherlands, New Zealand, Nigeria, Pakistan, Peru, Poland, Singapore, Solomon Islands, South
Africa, Sri Lanka,Turkey, UAE, Zambia and Zimbabwe
y = mx + c
In Afghanistan, Albania, Brazil, China, Czech Republic, Denmark, Ethiopia, France, Lebanon,
Holland, Kosovo, Kyrgyzstan, Romania, Spain, Tunisia and Viet Nam:
In Azerbaijan, China, Finland, Russia and Ukraine:
In Greece:
In Italy:
In Japan:
In Cuba and Israel:
In Latvia:
In Romania:
In Sweden:
In Serbia and Slovenia:
y = ax + b
let us know!
y = kx + b
ψ = αχ + β
y = mx + q
y = mx + d
y = mx + n
y = jx + t
y = gA + C
y = kx + m
y = kx + n
PROBLEM 1
จงหาวาจุ
่ าหนดให้ตอไปนี
้ อยูบนกราฟของ
y ที่
่ ดทีก
่
่
กาหนดให้หรือไม่
1) จุด (2,7) เมือ
่ y = 2x + 3
2) จุด (8 , 23) เมือ
่
y = 34 x + 16
3) จุด (-3 , 11) เมือ
่ 3x + y = 2
4) จุด (4 , -2) เมือ
่ y = -2
PROBLEM 2
จงหาคาของ
a หรือ b ถาจุ
่ าหนดให้ทาย
่
้ ดทีก
้
บนกราฟของฟั
ขออยู
งกชั
่
้
์ น
1.
y = ax + 8 ; (1 , -2)
2.
y – ax = 1 ; (3 , 3)
3.
4.
y=
2
7
x + b ; (14 , 1)
y–b=
2
9
x;
1
(
2
, 1)
PROBLEM 3
เมือ
่ จุดเยือกแข็งของน้าเทากั
่ บ 0 ˚C หรือ 32 ˚F
และจุดเดือดของน้าเทากั
่ บ 100 ˚C หรือ 212 ˚F จง
เขียนความสั มพันธของความสั
มพันธของอุ
ณหภูม ิ
์
์
ทีเ่ ป็ นองศาเซลเซียส ( ˚C ) และองศาฟาเรนไฮต ์
( ˚F ) ในรูปของฟังกชั
์ นเชิงเส้น y = ax + b โดย
i. เขียนความสั มพันธของอุ
ณหภูมท
ิ เี่ ป็ นองศาฟา
์
เรนไฮตให
ป ˚C
์ ้อยูในรู
่
ii. เขียนความสั มพันธของอุ
ณหภูมท
ิ เี่ ป็ นองศา
์
เซลเซียสให้อยูในรู
ป ˚F
่
iii. ถาอุณหภูมข
ิ องน้าวัดได 110 ˚F จะเทากับกีอ
่ งศา
PROBLEM 4
บริษัท แห่ งหนึ่ ง จ่ายค่าจ้ างซึ่ง คิด จากคาพาหนะ
่
และคาเบี
้ เลีย
้ งให้พนักงานขายทุกคน คนละเทาๆ
่ ย
่
กัน และจายค
าจั
่ วกับการขาย (commission)
่
่ ดการเกีย
ซึ่ ง คิ ด เป็ นร้ อยละจากยอดขายที่ พ นั ก งานแต่ ละ
คนขายได้ ปรากฏวา่
เมือ
่ เดือนทีผ
่ านมา
วิทวัส
่
ไดรั
ั 31,000 บาท โดยเขามียอดขาย
้ บเงินจากบริษท
300,000 บาท สุนทรไดรั
ั 32,500 บาท
้ บเงินจากบริษท
i. เขียนฟังกชั
่ นักงานไดรั
์ นแทนรายไดที
้ พ
้ บในแต่
ละเดือนในรูปของสมการ
FUNCTIONS
Parabola Or Square Function

This is the Square Function:
f(x) = x2

This is its graph:
It is a Parabola.
the y-axis (like a mirror
image).
And it is an even
function.
Its Domain is the Real
Numbers:
Its Range is the NonNegative Real
Numbers:
[0, +∞)
y = x2
y = 1 – x2
y = 2x2 + 4
y = –(x + 3)2
y = x2 + 2x
y = -x2 + 4x + 5
จงใช้ความรู้เรื่องกราฟเพื่อแสดงว่าสมการที่
กาหนดให้ในข้อใดต่อไปนี้ ที่
มีคาตอบของสมการทีเ่ ป็ นจานวนจริง
เพียง 1 จานวน
มีคาตอบของสมการทีเ่ ป็ นจานวนจริง 2
2
x -4=0
ไมมี
่ คาตอบของสมการทีเ่ ป็ นจานวนจ
2x2 + 5 = 0
-3x2 – 7 = 0
2(x + 1) 2 = 0
-5(x + 3)2 – 7
จงหาคาตอบของอสมการโดยใช้กราฟ
x2 – x – 2 > 0
x2 – 5x – 6 ≥ 0
จงหาคาตอบของอสมการโดยใช้กราฟ
–(x – 7)(x + 3) ≤ 0
-2x2 + 7x + 4 > 0
จงหาคาตอบของอสมการโดยใช้กราฟ
x2 > 3x
x2 + 2x ≥ 8
จงหาคาตอบของอสมการโดยใช้กราฟ
-x2 – 6x ≤ -7
x2 – 3x – 1 ≤ 3
Exponential Function

This is the Exponential Function:
f(x) = ax
a is any value greater than 0



Properties depend on value of "a“
When a=1, the graph is a horizontal line at y=1
Apart from that there are two cases to look at:
Exponential Function

Apart from that there are two cases to look at:
a between 0 and 1
Example: f(x) = (0.5)x
For a between 0 and 1
As x increases, f(x) heads to 0
As x decreases, f(x) heads to infinity
It is a Strictly Decreasing function
(and so is "Injective")
It has a Horizontal Asymptote along
the x-axis (y=0).
a above 1
Example: f(x) = (2)x
For a above 1:
As x increases, f(x) heads to infinity
As x decreases, f(x) heads to 0
it is a Strictly Increasing function
(and so is "Injective")
It has a Horizontal Asymptote along
the x-axis (y=0).
Exponential Function
f(x) = ax




In General:
It is always greater than 0, and never crosses the xaxisIt always intersects the y-axis at y=1 ... in other words
it passes through(0,1)
At x=1, f(x)=a ... in other words it passes through (1,a)
It is an Injective (one-to-one) function
Its Domain is the Real Numbers:
Its Range is the Positive Real Numbers: (0,
+∞)
Inverse of Exponential Function
ax is the inverse function of loga(x)
(the Logarithmic Function)
f(x) = loga(x)
So the Exponential Function can be "reversed" by the
Logarithmic Function.
The Natural Exponential Function
This is the "Natural" Exponential Function:
f(x) = ex
Where e is "Eulers Number" = 2.718281828459 (and more ...)
At the point (1,e) the slope of the line is e and the line is
tangent to the curve.
Absolute Value Function
This is the Absolute Value Function:
f(x) = |x|
It is also sometimes written: abs(x)
This is its graph:
It makes a right angle at (0,0)
It is an even function.
Its Domain is the Real
Numbers:Real Numbers
Its Range is the Non-Negative
Real Numbers: [0, +∞)
Floor and Ceiling Function
The floor and ceiling functions give you the nearest integer up or down.
Floor and Ceiling Function
Floor and Ceiling of Integers
What if you want the floor or ceiling of a number that is already an integer?
That's easy: no change!
Example: What is the floor and ceiling of 5?
The Floor of 5 is 5
The Ceiling of 5 is 5
Here are some example values for you:
x
Floor
Ceiling
-1.1
-2
-1
0
0
0
1.01
1
2
2.9
2
3
3
3
3
Floor and Ceiling Function
Definitions
Example: How do we define the floor of 2.31?
Well, it has to be an integer ...
... and it has to be less than (or maybe equal to) 2.31, right?
2 is less than 2.31 ...
but 1 is also less than 2.31,
and so is 0, and -1, -2, -3, etc.
Oh no! There are lots of integers less than 2.31.
So which one do we choose?
Choose the greatest one (which is 2 in this case)
So we get:
The greatest integer that is less than (or equal to) 2.31 is 2
Floor and Ceiling Function
Floor Function: the greatest integer that is less than or equal to x
Likewise for Ceiling:
Ceiling Function: the least integer that is greater than or equal to x
As A Graph
The Floor Function is this curious "step" function (like an infinite staircase):
The Floor Function
(Note: a solid dot means "including"
an open dot means "not including")
Floor and Ceiling Function
If it looks confusing, just imagine you are at some x-value (say x=1.5), and see
what y-value you get ... does it make sense now?
Example: at x=2 we meet an open dot at y=1 (so it does not include x=2), and a solid
dot at y=2 (which does include x=2) so the answer is y=2
And this is the Ceiling Function:
Floor and Ceiling Function
If it looks confusing, just imagine you are at some x-value (say x=1.5), and see
what y-value you get ... does it make sense now?
Example: at x=2 we meet an open dot at y=1 (so it does not include x=2), and a solid
dot at y=2 (which does include x=2) so the answer is y=2
And this is the Ceiling Function:
The "Int" Function

The "Int" function (short for "integer") is like the "Floor"
function, BUT some calculators and computer programs
show different results when given negative numbers:



Some say int(-3.65) = -4 (the same as the Floor function)
Others say int(-3.65) = -3 (the rule is: neighbouring
integer closest to zero, or "just throw away the .65")
So be careful with this function!
The "Frac" Function

When you use the Floor Function, you "throw away" the
fractional part. That part is called the "frac" or "fractional
part" function:
frac(x) = x - floor(x)
It looks like a sawtooth:
Example: what is frac(3.65)?
frac(x) = x - floor(x)
So: frac(3.65) = 3.65 - floor(3.65) = 3.65 - 3
= 0.65
Example: what is frac(-3.65)?
frac(x) = x - floor(x)
So: frac(-3.65) = (-3.65) - floor(-3.65) = (-3.65)
- (-4) = -3.65 + 4 = 0.35
```