How to find the row rank of matrix in Galois fields?

℡╲_俬逩灬. 提交于 2019-12-11 03:07:34

问题


Matlab has a built-in function for calculating rank of a matrix with decimal numbers as well as finite field numbers. However if I am not wrong they calculate only the lowest rank (least of row rank and column rank). I would like to calculate only the row rank, i.e. find the number of independent rows of a matrix (finite field in my case). Is there a function or way to do this?


回答1:


In linear algebra the column rank and the row rank are always equal (see proof), so just use rank
(if you're computing the the rank of a matrix over Galois fields, consider using gfrank instead, like @DanBecker suggested in his comment):

Example:

>> A = [1 2 3; 4 5 6]

A =
    1   2   3
    4   5   6

>> rank(A)
ans =
    2

Perhaps all three columns seem to be linearly independent, but they are dependent:

[1 2; 4 5] \ [3; 6]
ans =
    -1
     2

meaning that -1 * [1; 4] + 2 * [2; 5] = [3; 6]




回答2:


Schwartz,

Two comments:

  1. You state in a comment "The rank function works just fine in Galois fields as well!" I don't think this is correct. Consider the example given on the documentation page for gfrank:

    A = [1 0 1;
       2 1 0;
       0 1 1];
    gfrank(A,3) % gives answer 2
    rank(A) % gives answer 3
    

    But it is possible I am misunderstanding things!

  2. You also said "How to check if the rows of a matrix are linearly independent? Does the solution I posted above seem legit to you i.e. taking each row and finding its rank with all the other rows one by one?"

    I don't know why you say "find its rank with all the other rows one by one". It is possible to have a set of vectors which are pairwise linearly independent, yet linearly dependent taken as a group. Just consider the vectors [0 1], [1 0], [1 1]. No vector is a multiple of any other, yet the set is not linearly independent.

    Your problem appears to be that you have a set of vector that you know are linearly independent. You add a vector to that set, and want to know whether the new set is still linearly independent. As @EitanT said, all you need to do is combine the (row) vectors into a matrix and check whether its rank (or gfrank) is equal to the number of rows. No need to do anything "one-by-one".

    Since you know that the "old" set is linearly independent, perhaps there is a nice fast algorithm to check whether the new vector makes thing linearly dependent. Maybe at each step you orthogonalize the set, and perhaps that would make the process of checking for linear independence given the new vector faster. That might make an interesting question somewhere like mathoverflow.



来源:https://stackoverflow.com/questions/13480427/how-to-find-the-row-rank-of-matrix-in-galois-fields

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!