The Pseudocode for Gaussian elimination for a n by n system
The Pseudocode for Gaussian elimination for a n by n system, Ax=b, is shown below Following the pseudocode above, how many loops are required to complete the forward elimination? Please also provide the formula a for n times n system for forward elimination. Following the pseudocode above, how many loops are required to complete the backward substitution? Please also provide the formula a for n times n system for backward substitution.
Solution
1)
(n-2)2 + (n-3)2+.....+ (n-(n-1))2
n = 1 -> 0
n = 2 -> 0
n = 3 -> 1
n = 4 -> 5
n = 5 -> 14
2)
(n-3)+ (n-4) + .....+ (n-(n-1))
n < 4 -> 0
n = 4 -> 1
n = 5 -> 3
n = 6 -> 6
