✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Consider the following Python code for Gaussian elimination:
def gauss_elim(A, b):
n = len(A)
for k in range(n):
for i in range(k, n):
factor = A[i][k] / A[k][k]
for j in range(k, n):
A[i][j] -= factor * A[k][j]
b[i] -= factor * b[k]
return A, b
Why does this code fail to produce the correct upper triangular matrix?