$W_1$ and $W_2$ are subspaces of $R^{4}$ spanned by $[{(1,2,3,4),(2,1,1,2)]}$ and $[(1,0,1,0),(3,0,1,0)]$ respectively.Question is to find basis of $W_1 \cap W_2$ and also basis of $W_1 + W_2$ containing $[{(1,0,1,0),(3,0,1,0)}]$.I find rref of matrix $A=\left[\begin{array}{cccc}1&3&1&2\\0&0&2&1\\1&1&3&1\\0&0&4&2\end{array}\right]$ which gives me rank of this matrix 3.So the span of first three columns of matrix $A$ forms basis of $W_1 + W_2$ and last column of matrix $A$ forms basis of $W_1 \cap W_2.$Have I done it correctly?I have one more doubt.Suppose If I calculate rref of $A=\left[\begin{array}{cccc}1&2&1&3\\2&1&0&0\\3&1&1&1\\4&2&0&0\end{array}\right]$,then in this case last column of matrix again the basis of $W_1 \cap W_2$.So,in first case basis of $W_1 \cap W_2$ was span{[2,1,1,2]} and in second case it is ${[3,0,1,0]}$.What is correct then?
[Math] To find basis of intersection of two subspaces.
linear algebra
Related Solutions
Note that both the spaces have dimension $2$, this means that if their intersection had dimension $2$ they were equal. However it is immediate that no vector in $W_2$ can be written as $(x,y,z)$ with $y\neq 0$, and therefore $W_1\neq W_2$.
From this follows that the intersection has to have dimension $1$ or $0$. But we can also rule out the case where the intersection is zero, because then the direct sum of these spaces would be a $4$ dimensional subspace of $\Bbb R^3$. Impossible! So the intersection must have dimension $1$.
Since we already know that vectors in $W_2$ have their $y$ coordinate $0$, it is sufficient to see if we can find such vector in $W_1$, and then we can try to see whether or not this vector is in $W_2$ as well. The simplest and most obvious way would be: $$\begin{pmatrix}1\\2\\3\end{pmatrix}-2\begin{pmatrix}2\\1\\1\end{pmatrix}=\begin{pmatrix}1-4\\2-2\\3-2\end{pmatrix}=\begin{pmatrix}-3\\0\\1\end{pmatrix}=-\begin{pmatrix}3\\0\\-1\end{pmatrix}$$
Clearly this vector is in $W_2$ and therefore in the intersection. Since the intersection is of no more than one dimension, this is indeed a basis for $W_1\cap W_2$.
Some remarks: Note that I did not present a "general method" of solving this problem. I pointed out several heuristics which helped me solve this very quickly.
The reward for understanding the approach above, except the approach itself, is to understand that sometimes the general method is tedious and riddled with indices, whereas when one stops to ponder and observe the objects, one can draw immediate conclusions which cut the work in half.
Since this is such basic stuff, you must really be clear about what definitions you are using. In the courses I know (and give) "finite dimensional" is actually defined before dimension is, and it means "finitely generated", in other words a space is finite dimensional if (and only if) it is the span of a finite set. Span of a set of vectors is formed by the set of their linear combinations, which forms the smallest subspace containing that set. From this it is easy to show that the span of $A\cup B$ is the sum of the span of $A$ and the span of $B$ (which sum can be defined as the span of their union). Once this is done, it is clear that the sum of two finite dimensional subspaces (spans of finite $A,B$ respectively) is finite dimensional (the span of the finite set $A\cup B$).
On the other hand it is not so obvious (though true) that any subspace of a finite dimensional space is finite dimensional, and in particular that the intersection of a finite dimensional subspace with another subspace (which may or may not be finite dimensional) is finite dimensional.
Best Answer
You know that $W_1 + W_2 = \operatorname{span} (W_1 \cup W_2)$, so the set $$\{(1,0,1,0),(3,0,1,0), (1,2,3,4),(2,1,1,2)\}$$
certainly spans $W_1 + W_2$.
Also, $$(2,1,1,2) = -\frac32(1,0,1,0) + (3,0,1,0) + \frac12(1,2,3,4)$$
and $\{(1,0,1,0),(3,0,1,0), (1,2,3,4)\}$ is linearly independent so it is a basis for $W_1 + W_2$.
We have:
$$\dim (W_1 \cap W_2) = \dim W_1 + \dim W_2 - \dim (W_1 \cap W_2) = 1$$
so it suffices to find one nontrivial vector in $W_1 \cap W_2$. After inspection, we see that it is:
$$-\frac32(1,0,1,0) + (3,0,1,0) = \left(\frac32, 0, -\frac12, 0\right) = -\frac12 (1, 2, 3, 4) + (2, 1, 1, 2)$$
so $\left\{\left(\frac32, 0, -\frac12, 0\right)\right\}$ is a basis for $W_1 \cap W_2$. You can also take $\left\{\left(3, 0, -1, 0\right)\right\}$ as a basis to get rid of fractions.