# Solving a system of linear equations with undefined number of equations

I need to solve this system of linear equations:
$k_0=1+k_1$
$k_1=1+\frac{1}{3} k_1 +\frac{2}{3} k_2$
$k_2=1+\frac{1}{3} k_1 +\frac{2}{3} k_3$
$k_3=1+\frac{1}{3} k_1 +\frac{2}{3} k_4$
$...$
$k_{N-1}=1+\frac{1}{3} k_1 +\frac{2}{3} k_N$
$k_N=0$
I need to find a general solution for $k_0$ all $N$.

The system is equivalent to:
$k_0=1+k_1$
$k_i=1+\frac{1}{3} k_1 +\frac{2}{3} k_{i+1} \;\;\; i\in 1,2,3,...,N-1$
$k_N=0$

that is:
$k_0=1+k_1$
$k_i=\frac{3}{2} k_{i-1} -\frac{1}{2} k_1-\frac{3}{2} \;\;\; i\in 2,3,...,N \;\;\; $
$k_N=0 \;\;\; $

As far as I know, $$ and $$ is a linear unhomogenous recurrence relation with constant coefficients of order 1 with initial condition $k_N=0$ . The unhomogenous term is $f(n)=-\frac{1}{2} k_1-\frac{3}{2}$.
Solving this recurrence relation gives as general solution:
$k_i=A \left ( \frac{3}{2} \right )^i+3+k_1 \;\;\; $
with $A=\left ( \frac{2}{3} \right )^N \left ( -3-k_1 \right )$

Now I don't know how to proceed. As I said, I need to find $k_0$, but the solution $$ is just for $i\in 2,3,...,N$. How can I use $$ to find a general solution for $k_0$ for all $N$? Thank you.

• Note that $k_N = A (\dfrac{3}{2})^N + 3 + k_1 = 0$, so $k_1 = -3-A (\dfrac{3}{2})^N$ and hence, $k_0 = -2-A (\dfrac{3}{2})^N$. – Johannes Kloos Aug 21 '16 at 9:30
• If you can find $k_1$, then you can get $k_0$ from that quite easily. – Martin Sleziak Aug 21 '16 at 9:30
• You're right but $A$ is not a constant, it's a function of $k_1$, so we don't have a solution for $k_0$ because $k_0$ is a function of $A$ which is a function of $k_1$ – John M Aug 21 '16 at 15:54

## 1 Answer

You have done all the work already. Now simply use $$ for $i=2$ together with the second equation in your question to - after reducing a bit - obtain

\begin{align} k_1&=\frac{9}{2}\left(\frac{3}{2} \right)^{N-2}-3 \\ k_0&=1+k_1=\frac{9}{2}\left(\frac{3}{2} \right)^{N-2}-2 \end{align}

EDIT: Or use Johannes Kloos much faster method.

EDIT 2: Actually, as OP points out, Johannes Kloos' method actually doesn't work, since we get $$0=-\left(\frac{2}{3}\right)^N(3+k_1)\left(\frac{3}{2}\right)^N+3+k_1 \Rightarrow 0=0$$

• I think the Johannes Kloos method is not right for the reasons I wrote above – John M Aug 21 '16 at 15:56
• @JohnM You're right, I've made a second edit. – Bobson Dugnutt Aug 21 '16 at 16:07