Skip to content

Commit 300c151

Browse files
1 parent 7c8be32 commit 300c151

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

main/algebra/fibonacci-numbers.html

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6772,7 +6772,7 @@
67726772
<ul class="metadata page-metadata" data-bi-name="page info" lang="en-us" dir="ltr">
67736773

67746774
Last update:
6775-
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="April 22, 2025 01:19:59">April 22, 2025</span>&emsp;
6775+
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="April 22, 2025 03:58:03">April 22, 2025</span>&emsp;
67766776

67776777
<!-- Tags -->
67786778

@@ -6929,7 +6929,17 @@ <h3 id="matrix-form">Matrix form<a class="headerlink" href="#matrix-form" title=
69296929
F_{n}
69306930
\end{pmatrix}
69316931
$$</div>
6932-
<p>where <span class="arithmatex">$F_1 = 1, F_0 = 0$</span>.</p>
6932+
<p>where <span class="arithmatex">$F_1 = 1, F_0 = 0$</span>.
6933+
In fact, since </p>
6934+
<div class="arithmatex">$$
6935+
\begin{pmatrix} 1 &amp; 1 \\ 1 &amp; 0 \end{pmatrix}
6936+
= \begin{pmatrix} F_2 &amp; F_1 \\ F_1 &amp; F_0 \end{pmatrix}
6937+
$$</div>
6938+
<p>we can use the matrix directly:</p>
6939+
<div class="arithmatex">$$
6940+
\begin{pmatrix} 1 &amp; 1 \\ 1 &amp; 0 \end{pmatrix}^n
6941+
= \begin{pmatrix} F_{n+1} &amp; F_n \\ F_n &amp; F_{n-1} \end{pmatrix}
6942+
$$</div>
69336943
<p>Thus, in order to find <span class="arithmatex">$F_n$</span> in <span class="arithmatex">$O(\log n)$</span> time, we must raise the matrix to n. (See <a href="binary-exp.html">Binary exponentiation</a>)</p>
69346944
<div class="highlight"><pre><span></span><code><span class="k">struct</span><span class="w"> </span><span class="nc">matrix</span><span class="w"> </span><span class="p">{</span>
69356945
<span class="w"> </span><span class="kt">long</span><span class="w"> </span><span class="kt">long</span><span class="w"> </span><span class="n">mat</span><span class="p">[</span><span class="mi">2</span><span class="p">][</span><span class="mi">2</span><span class="p">];</span>
@@ -7034,7 +7044,7 @@ <h2 id="practice-problems">Practice Problems<a class="headerlink" href="#practic
70347044

70357045
<ul class="metadata page-metadata" data-bi-name="page info" lang="en-us" dir="ltr">
70367046
<span class="contributors-text">Contributors:</span>
7037-
<ul class="contributors" data-bi-name="contributors"><li><a href="https://github.com/gabrielsimoes" title="gabrielsimoes" data-bi-name="contributorprofile" target="_blank">gabrielsimoes</a> (24.64%)</li><li><a href="https://github.com/jakobkogler" title="jakobkogler" data-bi-name="contributorprofile" target="_blank">jakobkogler</a> (21.43%)</li><li><a href="#" title="Carlos Javier Blanco" data-bi-name="contributorprofile" target="_blank">Carlos Javier Blanco</a> (16.43%)</li><li><a href="https://github.com/jxu" title="jxu" data-bi-name="contributorprofile" target="_blank">jxu</a> (15.36%)</li><li><a href="https://github.com/madhur4127" title="madhur4127" data-bi-name="contributorprofile" target="_blank">madhur4127</a> (6.43%)</li><li><a href="https://github.com/tcNickolas" title="tcNickolas" data-bi-name="contributorprofile" target="_blank">tcNickolas</a> (5.36%)</li><li><a href="https://github.com/adamant-pwn" title="adamant-pwn" data-bi-name="contributorprofile" target="_blank">adamant-pwn</a> (2.5%)</li><li><a href="https://github.com/Morass" title="Morass" data-bi-name="contributorprofile" target="_blank">Morass</a> (2.14%)</li><li><a href="https://github.com/md-shamim-ahmad" title="md-shamim-ahmad" data-bi-name="contributorprofile" target="_blank">md-shamim-ahmad</a> (1.79%)</li><li><a href="https://github.com/boxlesscat" title="boxlesscat" data-bi-name="contributorprofile" target="_blank">boxlesscat</a> (1.07%)</li><li><a href="https://github.com/yeetholmes619" title="yeetholmes619" data-bi-name="contributorprofile" target="_blank">yeetholmes619</a> (1.07%)</li><li><a href="https://github.com/pasthec" title="pasthec" data-bi-name="contributorprofile" target="_blank">pasthec</a> (0.71%)</li><li><a href="https://github.com/mhayter" title="mhayter" data-bi-name="contributorprofile" target="_blank">mhayter</a> (0.36%)</li><li><a href="https://github.com/conlacda" title="conlacda" data-bi-name="contributorprofile" target="_blank">conlacda</a> (0.36%)</li><li><a href="https://github.com/ankit-kumar-dwivedi" title="ankit-kumar-dwivedi" data-bi-name="contributorprofile" target="_blank">ankit-kumar-dwivedi</a> (0.36%)</li></ul>
7047+
<ul class="contributors" data-bi-name="contributors"><li><a href="https://github.com/gabrielsimoes" title="gabrielsimoes" data-bi-name="contributorprofile" target="_blank">gabrielsimoes</a> (23.55%)</li><li><a href="https://github.com/jakobkogler" title="jakobkogler" data-bi-name="contributorprofile" target="_blank">jakobkogler</a> (20.48%)</li><li><a href="https://github.com/jxu" title="jxu" data-bi-name="contributorprofile" target="_blank">jxu</a> (18.77%)</li><li><a href="#" title="Carlos Javier Blanco" data-bi-name="contributorprofile" target="_blank">Carlos Javier Blanco</a> (15.7%)</li><li><a href="https://github.com/madhur4127" title="madhur4127" data-bi-name="contributorprofile" target="_blank">madhur4127</a> (6.14%)</li><li><a href="https://github.com/tcNickolas" title="tcNickolas" data-bi-name="contributorprofile" target="_blank">tcNickolas</a> (5.12%)</li><li><a href="https://github.com/adamant-pwn" title="adamant-pwn" data-bi-name="contributorprofile" target="_blank">adamant-pwn</a> (2.73%)</li><li><a href="https://github.com/Morass" title="Morass" data-bi-name="contributorprofile" target="_blank">Morass</a> (2.05%)</li><li><a href="https://github.com/md-shamim-ahmad" title="md-shamim-ahmad" data-bi-name="contributorprofile" target="_blank">md-shamim-ahmad</a> (1.71%)</li><li><a href="https://github.com/boxlesscat" title="boxlesscat" data-bi-name="contributorprofile" target="_blank">boxlesscat</a> (1.02%)</li><li><a href="https://github.com/yeetholmes619" title="yeetholmes619" data-bi-name="contributorprofile" target="_blank">yeetholmes619</a> (1.02%)</li><li><a href="https://github.com/pasthec" title="pasthec" data-bi-name="contributorprofile" target="_blank">pasthec</a> (0.68%)</li><li><a href="https://github.com/mhayter" title="mhayter" data-bi-name="contributorprofile" target="_blank">mhayter</a> (0.34%)</li><li><a href="https://github.com/conlacda" title="conlacda" data-bi-name="contributorprofile" target="_blank">conlacda</a> (0.34%)</li><li><a href="https://github.com/ankit-kumar-dwivedi" title="ankit-kumar-dwivedi" data-bi-name="contributorprofile" target="_blank">ankit-kumar-dwivedi</a> (0.34%)</li></ul>
70387048
</ul>
70397049

70407050
</article>

0 commit comments

Comments
 (0)