BaseHalf
All posts

Adding two vectors means adding the matching entries

In the same BaseHalf folder, I grew a note from the opening definition in §1.2, checked the entrywise properties, and used slicing and subtraction to work Exercise 1.6.

The first two notes were already in the folder. vmls-note.md still pointed at the opening definition on printed page 3, and 01-notation.md still had the 1-based index, the stacking rule, and the overloaded 0. I opened the same Desktop folder in BaseHalf 0.6.1 and kept reading, now from printed page 11.

This is part 3 of the close reading of Boyd and Vandenberghe's Introduction to Applied Linear Algebra. I did not start a new canvas, and I did not treat addition as a new kind of object. It is an operation on the same ordered lists.

A note grown from the definition of addition

In Card Detail I went to viewer page 21, printed page 11, selected the opening definition of §1.2, and chose Grow branch, from the reader, not from the cover. The new file was vmls-note-3.md. It already listed vmls.pdf as upstream and pointed at page 21.

The selected sentences are complete this time: two vectors of the same size can be added by adding the corresponding entries, and the result is another vector of that same size, called the sum. The constraint I am keeping is the size. A 3-vector cannot be added to a 4-vector. The same symbol + is used for numbers and for vectors; which one it is depends on what stands on each side, the same kind of overloading I already had for 0.

Subtraction, and four properties I actually checked

I kept reading through printed page 12 in the same reader, then wrote what I had understood into 03-addition.md, with the book, the new Grow branch note, and the earlier notation notes as upstream.

Subtraction is the same idea with a minus sign, and the result is called the difference. I redid the book's first addition with the 1-based index from the earlier notes:

(0, 7, 3) + (1, 2, 0) = (1, 9, 3)

and the subtraction

(1, 9) − (1, 1) = (0, 8)

The book lists four properties for vectors of the same size, and then shows how to derive commutativity from the definition and from ordinary numbers commuting. I followed that argument, and I checked the others on the same 3-vector example.

If a = (0, 7, 3) and b = (1, 2, 0), then b + a is also (1, 9, 3). With c = (1, 0, 1), both (a + b) + c and a + (b + c) are (2, 9, 4), so a + b + c is unambiguous. Adding the zero vector does nothing, and that 0 has to be the zero vector of the same size as a, which is the overloading already in 01-notation.md. Finally, a − a is that same zero: (0, 7, 3) − (0, 7, 3) = (0, 0, 0).

I am not treating this as a vector space yet. I have addition, not scalar multiplication.

The first examples on printed page 12 are displacements. If a and b are displacements, a + b is the net displacement of doing a and then b, and b + a ends at the same place, which is the geometry of the commutativity I had just checked. If p is a position and a is a displacement, p + a is the new position. If p and q are two positions, p − q is the displacement from q to p. Word counts and a bill of materials are the same entrywise sum, now with a meaning. I stopped this pass before the later examples on printed pages 13 and 14.

Exercise 1.6

The attempt is in 03-exercises.md. I used only slicing from the first half of §1.1 and the subtraction I had just read. The statement stays in the book, on printed page 26.

x is an n-vector. The associated vector of differences is the (n − 1)-vector d of consecutive changes, written in the notes as d = (x_2 − x_1, …, x_n − x_{n-1}). The slice x_{2:n} is (x_2, …, x_n), and x_{1:n-1} is (x_1, …, x_{n-1}). Both have length n − 1, so they can be subtracted, and that difference is exactly d:

d = x_{2:n} − x_{1:n-1}

I checked this on a short list of my own, x = (3, 1, 4, 2). Then d should be (−2, 3, −2). The slices are (1, 4, 2) and (3, 1, 4), and (1, 4, 2) − (3, 1, 4) = (−2, 3, −2). When x is a time series, d is the period-to-period change. I did not use linear combinations or the inner product, which I have not reached yet.

I checked the formula against the definition of subtraction and the slicing rule in 01-notation.md, not against a solution key. I did not ask an agent to grade the work in this session.

The same study folder after the first half of §1.2: the book, the earlier notes, the new Grow branch note pointing at page 21, and the addition and exercise notes, with connections already in the files.

The folder is still the same work

vmls-note-3.md, 03-addition.md, and 03-exercises.md now sit in the same folder as the first definition and the examples from §1.1. If I open this window again, those notes are still there to be reread. The later meanings of the sum, and a warning about what + does not mean, are next.

This is part 3 of Learning applied linear algebra with BaseHalf, a close reading of Introduction to Applied Linear Algebra. Previous: The same kind of list can be a color, a portfolio, or a week of use. Next: The same entrywise sum can be a trade, or a market that clears.