I'm having trouble with number 5 of this question below. I managed do do the other 4 though. This question comes from Trefethen & Bau - Numerical Linear Algebra.
$$ A = \begin{bmatrix} 1 & 1 \\ 1 & 1.0001\\ 1 & 1.0001\\ \end{bmatrix} \,\,\, B= \begin{bmatrix} 2 \\ 0.0001 \\4.0001 \end{bmatrix} $$
- What are the matrices $A^\dagger$ and $P$ for this matrix? (P is projection matrix, $A^\dagger$ is psuedo inverse.
- Find the exact solution $x$ and $y = Ax$ to the least squares problem $Ax \approx B$
- What are $K(A), \eta, \theta$
- What are the four condition numbers $\frac{1}{cos\theta}, \frac{K(A)}{\eta cos \theta}, \frac{K(A)}{cos\theta}, K(A) + \frac{K(A)^2 tan\theta}{\eta}$
- Give examples of perturbations $\delta B$ and $\delta A$ that approximately obtain these four condition numbers.
Here are the solutions I came up with:
$ K(A) = 42429.24 \\ \theta = 0.6847029 \\ \eta = 1 $
$ \text{sensitivity y to pertubations in B}\\ \frac{1}{cos \theta} = 1.290977236078941992048 $
$ \text{sensitivity x to perturbations in B}\\ \frac{k}{\eta cos \theta} = 54775.17703596802311949 $
$ \text{sensitivity y to perturbations in A}\\ \frac{k}{cos \theta} = 54775.17706639764946885 $
$ \text{sensitivity x to perturbations in A}\\ k + \frac{k ^ 2 tan \theta} {\eta} = 1469883252.857317209244 $
I'm really not sure how to go about number 5. Trying to get the intuition of this problem. Appreciate any help.
I did the work for this in R programming language, here is the code I used for reference:
library(pracma) #pinv
options(digits = 22)
A = matrix(
c(
1, 1,
1, 1.0001,
1, 1.0001
), nrow = 3, ncol = 2, byrow = TRUE
)
B = c(2, 0.0001, 4.0001)
pinv(A)
[,1] [,2] [,3]
[1,] 10001 -5000 -5000
[2,] -10000 5000 5000
#condition Number
k = norm(A, type = "2") * norm(pinv(A), "2")
[1] 42429.24
kappa(A)
[1] 42431.65
theta
x = pinv(A) %% B
y = A %%(pinv(A)%*% B)
cos^-1( ||y|| / ||b|| )
acos( norm(y, "2") / norm(B, "2") )
theta = acos( norm(y, "2") / norm(B, "2") )
[1] 0.6847029
eta
eta = (norm(A, "2") * norm(x, "2")) / norm(y, "2")
[1] 1
#sensitivity y to pertubations in B
1 / cos(theta)
[1] 1.290977236078941992048
#sensitivity x to pertubations in B
k / (eta * cos(theta))
[1] 54775.17703596802311949
#sensitivity y to pertubations in A
k / (cos(theta))
[1] 54775.17706639764946885 #eta is close to 1
#sensitivity x to pertubations in A
k + (k ^ 2 * tan(theta)) / eta
[1] 1469883252.857317209244