# Calculating dimension of the intersection of two subspaces

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\}$.

• This might help to make it more algorithmic, avoiding all this "trying" and "setting": en.wikipedia.org/wiki/Zassenhaus_algorithm – Dirk May 4 '17 at 10:01
• Awesome! Thanks for the link. +1 – Error 404 May 4 '17 at 13:02

To calculate the dimension of $U\cap V$ you can

1. Calculate a basis of $U\cap V$ and count the vectors, or
2. 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).

• Ah!! I see. Couldn't figure it out. Thanks a lot! :) – Error 404 May 4 '17 at 18:04

Hint: $Dim(U + V) = Dim(U) + Dim(V) - Dim (U\cap V)$.

• Then we have to calculate $\text {Dim} (U+V)$. Will it be easier than calculating $\text {Dim} (U \cap V)$? Thanks. – Error 404 May 4 '17 at 13:07
• @VikrantDesai Already you got the full detail. :) – srijan May 4 '17 at 23:28
• True that @srijan :D – Error 404 May 5 '17 at 4:30