0

Let f be a function defined for all positive integers x and y satisfying the following conditions:

$1)f(1, 1)=2$

$II. f(x+1, y)=2(x+y)+f(x, y)$

$III. f(x, y+1)=2(x+y-1)+f(x, y)$

The value of $x-y$ for what $f(x, y) =2006$ is ?(Answer:$-20$}

I tried like this but I don't see how to get to f(2006)

$III)x=1:y=1:\implies f(1,2)=2(1)+f(1,1)=2+2=4$ $II)x=1:y=1 \implies f(2,1)=2(1+1)+f(1,1) = 4+2=6$ $(II)x=1:y=2 \implies f(2,2) = 2(3)+f(1,2)=6+f(1,2)=10$ $(III)x=1,y=2 \implies f(1,3) = 2(2)+f(1,2)=4+f(1,2)=8$ $(II):x=2:y=2 \implies f(3,2)=2(4)+f(2,2) = 8+10 = 18$ $(III):x=2,y=2 \implies f(2,3)=2(3)+f(2,2) = 6+10=16$ $(II):x=2,y=1 \implies f(3,1)=2(3)+f(2,1)=6+4=10$ $(III):x=2:y=1 \implies f(2,2)= 2(2)+f(2,1) = 4+6 = 10$ $(II)x=1:y=3 \implies f(2,3) = 2(4)+f(1,3) = 8+f(1,3)=16 \therefore f(1,3) = -8$ $(III) x=3,y=1 \implies f(3,2)=2(3)+f(3,1)\implies f(3.1) = 18-6=12$

peta arantes
  • 6,211
  • 1
    Well, as a cheap remark: the factors of $2$ are not relevant. Let $F(x,y)=\frac 12\times f(x,y)$ and rewrite without the factors of $2$. At least that gets the target number down (not sure if that matters or not). Aside from that, I'd start by computing something like $f(n,1)$. Get a sense of how the function grows. Figure out where you need to start. – lulu Jan 10 '23 at 14:53
  • Can you check your $(II)x=1:y=3$? I believe that the conclusion should be $f(1,3) = 8$. – Calvin Lin Jan 10 '23 at 14:55
  • 1
    Hint: 1/ Find a closed-form for $f(1, y)$ (should be guessable by observation) 2/ Find a closed-form for $f(x,y)$ (just work through the definition). 3/ Hence determine how $f(x, y) = 2006$. – Calvin Lin Jan 10 '23 at 15:00
  • Your title is awkward – Anne Bauval Jan 10 '23 at 15:53
  • 1
    Note that II and III are redundant but happily compatible. I.e. if you move on a grid from $(1,1)$ to $(x,y)$ to compute what you must add to $f(1,1)$ to obtain $f(x,y),$ you get the same result whatever path you choose. – Anne Bauval Jan 10 '23 at 15:59

1 Answers1

1

Following @CalvinLin 's hint (for instance, but see also my last comment), I and II give $$f(x,1)=x(x+1).$$ From this and III, we deduce $$f(x,y)=(x+y-2)(x+y-1)+2x.$$

Therefore, $$f(x,y)=2006\iff(x,y)=(13,33).$$

This (unique) solution $(13,33)$ was found by noticing that $f(x,y)=2\pi(y-2,x)$ where $\pi:(\Bbb Z_{\ge0})^2\to\Bbb Z_{\ge0},\;(p,q)\mapsto\frac{(p+q)(p+q+1)}2+q$ is Cantor's pairing function, which is bijective and for which an inversion algorithm is known.

The answer $x-y$ is not $-10$ but $-20.$

Anne Bauval
  • 34,650