Homework on Functions - Questions

Ohhh! Got it. I was under the impression that I was still selecting the f value as Ivan did in the lecture.

1 Like
  1. A function is a computation that is given an input and returns an output.

2a.
f(x) = x^2
f(2) = (2^2)
= 4

2b.
f + x = f + 7
f + 7 = 10 + 7
=17

2c.
f(x) = (x^2)
f(0) = (0^2)
= 0

  1. f(x/4) = (x/4) - 5
1 Like
  1. function is computational & mathematical command to calculate the output from given input.
  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 a computation that creates a syntax that defines an input to create an output
  2. Calculate the output of the following function
    a) 4
    b)17
    c)0
  3. f(x) = (x/4) - 5
1 Like

can someone explain why 7 and 0? maybe a dom question but,1,3,5 are also odd.

1 Like
  1. A function represents a relationship between a value input into an equation to calculate the resultant output value that is related to that specific input for that specific function. It is basically a consistent calculation performed on variable to generate it’s calculated counterpart

  2. a) f(2) — 4
    b) f(7)— 17
    c) f(0)— 0

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

1 Like

1- a function gives an output which is equal to the input through a mathematical equation
2-
f(2)=4
f(7)=17
f(0)=0
3- f(x/4)=(x/4)-5

1 Like
  1. Describe what a function does in your own words
    A function accepts an optional value as input, performs a calculation using that input, and returns the result of the calculated value as 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 takes an input and computes an output
  2. 4, 17, 0
  3. f(x) = {(x/4) - 5}
1 Like
  1. a function helps compute an express to get a value.

A. 4 even
B. 17 false
C. 0 even

  1. F(x) = (x % 4) - 5
1 Like
  1. function is a output computation which is a mathematical rule

  2. a. 4
    b. 17
    c. 0

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

1 Like
  1. A function takes an input and produces an output. Certain function given certain input will produce always the same output.

  • f(2) = 4
  • f(7)=17
  • f(0) = 0
  1. f(x) = x/4 - 5
1 Like
  1. Describe what a function does in your own words

A function is a mathematical equation that calculates an output for every input.

  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) = 10
  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

A function is a calculation performed on a variable input.

a) 4
b) 17
c) 0

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

1 Like

A function is the mathematical language to calculate output from input

a) 4
b) 17
c) 0

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

1 Like

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

1 Like
  • A function has a parameter(s) that accepts an argument(s) as input
  • The function performs some computation on the input in the body of the function
  • The result of the computation is then returned from the function when the function is invoked by calling the function by writing the function name followed by parentheses

a) f(2)
2 is an even number
Therefore, 2 evaluates to true for the x is even condition
The circumflex mathematical computation can be applied
2^2 = 2 x 2 = 4
Answer: 4

b)
7 is an odd number
Therefore, 7 evaluates to true for the x is odd condition
The addition mathematical computation can be applied
7+10 = 17
Answer: 17

c) f(0)
0 is an even number
Therefore, 0 evaluates to true for the x is even condition
The circumflex mathematical computation can be applied
0^2 = 0 x 0 = 0
Answer: 0

  • This relates to function composition as two computations are being performed on the initial input
  • It can be written as f(g(x))
  • The inner function g(x) gets evaluated first, it result is returned as an input to the outer function f
  • f will then perform it’s computation on the input and the result will outputted (returned) on invokation
    const g = x = x / 4
    const f = x = x - 5
    const compose = f(g(x))
    compose(20)
    20 will be passed as input to g, which will divide it by 4 resulting in 5
    The result of 5 will be passed as input to f, which will subtract 5 from it resulting in 0
    Answer: 0
1 Like
  1. a function is a calculation made from input informations to get output results.

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

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

1 Like
  1. Function is a determinate rule. Think as a production line, you have your raw material (input) -> process (function) -> result. Function is the process of “adding value” to the input and turn it in an output.

a. 4
b. 17
c. 0
3. f(y) = {
f(x) {{
x/4
}
}
f(y) – 5

Describe what a function does in your own words
Basically a function is a calculation. A complex of mathematic operations

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

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