# How to determine if vector b is in the span of matrix A? [closed]

Given a matrix A = \begin{bmatrix} 1 &2 &3 \\ 4 &5 &6 \\ 7 &8 &9 \end{bmatrix}

Determine if vector $b$ is in $span(A)$ where $$b = \begin{bmatrix} 1 \\ 2 \\ 4 \end{bmatrix}$$

## closed as off-topic by Jack, user137731, saz, user91500, user223391 Oct 3 '16 at 0:30

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Jack, Community, saz, user91500, Community
If this question can be reworded to fit the rules in the help center, please edit the question.

• Do you know what it means for $b$ to be in the span of $A$? – Git Gud Oct 1 '16 at 20:43
• No, I do not. Hence why I ask how would I determine if b is in the span of matrix A. – KNgu Oct 1 '16 at 20:47
• OK. By definition it holds that $\operatorname{span}(A)=\left\{Ax\colon x\in \mathbb R^{3\times 1}\right\}$. Can you take it from here? Edit: And, if I understood correctly, then maybe you should be asking what the definition of $\operatorname{span}(A)$ is. – Git Gud Oct 1 '16 at 20:49
• So the span would be the column spaces? – KNgu Oct 1 '16 at 20:51
• Look at the following link: math.stackexchange.com/questions/56201/… – rannoudanames Oct 1 '16 at 20:52

First we address $\mathrm{Span}(A)$,

$$\mathrm{Span}(A) = \left\{ \left[ \begin{array}{c} x_1\\ x_2\\ x_3\\ \end{array}\right] : \left[ \begin{array}{c} x_1\\ x_2\\ x_3\\ \end{array}\right] = a \left[\begin{array}{c} 1\\ 4\\ 7\\ \end{array}\right] + b \left[\begin{array}{c} 2\\ 5\\ 8\\ \end{array}\right] + c \left[\begin{array}{c} 3\\ 6\\ 9\\ \end{array}\right]. a,b,c \in \mathbb{R} \right\}.$$

From this definition we can see that asking if vector $\vec{b} \in \mathrm{Span}(A)$ is equivalent to asking if there exists a vector $\vec{x}$ such that $A\vec{x} = \vec{b}$,

because $$\vec{x} = \left[\begin{array}{c} x_1\\ x_2\\ x_3\\ \end{array}\right],$$

then $$A\vec{x} = \left[\begin{array}{ccc} 1 & 2 & 3\\ 4& 5 & 6\\ 7 & 8 & 9\\ \end{array}\right] \left[ \begin{array}{c} x_1\\ x_2\\ x_3 \end{array}\right] = x_1 \left[ \begin{array}{c} 1\\ 4\\ 7 \end{array}\right] + x_2 \left[ \begin{array}{c} 2\\ 5\\ 8 \end{array}\right] + x_3 \left[ \begin{array}{c} 3\\ 6\\ 9 \end{array}\right].$$

So if there exists $x_1, x_2, x_3$ such that the final line equals $\vec{b}$, then we know $\vec{b}$ is in $\mathrm{Span}(A)$. This means it suffices to ask if there exists a $\vec{x}$ such that $A\vec{x} = \vec{b}$.

This final equation is equivalent to the matrix equation:

$$\left[\begin{array}{ccc} 1 & 2 & 3\\ 4 & 5 & 6\\ 7 & 8 & 9 \end{array} \right] \vec{x} = \left[\begin{array}{c} 1\\ 2\\ 4\\ \end{array}\right],$$ which we can convert to the system:

$$\left[\begin{array}{ccc|c} 1 & 2 & 3 & 1\\ 4 & 5 & 6 & 2\\ 7 & 8 & 9 & 4\\ \end{array}\right].$$

As you might have learned, we solve this system by row reduction (I used technology for this step, your instructor may require row reduction by hand):

$$\mathrm{RREF}\left(\left[\begin{array}{ccc|c} 1 & 2 & 3 & 1\\ 4 & 5 & 6 & 2\\ 7 & 8 & 9 & 4\\ \end{array}\right]\right) = \left[\begin{array}{ccc|c} 1 & 0 & 0 & \frac{-4}{3}\\ 0 & 1 & 0 & \frac{8}{3} \\ 0 & 0 & 1 & -1\\ \end{array}\right].$$

This implies the vector $\vec{x}$ we seek is given by: $$\vec{x} = \left[\begin{array}{c} \frac{-4}{3}\\ \frac{8}{3} \\ -1\\ \end{array} \right].$$

The existence of this $\vec{x}$ alone guarantees $\vec{b} \in \mathrm{Span}(A)$, but lets check our answer by computing $A\vec{x}$.

$$A\vec{x} = \left[\begin{array}{ccc} 1 & 2 & 3\\ 4 & 5 & 6\\ 7 & 8 & 9 \end{array} \right] \left[\begin{array}{c} \frac{-4}{3}\\ \frac{8}{3} \\ -1\\ \end{array} \right] = \left[\begin{array}{c} 1\\ 2 \\ 4\\ \end{array} \right],$$

as desired.

Some things to think about: are there any vectors in $\mathbb{R}^3$ that are not in Span($A$)? If so can you find them, if not can you justify it? Hope this answer helps!

• Is the rule that as long as the matrix is consistent then it's in the span? – Aaron Franke Feb 9 at 3:08
• A vector $\vec{b}$ is in the span of the columns of a matrix $A = [\vec{v}_1 \dots \vec{v}_n]$ iff the augmented matrix $[ \vec{v}_1 \dots \vec{v}_n \vec{b} ]$ is consistent. – Prince M Feb 9 at 20:02

You put the vector to the right (4th column) of the matrix and you do column reductions with respect to the first 3 columns. If the 4th column end up being zero it is in the span (and you may find which by doing the inverse of the column reductions).

Note that the property of the 4th column being in the span of the first 3 is preserved under the column reduction process (because it is invertible).

Before doing any mathematical problems, one should know what each term in the problem means. (And so that you would be able to ask a better question.)

"$b$ is in $span(A)$" means the vector $b$ is a linear combination of the column (row) vectors of $A$.