Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement a set of functions in python to analyze and solve linear systems. Before starting, read the document on Piazza Linear Algebra in Python. Solving

Implement a set of functions in python to analyze and solve linear systems. Before starting, read the
document on Piazza Linear Algebra in Python.
Solving a linear system using Gaussian Elimination requires implementing three functions:
(a) forward elmination (Stage 1)
(b) testing for consistency
(c) backsubstitution (Stage 2)
I have written the code for forward elimination. Your job is to provide the rest of the code and use the resulting
set of functions to analyze some linear systems. (In case it helps, the code you have to write is (quite a bit)
shorter than the code I have already supplied!)
In hw2GECode.py I have provided the function:
forwardElimination(B)
which takes a matrix (numpy array) B and returns a new matrix that is the row echelon form of B. There are also
helper functions in that file, for doing things like swapping rows of a matrix, doing row reduction, etc.
You need two write two functions:
inconsistentSystem(B)
which takes a matrix B in echelon form, and returns True if it represents an inconsistent system, and False
otherwise; and
backsubstitution(B)
which returns the reduced row echelon form matrix of B.
Using these, you should be able to analyze a matrix representing a linear system as follows:
AEchelon = forwardElimination(A)
if (! inconsistentSystem(AEchelon)):
AReducedEchelon = backsubstitution(AEchelon)
and then by inspecting AReducedEchelon you should be able to write down the solution set for the linear
system.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions