Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

The built in function:

Orthogonalize[m]

where m is a list of vectors returns a orthogonal basis for m. However, I want to stick to the binary field. However, I tried this:

Orthogonalize[m,Mod[#1.#2,2]&]

But this just still gives a set of vectors with negative coordinates.

Can anyone please help.

Thanks.

share|improve this question
    
Can you give an example of a set of vectors where your proposal fails, and what the answer ought to be? –  J. M. Aug 14 '12 at 5:29
    
Will vectors that are self-orthogonal be problrmatic for your purposes? if not, could just do Gram-Schmidt without the normalization part. –  Daniel Lichtblau Aug 14 '12 at 15:33
add comment

1 Answer 1

up vote 8 down vote accepted

Define the inner product modulo $2$:

orthogonalize[a_] := Mod[Orthogonalize[a, Mod[#1.#2, 2] &], 2]

Example:

(m = Union[orthogonalize[RandomInteger[{0, 1}, {500, 64}]] ]) // ArrayPlot

Orthogonal basis

Check orthogonality:

Mod[m . Transpose[m], 2] // ArrayPlot

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.