惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
博客园 - 三生石上(FineUI控件)
T
Threat Research - Cisco Blogs
S
SegmentFault 最新的问题
V2EX - 技术
V2EX - 技术
Hacker News: Ask HN
Hacker News: Ask HN
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
M
MIT News - Artificial intelligence
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
C
Cybersecurity and Infrastructure Security Agency CISA
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
U
Unit 42
腾讯CDC
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Cloudflare Blog
H
Help Net Security
Recent Announcements
Recent Announcements
P
Privacy & Cybersecurity Law Blog
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
H
Heimdal Security Blog
博客园 - 聂微东
S
Securelist
大猫的无限游戏
大猫的无限游戏
Cloudbric
Cloudbric
Cisco Talos Blog
Cisco Talos Blog

博客园 - 代码乱了

MIT 18.06 线性代数 - 23微分方程,exp(At) 测试markdown发布 visual webgui theme designer 健身视频 2012元旦遭遇坑爹的12306订票网站付了款不出票 博文阅读密码验证 - 博客园 ReportViewer 2008 打印出现Error loading resource library. (0x8007007E)和(0x80070006) 博文阅读密码验证 - 博客园 VM.xPort.ExcelClient XXX备忘 Parsing html markup text using MSHTML Serialize and Deserialize RDL Winform Field interface 转换前台javascript传递过来的时间字符串到.net的DateTime 博文阅读密码验证 - 博客园 SQL:获取正在执行的SQL语句 博文阅读密码验证 - 博客园 VSX vsct file context menu for script editor - 代码乱了 利用XML转换为table实现在SQL参数中传递表结构 MSChart出现为ChartImg.axd 执行子请求时出错 - 代码乱了 - 博客园
MIT 18.06 线性代数 - 22. 对角化和矩阵的幂
代码乱了 · 2023-09-02 · via 博客园 - 代码乱了

关于斐波那契数列计算第n个数,使用矩阵特征向量和特征值求解:

Fibonacci 数列的定义是:\(F(0)=0\)\(F(1)=1\) 并且对于 \(n>1\)\(F(n)=F(n-1)+F(n-2)\)。我们可以使用线性代数中的特征向量和特征值来求解 Fibonacci 数列。

首先,我们可以将 Fibonacci 数列写为一个线性系统的形式:

\[\begin{bmatrix} F(n+1)\\ F(n) \end{bmatrix} = \begin{bmatrix} 1 & 1\\ 1 & 0 \end{bmatrix} \begin{bmatrix} F(n)\\ F(n-1) \end{bmatrix} \]

我们可以将这个矩阵写为 \(A\),然后找到 \(A\) 的特征值和特征向量。计算得到,特征值为 \(\lambda_1=\frac{1+\sqrt{5}}{2}\)\(\lambda_2=\frac{1-\sqrt{5}}{2}\),对应的特征向量为 \(v_1=\begin{bmatrix} \frac{1+\sqrt{5}}{2}\\1 \end{bmatrix}\)\(v_2=\begin{bmatrix} \frac{1-\sqrt{5}}{2}\\1 \end{bmatrix}\)

我们可以将 Fibonacci 数列的通项公式写为这两个特征向量的线性组合形式:

\[\begin{bmatrix} F(n)\\ F(n-1) \end{bmatrix} = c_1 \begin{bmatrix} \frac{1+\sqrt{5}}{2}\\ 1 \end{bmatrix} (\frac{1+\sqrt{5}}{2})^n + c_2 \begin{bmatrix} \frac{1-\sqrt{5}}{2}\\ 1 \end{bmatrix} (\frac{1-\sqrt{5}}{2})^n \]

通过 \(F(0)=0\)\(F(1)=1\),我们可以解得 \(c_1=\frac{1}{\sqrt{5}}\)\(c_2=-\frac{1}{\sqrt{5}}\)

所以 Fibonacci 数列的第 \(n\) 项可以由以下公式计算:

\[F(n) = \frac{1}{\sqrt{5}} (\frac{1+\sqrt{5}}{2})^n - \frac{1}{\sqrt{5}} (\frac{1-\sqrt{5}}{2})^n \]

这就是通过线性代数特征值和特征向量方式求解 Fibonacci 数列的方法。