{%hackmd 5xqeIJ7VRCGBfLtfMi0_IQ %}
# Is this vector in the affine subspace? Case of no
## Problem
Let
$$
\bp = \begin{bmatrix} 1 \\ 1 \\ 2 \\ 2 \end{bmatrix},\
\bu_1 = \begin{bmatrix} 1 \\ 1 \\ 1 \\ 1 \end{bmatrix},\
\bu_2 = \begin{bmatrix} 1 \\ 2 \\ 3 \\ 4 \end{bmatrix},\ \text{ and }
\bb = \begin{bmatrix} 5 \\ 7 \\ 9 \\ 11 \end{bmatrix}.
$$
and $S = \{\bu_1, \bu_2\}$. Is $\bb$ in the set $\bp + \vspan(S)$?
## Thought
Recall that $\bp + \vspan(S)$ contains all vectors of the form $\bp + c_1\bu_1 + c_2\bu_2$ for some $c_1,c_2\in\mathbb{R}$. By definition, $\bb\in\bp + \vspan(S)$ if and only if there are $c_1, c_2\in\mathbb{R}$ such that $\bp + c_1\bu_1 + c_2\bu_2 = \bb$. Therefore, the problem is equivalent to whether
$$
\begin{aligned}
1 + c_1 + c_2 &= 5, \\
1 + c_1 + 2c_2 &= 7, \\
2 + c_1 + 3c_2 &= 9, \\
2 + c_1 + 4c_2 &= 11 \\
\end{aligned}
$$
has a solution or not.
## Sample answer
The equation $\bp + c_1\bu_1 + c_2\bu_2 = \bb$ is equivalent to
$$
\begin{aligned}
1 + c_1 + c_2 &= 5, \\
1 + c_1 + 2c_2 &= 7, \\
2 + c_1 + 3c_2 &= 9, \\
2 + c_1 + 4c_2 &= 11, \\
\end{aligned}
$$
which is equivalent to
$$
\begin{aligned}
c_1 + c_2 &= 4, \\
c_1 + 2c_2 &= 6, \\
c_1 + 3c_2 &= 7, \\
c_1 + 4c_2 &= 9. \\
\end{aligned}
$$
By substracting the first equation from the remaining equations, we have
$$
\begin{aligned}
c_1 + c_2 &= 4, \\
c_2 &= 2, \\
2c_2 &= 3, \\
3c_2 &= 5. \\
\end{aligned}
$$
Thus, there is no solution for this system since it is impossible for $c_2 = 2$ and $2c_2 = 3$. As a result, we know $\bb$ is not in $\bp + \vspan(S)$.
## Note
One may visualize $\bb$ and $\vspan(S)$ as the picture below.

*This note can be found at Course website > Learning resources.*