Homework on Functions - Questions

Function is a mathematical method which is ‘does’ stuffs depend on it’s returning type. For example, a ‘plus’ function would return with the addition of 2 parameters from the input to the output.

a, f(2) = 4
b, f(7) = 17
c, f(0) is a tricky one. If we consider 0 as an even, then the answer is 0, but if we consider 0 as an odd number then it’s 10. maybe we throw exception for 0.

function f ( x ) {
return (x / 4) - 5;
}

1 Like

0 is an even number, so f(0)= 0

2 Likes

You are right, but sometimes 0 is exceptional and have to handle carefully. For example, if you write a function with input x and you want to divide 10 by x, you cannot do 10 / x if x = 0. That was my initial thought but yeah, maybe I confused myself too much :D.

1 Like

Homework on Functions - Questions

  1. Describe what a function does in your own words.
    Function is like an expression, computation or relation from a set of inputs and a set of outputs. Each input is related with excatly one output.

  2. Calculate the output of the following function

f(x) = {

x^2 if x is even

x+10 if x is odd

}

What will be the output for the following inputs?

  • a) f(2) = 4

  • b) f(7) = 17

  • c) f(0) = 0

  1. 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
1 Like
  1. A function is a process whereby the input is altered in some way that is pre-defined to produce an output.

2a. 4
b. 17
c. 0

  1. f(x) = (x/4)-5
1 Like

Describe what a function does in your own words.
A function mathematically computates input to output.

Calculate the output of the following function.
a) f(2)=2x2=4
b) f(7)=7+10=17
c) f(0)=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.
f(x) = x/4-5

2 Likes
  1. A function takes an input in and then changes it to the output

a. 4
b. 17
c. 0
3. f(x) = (x/4) - 5

1 Like
  1. A function is a set of instructions (inputs) which are executed to generate a specific result (output)

a) 4

b) 17

c) 0

  1. f(x)= (x/4)-5
1 Like

1. Describe what a function does in your own words
-a function produces a specific output given a specific input and vice versa
2. Calculate the output of the following function

f(x) = {

x^2 if x is even

x+10 if x is odd

}

What will be the output for the following inputs?

  • a) f(2)
    x^2 = 4
  • b) f(7)
    7+10 = 17
  • c) f(0)
    0

3. 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

1 Like
  1. A function describes in mathematical terms operations to get an output value from any given input value.

  2. a) 4 b) 17 c) 0

  3. f(x)= x/4 - 5

1 Like
  1. Describe what a function does in your own words

Modifies an input to give an output.

  1. Calculate the output of the following function
f(x) = {

x^2 if x is even

x+10 if x is odd

}

What will be the output for the following inputs?

  • a) f(2) 4
  • b) f(7) 17
  • c) f(0) 0
  1. 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

1 Like

I just really don’t get it

  1. a function is a computation that given a input will produce an certain output

  2. f(2)=4
    f(7)=17
    f(0)=0

  3. f(x)=x/4-5

1 Like
  1. A function is basically a computation of a mathematic sum in which f(x) where x is a variable and it will calculate the output for various inputs.

  2. a)4
    b)17
    c)0

  3. f(x) = (x/4)-5

1 Like
  1. A function is a mathematical operations.
  2. f(2), f(x) = 4
    f(7), f(x) = 17
    f(0), f(x) = 0
  3. f(x) = (x/4) - 5
1 Like
  1. Describe what a function does in your own words:
    A function is a calculation programed to be performed on a valid input.

  2. Calculate the output of the following function

f(x) = {

x^2 if x is even

x+10 if x is odd

}

What will be the output for the following inputs?

  • a) f(2) =4
  • b) f(7) =17
  • c) f(0) =0
  1. 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
1 Like

Describe what a function does in your own words
-indicate the number as multiplayer for input

-4
-17
-0

f(x)=(x{1/4})*(-5)

1 Like
  1. A function is a mathematical equation that converts an input into a chosen output dependent on the equation.

  2. a) 4 b) 17 c) 0

  3. f(x) = { x/4-5}

1 Like

Can you explain what you don’t understand?

a function is a set of instruction that performs an action to give the following output

f(2)= 4
f(7)= 17
f(0)= 0

f(x)=x/4-5

1 Like