Linear Algebra I · Vectors, matrix products, and linear combinations

Prerequisites: signed arithmetic, fractions, coordinates, and the previous lesson on linear systems. No calculus is required. Goals: calculate with column vectors, interpret Ax as a weighted sum of columns, check matrix dimensions, multiply matrices, and explain why a target may be unreachable. Suggested study: read the definitions, trace the diagram, redo the examples without looking, complete the lab and practice, then take the assessment.

Vectors, scalars, and linear combinations

A column vector in ℝⁿ is an ordered list of n real components. We write (a,b) for the column [a;b] in this lesson. A scalar is a real number. Add vectors of the same size component by component, and multiply every component by a scalar: (a,b)+(c,d)=(a+c,b+d), and s(a,b)=(sa,sb). The zero vector has all components zero. Negative scaling reverses direction; zero scaling gives the zero vector. A coordinate arrow can move parallel to itself without changing its components.

A linear combination s₁v₁+⋯+sₙvₙ scales given vectors and adds them. Its coefficients may be positive, negative, or zero; they need not sum to one. The span of the given vectors is the set of every such combination. A nonzero vector alone spans a line through the origin; two nonparallel vectors in ℝ² span the plane. Parallel vectors still only reach a line. The next lesson will formalize span and independence.

0xy2u+ vv=(2,1)(4,−1)2u + v = (4,−1)
Original diagram: u=(1,−1), v=(2,1). Follow 2u and then a translated copy of v. The direct arrow ends at the same sum (4,−1). Dashed v shows that translating a vector preserves its components.

Matrix–vector multiplication: rows and columns

An m×n matrix A has m rows and n columns; entry aᵢⱼ is in row i, column j. The product Ax requires x to have n components and returns m components. Row i gives (Ax)ᵢ=∑ⱼ aᵢⱼxⱼ. Equivalently, if a₁,…,aₙ are the columns of A, then Ax=x₁a₁+⋯+xₙaₙ. These are two ways of computing the same vector. Do not multiply corresponding entries as though Ax were an elementwise product.

Reason: component i of the column sum is aᵢ₁x₁+⋯+aᵢₙxₙ, exactly the row formula. Consequently solving Ax=b asks which column weights produce b. If b is outside the span of the columns, the system has no solution. Distributing each finite sum also proves A(sx+ty)=sAx+tAy whenever x,y have n components and s,t are real. This is the algebraic superposition property of this model.

Matrix products and order

For A of size m×n and B of size n×p, AB has size m×p. Its jth column is A times the jth column of B, and (AB)ᵢⱼ=∑ₖ aᵢₖbₖⱼ. The inside sizes must match. When acting on a vector, ABx means apply B first and A second: A(Bx)=(AB)x. The identity matrix I leaves a vector unchanged. In general AB≠BA, even when both products exist.

Worked examples

  1. Column picture and solving: let A=[1 2; −1 1], with columns u=(1,−1), v=(2,1). For x=(2,1), row arithmetic gives Ax=(2+2,−2+1)=(4,−1). Column arithmetic gives 2u+v=(2,−2)+(2,1)=(4,−1). Conversely Ax=(4,−1) gives s+2t=4 and −s+t=−1. Adding yields 3t=3, so t=1 and s=2.
  2. Rectangular example: C=[1 0 −2; 3 1 1] is 2×3 and x=(2,−1,3) has three components. Thus Cx=(2−6,6−1+3)=(−4,8). Its column calculation is 2(1,3)−(0,1)+3(−2,1)=(−4,8). A two-component input would be incompatible, even though the output has two components.
  3. Unreachable target: D=[1 2; 2 4] has columns v and 2v, where v=(1,2). Every output is (s+2t)v, so its second component is twice its first. Target (3,6) is reachable, for example with (s,t)=(3,0); target (3,7) is not. This geometric condition agrees with elimination giving 0=1.
  4. Order matters: P=[1 2; 0 1], Q=[1 0; 3 1]. Row-by-column multiplication gives PQ=[7 2; 3 1] but QP=[1 2; 3 7]. On e₁=(1,0), the outputs are respectively (7,3) and (1,3). Both products exist, but reversing the order changes the result.

Common mistakes and modeling conditions

Keep component order and column weights fixed; a vector’s coefficient is not its coordinate index. Addition needs equal dimensions. Check product dimensions before arithmetic and preserve multiplication order. For physical quantities, each row must add terms with compatible units; matrix entries may carry units converting inputs to outputs. Superposition describes a linear model only: saturation, offsets, and nonlinear devices can invalidate it. This unit does not claim that every physical circuit is linear.

Practice

  1. Warm-up: for u=(2,−1), v=(−1,3), calculate 3u−2v.
  2. Dimensions: A is 3×2, B is 2×4, and x has four components. Which of AB, BA, Bx, and Ax exist? Give their sizes.
  3. Use the lab matrix A=[1 2; −1 1]. Find weights producing b=(1,2). Then check by both row and column calculations.
  4. Challenge: characterize every reachable target for columns (2,−1) and (−4,2). Is (6,−3) reachable? Is (6,3)?
