Week 4 Flashcards
How to solve linear equation using back substitution?
If we have a diagonal matrix, then we can easily solve the first one. Then we can fill the value in in the row above, and continue from there.
I.e.
- Prepare space for the solution x = (x1, …, xn)
- Solve starting at i = n
- Calculate the remaining sum: s.i = sum j >I a.ij * xj, where the sum is defined as s.i = 0 if I = n
- Compute solution xi = (bi-si)/aii
- Decrease I, repeat from 3 while i > 0
How does Gaussian elimination work?
- Set i =1
- Wipe column I below pivot a.ii by:
- Set j = i + 1
- 2 Calculate multiplicity f = a.ji/a.ii
- 3 Subtract f times row I from row j: a’.jk = a jk - f a/ik, k ≥ I
- 4 Increase j, if j ≤ n goto 2
- Increase I, if i ≤ n - 1 goto step 2
What is a trivial pivot?
When you swap rows when needed
What is a partial pivot?
When you swap rows to get larger (absolute) pivot in this column
What is complete pivoting?
When you swap rows and columns to get the largest absolute pivot from the remaining submatrix. (This is not recommended, the gain is small, but it requires much more work.)
What’s scaled partial pivoting?
Swapping rows to get the largest absolute relative pivot in this column.
How to partial pivot?
- Jet j* = i
- For j in i + 1,.., n
- If |a.ji| > |a.jI| then j = j
- Use j* for optimal row
Why scale partial pivot?
If factor f leads to a large subtraction factor, large rounding errors may accumulate.
How to Scaled Partial Pivot?
- Find s.j = max 1≤k≤n |a.jk.^(0)|, j = 1, …, n^1.
- Choose pivot a.ki^(i -1) with k = argmax i≤j≤n (a.ji^(i-1))/(s.j)
- Use a.ki^(i-1) as the pivot for eliminating th ei-th column