Question: PYTHON Programming Assignment by following Written Algorithm Step-by-Step Topic: Gaussian Elimination Written Algorithm (Please follow step-by-step in the code, write comments explaining): - Given an
PYTHON Programming Assignment by following Written Algorithm Step-by-Step
Topic: Gaussian Elimination
Written Algorithm (Please follow step-by-step in the code, write comments explaining):
- Given an nn matrix A, and a n1 vector b, solve for solution vector x where Ax = b
- Create augmented matrix C = [A | b]
- Set E = 1 (this is a parameter to check if the algorithm successfully found a unique solution)
- for j = 1 to n: (iterate through columns of matrix)
---- Find largest magnitude value in columnj only looking at rowj and below. This is the pivot (p).

---- if
= 0: set E = 0, exit
---- if p > j: flip rows p and j
---- for all rows i > j: 
- if E == 1: a unique solution to the system of equations was found. Use substitution to extract the solution (elements of x). Start with the bottom line of the matrix/bottom equation and work up.

- else: the algorithm failed to find a unique solution
At the beginning, there should be a variable for the matrix. Test your code by trying different matrices. When finalizing, however, set the following values:
x + 2z = 1
2x + -y + 3z = -1
4x + y + 8z = 2
Provide screenshots of your code if you can. I will upvote if your solution helps me. Thank you! :)
Cp,j=maxi=jn{Ci,j} Cp,j rowi=rowiCj,jCi,jrowj Partition matrix C into C=[Dl] for j=n down to 1 : xj=Djj1(eji=j+1nDjixi)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
