# 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 $\displaystyle u_{n}=u_{n-1}+6u_{n-2}$. Now, the initial conditiones are? $\displaystyle 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 $\displaystyle \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 $\displaystyle u_{n}=u_{n-1}+6u_{n-2}$. Now, the initial conditiones are? $\displaystyle 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...

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

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

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

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

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

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

Kind regards

$\displaystyle \chi$ $\displaystyle \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?
$\displaystyle u_i$ = # of different things that can be made with $\displaystyle 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 $\displaystyle u_{1}=1$, when we have two balls $\displaystyle u_{2}=2$, and then corresponding sequence is $\displaystyle 1,2, 13,...$. So I ca write the initial conditions $\displaystyle u_{0}=1, u_{1}=2$, is that correct?

8. Originally Posted by Gibo
Hi, so let say I have one ball, hence $\displaystyle u_{1}=1$, when we have two balls $\displaystyle u_{2}=2$, and then corresponding sequence is $\displaystyle 1,2, 13,...$. So I ca write the initial conditions $\displaystyle u_{0}=1, u_{1}=2$, is that correct?
First you say $\displaystyle u_{1}=1$, then you say $\displaystyle 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 $\displaystyle a_{1}=1$ and $\displaystyle a_{0}=1$ as well. Then we have a sequence $\displaystyle 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 $\displaystyle a_{1}=1$ and $\displaystyle a_{0}=1$ as well. Then we have a sequence $\displaystyle 1,1,7,13...$.
Exactly

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

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

12. Originally Posted by Gibo
Thanks a lot, in the difference equation, $\displaystyle u_{2}=u_{1}+6u_{0}$, if we have $\displaystyle u_{0}=1, u_{1}=1$, we can clearly see that $\displaystyle 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