HilbertMatrix
HilbertMatrix [n]
gives the n×n Hilbert matrix with elements of the form .
HilbertMatrix [{m,n}]
gives the m×n Hilbert matrix.
Details and Options
- HilbertMatrix [n] or HilbertMatrix [{m,n}] gives a matrix with exact rational entries.
- The following options can be given:
- Possible settings for TargetStructure include:
-
Automatic automatically choose the representation returned"Dense" represent the matrix as a dense matrix"Cauchy" represent the matrix as a Cauchy matrix"Hankel" represent the matrix as a Hankel matrix"Hermitian" represent the matrix as a Hermitian matrix"Symmetric" represent the matrix as a symmetric matrix
- HilbertMatrix […,TargetStructure Automatic ] is equivalent to HilbertMatrix […,TargetStructure "Dense"].
Examples
open allclose allBasic Examples (2)
3×3 Hilbert matrix:
3×5 Hilbert matrix:
Scope (2)
Hilbert matrix with machine-number entries:
Hilbert matrix with 20-digit precision entries:
Options (2)
TargetStructure (1)
Return the Hilbert matrix as a dense matrix:
Return the Hilbert matrix as a Cauchy matrix:
Return the Hilbert matrix as a Hankel matrix:
WorkingPrecision (1)
A Hilbert matrix with machine-number entries:
A Hilbert matrix with 24-digit precision entries:
Applications (2)
Hilbert matrices are often used to compare numerical algorithms:
Compare methods for solving for known :
Solve using :
Solve using LinearSolve with Gaussian elimination:
Solve using LinearSolve using a Cholesky decomposition:
Solve using LeastSquares :
Compare errors:
An expression for the Legendre polynomial in terms of the Hilbert matrix:
Verify the expression for the first few cases:
Properties & Relations (5)
Square Hilbert matrices are real symmetric and positive definite:
Hilbert matrices can be expressed in terms of HankelMatrix :
Compare with HilbertMatrix :
Hilbert matrices can be expressed in terms of CauchyMatrix :
Compare with HilbertMatrix :
The smallest eigenvalue of a square Hilbert matrix decreases exponentially with n:
The model is a reasonable predictor of magnitude for larger values of n:
The condition number increases exponentially with n:
The 2-norm condition number is the ratio of largest to smallest eigenvalue due to symmetry:
Neat Examples (4)
The determinant of the Hilbert matrix can be expressed in terms of the Barnes G-function:
Verify the formula for the first few cases:
A function for computing the inverse of the Hilbert matrix:
Verify the inverse for the first few cases:
A function for computing the Cholesky decomposition of the Hilbert matrix:
Verify the Cholesky decomposition for the first few cases:
Visualize the decay of the entries of the Hilbert matrix:
Related Guides
Text
Wolfram Research (2007), HilbertMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/HilbertMatrix.html (updated 2023).
CMS
Wolfram Language. 2007. "HilbertMatrix." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/HilbertMatrix.html.
APA
Wolfram Language. (2007). HilbertMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HilbertMatrix.html
BibTeX
@misc{reference.wolfram_2025_hilbertmatrix, author="Wolfram Research", title="{HilbertMatrix}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/HilbertMatrix.html}", note=[Accessed: 10-April-2025 ]}
BibLaTeX
@online{reference.wolfram_2025_hilbertmatrix, organization={Wolfram Research}, title={HilbertMatrix}, year={2023}, url={https://reference.wolfram.com/language/ref/HilbertMatrix.html}, note=[Accessed: 10-April-2025 ]}