1. ## Function Question

2. How much of this have you done?
Have you done any of it?
If you have, what pattern do you see?

3. Originally Posted by Plato
How much of this have you done?
Have you done any of it?
If you have, what pattern do you see?
For part a, for f2(x) i get f(f(x)), so what would f(f(n)) be? Without knowing n, how would I calculate this? maybe i'm just confused about what to provide for an answer.

4. Originally Posted by shawn
For part a, for f2(x) i get f(f(x)), so what would f(f(n)) be? Without knowing n, how would I calculate this? maybe i'm just confused about what to provide for an answer.
Well,
$f(n) = \left \{ \begin{array}{rr}n + 3,\text{ if n is even} \\ n - 1,\text{ if n is odd} \end{array} \right .$

So to calculate $f(f(n))$,
If n is even this is $f(f(n)) = f(n + 3) = (n + 3) - 1 = n + 2$
since n + 3 is odd.

If n is odd then this is $f(f(n)) = f(n - 1) = (n - 1) + 3 = n + 2$
since n - 1 is even.

So $f^2(n) = n + 2$ for all n.

You do the rest.

-Dan

5. Originally Posted by topsquark
Well,
$f(n) = \left \{ \begin{array}{rr}n + 3,\text{ if n is even} \\ n - 1,\text{ if n is odd} \end{array} \right .$

So to calculate $f(f(n))$,
If n is even this is $f(f(n)) = f(n + 3) = (n + 3) - 1 = n + 2$
since n + 3 is odd.

If n is odd then this is $f(f(n)) = f(n - 1) = (n - 1) + 3 = n + 2$
since n - 1 is even.

So $f^2(n) = n + 2$ for all n.

You do the rest.

-Dan
Ah okay got it..thanks.

So, $f^2(n) = n + 2$ when n is odd
and $f^2(n) = n + 2$ when n is even

and $f^3(n) = n + 5$ when n is odd
and $f^3(n) = n + 1$ when n is even

and $f^4(n) = n + 6$ when n is odd
and $f^4(n) = n + 4$ when n is even

I don't see a pattern for a simple formula?

6. ## Inductive Proof

I'm doing part c now,
Basis is easy when k = 3.

Inductive step

Let x >=3 be an integer.
Our IH is (from the formula's I found for part b)
f^x (n) = n + x when x is even, and
f^x (n) = n + x + 2(-1)^n when x is odd

We want to prove that
f^x+1(n)=n+x+1 when x+1 is even, and
f^x+1(n)=n+x+1+2(-1)^n when x+1 is odd

Is the above correct?

So we have two cases from here:

Case 1: when x+1 is even, x is odd
Now, f^x+1(n) = f(f^x(n)) = f(n +x + 2(-1)^n)

Now, I think we have two more sub cases but I'm not sure?

Case 2: when x+1 is odd, x is even
Now, f^x+1(n) = f(f^x(n)) = f(n + x)
Now, I think we have two more sub cases but I'm not sure?

Can someone help me finish the sub cases?

Thanks!