How to check if m n-sized vectors are linearly independent?

前端 未结 8 2454
栀梦
栀梦 2020-12-15 05:47

Disclaimer
This is not strictly a programming question, but most programmers soon or later have to deal with math (especially algebra), so I think tha

8条回答
  •  伪装坚强ぢ
    2020-12-15 06:02

    Construct a matrix M whose rows are the vectors and determine the rank of M. If the rank of M is less than m (the number of vectors) then there is a linear dependence. In the algorithm to determine the rank of M you can stop the procedure as soon as you obtain one row of zeros, but running the algorithm to completion has the added bonanza of providing the dimension of the spanning set of the vectors. Oh, and the algorithm to determine the rank of M is merely Gaussian elimination.

    Take care for numerical instability. See the warning at the beginning of chapter two in Numerical Recipes.

提交回复
热议问题