Challenge: Solving a Linear System with LU Decomposition
A student is given a small system of linear equations representing the balance of flows in a simple network.
The system is expressed as:
Ax=bWhere:
- A is a 3×3 matrix;
- b is the vector of known quantities.
The student's goal is to solve for x by performing LU decomposition on matrix A, then using forward and backward substitution to find the solution.
Compare your solution with numpy
's built-in solver to verify correctness.
Swipe to start coding
Complete the Python code below to implement LU decomposition and solve the system step-by-step:
- Fill in the missing code for the LU factorization of A.
- Implement forward substitution to solve Ly=b.
- Implement backward substitution to solve Ux=y.
- Compare your solution with
np.linalg.solve()
.
Lösung
Danke für Ihr Feedback!
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Can you show me how to perform LU decomposition step by step?
How do I use forward and backward substitution after LU decomposition?
How can I compare my solution with numpy's built-in solver?
Awesome!
Completion rate improved to 1.89
Challenge: Solving a Linear System with LU Decomposition
Swipe um das Menü anzuzeigen
A student is given a small system of linear equations representing the balance of flows in a simple network.
The system is expressed as:
Ax=bWhere:
- A is a 3×3 matrix;
- b is the vector of known quantities.
The student's goal is to solve for x by performing LU decomposition on matrix A, then using forward and backward substitution to find the solution.
Compare your solution with numpy
's built-in solver to verify correctness.
Swipe to start coding
Complete the Python code below to implement LU decomposition and solve the system step-by-step:
- Fill in the missing code for the LU factorization of A.
- Implement forward substitution to solve Ly=b.
- Implement backward substitution to solve Ux=y.
- Compare your solution with
np.linalg.solve()
.
Lösung
Danke für Ihr Feedback!
Awesome!
Completion rate improved to 1.89single