Module 1 of 2 · Lesson 1 of 5

Vectors and Linear Combinations

The dot product, which every constraint and every objective is built from.

What you will be able to do

Given vectors in R n , the learner can add and scale them, form a linear combination, and compute a dot product, saying what each result means geometrically.

What you will be able to do

Given a vector in R n , the learner can compute its norm, produce the unit vector with the same direction, and decide which of two vectors is longer and whether they point the same way, treating length and direction as independent properties.

Orientation

A list of numbers and an arrow with a length and a direction are the same object. Which reading is useful depends on the question. A cost dotted with a plan is money, a cost dotted with a direction is a rate.

Two operations and one product. Everything later in this subject, a constraint, a cost, a basis, a pivot, is assembled from them, so the arithmetic here is worth being fluent in rather than merely able to do.

Intuition

Translating between the two readings

Each row below is one object read twice. Fill the missing cell before reading on: the point is that the translation is mechanical, and that fluency in it is what later algorithms assume.

SituationAs a listAs an arrow
Make 3 of A, 7 of B ( 3 , 7 ) displacement 3 east, 7 north
Double the production plan 2 ( 3 , 7 ) = ( 6 , 14 ) same direction, twice the length
Combine two plans ( 3 , 7 ) + ( 1 , 2 ) = ( 4 , 9 ) second arrow's tail at the first's head
Reverse a plan − ( 3 , 7 ) = ( − 3 , − 7 ) same line, opposite direction

A numerical check worth doing once. Take u = ( 3 , 4 ) and v = ( 4 , − 3 ) .

u T v = 3 ( 4 ) + 4 ( − 3 ) = 12 − 12 = 0 .

Now verify geometrically: u has length 5 and so does v ; the angle between them comes from cos ⁡ θ = u T v ‖ u ‖ ‖ v ‖ = 0 25 = 0 , so θ = 90 ° . Two unrelated-looking calculations, one answer.

Where the translation earns its keep. A constraint 2 x 1 + 3 x 2 ≤ 12 is a dot product c T x with c = ( 2 , 3 ) . Testing the point ( 3 , 1 ) :

( 2 , 3 ) T ( 3 , 1 ) = 6 + 3 = 9 ≤ 12 ,

so the point satisfies it. Geometrically, c points perpendicular to the boundary line and the test asks which side ( 3 , 1 ) falls on. The simplex method performs exactly this test thousands of times, and reads the same number as "how much does moving in this direction improve the objective".

One number, three questions. For a direction d and coefficient vector c , the single quantity c T d answers: does this direction improve the objective (sign), by how much per unit travelled (magnitude), and is this direction along a contour (zero). No separate machinery is introduced later for any of the three.

Simulation

Scalar multiples of one vector, positive and negative

λu for positive and negative λ, always on one line

Move λ and watch λ u for u = ( 3 , 4 ) .

Every multiple lies on one line through the origin — the blue span line — so scaling changes length without changing the line. Between 0 and 1 the arrow shrinks; above 1 it stretches; at λ = 0 it collapses to the origin.

Negative λ is the case worth watching. The arrow flips to the opposite side of the origin and keeps growing along the same line, which is what − ( 3 , 4 ) = ( − 3 , − 4 ) means geometrically: same line, opposite direction, not a different direction.

This is the operation later algorithms assume when they speak of moving a distance along a direction, and of moving backwards along it.

Figure

Vector addition tip to tail, and orthogonality at a common origin

the tip-to-tail path and the right angle are two readings of one pair

Two operations on the same pair of vectors, u = ( 3 , 4 ) and v = ( 4 , − 3 ) , and each needs its own placement of v to be visible.

Addition. Drawn from the tip of u , the copy of v ends at ( 7 , 1 ) , and u + v is the arrow from the origin to that point. Following u and then v arrives where the sum points: that is what tip-to-tail means, and it is why addition is coordinatewise, ( 3 + 4 , 4 − 3 ) .

Orthogonality. Drawn from the origin instead, the faint copy of v shows the angle between the two vectors, and the small square marks it as a right angle. The dot product confirms it: 3 ( 4 ) + 4 ( − 3 ) = 0 .

Both copies are the same vector. A vector is a displacement, not a position, so it may be drawn anywhere; where you choose to draw it is chosen to make the relation you are asking about visible.

Definition

Vectors, combinations, and the dot product

The canonical statement above fixes the objects and the two operations. Three things follow from it that the statement does not say, and each is used later without comment.

