gaussian elim with rref(M) over Gf(2)

13 visualizaciones (últimos 30 días)
yu kay
yu kay el 16 de Mzo. de 2011
Editada: John D'Errico el 30 de Mzo. de 2020
Hello!!!
Please how can i make a systematic matrix M. all M's element are over gf(2).(it's means M take value in {0,1}. -I try to do that with matlab function rref but results are not in gf(2). -I add mod(2). but it generate an error -could you help me??? thank's a lot

Respuestas (1)

John D'Errico
John D'Errico el 30 de Mzo. de 2020
Editada: John D'Errico el 30 de Mzo. de 2020
Far too late for this question, but in case others want help...
You seem to have asked two questions. First, how to create a symmetric matrix in GF(2) (or perhaps in any field induced by some integer N.)
We can create a matrix in GF(2) easily enough,
A = randi([0,1],[5,5])
A =
1 0 1 0 1
0 0 1 0 1
0 1 0 1 0
1 1 1 0 0
0 0 1 0 1
Of course, it is not symmetric as I generated it. I could symmetrize things by a step like this:
mod(A + A',2)
ans =
0 1 0 0 1
1 0 0 1 1
0 0 0 1 0
0 1 1 0 1
1 1 0 1 0
but you should see that will always result in a zero main diagonal. As well, this does not insure the matrix will be full rank in GF(2).
A simple solution would be to start with a factorization, whereby we can ensure the matrix is non-singular, because my matrix L will be lower triangular, but with a unit main diagonal.
L = tril(randi([0 1],[5 5])) | eye(5)
L =
5×5 logical array
1 0 0 0 0
0 1 0 0 0
1 0 1 0 0
1 0 1 1 0
1 0 0 1 1
A = mod(L*L',2)
A =
1 0 1 1 1
0 1 0 0 0
1 0 0 0 1
1 0 0 1 0
1 0 1 0 1
A now has the property that it will be a pseudo-random symmetric array in GF(2), such that it is known to be of full rank.
The inverse is easy enough to compute, using an elimination scheme.
Ainv =
1 0 0 1 1
0 1 0 0 0
0 0 1 0 1
1 0 0 0 1
1 0 1 1 1
mod(A*Ainv,2)
ans =
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
My recommendation is you should write the code to compute that inverse, if that is your goal. I'll attach a code that does so, but if you were to submit it as your homework, my bet is your teacher would see through it. So, for anyone who wants to compare my solution in GF(N) to yours, I've attached rrefgf.m to this answer.

Categorías

Más información sobre Linear Algebra en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by