1

Let's say we have the recurrence relation $$ x_n = \begin{cases} x_{n-1} + y_{n-2} + y_{n-3} + n2^n, & \mbox{if } n\ \geq 0 \\ 1 & \mbox{if } n \lt 0 \end{cases}\\ y_n = \begin{cases} y_{n-2} + x_{n-1} + x_{n-1} + n4^n, & \mbox{if } n\ \geq 0 \\ 1 & \mbox{if } n \lt 0 \end{cases} $$

How to build a transformation matrix for the recurrence relation and solve it with matrix exponentiation?

If it would be possible to get rid of $n2^n$ and $n4^n$, then we can build the transformation matrix for the linear recurrence relation:

$$ T = \begin{bmatrix} 1 & 0 & 1 & 1 \\ 2 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ \end{bmatrix} $$

And eventually, we will be able to use $\vec{V_n} = T^{n+1} \cdot \vec{V_{-1}}$ formula to find $x_n$ and $y_n$.

However, the recurrence is no longer linear with the additional parts. As I understand, it's possible to represent additional part other way: $d^{n+1} = d(d^n) => (n+1)d^{n+1} = d(nd^n) + d(d^n)$, but I don't know where to move further.

I would really appreciate it if you could help me to find a way to build a transformation matrix for this recurrence.

  • @RodrigodeAzevedo - I am not an expert but I think OP is correct. You just need to remember the previous $x$ and the three previous $y$'s, right? – antkam Jul 04 '20 at 20:21
  • @antkam Sounds right. – Rodrigo de Azevedo Jul 04 '20 at 20:25
  • Why do you want to get rid of $n2^n$ and $n4^n$? Those are the input signals. Just use convolution. – Rodrigo de Azevedo Jul 04 '20 at 20:26
  • It's not about ML, actually. Anyway, thank you for your help!

    My target is to be able to find $x_n$ and $y_n$ for arbitrary positive integer $n$ using matrix exponentiation. Just some sort of competitive programming task, but focused on math. I'm not linear algebra expert and decided to start from basics, however, I've stuck with this question.

    My first guess was that it's possible to calc $x_{n−1}+y_{n−2}+y_{n−3}$ and $n2^n$ separately and sum the results, as it should be done for non-homogeneous relation, but I can't adapt it.

    – Furdarius Jul 04 '20 at 21:07
  • @Furdarius You have a discrete-time LTI system driven by resonant exponential signals. Take a look at Antsaklis & Michel or other books on linear systems. – Rodrigo de Azevedo Jul 04 '20 at 23:09
  • Great, thank you! I would really appreciate it if you could point out the exact chapter where to read more about the particular recurrence relation from the question here.

    Btw, could it be possible to simplify the relation here to linear one?

    – Furdarius Jul 05 '20 at 07:48
  • @Furdarius Your recurrence relation is not special at all. It is linear and of the form $x^+ = A x + B u$, where $x$ is the state, $x^+$ is the next state, and $u$ is the input. Try the first few iterations, and you should easily obtain a closed form for $x$. – Rodrigo de Azevedo Jul 05 '20 at 10:34

1 Answers1

0

I think you can use this matrix for the transition $$ \begin{pmatrix} 1 & 0 & 1 & 1 & 0 & 0 & 1 & 0 \\ 2 & 0 & 1 & 0 & 0 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 2 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 4 & 0 & 0 \\ 0 & 0 & 0 & 0 & 2 & 0 & 2 & 0 \\ 0 & 0 & 0 & 0 & 0 & 4 & 0 & 4 \\ \end{pmatrix} $$

The bottom-right $4 \times 4$ block will take care of generating $2^n$, $4^n$, $n \, 2^n$, and $n \, 4^n$, with a starting vector of $(1, 1, 1, 1, 2, 4, 2, 4)^T$. The non-zero entries in the top-right $4 \times 4$ block add the terms $n \, 2^n$ and $n \, 4^n$ to each of the $x_n$, $y_n$. The top-left block is what you wrote in the question. It uses the fact that $(n+1) \, a^{n+1}$ can be written as a linear combination of $n a^n$ and $a^n$.

EDIT: In response to the question, some further details on the matrix and state vector.

The state vector needs have four elements to carry the previous sequence terms needed in the recurrence: $x_{n-1}, y_{n-1}, y_{n-2}, y_{n-3}$. For the above, these are the first four components of the vector.

The next two components of the state vector carry values for $2^n$ and $4^n$, these are generated by powers of the $2 \times 2$ sub-matrix in the first part of the lower-right quarter-block $$ \begin{pmatrix} 2 & 0 \\ 0 &4 \end{pmatrix} $$

It needs two further terms to carry the values of $n \, 2^n$ and $n \, 4^n$. These are the last two components of the state vector.

Note that $$ (n+1) 2^{n+1} = 2 \left( n \, 2^n \right) + 2 \left( 2^n \right) $$ i.e. $(n+1) 2^{n+1}$ is a linear combination of $n \, 2^n $ and $ 2^n $, with a similar comment for the $n \, 4^n$ term. The bottom two rows of the transition matrix represent these linear relationships.

Paul Aljabar
  • 1,519
  • Thank you for your reply! Interestingly, I've tried a similar approach but it didn't work for me.

    Due to the comment's length limit here, I've summarized my calculation in the PDF file.

    I would really appreciate it if you could point out my mistake and explain how did you come up with your transformation matrix and starting vector?

    – Furdarius Jul 07 '20 at 09:25
  • I've expanded my response to hopefully clarify how I obtained the matrix. – Paul Aljabar Jul 07 '20 at 10:20
  • I had a quick look at your pdf, it looks like your components carrying terms like $2^n$, $4^n$, $n , 2^n$, and $n , 4^n$ remain unchanged in the transition from $\overrightarrow{V}n$ to $\overrightarrow{V}{n+1}$ near the top of the page. – Paul Aljabar Jul 07 '20 at 10:25