# Vectors and spanning

1. Feb 6, 2012

### DmytriE

If you are given three vectors (v1, v2, v3) that each have 3 components (i.e. x, y, z) how do you go about figuring out if vector w is in the subspace that is spanned by v1, v2, v3?

I know that span is the sum of scalar multiples of vectors for example:
αv1 + βv2 + γv3

I am brand new to linear algebra and our professor decided to start in chapter 4 rather than from the beginning.

2. Feb 6, 2012

### micromass

Staff Emeritus
There is nothing else you can do then actually finding the a,b and c such that

$$w=av_1+bv_2+cv_3$$

For example, (1,2,4) is in the span of (1,1,1),(0,1,1) and (0,0,1) because

$(1,2,3)=(1,1,1)+(0,1,1)+2(0,0,1)$.

So take a=b=1 and c=2.

The hard problem is actually finding the a,b and c. There are a couple of trick to do that.

For example, let's say you have (4,1,6) and you want to see if it is in the span of (2,6,1), (4,1,2) and (6,6,4). So you need to find a,b and c such that

$$(4,1,6)=a(2,6,1)+b(4,1,2)+c(6,6,4)=(2a+4b+6c,6a+b+6c,a+2b+4c)$$

This means you have to solve the following system of equations:

$$\left\{ \begin{array}{l} 2a+4b+6c=4\\ 6a+b+6c=1\\ a+2b+4c=4 \end{array} \right.$$

If this system has a solution (a,b,c) and these are the a,b and c you are looking for. If the system has no solution, then (4,1,6) is not in the span of the three vectors.

3. Feb 6, 2012

### DmytriE

Thank you! :-) That is exactly what I was looking for. I didn't want to post the homework question mainly because I wanted to understand the concept and then apply it.

4. Feb 6, 2012

### micromass

Staff Emeritus
Perhaps it's a good idea to make some exercises on the concept. Make up your own vectors and see if you can do it.

Just an idea. You do what you want! :tongue2:

5. Feb 7, 2012

### Amir Livne

There is actually a trick that can give a simple formula to know if there is a solution or not.
This is based on observing that the equation set micromass showed near the end of her post is very similar for different vectors: only the numbers on the right side of the equals sign change.

The numbers on the left hand side are usually called "the transition matrix of v1,v2,v3". That is, all 9 of them together as a block. Now the determinant of this matrix can tell you if there are solutions are not. This is more advanced material, and will probably be covered later in your course.

6. Feb 7, 2012

### DmytriE

I am intrigued. I looked at the wikipedia page that you linked to but am confused by the terminology that they used. When taking the determinant of matrix A what value will represent whether the vector in question is part of the span?

7. Feb 7, 2012

### micromass

Staff Emeritus
In general, given a system (I'll do a 3x3 system, but it can be any nxn system):

$$\left\{\begin{array}{l} ax+by+cz=d\\ ex+fy+gz=h\\ ix+jy+kz=l \end{array}\right.$$

This system can be written in following form

$$\left(\begin{array}{ccc} a & b & c\\ e & f & g\\ i & j & k \end{array}\right)\left( \begin{array}{c} x\\ y\\ z\end{array}\right) = \left(\begin{array}{c}d\\ h\\ l\end{array}\right)$$

which I will write as $A\mathbf{x}=\mathbf{b}$. If the matrix A is invertible, then this has a unique solution $\mathbf{x}=A^{-1}\mathbf{b}$. (of course we need A to be invertible in order for $A^{-1}$ to exists).

However, a matrix is invertible if and only if its determinant is nonzero.

So we have now shown that the system above has a solution if its determinant is nonzero.
If $\mathbf{b}=0$ (so if d=h=l=0) then the converse also hold: the system has a solution if and only if the determinant is nonzero.