Homework on Functions - Questions

Thanks for explanation. I still need read it several times to understand it.

1 Like
  1. Function is a formula where you use a variable to calculate the output.

  2. a. 4
    b. 17
    c. 0

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

1 Like

Hello

  1. a function applies a predetermined process to a variable.

a) 4
b)17
c) N/A
d) f(x) = ( x/4 - 5)

Best

1 Like
  1. A function is a mathematical computation that derives an output, based on the input and function.

  2. f(x) = {x^2 if x is even x+10 if x is odd}
    a) 4
    b) 17
    c) 0

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

2 Likes
  1. A function calculates an output based on the definition of the function and the input.

  2. a) 4; b) 17; c) 0 (zero is an even number because it is divisible by 2 without a remainder)

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

1 Like
  1. A function takes and input and produces and output.
  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. A function is an expression that takes an input and produces a derived 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. Describe what a function does in your own words
A function is a mathematical expression which allows an input to be computed using variables into an 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

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 is a computation. It takes an input to compute an 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 combines several instructions into a single line of code

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

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. Describe what a function does in your own words – A function takes an input value, does a calculation with the input value, and emits an output value.
  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?

* f(2) = 2^2 = 4
* f(7) = 7 + 10 = 17
* f(0) = 0^2 = 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- It’s a computation that applies a one or multiple oerations to an input to give an output.

2- a)4, b) 17, c)0.

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

1 Like
  1. A function is a computation that you define.
  2. 4
    17
    error
  3. f(x)=(x/4) - 5
1 Like

Homework on Functions - Questions

  1. Describe what a function does in your own words
  • its a set of rules which produces different output by changing the variable.
  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.
    [/quote]
    f(x) = x /4 - 5
1 Like
  1. A function is calculating a value (output) that is dependent on one or more variables (input). A function always follows a pre set formula.

a) f(2) (x is even) means the formula is f(x) = x^2 and that gives us f(2) = 2^2 = 4 Answer: 4

b) f(7) (x is odd) means the formula is f(x) = x +10 and that gives us f(7) = 7 +10 = 17 Answer: 17

c) f(0) (x is even) means the formula is f(x) = x^2 and that gives us f(0) = 0^2 = 0 Answer: 0

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

technically, zero is even. 0^2 = 0

1 Like

1-Function is a mathematical equation that takes and input and produces and output. The out put changes with variable inputs.

2a-f(2)= 2 X 2 =4
2b-f(7) since odd add 10 f(7)=7 + 10 = 17
2c-f(0) =0

3- f(x)=[x/4] - 5

1 Like

A function creates an output by applying a variable to a given input.

  • a) f(2) = 4
  • b) f(7) = 17
  • c) f(0) = 0
  1. f(x) = (x/4)-5
1 Like
#Written in Python since that is 
#the programming language that I am most familiar with.

def f(x):
	if (x % 2 == 0):  # if x divided by 2 leaves no remainder...(x is even)
		return(x**2)  # return x to the power of 2
	else:
		return x+10  # otherwise (x is odd) return x + 10

# What will be the outputs of the following inputs?
print(f(2)) # 14
print(f(7)) # 17
print(f(0)) # 0


#3. Write a function that takes an input x, divides it by four then outputs that result subtracted by 5

def f(x):
	return ((x/4.0)-5.0)


print(f(100)) 


2 Likes

Homework

1.In my understanding function is a math formula. And u are able to change variable in a function, not in a formula. Output depends on a formula(captain obvious) and the variable(input).

2.f(x) = {x^2 if x is even x+10 if x is odd}

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

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

it toked me like 20 min to remember what a function is and how to use it. thanks for school… :slight_smile:

1 Like