Recent chats

How can I check whether a vector is in the span of two given vectors?

Quick answer

Let the given vectors be u and v, and the candidate be w. Try to find numbers a and b such that w = au + bv. Expand this equation component by component and solve for a and b. If one pair of coefficients satisfies every component, w is in the span; if no such pair exists, it is not. The span consists of all combinations of the given vectors. [S1]

LET’S WORK THROUGH IT

The question, the details, the next step.

Question

How do I check whether a particular vector is in the span of two vectors? I’m not sure what I should actually calculate.

Geez

Think of the two given vectors as building blocks. Their span is the set of every vector you can make by scaling each one and adding the results. [S1] So the direct test is to ask whether your candidate can be written as a*u + b*v for some numbers a and b. Set the candidate equal to that expression, expand it by components, and look for one pair of coefficients that works throughout.

For example, suppose the given vectors are u = (1, 2) and v = (2, 1), and the candidate is w = (5, 4). We’ll check whether there are numbers a and b such that a(1, 2) + b(2, 1) = (5, 4).

Follow-up question

Can you work through those numbers? How do I turn the vector equation into something I can solve?

Geez

Scale each vector, then add matching coordinates:

a(1, 2) + b(2, 1) = (a, 2a) + (2b, b) = (a + 2b, 2a + b).

For this to equal (5, 4), the first coordinate must be 5 and the second must be 4. That gives a + 2b = 5 and 2a + b = 4. A pair that satisfies both is a = 1 and b = 2: the first expression gives 1 + 2(2) = 5, and the second gives 2(1) + 2 = 4.

So (5, 4) = 1(1, 2) + 2(2, 1). The same coefficients reproduce both coordinates, which confirms that this candidate is in the span.

Follow-up question

What if I can make one coordinate match, but not all of them? Could I still say the vector is in the span?

Geez

No. The coefficients have to make the entire vector match, not just one coordinate. For vectors with two coordinates, check both component equations using the same a and b; for vectors with more coordinates, check every component. If no single pair works for all of them, then the candidate is not in the span. [S1]

For a quick contrast using the same given vectors, consider the candidate (1, 1). Its equations would be a + 2b = 1 and 2a + b = 1. They have the solution a = b = 1/3, so this candidate is also in the span. To conclude that a candidate is outside the span, you must establish that its full set of component equations has no solution—not merely stop after a failed guess.

Follow-up question

Can you give me a short reusable setup so I can test another candidate without getting lost?

Geez

Use this template, replacing the letters with your vectors:

Given u = (u1, u2, ...) and v = (v1, v2, ...), test w = (w1, w2, ...).

  1. Write w = au + bv.
  2. Expand: (w1, w2, ...) = (a*u1 + b*v1, a*u2 + b*v2, ...).
  3. Match corresponding coordinates and solve for a and b.
  4. Substitute the proposed coefficients back into every coordinate.
  5. Conclude “in the span” if all coordinates match; conclude “not in the span” only if no coefficients satisfy all of them.

In the worked example, the check ends with (5, 4) = 1(1, 2) + 2(2, 1), so the conclusion follows directly from the combination. [S1]

A practical checklist

  • Name the two given vectors u and v and the candidate w.

  • Set w equal to au + bv using unknown coefficients.

  • Expand both sides and match corresponding coordinates.

  • Check that one pair of coefficients works in every coordinate.

  • Conclude membership only from a complete match; conclude nonmembership only when no solution exists.

A few more useful answers

Do the coefficients have to be whole numbers?

No. They can be any numbers allowed in your problem; the key is that the same coefficients reproduce the candidate in every coordinate.

What does it mean if the coefficient equations have more than one solution?

If even one solution reproduces the candidate, it is in the span. Whether the coefficients are unique is a separate question.

Sources

References used for this guide.

  1. [S1] MIT OpenCourseWare: Independence, basis, and dimension (18.06SC, Fall 2011)
    ocw.mit.edu · Checked

YOUR QUESTION. YOUR DETAILS.

Let’s work through your situation.

Get a tailored answer or help with your next task. Starts at $1, with a quote before you pay.

Ask your own question
← Back to Geez at Work