Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Given the matrix A = $\begin{pmatrix} 0.005 & 1 \\ 1 & 1 \\ \end{pmatrix}$ and the vector b = $\begin{pmatrix} 0.5 \\1 \end{pmatrix} $ we have to solve for x in Ax = b in three different ways:

  1. Gaussian Elimination
  2. Without "pivotisation", i.e. withouth interchanging rows and columns and in the floating point arithmetic $\mathbb F(10,3,-10,10)$
  3. With "pivotisation" in $\mathbb F(10,3,-10,10)$

$\mathbb F(\beta,t,e_{min},e_{max})$ is defined as follows: $\beta \in \mathbb N, b \geq 2$ is the basis, $t \in \mathbb N$ is the length of the mantissa and $e_{min}$ and $e_{max}$ with $e_{min} < 0 < e_{max}$ are the bounds of the exponent. Then $\mathbb F$ is defined as follows:

$\mathbb F := \{ \pm \beta^{e}(\frac{d_1}{\beta} + ...+ \frac{d_t}{\beta^t}); d_1,...,d_t \in \{0,...,\beta-1\}, d_1 \neq 0, e \in \mathbb Z, e_{min} \leq e \leq e_{max} $ } or {0}

My solutions:

  1. With gaussian elimination I simply get x_1 = 100/199 and x_2 = 99/199.

  2. and 3. I don't really understand, since even for Gaussian elimination it is not really necessary to interchange any rows and coluns. Regarding the floting point arithmetic then, I wonder if the solutions would be simply x_1 = 0.503 and x_2 = 0.497?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

By Gaussian Elimination without any precision limitation, I would see $$\begin {pmatrix} 0.005&1&0.5\\1&1&1 \end {pmatrix}\to \begin {pmatrix} 0.005&1&0.5\\0&-199&-99 \end {pmatrix}\to \begin {pmatrix} 1&200&100\\0&1&\frac{99}{199} \end {pmatrix} \to\begin {pmatrix} 1&0&100-200\cdot \frac {99}{199}\\0&1&\frac{99}{199} \end {pmatrix}=\begin {pmatrix} 1&0&\frac {100}{199}\\0&1&\frac{99}{199} \end {pmatrix}$$

agreeing with your answer. With the restricted precision, we cannot represent $\frac {99}{199}$ and will round it to $0.497$. Then the first coordinate of the solution becomes $100-99.4=0.6$. If you interchange the rows, I believe the cancellation will be much smaller because the $0.005$ is no longer on the diagonal and the answer will be much closer to the truth.

share|improve this answer
    
Thanks for the answer. But why do you believe that we would have to round 99/199 to 1/2? If I understand it correctly, F(10,3,-10,10) means that the length of the mantissa is allowed to be up to 3 digits, hence wouldn't it be 0.503 as suggested? –  GuestGuest Mar 4 '13 at 18:37
    
@GuestGuest: Yes, it will round as I now show (though it is close to rounding to $0.498$) The subtraction still perturbs the solution substantially. –  Ross Millikan Mar 4 '13 at 19:04
    
When interchanging the rows, I get 0.497 and 0.503, so I guess you were right (assuming I haven't done any mistake). –  GuestGuest Mar 4 '13 at 20:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.