You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

竞赛考试题:求矩阵M=\begin{bmatrix}2&1\\1&2\end{bmatrix}的cos(πM/6)值

解决矩阵余弦值的高效方法:对角化

嘿,你提到的这道竞赛题,用矩阵对角化来解会比级数展开简洁太多,我来一步步拆解给你看:

首先,给定矩阵 ( M = \begin{bmatrix}2&1\1&2\end{bmatrix} ),我们的目标是计算 ( \cos\left(\frac{\pi M}{6}\right) )。

步骤1:对矩阵M做对角化

对称矩阵一定可以对角化,先求M的特征值:
特征方程为 ( \det(M - \lambda I) = 0 ),代入得:
[
\begin{vmatrix}2-\lambda&1\1&2-\lambda\end{vmatrix} = (2-\lambda)^2 - 1 = 0
]
展开后解得特征值 ( \lambda_1 = 3 ),( \lambda_2 = 1 )。

接下来求对应的特征向量:

  • 对于 ( \lambda_1=3 ),解 ( (M-3I)\mathbf{x}=0 ),得到特征向量 ( \mathbf{v}_1 = \begin{bmatrix}1\1\end{bmatrix} )
  • 对于 ( \lambda_2=1 ),解 ( (M-I)\mathbf{x}=0 ),得到特征向量 ( \mathbf{v}_2 = \begin{bmatrix}1\-1\end{bmatrix} )

构造对角化矩阵 ( P = \begin{bmatrix}1&1\1&-1\end{bmatrix} ),其逆矩阵为 ( P^{-1} = \begin{bmatrix}\frac{1}{2}&\frac{1}{2}\\frac{1}{2}&-\frac{1}{2}\end{bmatrix} )(计算行列式后可得),此时满足 ( M = PDP^{-1} ),其中对角矩阵 ( D = \begin{bmatrix}3&0\0&1\end{bmatrix} )。

步骤2:利用矩阵函数的性质计算余弦值

对于可对角化矩阵,矩阵函数满足 ( f(M) = P f(D) P^{-1} ),这里 ( f(x) = \cos\left(\frac{\pi x}{6}\right) )。

先计算对角矩阵的余弦值:
[
\cos\left(\frac{\pi D}{6}\right) = \begin{bmatrix}\cos\left(\frac{\pi \cdot 3}{6}\right)&0\0&\cos\left(\frac{\pi \cdot 1}{6}\right)\end{bmatrix} = \begin{bmatrix}\cos\left(\frac{\pi}{2}\right)&0\0&\cos\left(\frac{\pi}{6}\right)\end{bmatrix} = \begin{bmatrix}0&0\0&\frac{\sqrt{3}}{2}\end{bmatrix}
]

步骤3:矩阵乘法得到结果

最后计算 ( P \cos\left(\frac{\pi D}{6}\right) P^{-1} ):

  1. 先算 ( P \cdot \cos\left(\frac{\pi D}{6}\right) = \begin{bmatrix}1&1\1&-1\end{bmatrix} \cdot \begin{bmatrix}0&0\0&\frac{\sqrt{3}}{2}\end{bmatrix} = \begin{bmatrix}0&\frac{\sqrt{3}}{2}\0&-\frac{\sqrt{3}}{2}\end{bmatrix} )
  2. 再乘以 ( P^{-1} ):
    [
    \begin{bmatrix}0&\frac{\sqrt{3}}{2}\0&-\frac{\sqrt{3}}{2}\end{bmatrix} \cdot \begin{bmatrix}\frac{1}{2}&\frac{1}{2}\\frac{1}{2}&-\frac{1}{2}\end{bmatrix} = \begin{bmatrix}\frac{\sqrt{3}}{4}&-\frac{\sqrt{3}}{4}\-\frac{\sqrt{3}}{4}&\frac{\sqrt{3}}{4}\end{bmatrix}
    ]

这个结果正好对应选项中的第二个矩阵。

另外补充一个小技巧:如果熟悉Pauli矩阵(( \sigma_x = \begin{bmatrix}0&1\1&0\end{bmatrix} )),可以把M写成 ( 2I + \sigma_x ),利用矩阵指数的欧拉公式 ( \cos(A) = \frac{e^{iA} + e^{-iA}}{2} ) 也能快速得到相同结果,本质和对角化是一致的。

内容的提问来源于stack exchange,提问作者user1844

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 08:45:35