# Finding a basis containing v

Let $w = \{ (a,b,c,d)^T \mid 2a+3b+c+2d=0 \}$ in the vector space $\mathbb{Z}_5^4$.

$(2,2,1,2)$ is in $w$. ($w(2,2,1,2) = 15$, $15\,\mbox{mod}\,5=0$)

How do I find a basis for $w$ that contains $(2,2,1,2)$?

-
What is z(4,5)? The field with 625 elements? – Hagen von Eitzen Oct 25 '12 at 5:51
its the integers{0,1,2,3,4) in 4 dimensions So EG 4*4 =16 , but can only have numbers 0,1,2,3 or 4, so 16 =1; (16mod5 = 1) – straykiwi Oct 25 '12 at 6:09
Step 1: find a basis for $w$. If it contains $(2,2,1,2)$, stop. Step 2: write $(2,2,1,2)$ as a linear combination of your basis elements. Choose a basis element with a nonzero coefficient in this linear combination, and replace it with $w$. – Gerry Myerson Oct 25 '12 at 6:31
Thanks Gerry. I got basis {(1,0,-2,0),(0,1,-3,0),(0,0,-2,1)} and (2,2,1,2) is 2b1+2b2+2b3 so i can replace any of b1,b2,b3 with (2,2,1,2) and that is correct yeah? – straykiwi Oct 25 '12 at 6:58
If you want to be sure I see a comment addressed to me, you have to write @Gerry. What you have done looks correct. Now you can post it as an answer. Then, later, you can accept it. – Gerry Myerson Oct 25 '12 at 23:08

Here is a general method to extend any linearly independent set $S$ to a basis of a subspace $W$ contining them. First choose any set $b_1,\ldots,b_k$ that generates $W$. Then starting with the set $S$, let $b$ run through $b_1,\ldots,b_k$ and ask whether $b$ is linearly dependent on $S$ extended with any $b_i$ already added to it; if it is, then add $b$ to the set, if it isn't drop it. Since in the end you've dropped only vectors dependent on others, whatever is left will still span $W$, and they are linearly independent by construction.

In this concrete example you can take $b_1=(1,0,-2,0)$, $b_2=(0,1,-3,0)$, $b_3=(0,0,-2,1)$ (I drop the silly transposes: vectors are vectors, not matrices; of course the coordinates can be taken mod $5$ as we are in $(\Bbb Z/5\Bbb Z)^4$), and $S=\{(2,2,1,2)\}$ is given. Clearly $b_1$ is linearly independent from $S$, and $(2,2,1,2)-2b_1=(0,2,0,2)$ is up to a scalar the only linear combination we can now form with an initial coordinate $0$, so $b_2$ is also linearly independent from them. Now we have already have $3$ linearly independent vectors in a subspace of dimension $3$, so $b_3$ had better be linearly dependent; indeed it is $b_3=3*(2,2,1,2)-b_1-b_2$. So $\{(2,2,1,2),b_1,b_2\}$ is a basis of $w$.

In the end this is not different from what you found yourself, but the method works no matter how many vectors are imposed on you initially to be in the basis, provided of course they are linearly independent.

-

I got basis $\{(1,0,-2,0),(0,1,-3,0),(0,0,-2,1)\}$ and $(2,2,1,2) = 2b_1+2b_2+2b_3$ so i can replace any of $b_1,b_2,b_3$ with $(2,2,1,2)$.