Functions which take two inputs??

Hi all,

Consider the function f(x,n) = x mod n.

What is the domain of f ?

what is the range of f ?

Let g(n) = f(87,n) Evaluate g(g(g(8)))

Is the domain simply say, the set of Real numbers?

Is the range {x,...,(n-1)} ?

last part totally stumped but assumed something like

(87,8) = 7

(7,8) = 7

7,7 = 0

g o g o g = 0?????

any help would be great, exam tomorrow, and i did try to solve!!!

Re: Functions which take two inputs??

Quote:

Originally Posted by

**matrix37696** Consider the function f(x,n) = x mod n.

What is the domain of f ?

what is the range of f ?

Let g(n) = f(87,n) Evaluate g(g(g(8)))

Is the domain simply say, the set of Real numbers?

You said yourself that the function takes two arguments. So, what happens when we give it an element of real numbers, i.e., just one number? This is a type error: one argument is not enough.

Second: do you know what $\displaystyle \pi\text{ mod }\sqrt{2}$ is? I am not sure either. So, can you give any real numbers as inputs to f? Lastly, there are several variants to define mod when one of the arguments is negative. E.g., one option is 5 mod -3 = 2 and another is 5 mod -3 = -1. Both are reasonable because 5 - 2 and 5 - (-1) are divisible by -3; both versions have advantages and disadvantages. Check if the mod function from your textbook or lecture notes accepts negative numbers.

Quote:

Originally Posted by

**matrix37696** Is the range {x,...,(n-1)} ?

This cannot be because x and n - 1 are undefined. The range is a single set of outputs for all possible inputs; it may not depend on some concrete inputs.

Quote:

Originally Posted by

**matrix37696** last part totally stumped but assumed something like

(87,8) = 7

(7,8) = 7

7,7 = 0

What do you denote by two numbers in parentheses? Sometimes this denotes the greatest common divisor of the two numbers, but I don't think this is what you mean.

Quote:

Originally Posted by

**matrix37696** g o g o g = 0?????

This is incorrect because the left-hand side is a function and the right-hand side is a number.

To evaluate g(g(g(8))), find g(8) and call it, say, u. Next find g(u) and call it v. Finally, find g(v).

Re: Functions which take two inputs??

Quote:

Originally Posted by

**emakarov** Second: do you know what $\displaystyle \pi\text{ mod }\sqrt{2}$ is? I am not sure either.

And yet we talk about angles "mod $\displaystyle \pi$" So it makes sense sometimes!

-Dan