Challenge: Linear Combination Checker
Write a Python algorithm to check if a matrix is an integer linear combination.
We'll cover the following
Problem statement
Write an IsIntLC
function that accepts three matrices, , and as input. is the set of scalars to choose from. Your challenge is to check if matrix
can be written as a linear combination of matrices and , with scalars from .
Example
Consider
We can write as simply .
Sample input and output
The following table describes the expected input and output format.
Input | Output |
---|---|
True |
Try it yourself
The function’s signature is given below:
Get hands-on with 1400+ tech skills courses.