Scalars, Vectors, and Dimensions in Linear Algebra
Learn the difference between scalars and vectors, how vector dimensions work, and why vectors represent feature data in machine learning.
1. Scalars and vectors
A scalar is a single number. Examples include , , and .
A vector is an ordered collection of numbers. It is often written as a column:
The entries of a vector are called its components. The order matters:
In geometry, a vector can represent an arrow. In data science, it can represent one item using several numerical features.
2. Dimension: how many components?
The dimension of a vector is the number of entries it contains.
- has dimension .
- has dimension .
- has dimension .
A vector with real-number components belongs to :
For example,
3. Vectors as feature lists
In machine learning, a vector commonly stores the features of one observation. For instance,
could represent three measurements, where each position has a fixed meaning:
The vector has dimension because there are three features. Every vector in a dataset must use the same feature order so that corresponding components can be compared correctly.
4. Worked example and flashcards
Worked example: Classify the object below:
- It has three entries: , , and .
- Therefore, it is a vector, not a scalar.
- Its dimension is .
- In notation, .
Quick flashcards
Check yourself
- 1.
Is a scalar or a vector?
Show the answer
It is a scalar because it is one number.
- 2.
Find the dimension of .
Show the answer
There are four components, so its dimension is . It belongs to .
- 3.
Are and the same vector?
Show the answer
No. Their components appear in different positions, so they are different vectors.
Written with Kuest's AI tutor from a study session and checked before publishing; no personal details are included. Spot a mistake? Tell us.