0

I want to check whether some vectors are dependent on each other or not by numpy, I found some good suggestions for checking linear dependency of rows of a matrix in the link below: How to find linearly independent rows from a matrix

I can not understand the 'Cauchy-Schwarz inequality' method which I think is due to lack of my knowledge, however I tried the Eigenvalue method to check linear dependency among columns and here is my code:

A = np.array([
              [0, 1, 0, 0],
              [0, 0, 1, 0],
              [0, 1, 1, 0],
              [1, 0, 0, 1]
])

lambdas, V = np.linalg.eig(A)
print(lambdas)
print(V)

and I get:

[ 1.          0.          1.61803399 -0.61803399]
[[ 0.          0.70710678  0.2763932  -0.7236068 ]
 [ 0.          0.          0.4472136   0.4472136 ]
 [ 0.          0.          0.7236068  -0.2763932 ]
 [ 1.         -0.70710678  0.4472136   0.4472136 ]]

My question is what is the relevance between these eigenvectors or eigenvalues to the dependency of columns of my matrix? How can I understand which columns are dependent to each other and which are independent by these values?

  • Note that in the linked answer, you should use `np.linalg.eig(A.T)` (the transpose!) to work on the rows – mozway Jan 24 '22 at 16:22
  • Your final question doesn't make sense: an eigenvalue does not "belong to" a column of the matrix. Perhaps you want to find a combination of rows that illustrates the linear dependence? Please can you edit your question to clarify what you want. – myrtlecat Jan 24 '22 at 18:29

2 Answers2

0

The second column vector corresponds to the eigenvalue of 0.

Just take a look at the API documentation when you get confused.

v : (…, M, M) array

The normalized (unit “length”) eigenvectors, such that the column v[:,i] is the eigenvector corresponding to the eigenvalue w[i].

jyli
  • 41
  • 3
0

You can find the linearly independent columns by QR decomposition as described here.

  • 2
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 28 '22 at 10:06