✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Consider the following modified Python code for Gaussian elimination:
def gauss_elim_v2(A, b):
n = len(A)
for k in range(n-1):
for i in range(k+1, n):
factor = A[i][k] / A[k][k]
for j in range(n):
A[i][j] -= factor * A[k][j]
b[i] -= factor * b[k]
return A, b
What is the consequence of using
range(n) instead of range(k, n) in the innermost loop?