Homework on Functions - Questions

  1. Function is a computation. Data to compute is in input result is an output.

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

1 Like

1- It is a mathematical formula that needs an input to return an output.
2a) 4
2b)17
2c) 0

1 Like

Thanks! I agree with the readability aspect.

  1. A function is a description of rules to be applied to each and every unique input.
  2. a) 4
    b) 17
    c) 0
  3. f(x)=(x/4)-5
1 Like

Thank you. This makes perfect sense.

  1. A function is a set of instructions for the execution of a computation.

    1. 4
    2. 17
    3. 0
  2. I am embarrassed to say that I am not sure how to answer this question. Is the definition for this function and different from that of the problem in question 2?

1 Like
  1. a function is a formula that computes an input and puts out an output

  2. a f(2)
    b f(7)
    c f(0)

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

1 Like

1 Function takes a input and perform a calculation with it.
2. a) 4
b) 17
c) 0 or error
3. f(x)= x/4 - 5

1 Like

1: A function is a calculation that gives an output from an input.
2: a) = 4 b) = 17 c) = 0
3: F(x) = (x/4)-5

1 Like
  1. A function takes an input and gives an output based on specified instructions.
  2. a) 4
    b) 17
    c) 0
  3. f ( x ) = x / 4 - 5
1 Like

I understand the whole n=2k (for k) but I thought this was referring to functions, and hence I went down the mathematical function path, rather than the basic math path :stuck_out_tongue_winking_eye: I never claimed to be bright (I think we’ve established that :slight_smile:

For anyone else confused as to which is which:

  • An even number is a number n which can be written as n=2K for some whole number K. e.g.: after dividing, there is zero (0) remainder
  • An odd number is a number n which can be written as n=2K+1for some whole number K

Even is thus: n = 2K
0 = 2K
===> 0 = 2K
===> 0/2 = K ===> 0 = K ===> 0 is a Whole Number (for which there is no remainder, in this equation). So it is an even number.

Odd is thus: n = 2K + 1
0 = 2K + 1
===> -1 = 2K
===> -1/2 = K ===> -0.5 = K ===> 0.5 is not a Whole Number :wink: So zero is not an odd number.

1 Like
  1. A function is a generalized input-output process that defines a mapping of a set of input values to a set of output values.

2a) 4

2b) 17

2c) 0 or error

  1. f(x) = x/5 - 4
1 Like
  1. A function takes an input, performs operations/computations based on this input and any function parameters, and gives results as an output.

  2. A) 4
    B) 17
    C) 0

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

1 Like
  1. A function takes a given input, performs a calculation and returns a single output
  2. • f(2) = 4
    • f(7) = 17
    • f(0) = 0
  3. f(x) = x/4 - 5
1 Like

In the second question you had to provide answers for the defined formula. In the third you must specify the formula based on provided instructions. :slight_smile:

1 Like

These are incorrect unfortunately. If X is even you must square it and if its odd you must add 10. :slight_smile:

0 is an even number so no error. :wink:

Sorry! I didnt read the question properly.

  1. Describe what a function does in your own words
    A mathemetical function applies math operators to an input variable and produces a result.

  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. Describe what a function does in your own words
  • A function takes an input/variable and does some “logic”/calculations with the variable and outputs it.
  1. Calculate the output of the following function
  • a) 4
  • b) 17
  • c) In programming, “0” is considered an even number AFAIK which means the result is = 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