(a) Define r(n, m) : N x Z+ ->N be the remainder obtained when dividing m into n. Define the function g: Z+ x Z+ ->Z+ as follows: g(a, b) = b if r(a, b) = 0, and g(a, b) = g(b, r(a,b)) otherwise. Describe what g is calculating, and justify your answer.
The Answer to the Question
is below this banner.
Can't find a solution anywhere?
NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?
Get the Answers Now!You will get a detailed answer to your question or assignment in the shortest time possible.
Here's the Solution to this Question
There is two cases:
first case:
function multiplies two positive integers (because r(a, b) = 0); for example g(2,4)=2x2=4, g(3,9)=3x3=9, g(3,15)=3x5=15
second case - the result of function is remainder of dividing two positive integers; for example: g(7,8)=1, g(5,19)=4