{%hackmd 5xqeIJ7VRCGBfLtfMi0_IQ %} # Is this vector in the affine subspace? Case of yes ## 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 \\ 5 \\ 6 \\ 6 \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 &= 5, \\ 2 + c_1 + 3c_2 &= 6, \\ 2 + c_1 + 4c_2 &= 6 \\ \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 &= 5, \\ 2 + c_1 + 3c_2 &= 6, \\ 2 + c_1 + 4c_2 &= 6, \\ \end{aligned} $$ which is equivalent to $$ \begin{aligned} c_1 + c_2 &= 4, \\ c_1 + 2c_2 &= 4, \\ c_1 + 3c_2 &= 4, \\ c_1 + 4c_2 &= 4. \\ \end{aligned} $$ The system has a solution $c_1 = 4$ and $c_2 = 0$. Therefore, $\bb = \bp + 4\bu_1 + 0\bu_2$ and $\bb\in\bp + \vspan(S)$. ## Note One may visualize $\bb$ and $\vspan(S)$ as the picture below. ![](https://hackmd.io/_uploads/SJnoc-cRh.png) *This note can be found at Course website > Learning resources.*