- Describe what a function does in your own words
It takes input or mathematical data and produces a result or output through mathematical computations. - Calculate the output of the following function
f(x) = {
x^2 if x is even
x+10 if x is odd
}
If the input is an even number the result will be that number to the 2nd potency
If the input is an odd number the result will be that number plus a value of 10.
- What will be the output for the following inputs?
• a) f(2) = 4
• b) f(7) = 17
• c) f(0) = 0 (if zero taken as an even number); 17 (if zero taken as an odd number) - Write the definition of a function f that takes an input x, divides it by four and then outputs that result subtracted by 5.
F(x) = x/4 -5