Fully worked solutions
  1. 3u=(6,−3) and 2v=(−2,6). Subtract componentwise: (6−(−2),−3−6)=(8,−9).
  2. AB exists and is 3×4 since the inside sizes are 2. BA is undefined: 4≠3. Bx exists and has two components. Ax is undefined: A expects two input components, not four.
  3. Solve s+2t=1, −s+t=2. Adding gives 3t=3, so t=1, s=−1. Rows give (−1+2,1+1)=(1,2). Columns give −(1,−1)+(2,1)=(1,2).
  4. The second column is −2 times the first, so every output is (s−2t)(2,−1). Targets (a,b) satisfy a+2b=0. Thus (6,−3)=3(2,−1) is reachable, while (6,3) violates the condition.

Assessment · Open book · 16 points

Open book: use books, lesson notes, cited readings, calculators, and relevant free software. Explain your own reasoning, assumptions, units, and checks; identify references or software you use. Attempt the questions before opening the answer key. Suggested study time: 40–60 minutes; this is a self-study guide, not a timed restriction.

  1. For A=[2 −1; 1 3], calculate A(1,2) by rows and by columns. (3)
  2. A is 2×3 and B is 3×1. Give the size of AB and decide whether BA exists. Explain. (2)
  3. For D=[1 3; 2 6], decide whether (2,5) is reachable. Prove your answer. (2)
  4. For P and Q in worked example 4, calculate (PQ)e₂ and (QP)e₂ with e₂=(0,1). What does this demonstrate? (3)

Application and reasoning · 6 points

A linear map sends e₁ to (1,2) and e₂ to (2,4). Construct its matrix (2). Characterize every reachable output and test (3,6),(3,5) (2). Exhibit distinct inputs with the same output and explain why no inverse on ℝ² can exist (2).

Complete answer key and scoring rubric
  1. Rows: (2−2,1+6)=(0,7) (1). Columns: (2,1)+2(−1,3)=(0,7) (1). Correctly matching each weight to its column earns 1.
  2. AB is 2×1 (1). BA is undefined because inside sizes 1 and 2 differ (1).
  3. Every output is (s+3t)(1,2), whose second coordinate doubles the first (1). Since 5≠2·2, (2,5) is unreachable (1).
  4. (PQ)e₂ is the second column (2,1) (1); (QP)e₂=(2,7) (1). Therefore matrix multiplication is not generally commutative (1).

Application and reasoning · 6 points

A=[1 2;2 4], with basis images as columns (2). Every output is (s+2t)(1,2); (3,6) is reachable and (3,5) is not (1 characterization, 1 both tests). Inputs (2,0),(0,1) both give (2,4), so an inverse could not select a unique input (1 example, 1 reasoning).

Scoring: existing questions 10 + application problem 6 = 16 points. Award the stated method and reasoning marks, not only final answers.

Download the column-combination lab

Download the Python lab · Exact column and row calculations

Objective: verify that row and column views agree for A=[1 2; −1 1], including negative, zero, and fractional weights. Install free Python 3 for Windows, macOS, or Linux from the official link below. Save the file, open a terminal in its folder, and run the commands. Windows users can replace python3 with py -3. After installation it runs offline, uses only the standard library, and needs no account or paid tool. Arguments are s and t; enter fractions as 1/2, not decimal commas.

python3 ee-vectors.py 2 1
python3 ee-vectors.py -1 1
python3 ee-vectors.py 0 0
python3 ee-vectors.py 1/2 -1

Procedure: predict each scaled column and sum on paper; run each command; compare row and column outputs; then repeat the inputs in the browser lab. Expected outputs are (4,−1), (1,2), (0,0), and (−3/2,−3/2). Explain why zero input produces zero output, and why negating both weights negates the output. Answers: every component is a sum of scalar multiples; multiplying every weight by −1 factors a −1 from that sum. This verifies the model, not physical sensor calibration or circuit construction.

Free primary readings and software

Read the column-picture discussion first, then the multiplication summary. The freely available lecture summaries, videos, and exercises are sufficient; purchasing the suggested textbook is not required.

Column-combination lab · Two ways to compute Ax

Compare weighted columns with row arithmetic for A=[1 2; −1 1].

Free tool built into this page. Use it in your browser without an account or download.

Procedure

Predict the scaled columns and output. Try (s,t)=(2,1), (−1,1), (0,0), and (0.5,−1), then compare with the downloaded Python lab. Negate both weights: why does the output reverse?

Expected results and answer check

Outputs are (4,−1), (1,2), (0,0), and (−1.5,−1.5). Row and column calculations agree. Zero weights produce the zero vector; negating both weights multiplies each output component by −1.

The browser allows half-unit weights for this fixed matrix; Python also accepts exact rational weights such as 1/3. These are ideal algebraic calculations, not a test of real sensor noise, saturation, or hardware skills.