# Thread: Second order linear difference equations with constant coefficents

1. ## Second order linear difference equations with constant coefficents

Hi, I tried to solve below word problem
Express the solution of the following problem in terms of a difference equation, then use a generating function to solve the difference equation to give an explicite solution.
Every week my grandmother knits either a hat that uses one ball of wool, or a scarf that uses two balls of wool. If the hats are all black and the scarves can be blue, red, or green, yellow, purple or orange, how many different ways are there for her to use up n balls of wool? (We assume that the order in which she knits the items matters.)
I know that the difference equation is of the form $u_{n}=u_{n-1}+6u_{n-2}$. Now, the initial conditiones are? $u_{0}=1, u_{1}=2$, as using one ball of wool you get only 1 hat, and when using 2 balls of wool you get either 2 hats or one scarf. I also know the form of the generating function but, I am not sure about the initial conditiones, I would appreciate any help.

2. For the initial conditions, what about the colors?

Also, as in your previous post, for any linear recurrences use generating functions of the form $\sum a_nx^n.$.

3. Originally Posted by Gibo
Hi, I tried to solve below word problem
Express the solution of the following problem in terms of a difference equation, then use a generating function to solve the difference equation to give an explicite solution.
Every week my grandmother knits either a hat that uses one ball of wool, or a scarf that uses two balls of wool. If the hats are all black and the scarves can be blue, red, or green, yellow, purple or orange, how many different ways are there for her to use up n balls of wool? (We assume that the order in which she knits the items matters.)
I know that the difference equation is of the form $u_{n}=u_{n-1}+6u_{n-2}$. Now, the initial conditiones are? $u_{0}=1, u_{1}=2$, as using one ball of wool you get only 1 hat, and when using 2 balls of wool you get either 2 hats or one scarf. I also know the form of the generating function but, I am not sure about the initial conditiones, I would appreciate any help.
The difference equation in 'standard form' is...

$u_{n} - u_{n-1} - 6\ u_{n-2}=0$ (1)

... and the corresponding 'characteristic equation' is...

$x^{2} - x - 6=0$ (2)

... the roots of which are $x_{1}=-2$ and $x_{2}= 3$ so that the general solution of (1) is...

$u_{n} = c_{1}\ (-2)^{n} + c_{2}\ 3^{n}$ (3)

The constants $c_{1}$ and $c_{2}$ are derived from the 'initial conditions'...

Kind regards

$\chi$ $\sigma$

4. I think in the initial conditions, you don't take colours under consideration, you just need them to start your calculation, that is what I think at least.

5. Thanks a lot, but I still don't understand in my task how can I get the initial conditions for this problem? I know how to calculate it, but as I have to provide explicit solution, I need initial conditions. Regards Gibo

6. Originally Posted by Gibo
I think in the initial conditions, you don't take colours under consideration, you just need them to start your calculation, that is what I think at least.
How did you get that idea?
$u_i$ = # of different things that can be made with $i$ balls of wool.
Now interpret this for i=1,2 (or i=0,1) for initial conditions.

7. Hi, so let say I have one ball, hence $u_{1}=1$, when we have two balls $u_{2}=2$, and then corresponding sequence is $1,2, 13,...$. So I ca write the initial conditions $u_{0}=1, u_{1}=2$, is that correct?

8. Originally Posted by Gibo
Hi, so let say I have one ball, hence $u_{1}=1$, when we have two balls $u_{2}=2$, and then corresponding sequence is $1,2, 13,...$. So I ca write the initial conditions $u_{0}=1, u_{1}=2$, is that correct?
First you say $u_{1}=1$, then you say $u_{1}=2$. Which one is it? Explain how you got these initial conditions.
Again, you must count the different color possibilites.

9. Sorry, I think I get a bit confused, when we have one ball we can only make one hat, hence $a_{1}=1$ and $a_{0}=1$ as well. Then we have a sequence $1,1,7,13...$.

10. Originally Posted by Gibo
Sorry, I think I get a bit confused, when we have one ball we can only make one hat, hence $a_{1}=1$ and $a_{0}=1$ as well. Then we have a sequence $1,1,7,13...$.
Exactly

To check your answer. Can you explain why $u_2 = 7$?

11. Thanks a lot, in the difference equation, $u_{2}=u_{1}+6u_{0}$, if we have $u_{0}=1, u_{1}=1$, we can clearly see that $u_{2}=1+6\times1=7$.

12. Originally Posted by Gibo
Thanks a lot, in the difference equation, $u_{2}=u_{1}+6u_{0}$, if we have $u_{0}=1, u_{1}=1$, we can clearly see that $u_{2}=1+6\times1=7$.
That's true, but what I meant was can you count it directly to make sure it was 7.

E.g. with 2 balls you can make 1 scarf (6 possible colors) or 2 black hats (1 possible color for both).
6^1 + 1^2 = 7