Express the following relations in their simplest form

191 Views Asked by At

Let $x$ and $y$ be integers where

$$f(x,y)= \begin{cases} 5 & x< y \\ f(x-y,y+2)+1 & x\ge y \\ \end{cases}$$

Express the following relations in their simplest forms.

a. $f(2, 7)$

b. $f(5, 3)$

c. $f(15, 2)$

I have the following answers so far:

a. $f(2,7) = 5$

b. $f(5,3) = f(2,5) + 1 $

c. $f(15,2) = f(13,5) + 1$

I've been trying to teach myself this stuff off the internet and struggling to really get a grasp of it. If anyone could show me where I have gone wrong or offer an explanation/breakdown it would be truly appreciated.

2

There are 2 best solutions below

3
On BEST ANSWER

You just haven't gone far enough. $f(5,3)=f(2,5)+1$, but $f(2,5)=5$ so $f(5,3)=6$. For c you will need several steps to get an answer.

1
On

"and struggling to really get a grasp of it."

What's to grasp? You keep doing things until you don't have any $f$ expression any more.

1) $f(2,7)$:

$2< 7$ so $f(2,7) = 5$.

2) $f(5,3)$.

$5 \ge 3$ so $f(5,3) = f(5 -3, 3+2) + 1= f(2,5) + 1$. $2 < 5$ so $f(2,5) = 5$ and $f(2,5) + 1 = 5 + 1 = 6$. So $f(5,3) = 6$.

3) $f(15,2)$.

$15 \ge 2$ so $f(15,2) = f(15-2,2+2) + 1 = f(13,4) + 1$.

$13 \ge 4$ so $f(13, 4) = f(13-4, 4+2)+1 = f(9,6)+1$. So $f(13,4) + 1 = f(9,6) + 1 + 1 = f(9,6) +2$.

$9 \ge 6$ so $f(9,6) = f(9-6, 6+ 2)+1 = f(3,8)+1$ and $f(9,6) + 2 = f(3,8) + 1 + 2 = f(3,8) + 3$.

$3 < 8$ so $f(3,8) = 5$. So $f(3,8) + 3 = 5 + 3 = 8$.

... or in other words....

1)

$f(2,7) = 5$

2)

$f(5,3) =$

$f(5-3, 3+2) + 1=$

$f(2, 5) + 1=$

$5 + 1 = 6$

3)

$f(15,2) =$

$f(13,4) + 1=$

$(f(9,6) + 1) +1= f(9,6) + 2 = $

$(f(3,8)+1 ) + 2 =f(3,8) + 3=$

$5 + 3 = 8$.