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øsning
Takk for tilbakemeldingene dine!
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Awesome!
Completion rate improved to 1.89
Challenge: Solving a Linear System with LU Decomposition
Sveip for å vise menyen
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øsning
Takk for tilbakemeldingene dine!
Awesome!
Completion rate improved to 1.89single