Question: NEEDS TO BE DONE IN PYTHON 3 A Frobenius matrix (also known as a Gauss transformation) is a special kind of matrix used in the
NEEDS TO BE DONE IN PYTHON 3
A Frobenius matrix (also known as a Gauss transformation) is a special kind of matrix used in the process of Gaussian elimination. A matrix is a Frobenius matrix if it satisfies the following properties:
it is square
all of the entries on the main diagonal are ones
the entries below the main diagonal of at most one column are arbitrary
every other entry is zero
Write a function named is_frobenius() that takes as input a nested list of numbers (lists of rows) and RETURNS the Boolean value True if the matrix satisfies the properties of a Frobenius matrix and False otherwise.
>>> is_frobenius([[1]]) True >>> is_frobenius([[0]]) False >>> is_frobenius([[1, 0], [2.5, 1]]) True >>> is_frobenius([[1, 0, 0], [5, 1, 0], [7, 0, 1]]) True >>> is_frobenius([[1, 0, 0], [5, 1, 0], [0, 0, 1]]) True >>> is_frobenius([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) True >>> is_frobenius([[1, 0, 0, 0], [0, 1, 0, 0], [0, 3, 1, 0], [0, 5, 0, 1], [0, 0, 0, 1]]) False >>> is_frobenius([[1, 0, 0, 0], [0, 1, 0, 0], [0, 3, 1, 0], [0, 5, 0, 1]]) True >>> is_frobenius([[1, 4, 0, 0], [0, 1, 0, 0], [0, 3, 1, 0], [0, 5, 0, 1]]) False >>> is_frobenius([[1, 0, 0, 0], [0, 2, 0, 0], [0, 3, 1, 0], [0, 5, 0, 1]]) False >>> is_frobenius([[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 3, 1, 0, 0], [0, 5, 0, 1, 0], [0, 0, 0, 7, 1]]) False
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
