Recursive Summary of matrix rapid Power Optimization

Source: Internet
Author: User

RT, mainly to summarize the matrix method.

First, the recursive type of matrix-based rapid power oPtimization is f [N] = 5f [n-3] + 6f [N-2] + 2f [n-1] + N ^ 2 + N + 8 and so on.

That is to say, recursion is linear recursion, and the coefficient before f [n-I] is a constant. It can contain a polynomial related to N or a constant, the following describes how to write a matrix:

First, consider the simplest constant. In fact, we can ignore the constant, because at most we can add a row and a column to the matrix without constants.

Taking f [N] = 2f [n-1] + 6f [N-2] + 5f [n-3] + N ^ 2 + N as an Example

First, write the iterative matrix. Generally, you can write a row. There are several items on the right.

{F [n-1], F [N-2], F [n-3], n ^ 2, n}

If so, the Number Matrix must be 5*5 (because the 1*5 matrix multiplied by 5 * x matrix is equal to 1*5 matrix, then x = 5)

But I can't find it. Why? Because n ^ 2 and N cannot be obtained through the four arithmetic operations of a simple number (n + 1) ^ 2 and n + 1, but we can write

{F [n-1], F [N-2], F [n-3], n ^ 2, N, 2n}

*

2 1 0 0 0 0 0 0

6 0 1 0 0 0 0 0

5 0 0 0 0 0 0 0

1 0 0 1 0 0 0

1 0 0 0 1 0 0 0

0 0 0 1 0 0 0

0 0 0 1 0 1 0 0

0 0 0 0 1 2 0 1

= {F [N], F [n-1], F [N-2], (n + 1) ^ 2, N + (n + 1}

What do you think ?? Starting with N ^ 2-> (n + 1) ^ 2 and N-> n + 1, (n + 1) ^ 2-N ^ 2 = 2n + 1, so we have 2n and 1, N + 1-N = 1, so we have 1. (In fact, we need to consider the extra 2n, but there is only one item, so it is integrated into it .)

Of course, the above is not the simplest and can be simplified, but it is a constructor =

--------------------------------------

Consider adding a constant of 8 to easily write it out:

{F [n-1], F [N-2], F [n-3], n ^ 2, N, 2n, 8}

*

2 1 0 0 0 0 0 0 0

6 0 1 0 0 0 0 0 0

5 0 0 0 0 0 0 0 0

1 0 0 1 0 0 0 0

1 0 0 0 1 0 0 0 0

0 0 0 1 0 0 0 0

0 0 0 1 0 1 0 0 0

0 0 0 0 1 2 0 1 0

0 0 0 0 0 0 0 1

= {F [N], F [n-1], F [N-2], (n + 1) ^ 2, N + (n + 1), 8}

Recursive Summary of matrix rapid Power Optimization

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.