The zero vector is a linear combination of every set. Take every coefficient zero in λ 1 v 1 + ⋯ + λ k v k . Nothing in the definition excludes it, and the independence test depends on this case being available: independence asks whether the zero vector has any other representation.

The dot product is the only place two vectors become a scalar. Addition and scaling return vectors; x T y returns a number. Every later quantity that is a single figure — a cost, an objective value, the left side of a constraint — is a dot product somewhere, which is why a constraint row applied to a candidate point produces something comparable against b i .

The norm is defined from the dot product, not beside it. ‖ x ‖ = x T x means length is not a separate notion to be supplied: it is what the dot product of a vector with itself measures. Orthogonality is the same economy in reverse: x T y = 0 is a statement about angle written without mentioning angles, which is what makes it computable in any dimension.

A note on shape. x T y is written with a transpose because the two operands are columns and the product of a 1 × n with an n × 1 is 1 × 1 . The transpose is doing real work here, and the same symbols without it, x y T , produce an n × n matrix instead.

Example

Three quantities, three readings

Take x = ( 2 , − 1 , 3 ) and y = ( 4 , 5 , 1 ) in R 3 .

Addition and scaling.

x + y = ( 6 , 4 , 4 ) , 3 x = ( 6 , − 3 , 9 ) .

Each is another vector in R 3 .

A linear combination. With coefficients 2 and − 1 :

2 x − y = ( 4 , − 2 , 6 ) − ( 4 , 5 , 1 ) = ( 0 , − 7 , 5 ) .

The dot product.

x T y = ( 2 ) ( 4 ) + ( − 1 ) ( 5 ) + ( 3 ) ( 1 ) = 8 − 5 + 3 = 6.

One number, not a vector. Its sign says the two vectors broadly agree in direction; had it come out zero they would be perpendicular.

The norm.

‖ x ‖ = 4 + 1 + 9 = 14 ≈ 3.74 .

A length, so it is never negative, and it says nothing about which way x points.

Worked example

A cost, a plan, and a direction

Problem. A workshop makes three products. The production plan is x = ( 10 , 4 , 6 ) units, and the unit profits are c = ( 3 , 7 , 2 ) . A proposed change to the plan is the direction d = ( 1 , − 1 , 0 ) .

Find the total profit, decide whether moving along d improves it, and say what c T d = 0 would have meant.

Goal. Read each dot product as the quantity it reports.

Relevant principle. A dot product measures how much of one vector lies along another. With a cost vector on one side, it measures money.

Step 1: total profit.

c T x = ( 3 ) ( 10 ) + ( 7 ) ( 4 ) + ( 2 ) ( 6 ) = 30 + 28 + 12 = 70.

Reason: each product's profit times its quantity, summed, which is exactly the dot product of the two lists.

Step 2: the effect of the change.

c T d = ( 3 ) ( 1 ) + ( 7 ) ( − 1 ) + ( 2 ) ( 0 ) = 3 − 7 = − 4.

Reason: d says make one more of the first product and one fewer of the second. The profit changes by the dot product of the cost with that direction.

Step 3: read the sign. Negative, so the change loses £4 per unit step. Moving along d makes the plan worse.

Step 4: what zero would have meant. c T d = 0 would say the direction is orthogonal to the cost: the plan changes but the profit does not. That is a flat direction, and it is precisely how a linear program comes to have several optimal plans with the same value.

Result. Profit 70 ; the direction d is worsening at − 4 per step.

Check. Does the sign make sense without the arithmetic? d trades a unit of the £7 product for a unit of the £3 product, so it should lose £4. It does.

Interpretation. Nothing here required a diagram. The geometry, improving, worsening, flat, arrived entirely through one scalar, which is why the dot product does so much work later.

Non-example

Undefined vector operations

Adding vectors of different dimensions. ( 1 , 2 ) + ( 1 , 2 , 3 ) is undefined. The shorter vector is not padded with a zero; the operation simply does not apply.

A dot product that returns a vector. x T y is a single number. Multiplying entry by entry to get ( x 1 y 1 , x 2 y 2 , … ) is a different operation and is not what any later formula means by the notation.

Concluding that a zero dot product means a zero vector. ( 1 , 0 ) T ( 0 , 1 ) = 0 with neither vector zero. Orthogonality is a relationship, not a statement that something vanished.

Reading a larger norm as a better direction. The norm measures length only. Scaling a worsening direction makes it longer and no less worsening.

Treating the zero vector as outside the space. It is a perfectly ordinary member, and it is a linear combination of every set, which is the fact the definition of independence is built on.

