Блог пользователя aajjbb

Автор aajjbb, 12 лет назад, По-английски

Hello, I'm currently learning how to use matrix exponentiation to solve linear recurrence relations, and I'm in doubt on how to build transformation matrices, for example.

Let f(n) = 2 * f(n - 1) + 2 * (f - 2) + 2 * f(n - 3) + f(n - 4)

With f(1) = a, f(2) = b, f(3) = c, f(4) = d

The vector v with the initial values should be

How to build it's transformation matrix ?

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

»
12 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

You are looking for a matrix A such that if you take the vector ( f(n-4), f(n-3), f(n-2), f(n-1) ) and multiply it by A you will get the vector ( f(n-3), f(n-2), f(n-1), f(n) ) for any n. Knowing this property, can you see how A must look like?

»
12 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Let and .
now u can see that .

just handle cases when separately, otherwise find (can be done in ) and multiply it with to get (whose first element will be , which is exactly what u want).