Examine how to calculate the determinant of the matrix inverse `A^(-1)`

, for an ill-conditioned matrix `A`

, without explicitly calculating `A^(-1)`

.

Create a 10-by-10 Hilbert matrix, `A`

.

Find the condition number of `A`

.

The large condition number suggests that `A`

is close to being singular, so calculating `inv(A)`

might produce inaccurate results. Therefore, the inverse determinant calculation `det(inv(A))`

is also inaccurate.

Calculate the determinant of the inverse of `A`

by exploiting the fact that

This method avoids computing the inverse of the matrix, `A`

.

Calculate the determinant of the exact inverse of the Hilbert matrix, `A`

, using `invhilb`

. Compare the result to `d1`

to find the relative error in `d1`

.

The relative error in `d1`

is reasonably small. Avoiding the explicit computation of the inverse of `A`

minimizes it.

For comparison, also calculate the determinant of the inverse of `A`

by explicitly calculating the inverse. Compare the result to `d`

to see the relative error.

The relative error in the calculation of `d2`

is many orders of magnitude larger than that of `d1`

.