how to find a basis of complementary subspace of a subspace

I have a mm dimensional subspace VV of Rn\mathbb{R}^n, I know for another subspace WW for which

V⊕W=RnV\oplus W=\mathbb{R}^n Now basis of VV is given explicitly in a matrix MM whose mm collumns are linearly indipendent and play role as basis for VV.

My question is how I can find explicitly ( when everything is given say a n=4n=4, and m=1/2/3m=1/2/3) a basis for WW from these information?

Thanks for help. If one can explain by example, it will be helpful too.




as in the other problem you want a solution using matlab?
– H. H. Rugh
2 days ago



Anything to say about the two solutions you have received?
– Gerry Myerson
19 hours ago


2 Answers


Find a basis, by the standard techniques, for the nullspace of the transpose of MM. This will be a basis for the orthogonal complement of VV, and the orthogonal complement of VV will certainly work as the WW you want.

Matlab suggestion: If M is a list with a basis of say mm column vectors for VV, you may construct a list B of any (e.g. the canonical) nn basis vectors Rn{\Bbb R}^n and use A:=linalg::sumBasis(M,B) to get a basis for Rn{\Bbb R}^n again of nn vectors. If matlab (hopefully) calculates from left to right then the first mm vectors in AA is the given basis for VV (i.e. the matrix M) and the remaining n−mn-m vectors should be a basis for a complement WW.