4
$\begingroup$

The function $f(x) = 1-f(x-1)$, for positive interger, $x$. If $f(2) = 12$, compute $ f(2012)$

$\endgroup$
7
$\begingroup$

$f(x)=1-f(x-1)=1-(1-f(x-2))=f(x-2)=...=f(2)$ is $x$ is even

So, $f(2012)=f(2)=12$

If x is odd, $f(x)$ will reduce to $f(1)=1-f(2)=1-12=-11$

$\endgroup$
  • $\begingroup$ So, the answer to f(2) and f(2012) are both 12? And any even number is also 12? $\endgroup$ – Ctrl Sep 9 '12 at 17:48
  • $\begingroup$ Yes, to me that is the case. $\endgroup$ – lab bhattacharjee Sep 10 '12 at 4:59
3
$\begingroup$

Since $x$ is an integer, I will replace it with $k$. Also, instead of $f (x)$ I will use $x_k$. Hence, the rephrased problem is the following:

Problem: for nonnegative $k$ we have that $x_{k+1} = 1 - x_k$. If $x_2 = 12$, compute $x_{2012}$.

Consider the discrete-time dynamical system

$$x_{k+1} = a x_k + b$$

where $a, b \in \mathbb{R}$. It is easy to show that for all $k \geq 0$ we have that

$$x_k = a^k x_0 + \displaystyle\sum_{i=0}^{k-1} a^i b = a^k x_0 + \displaystyle \left(\frac{1 - a^k}{1 - a}\right) b$$

Let's make $a = -1$ and $b = 1$. We then have that the general solution of $x_{k+1} = 1- x_k$ is

$$x_k = (-1)^k x_0 + \displaystyle \left(\frac{1 - (-1)^k}{2}\right)$$

If $x_2 = 12$, then $x_0 = 12$ as well. Note that $x_{2012} = (-1)^{2012} x_0 = x_0 = 12$. I do concede that this approach is total overkill, but next time you see something of the form $x_{k+1} = a x_k + b$, you know what to do.

$\endgroup$
  • $\begingroup$ Nice one! ${}{}$ $\endgroup$ – Pedro Tamaroff Sep 8 '12 at 17:33
0
$\begingroup$

Hint $\ $ Iterating a function $\rm\:g\:$ of period $\rm\,n\:$ produces a sequence of period $\rm\,n$

$$\rm g^n = Id,\,\ f(k\!+\!1) = g\,f(k)\ \Rightarrow\ f(k\!+\!n) = g^n f(k) = f(k)\ \Rightarrow\ f(k\!+\!jn) = f(k) $$

Yours is the special case $\rm\:n=2,\:$ since $\rm\:f(k\!+\!1) = 1-f(k) = g\,f(k),\:$ for $\rm\:g(x) = 1\!-\!x,\:$ where $\rm\:g^2(x) = g(g(x)) = g(1\!-\!x) = 1\!-\!(1\!-\!x) = x,\ $ so $\rm\:g^2(x) = x,\:$ i.e. $\rm\ g^2 = Id.$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.