Contrast

Two products that are easy to confuse

Dot product x T y Entrywise product
ResultOne scalarA vector
Formula ∑ i x i y i ( x 1 y 1 , … , x n y n )
AnswersHow much of one lies along the otherNothing geometric
Used forCosts, constraint tests, orthogonalityRescaling data entry by entry
Appears in this subjectConstantlyAlmost never

Why the confusion is common. Both are written as a product of two vectors, and a calculator will happily do either. The notation x T y is what distinguishes them: the transpose is doing real work, turning a column into a row so the multiplication collapses to a single number.

The test. Ask what the answer is supposed to be. A cost applied to a plan is money, one number. A constraint applied to a point is a quantity to compare with a bound, one number. If the answer should be a single quantity, it is a dot product.

Where the entrywise product does appear. Rescaling: multiplying each entry of a plan by a per-unit factor. That is a legitimate operation and it is never written x T y .

Exercise

1: fully structured. Let u = ( 1 , 3 ) and v = ( 4 , − 2 ) .

(a) Compute u + v and 2 u . (b) Compute u T v . (c) Are u and v orthogonal?

Check: (a) ( 5 , 1 ) and ( 2 , 6 ) ; (b) ( 1 ) ( 4 ) + ( 3 ) ( − 2 ) = 4 − 6 = − 2 ; (c) no, orthogonality requires the product to be zero, and this is − 2 .

2: partly structured. A plan is x = ( 5 , 5 ) with cost vector c = ( 2 , 6 ) , and a proposed direction is d = ( 3 , − 1 ) .

(a) What is the current cost? (b) Does d increase or decrease it, and by how much per step? (c) Find a nonzero direction that leaves the cost unchanged.

Check: (a) 10 + 30 = 40 ; (b) c T d = 6 − 6 = 0 , so the cost is unchanged, d is already a flat direction; (c) any nonzero multiple of ( 3 , − 1 ) , since scaling a direction orthogonal to c keeps it orthogonal.

3: unstructured. A logistics planner writes: "Our two route vectors are r 1 = ( 6 , 2 ) and r 2 = ( − 1 , 3 ) . Their dot product is zero, so neither route carries any load and both can be dropped."

Assess the reasoning, and say what the zero actually tells the planner.

Check: the conclusion is wrong and the arithmetic is right. r 1 T r 2 = − 6 + 6 = 0 , but a zero dot product means the two vectors are perpendicular, not that either is the zero vector, and here both are plainly nonzero, with lengths 40 and 10 . What the planner has discovered is that the two routes are independent in direction: neither is a multiple of the other, and changes along one do not affect the other's contribution. That is a useful fact about the pair, and it is the opposite of grounds for dropping them.

What to carry forward

A vector is a list of n numbers, read as data or as a direction with a length.

Two operations. ( x + y ) i = x i + y i and ( λ x ) i = λ x i , both entrywise, both requiring matching dimensions.

A linear combination. λ 1 v 1 + ⋯ + λ k v k . Every coefficient zero gives the zero vector, which is therefore a combination of any set.

The dot product. x T y = ∑ i x i y i . One scalar, never a vector.

What it measures. How much of one vector lies along the other. A cost dotted with a plan is money; a cost dotted with a direction is the rate of change along it.

Orthogonality. x T y = 0 , which two nonzero vectors can satisfy. A flat direction for an objective is exactly one orthogonal to it.

The norm. ‖ x ‖ = x T x . A length, never negative, silent about direction.

The recurring error. Treating the dot product as a vector.

Next step

Practice Vectors and Linear Combinations

Practice records what support you used, so the evidence reflects how you actually performed.

Practice this lessonSkip to Matrices as Operators

Results update as you type. Use the up and down arrow keys to move between results, Enter to open one, and Escape to close.

Type to search.

Settings

Appearance

Interface density

Your record

Your progress is stored in this browser and nowhere else: an identifier, the answers you have given, the mastery states and review schedule derived from them, and the lesson you last opened. Clearing it makes you a new learner on this device. It cannot be undone, and it will not affect your appearance or density settings.

Focus timer

Focus--minutes remaining

Phase

Kept in this browser only, and used to label the session in your own history.

Today

Nothing recorded yet. Finish a focus session and it will appear here.

Settings

Focus sessions between long breaks.

Sessions you are aiming for in a day.

Notifications

Your history

Sessions are stored in this browser and nowhere else. They are not evidence and never reach your mastery record.