Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit546ce11

Browse files
authored
Merge pull request#1455 from cp-algorithms/fibmatrix
Fibonacci: restore matrix power form
2 parents51d3953 +59c3174 commit546ce11

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

‎src/algebra/fibonacci-numbers.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,20 @@ F_{n}
159159
\end{pmatrix}
160160
$$
161161
162-
where $F_1 = 1, F_0 = 0$.
162+
where $F_1 = 1, F_0 = 0$.
163+
In fact, since
164+
165+
$$
166+
\begin{pmatrix} 1 & 1 \\ 1 & 0 \end{pmatrix}
167+
= \begin{pmatrix} F_2 & F_1 \\ F_1 & F_0 \end{pmatrix}
168+
$$
169+
170+
we can use the matrix directly:
171+
172+
$$
173+
\begin{pmatrix} 1 & 1 \\ 1 & 0 \end{pmatrix}^n
174+
= \begin{pmatrix} F_{n+1} & F_n \\ F_n & F_{n-1} \end{pmatrix}
175+
$$
163176
164177
Thus, in order to find $F_n$ in $O(\log n)$ time, we must raise the matrix to n. (See [Binary exponentiation](binary-exp.md))
165178

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp