# 希尔伯特矩阵

希尔伯特矩阵（Hilbert matrix）是第 i 行第 j 列元素为单位分数 1/(i + j − 1) 的方阵，因此 3×3 的例子为

\[ H_3 = \begin{pmatrix} 1 & 1/2 & 1/3 \\ 1/2 & 1/3 & 1/4 \\ 1/3 & 1/4 & 1/5 \end{pmatrix}. \]

它是严重病态矩阵的标准例子：其元素的微小变化——例如分数以浮点数存储时产生的舍入——会使计算出的逆矩阵和线性方程组的解发生剧烈变化。<sup>[1](https://www.mathworks.com/help/matlab/ref/hilb.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 对 n×n 矩阵，\( H_{ij} = 1/(i+j-1) \)，下标从 1 开始<sup>[1](https://www.mathworks.com/help/matlab/ref/hilb.html)</sup> |
| 结构性质 | 对称、正定、汉克尔矩阵（元素仅依赖于 i + j）、柯西矩阵，且接近奇异<sup>[3](https://blogs.mathworks.com/cleve/2017/06/07/hilbert-matrices-2/?from=en)</sup> |
| 条件数 | 3 阶条件数为 524.06；4 阶为 \( 1.5514 \times 10^{4} \)；10 阶约为 \( 1.6 \times 10^{13} \)；20 阶为 \( 5.1944 \times 10^{19} \)<sup>[5](https://www.mathworks.com/matlabcentral/answers/811710-hilbert-matrix-in-least-squares-polynomial-regression)</sup><sup> • </sup><sup>[1](https://www.mathworks.com/help/matlab/ref/hilb.html)</sup><sup> • </sup><sup>[6](https://digital.auraria.edu/downloads/v92cm-w5p63/AA00005922_00001.pdf)</sup><sup> • </sup><sup>[2](https://www.mathworks.com/help/symbolic/hilbert-matrices-and-their-inverses.html)</sup> |
| 病态性的增长 | 条件数随阶数 N 大致按 \( O\bigl((1+\sqrt{2})^{4N}/\sqrt{N}\bigr) \) 增长<sup>[7](https://math.stackexchange.com/questions/2633861/growth-of-the-condition-number-of-hilbert-matrices-theoretical-vs-matlab/2634010)</sup> |
| 逆矩阵 | 元素有闭形式的二项式系数公式，且全为整数；13 阶时最大元素为 \( (T_{13})_{9,9} = 100863567447142500 \)<sup>[3](https://blogs.mathworks.com/cleve/2017/06/07/hilbert-matrices-2/?from=en)</sup> |
| 起源 | 在 [0, 1] 上用单项式基多项式对函数作最小二乘拟合时的正规方程矩阵<sup>[3](https://blogs.mathworks.com/cleve/2017/06/07/hilbert-matrices-2/?from=en)</sup> |
| 软件 | MATLAB 提供 `hilb` 与 `invhilb`；后者对小于约 15 的 n 给出精确逆矩阵<sup>[1](https://www.mathworks.com/help/matlab/ref/hilb.html)</sup><sup> • </sup><sup>[8](https://au.mathworks.com/help/matlab/ref/invhilb.html)</sup> |

## 定义与例子

对阶数 n，希尔伯特矩阵的元素为

\[ H_{ij} = \frac{1}{i+j-1}, \qquad i, j = 1, \ldots, n. \]

四阶矩阵为

\[ H_4 = \begin{pmatrix} 1 & 1/2 & 1/3 & 1/4 \\ 1/2 & 1/3 & 1/4 & 1/5 \\ 1/3 & 1/4 & 1/5 & 1/6 \\ 1/4 & 1/5 & 1/6 & 1/7 \end{pmatrix}, \]

在双精度算术下其 2-范数条件数为 \( 1.5514 \times 10^{4} \)。<sup>[1](https://www.mathworks.com/help/matlab/ref/hilb.html)</sup> 每一列都几乎是其他列的倍数，因此各列近似线性相关，矩阵接近奇异但并不恰好奇异。<sup>[3](https://blogs.mathworks.com/cleve/2017/06/07/hilbert-matrices-2/?from=en)</sup>

该矩阵也是汉克尔矩阵，即其元素仅依赖于 i + j 之和；它是矩序列 \( s_n = 1/(n+1) = \int_0^1 x^n \, dx \) 的汉克尔矩阵。<sup>[3](https://blogs.mathworks.com/cleve/2017/06/07/hilbert-matrices-2/?from=en)</sup><sup> • </sup><sup>[9](https://web.math.ku.dk/~berg/manus/filbert.pdf)</sup> 由于变号后它具有柯西形式 \( a_{ij} = 1/(x_i - y_j) \)，其逆矩阵的闭形式公式可由柯西矩阵的一般逆公式推出。<sup>[3](https://blogs.mathworks.com/cleve/2017/06/07/hilbert-matrices-2/?from=en)</sup>

## 最小二乘多项式拟合中的起源

当区间 0 ≤ τ ≤ 1 上的函数 y(τ) 用单项式基多项式 \( \Xi(\tau) = \sum_{j=1}^{N} \xi_j \tau^{j-1} \) 作最小二乘逼近时，希尔伯特矩阵就会出现。该拟合的正规方程的系数矩阵元素为

\[ \theta_{ij} = \int_0^1 \tau^{i+j-2} \, d\tau = \frac{1}{i+j-1}, \]

恰为 N×N 的希尔伯特矩阵。<sup>[4](https://people.eecs.berkeley.edu/~wkahan/MathH110/HilbMats.pdf)</sup><sup> • </sup><sup>[3](https://blogs.mathworks.com/cleve/2017/06/07/hilbert-matrices-2/?from=en)</sup> 矩阵的病态性反映了：随着次数增加，区间上有界多项式的单项式系数呈指数增长。<sup>[4](https://people.eecs.berkeley.edu/~wkahan/MathH110/HilbMats.pdf)</sup>

这一起源既解释了该矩阵的名声，也说明了它的实际教训。用区间上的正交多项式基表示同一拟合，在次数增大时得到的系数更温和，矩阵的条件数也远优于希尔伯特矩阵。<sup>[4](https://people.eecs.berkeley.edu/~wkahan/MathH110/HilbMats.pdf)</sup> 在应用中，病态性表现为巨大的解范数：在 GNU 科学计算库的一个正则化回归示例中，基于 10×8 希尔伯特矩阵（条件数 \( 3.565872 \times 10^{9} \)），未正则化的最小二乘解范数为 \( 2.92217 \times 10^{9} \)，而适当正则化后的解范数为 0.139357。<sup>[10](https://www.gnu.org/software/gsl/doc/html/lls.html)</sup>

## 病态性

条件数是乘积 \( \|A\| \cdot \|A^{-1}\| \)，它预示数值稳定性的表现；尽管希尔伯特矩阵是对称正定的，其病态性却众所周知。<sup>[6](https://digital.auraria.edu/downloads/v92cm-w5p63/AA00005922_00001.pdf)</sup> 随阶数增长极快：10×10 希尔伯特矩阵的条件数已达约 \( 1.6 \times 10^{13} \)，<sup>[6](https://digital.auraria.edu/downloads/v92cm-w5p63/AA00005922_00001.pdf)</sup> 20×20 矩阵在双精度下达到 \( 5.1944 \times 10^{19} \)，<sup>[2](https://www.mathworks.com/help/symbolic/hilbert-matrices-and-their-inverses.html)</sup> 理论增长率为 \( O\bigl((1+\sqrt{2})^{4N}/\sqrt{N}\bigr) \)。<sup>[7](https://math.stackexchange.com/questions/2633861/growth-of-the-condition-number-of-hilbert-matrices-theoretical-vs-matlab/2634010)</sup>

**求逆为何失败。** 随着阶数增加，矩阵迅速接近奇异矩阵，因此商 1/(i + j − 1) 中微小的舍入扰动会导致计算出的逆矩阵发生剧烈变化，且 n 越大越严重。<sup>[4](https://people.eecs.berkeley.edu/~wkahan/MathH110/HilbMats.pdf)</sup> 在 MATLAB 中用通用 `inv` 函数对 20×20 希尔伯特矩阵求逆会触发接近奇异的警告，且乘积 H·inv(H) 与单位矩阵的偏差达到 1 的量级；符号计算使用精确有理元素，能在纯数值方法失败之处给出准确结果。<sup>[2](https://www.mathworks.com/help/symbolic/hilbert-matrices-and-their-inverses.html)</sup> 部分误差甚至在求逆之前就已产生：1/3 等元素的浮点表示是两个大整数之比，而这些表示误差是所涉及舍入效应中最显著的。<sup>[3](https://blogs.mathworks.com/cleve/2017/06/07/hilbert-matrices-2/?from=en)</sup><sup> • </sup><sup>[8](https://au.mathworks.com/help/matlab/ref/invhilb.html)</sup>

## 逆矩阵

逆矩阵的元素有闭形式

\[ (H^{-1})_{ij} = (-1)^{i+j} (i+j-1) \binom{n+i-1}{n-j} \binom{n+j-1}{n-i} \binom{i+j-2}{i-1}^{2}, \]

且每个元素都是整数，因此一个完全由分数构成的矩阵，其逆矩阵却不含任何分数。<sup>[3](https://blogs.mathworks.com/cleve/2017/06/07/hilbert-matrices-2/?from=en)</sup> 元素增长很快，且在对角线上最大：13 阶时最大元素为 \( (T_{13})_{9,9} = 100863567447142500 \)，超过 \( 10^{17} \)，超出了双精度上限 `flintmax`（\( 9.007199254740992 \times 10^{15} \)）；只有 n ≤ 12 时最大元素才能在双精度下精确表示。<sup>[3](https://blogs.mathworks.com/cleve/2017/06/07/hilbert-matrices-2/?from=en)</sup>

由于逆矩阵精确已知，希尔伯特矩阵可作校验用例：右端为有理数的希尔伯特方程组的真解可在无舍入的情况下算出，并与浮点求解结果比较，因此误差是已知的而非估计的。<sup>[11](https://www.numerical-linear-algebra.com/essays/an-answer-that-is-known/)</sup> MATLAB 的 `invhilb` 函数直接计算二项式系数公式，而不是对 `hilb(n)` 求逆，对小于约 15 的 n 生成精确逆矩阵，对更大的 n 则给出近似。<sup>[8](https://au.mathworks.com/help/matlab/ref/invhilb.html)</sup> 四阶矩阵的逆为

\[ \begin{pmatrix} 16 & -120 & 240 & -140 \\ -120 & 1200 & -2700 & 1680 \\ 240 & -2700 & 6480 & -4200 \\ -140 & 1680 & -4200 & 2800 \end{pmatrix}. \]<sup>[8](https://au.mathworks.com/help/matlab/ref/invhilb.html)</sup>

## 历史与作为测试矩阵的角色

希尔伯特矩阵在 20 世纪 50 年代和 60 年代被广泛用于测试求逆算法和线性方程求解器。据曼彻斯特大学数值分析学家尼古拉斯·J·海厄姆（Nicholas J. Higham）说，它的吸引力有三重：即使对中等大小的 n 也极为病态；其逆矩阵元素有已知公式；它出现在用单项式基多项式作最小二乘拟合的实际问题中。尽管如此流行，他认为它并非好的测试矩阵，因为它太特殊：它不仅是对称正定的，而且是全正的。<sup>[12](https://epubs.siam.org/doi/10.1137/1.9780898718027.ch28)</sup> 约翰·托德（John Todd）在美国国家标准局撰写了关于条件数的早期报告，是最早论述条件数的人之一，希尔伯特矩阵则成为说明条件数的标准载体。<sup>[3](https://blogs.mathworks.com/cleve/2017/06/07/hilbert-matrices-2/?from=en)</sup><sup> • </sup><sup>[13](https://www.nist.gov/publications/motivation-working-numerical-analysis)</sup> 多伦多大学算子代数学家蔡文端（Man-Duen Choi）的综述文章《希尔伯特矩阵的戏法与馈赠》（Tricks or Treats with the Hilbert Matrix，载《美国数学月刊》1983 年）汇集了该矩阵的代数奇趣。<sup>[14](https://www.tandfonline.com/doi/abs/10.1080/00029890.1983.11971218)</sup>

## 无限希尔伯特矩阵

无限矩阵 \( H = \bigl(1/(i+j+1)\bigr)_{i,j \geq 0} \) 在序列空间 \( \ell^2 \) 上定义了一个有界线性算子。马格努斯（Magnus）与希尔（Hill）的经典结果描述了它的谱性质：H 的谱是区间 \( [0, \pi] \)，没有特征值；对某个复数 μ 满足 \( Hx = \mu x \) 的序列 x 已被完全刻画。<sup>[15](https://arxiv.org/abs/2411.07324)</sup> 广义希尔伯特矩阵——其元素如 \( \sin((1+\delta)\pi) / (\pi(j+k+1+\delta)) \)——仍是活跃的研究对象；近期工作计算了与安德森正交性灾变相关的大 N 行列式渐近。<sup>[16](https://arxiv.org/abs/2609.00255)</sup>

## References

1. [hilb – Hilbert matrix, MATLAB documentation, MathWorks](https://www.mathworks.com/help/matlab/ref/hilb.html)
2. [Hilbert Matrices and Their Inverses, MATLAB & Simulink Example, MathWorks](https://www.mathworks.com/help/symbolic/hilbert-matrices-and-their-inverses.html)
3. [Hilbert Matrices, Cleve's Corner: Cleve Moler on Mathematics and Computing, MathWorks](https://blogs.mathworks.com/cleve/2017/06/07/hilbert-matrices-2/?from=en)
4. [W. Kahan, HilbMats: Four Cholesky Factors … Hilbert Matrices, course notes, UC Berkeley](https://people.eecs.berkeley.edu/~wkahan/MathH110/HilbMats.pdf)
5. [Hilbert Matrix in least squares polynomial regression, MATLAB Answers, MathWorks](https://www.mathworks.com/matlabcentral/answers/811710-hilbert-matrix-in-least-squares-polynomial-regression)
6. [4.5 Hilbert Matrices, Numerical Analysis course materials, Auraria Library](https://digital.auraria.edu/downloads/v92cm-w5p63/AA00005922_00001.pdf)
7. [Growth of the condition number of Hilbert matrices, Mathematics Stack Exchange](https://math.stackexchange.com/questions/2633861/growth-of-the-condition-number-of-hilbert-matrices-theoretical-vs-matlab/2634010)
8. [invhilb – Inverse of Hilbert matrix, MATLAB documentation, MathWorks](https://au.mathworks.com/help/matlab/ref/invhilb.html)
9. [Christian Berg, The Hilbert matrices are the Hankel matrices corresponding to the moment sequence, University of Copenhagen](https://web.math.ku.dk/~berg/manus/filbert.pdf)
10. [Linear Least-Squares Fitting, GSL 2.8 documentation, GNU Project](https://www.gnu.org/software/gsl/doc/html/lls.html)
11. [An answer that is known, Numerical Linear Algebra essays](https://www.numerical-linear-algebra.com/essays/an-answer-that-is-known/)
12. [Nicholas J. Higham, Accuracy and Stability of Numerical Algorithms, Chapter 28: A Gallery of Test Matrices, SIAM](https://epubs.siam.org/doi/10.1137/1.9780898718027.ch28)
13. [John Todd (1954), Motivation for working in numerical analysis, NBS Report 3371, NIST](https://www.nist.gov/publications/motivation-working-numerical-analysis)
14. [Man-Duen Choi (1983), Tricks or Treats with the Hilbert Matrix, The American Mathematical Monthly 90(5), 301–312](https://www.tandfonline.com/doi/abs/10.1080/00029890.1983.11971218)
15. [A. Montes-Rodríguez, J. A. Virtanen (2024), The Hilbert matrix done right, arXiv:2411.07324](https://arxiv.org/abs/2411.07324)
16. [Martin Gebert, Heinrich Küttler (2026), Szegő-type determinant asymptotics for generalized Hilbert matrices with edge eigenvalues, arXiv:2609.00255](https://arxiv.org/abs/2609.00255)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Linear and multilinear algebra › Matrix theory › Structured and special matrix classes

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/hilbert-matrix

English original: https://www.edgepedia.org/hilbert-matrix
