Vectors

Treat a vector as an ordered list, compute a weighted score with a dot product in Python, add and scale vectors, and see what a Euclidean norm measures.

Suppose a tiny model describes a study session with two numbers: hours spent reading and exercises attempted. One session might be [2, 3]. The order matters: [3, 2] describes a different session.

This ordered collection is a vector . We'll call it x. In this example x₁ = 2 and x₂ = 3; the subscripts select entries. These are chosen teaching numbers, not a claim about how learning should be scored.

Give the entries different weights

Choose a second vector w = [4, 1]. Multiply corresponding entries and add the products:

The dot symbol names the dot product . Each weight says how strongly its input contributes to this particular score.

Predict: Keep w fixed. Which change adds more to the score: one more reading hour, or one more attempted exercise?

We can calculate the score without a special library:

Both lists have two entries here. In general, check equal lengths: Python's zip stops at the shorter list, which could silently leave out an input.

Change the whole vector

Adding [1, 2] to x means adding corresponding entries: [2 + 1, 3 + 2] = [3, 5]. Multiplying x by the scalar 2 scales every entry, producing [4, 6]. A scalar is a single number.

Now double x but keep w fixed. Predict the new score before expanding the dot product.

If you draw [2, 3] as an arrow from (0, 0) to (2, 3), its ordinary Euclidean length is √(2² + 3²) = √13. This is its norm , written ‖x‖. In our study-session data, however, hours and counts have different units. A geometric length is a calculation we chose, not automatically a meaningful measure of effort.