TITLE: Calculating dimension of the intersection of two subspaces
QUESTION [8 upvotes]: Q. Let $U$ be the vector subspace of $\Bbb R^5$ generated by $\{(1,3,-3,-1,-4),(1,4,-1,-2,-2),(2,9,0,-5,-2)\}$, and let $V$ be the vector subspace of $\Bbb R^5$ generated by $\{(1,6,2,-2,3),(2,8,-1,-6,-5),(1,3,-1,-5,-6)\}$. What is the vector space dimension of $U \cap V$?

I found that the basis of $U$ is just $\{(1,3,-3,-1,-4),(1,4,-1,-2,-2)\}$ and that of $V$ is $\{(1,6,2,-2,3),(2,8,-1,-6,-5),(1,3,-1,-5,-6)\}$. This means $\dim U=2$ and $\dim V=3$. I know that the dimension of $U \cap V$ is either $0,1$ or $2$ since $\dim (U \cap V) \le \dim U$.
Attempt : Using the method of top answer from here, I got this equation 
$a(1,3,-3,-1,-4)+b(1,4,-1,-2,-2)-x(1,6,2,-2,3)-y(2,8,-1,-6,-5)-z(1,3,-1,-5,-6)=0$
then solving the arising system of linear equations and reducing to row-echelon form I get the following system of linear equations :
$$
\left\{ 
\begin{array}{c}
a+b-x-2y+z=0 \\ 
b-3x-2y=0 \\ 
x-y-2z=0
\end{array}
\right. 
$$
Which gives me null space as $[-2y-5z \;\;\; 5y+6z \;\;\; y+2z \;\;\; y \;\;\; z]^T$.
Setting $y=-\frac 65$ and $z=1$ we get a vector in null space as $(-\frac {13}5,0,\frac 45,-\frac 65,1)$
Hence our $\textbf {v}=-\frac {13}5 (1,3,-3,-1,-4)=\frac 45(1,6,2,-2,3)+\frac {-6}5 (2,8,-1,-6,-5)+(1,3,-1,-5,-6)$.
Does this mean that $\{(1,3,-3,-1,-4)\}$ is a basis of $U \cap V$ implying that $\dim (U \cap V)=1$? Have I done it right through out? Thanks.
PS : How I set $y=-\frac 65,z=1$ ? I let $5y+6z=0 \; \text{in null space} \; \Rightarrow y=-\frac {6z}5$. Which gives me $[-\frac {13z}5 \;\;\; 0 \;\;\; \frac {4z}5 \;\;\; -\frac {6z}5 \;\;\; z]$. Then I took $z=1$.
If I vary $z$ all over the $\Bbb R$ then,
$U \cap V=\{-\frac {13z}5 (1,3,-3,-1,-4)\ : z \in \Bbb R\}$.

REPLY [17 votes]: To calculate the dimension of $U\cap V$ you can

Calculate a basis of $U\cap V$ and count the vectors, or
Use $\dim(U\cap V)=\dim(U)+\dim(V)-\dim(U+V)$. 

The second method can be realized as the following:

Collect all the $U$-vectors as columns of the matrix $A$ and all the $V$-vectors as columns of the matrix $B$.
Calculate $\dim(U)=\operatorname{rank}A$, $\dim(V)=\operatorname{rank}B$, $\dim(U+V)=\operatorname{rank}[A\ B]$.
Calculate $\dim(U\cap V)$ using the formula above.

P.S. In your attempt: the nullspace you've got
$$
\begin{pmatrix}-2y-5z & 5y+6z & y+2z & y & z\end{pmatrix}^T
$$
is exactly all the coefficients $(a,b,x,y,z)$ such that the corresponding linear combinations with $(a,b)$, or with $(x,y,z)$, generate the subspace $U\cap V$ (because you were looking for linear combinations from $U$ that were equal to linear combinations from $V$). 
Let's take, for example, $(a,b)$ in $U$
$$
\begin{bmatrix}
1 & 1\\
3 & 4\\
-3 & -1\\
-1 & -2\\
-4 & -2
\end{bmatrix}
\begin{bmatrix}
a\\ b
\end{bmatrix}=
\begin{bmatrix}
1 & 1\\
3 & 4\\
-3 & -1\\
-1 & -2\\
-4 & -2
\end{bmatrix}
\begin{bmatrix}
-2y-5z\\ 5y+6z
\end{bmatrix}=
\begin{bmatrix}
1 & 1\\
3 & 4\\
-3 & -1\\
-1 & -2\\
-4 & -2
\end{bmatrix}
\begin{bmatrix}
-2 & -5\\ 5 & 6
\end{bmatrix}
\begin{bmatrix}
y\\ z
\end{bmatrix}=
\underbrace{\begin{bmatrix}
3 & 1\\
14 & 9\\
1 & 9\\
-8 & -7\\
-2 & 8
\end{bmatrix}}_{\text{basis of }U\cap V}
\begin{bmatrix}
y\\ z
\end{bmatrix}.
$$
The dimension of $U\cap V$ is, thus, $2$ (as the two columns are linearly independent).