How to understand this recursive definition?

38 Views Asked by At

My question is:

Now know through my Discrete-Mathematics course what recursion is, but this notation confuses me.

$$ \mathbf a_n = \begin{cases} n, & \text{for $ 0\le n \le 2 $ } \\ a_{n-3}+a_{n-2}+a_{n-1}, & \text{for $ n \ge 3 $} \end{cases} $$

So this is an example of my problem.

3

There are 3 best solutions below

1
On BEST ANSWER

When an author uses the left-brace and conditions sort of notation you present here, the way to interpret it is to look at the right-hand column first. In this case, the first line says $0\leq n\leq 2$ so whatever it is saying applies to only $n$ values in that range, namely (if $n$ is assumed to be an integer) to $n=0$, $n=1$ and $n=2$. So the first line tells you that $$ a_0 = 0 \\ a_1 = 1 \\a_2 = 2 $$ but it tells you nothing about $a_3$ or $a_4$ or $a_n$ for any other values of the index $n$.

The second line, on the right, says "Now I'm going to tell you about $n_n$ when $n \geq 3$," which fortunately comprises all the other values of $n$ not covered by the first line. So for example, $$ a_3 = a_2 + a_1 + a_0 = 2+1+0 = 3 \\ a_4 = a_3+a_2+a_1 = 3+2+1 = 6 $$ but that second line does not apply if you wanted to find $a_2 = a_1 + a_0 + a_{-1}$. (In fact, $a_{-1}$ is left undefined in this definition of the $a_k$.)

1
On

That means that $a_0=0,a_1=1,a_2=2$ and then you use the definition $a_n =a_{n-3} +a_{n-2}+a_{n-1}$

1
On

It means what it says. $a_0 = 0; a_1 = 1, a_2 = 2$.

And $a_3 = a_0 + a_1 + a_2$.

And $a_4 = a_1 + a_2 + a_3$.

And $a_5 = a_2 + a_3 + a_4$.

And $a_6 = a_3 + a_4 + a_5$ and so on.

In general: $a_n = a_{n-3} + a_{n-2} + a_{n-1}$.

Would it have made more sense if we had written

$a_{n+3} =a_{n} + a_{n+1} + a_{n+2}$?