1.The first example function inputs any number x represents.
Between the {} parenthesis means the condition that needs to be true in order to complete the mathematical output.
So x^2 means, any number x is will be to the power of 2 if x is an even number eg; 6^2 is 6*6 which makes the output to 36.
So for x + 10 will be any number that represents (x) will be added to 10 if x is an odd number eg; x is 3 equation would be 3 + 10 which makes the output 13.
- What will be the output for the following inputs?
for example a) f(2)
f(2) = {
x^2 if x is even
x+10 if x is odd
}
as x = 2 then the condition implements even number so the equation is 2^2 = 4
for example b) f(7)
f(7) = {
x^2 if x is even
x+10 if x is odd
}
as x = 7 then the condition implements odd number so the equation is 7 + 10 = 17
for example c) f(0)
f(0) = {
x^2 if x is even
x+10 if x is odd
}
as x = 0 then the condition implements even number so the equation is 0^2 = 0
- Write the definition of a function f that takes an input x, divides it by four and then outputs that result subtracted by 5.
The function would be:
f(x) = {
x / 4 - 5
}