Challenge: Calculate the Largest Independent Subset
Program a Python algorithm to find the linearly independent subset of a collection of vectors.
We'll cover the following
Statement
Write a largestIndependentSubsetCalculator
function that takes a collection of vectors , where all vectors belong to the same vector space, and returns the largest linearly independent subset (this subset could be any subset and need not be unique).
Example
Consider an example of a collection of vectors:
The largest possible independent subset of the collection is
Sample inputs and outputs
The following table describes the desired outputs of the corresponding inputs (including a few that are taken from the set of vectors above).
Input | Output |
---|---|
Try it yourself
The signature of a function is given below. It accepts an array of vectors and returns an array of linearly independent vectors.
Get hands-on with 1400+ tech skills courses.