Chapter 1. Vectors
第 1 章 向量
1.1 Scalars and Vectors
1.1 标量和矢量
A scalar is a single numerical quantity, most often taken from the real numbers, denoted by . Scalars are the fundamental building blocks of arithmetic: they can be added, subtracted, multiplied, and, except in the case of zero, divided. In linear algebra, scalars play the role of coefficients, scaling factors, and entries of larger structures such as vectors and matrices. They provide the weights by which more complex objects are measured and combined. A vector is an ordered collection of scalars, arranged either in a row or a column. When the scalars are real numbers, the vector is said to belong to real -dimensional space, written
标量是一个单一的数值,通常取自实数,用 表示。标量是算术的基本组成部分:它们可以进行加、减、乘和除(零除外)。在线性代数中,标量充当系数、比例因子以及向量和矩阵等更大结构中的元素。它们提供权重,用于测量和组合更复杂的对象。向量是按行或列排列的标量的有序集合。当标量为实数时,该向量被称为属于实 维空间,写为
An element of is called a vector of dimension or an n-vector. The number is called the dimension of the vector space. Thus is the space of all ordered pairs of real numbers, the space of all ordered triples, and so on.
中的一个元素称为维度为 的向量或 n 向量。数字 称为向量空间的维数。因此, 是所有有序实数对的空间, 是所有有序三元组的空间,等等。
Example 1.1.1. 例 1.1.1。
-
A 2-dimensional vector: .
二维向量: 。
-
A 3-dimensional vector: .
三维向量: 。
-
A 1-dimensional vector: , which corresponds to the scalar 7 itself.
一维向量: ,对应于标量 7 本身。
Vectors are often written vertically in column form, which emphasizes their role in matrix multiplication:
向量通常以列的形式垂直书写,这强调了它们在矩阵乘法中的作用:
The vertical layout makes the structure clearer when we consider linear combinations or multiply matrices by vectors.
当我们考虑线性组合或矩阵乘以向量时,垂直布局使结构更加清晰。
Geometric Interpretation
几何解释
In , a vector can be visualized as an arrow starting at the origin and ending at the point . Its length corresponds to the distance from the origin, and its orientation gives a direction in the plane. In , the same picture extends into three dimensions: a vector is an arrow from the origin to . Beyond three dimensions, direct visualization is no longer possible, but the algebraic rules of vectors remain identical. Even though we cannot draw a vector in , it behaves under addition, scaling, and transformation exactly as a 2- or 3-dimensional vector does. This abstract point of view is what allows linear algebra to apply to data science, physics, and machine learning, where data often lives in very high-dimensional spaces. Thus a vector may be regarded in three complementary ways:
在 中,向量 可以可视化为一个从原点 开始到点 结束的箭头。它的长度对应于与原点的距离,其方向给出了平面内的方向。在 中,同样的图像延伸到三维空间:向量是一个从原点指向 的箭头。超过三维空间后,直接可视化就不再可能,但向量的代数规则保持不变。即使我们无法在 中绘制向量,它在加法、缩放和变换下的行为与二维或三维向量完全相同。这种抽象的观点使得线性代数能够应用于数据科学、物理学和机器学习,这些领域的数据通常存在于非常高维的空间中。因此,向量可以从三个互补的角度来看待:
-
As a point in space, described by its coordinates.
作为空间中的一个点,由其坐标描述。
-
As a displacement or arrow, described by a direction and a length.
作为位移或箭头,由方向和长度描述。
-
As an abstract element of a vector space, whose properties follow algebraic rules independent of geometry.
作为向量空间的抽象元素,其属性遵循与几何无关的代数规则。
Notation
符号
-
Vectors are written in boldface lowercase letters: .
向量以粗体小写字母表示: 。
-
The i-th entry of a vector is written , where indices begin at 1.
向量 的第 i 个元素写为 ,其中索引从 1 开始。
-
The set of all n-dimensional vectors over is denoted .
上的所有 n 维向量的集合记为 。
-
Column vectors will be the default form unless otherwise stated.
除非另有说明,列向量将是默认形式。
Why begin here?
为什么从这里开始?
Scalars and vectors form the atoms of linear algebra. Every structure we will build-vector spaces, linear transformations, matrices, eigenvalues-relies on the basic notions of number and ordered collection of numbers. Once vectors are understood, we can define operations such as addition and scalar multiplication, then generalize to subspaces, bases, and coordinate systems. Eventually, this framework grows into the full theory of linear algebra, with powerful applications to geometry, computation, and data.
标量和向量构成了线性代数的原子。我们将要构建的每一个结构——向量空间、线性变换、矩阵、特征值——都依赖于数和有序数集的基本概念。一旦理解了向量,我们就可以定义诸如加法和标量乘法之类的运算,然后推广到子空间、基和坐标系。最终,这个框架将发展成为完整的线性代数理论,并在几何、计算和数据领域拥有强大的应用。
Exercises 1.1
练习 1.1
-
Write three different vectors in and sketch them as arrows from the origin. Identify their coordinates explicitly.
在 中写出三个不同的向量,并将它们画成从原点出发的箭头。明确指出它们的坐标。
-
Give an example of a vector in . Can you visualize it directly? Explain why high-dimensional visualization is challenging.
给出 中一个向量的例子。你能直接将其可视化吗?解释为什么高维可视化具有挑战性。
-
Let . Write in column form and state .
令 。将 写成列形式,并说明 .
-
In what sense is the set both a line and a vector space? Illustrate with examples.
在什么意义上集合 既是线空间又是向量空间?请举例说明。
-
Consider the vector . What is special about this vector when is large? What might it represent in applications?
考虑向量 。当 很大时,这个向量有什么特殊之处?它在应用中可能代表什么?
1.2 Vector Addition and Scalar Multiplication
1.2 向量加法和标量乘法
Vectors in linear algebra are not static objects; their power comes from the operations we can perform on them. Two fundamental operations define the structure of vector spaces: addition and scalar multiplication. These operations satisfy simple but far-reaching rules that underpin the entire subject.
线性代数中的向量并非静态对象;它们的力量源于我们可以对它们执行的运算。两个基本运算定义了向量空间的结构:加法和标量乘法。这两个运算满足一些简单却影响深远的规则,这些规则构成了整个线性代数学科的基础。
Vector Addition
向量加法
Given two vectors of the same dimension, their sum is obtained by adding corresponding entries. Formally, if
给定两个相同维度的向量,它们的和可以通过添加相应的元素来获得。形式上,如果
then their sum is
那么它们的总和是
Example 1.2.1. Let and . Then
例 1.2.1。 设 和 。则
Geometrically, vector addition corresponds to the parallelogram rule. If we draw both vectors as arrows from the origin, then placing the tail of one vector at the head of the other produces the sum. The diagonal of the parallelogram they form represents the resulting vector.
从几何学上讲,向量加法对应于平行四边形法则 。如果我们将两个向量都画成从原点出发的箭头,那么将一个向量的尾部放在另一个向量的头部,就能得到向量的和。它们构成的平行四边形的对角线代表最终的向量。
Scalar Multiplication
标量乘法
Multiplying a vector by a scalar stretches or shrinks the vector while preserving its direction, unless the scalar is negative, in which case the vector is also reversed. If and
将矢量乘以标量会拉伸或收缩矢量,同时保持其方向,除非标量 负数,在这种情况下向量也会反转。如果 和
then
然后
Example 1.2.2. Let and . Then
例 1.2.2。 设 和 。则
This corresponds to flipping the vector through the origin and doubling its length.
这相当于通过原点翻转向量并使其长度加倍。
Linear Combinations
线性组合
The interaction of addition and scalar multiplication allows us to form linear combinations. A linear combination of vectors is any vector of the form
加法和标量乘法的相互作用使我们能够形成线性组合 。向量𝑣的线性组合 1 , 𝑣 2 , … , 𝑣 𝑘 v 1 ,v 2 ,…,v k 是任意形式的向量
Linear combinations are the mechanism by which we generate new vectors from existing ones. The span of a set of vectors-the collection of all their linear combinations-will later lead us to the idea of a subspace.
线性组合是一种从现有向量生成新向量的机制。一组向量的跨度——它们所有线性组合的集合——稍后会引出子空间的概念。
Example 1.2.3. Let and . Then any vector can be expressed as
例 1.2.3。 设 和 。则任意向量 可以表示为
Thus and form the basic building blocks of the plane.
因此 和 构成了平面的基本构造块。
Notation
符号
-
Addition: means component-wise addition.
加法: 表示逐个组件的加法。
-
Scalar multiplication: scales each entry of by .
标量乘法: 将 的每个条目乘以 。
-
Linear combination: a sum of the form .
线性组合:𝑐 形式的和 1 𝑣 1 + ⋯ + 𝑐 𝑘 𝑣 𝑘 c 1 v 1 +⋯+c k v k .
Why this matters
为什么这很重要
Vector addition and scalar multiplication are the defining operations of linear algebra. They give structure to vector spaces, allow us to describe geometric phenomena like translation and scaling, and provide the foundation for solving systems of equations. Everything that follows-basis, dimension, transformations-builds on these simple but profound rules.
向量加法和标量乘法是线性代数的定义运算。它们赋予向量空间结构,使我们能够描述平移和缩放等几何现象,并为方程组的求解奠定基础。之后的一切——基、维度、变换——都建立在这些简单而深刻的规则之上。
Exercises 1.2
练习 1.2
-
Compute where and .
计算 ,其中 和 。
-
Find where . Sketch both vectors to illustrate the scaling.
求 其中 。画出两个向量的示意图,以说明缩放关系。
-
Show that can be written as a linear combination of and .
证明 可以写成 和 的线性组合。
-
Write as a linear combination of and . 将 写为 和 的线性组合。
-
Prove that if , then for scalars .
证明如果 ,则对于标量 有 。
1.3 Dot Product, Norms, and Angles
1.3 点积、范数和角
The dot product is the fundamental operation that links algebra and geometry in vector spaces. It allows us to measure lengths, compute angles, and determine orthogonality. From this single definition flow the notions of norm and angle, which give geometry to abstract vector spaces.
点积是向量空间中连接代数和几何的基本运算。它使我们能够测量长度、计算角度并确定正交性。从这个单一定义中衍生出范数和 角度 ,它为抽象向量空间提供几何形状。
The Dot Product
点积
For two vectors in , the dot product (also called the inner product) is defined by
对于 中的两个向量,点积(也称为内积)定义为
Equivalently, in matrix notation:
等效地,用矩阵表示法表示:
Example 1.3.1. Let and . Then
例 1.3.1。 设 和 。则
The dot product outputs a single scalar, not another vector.
点积输出单个标量,而不是另一个向量。
Norms (Length of a Vector)
范数(向量的长度)
The Euclidean norm of a vector is the square root of its dot product with itself:
向量的欧几里得范数是其与自身的点积的平方根:
This generalizes the Pythagorean theorem to arbitrary dimensions.
这将勾股定理推广到任意维度。
Example 1.3.2. For ,
例 1.3.2。 对于 ,
This is exactly the length of the vector as an arrow in the plane.
这正是平面中箭头所指的矢量的长度。
Angles Between Vectors
向量之间的角度
The dot product also encodes the angle between two vectors. For nonzero vectors ,
点积也编码了两个向量之间的角度。对于非零向量 ,
where is the angle between them. Thus,
其中 是它们之间的角度。因此,
Example 1.3.3. Let and . Then
例 1.3.3。 设 和 。则
Hence
因此
The vectors are perpendicular.
这些向量是垂直的。
Orthogonality
正交性
Two vectors are said to be orthogonal if their dot product is zero:
如果两个向量的点积为零,则称它们正交:
Orthogonality generalizes the idea of perpendicularity from geometry to higher dimensions.
正交性将垂直性的概念从几何学推广到更高维度。
Notation
符号
-
Dot product: .
点积: 。
-
Norm (length): .
规范(长度): 。
-
Orthogonality: if .
正交性:如果为 ,则为 。
Why this matters
为什么这很重要
The dot product turns vector spaces into geometric objects: vectors gain lengths, angles, and notions of perpendicularity. This foundation will later support the study of orthogonal projections, Gram–Schmidt orthogonalization, eigenvectors, and least squares problems.
点积将向量空间转化为几何对象:向量获得长度、角度和垂直度的概念。这一基础将为后续的正交投影、格拉姆-施密特正交化、特征向量和最小二乘问题的研究奠定基础。
Exercises 1.3
练习 1.3
-
Compute for , .
计算 、 的 。
-
Find the norm of .
求出 的范数。
-
Determine whether and are orthogonal.
确定 和 是否正交。
-
Let , . Compute the angle between them.
令 , 。计算它们之间的角度。
-
Prove that . This identity is the algebraic version of the Law of Cosines.
证明 。这个恒等式是余弦定理的代数形式。
1.4 Orthogonality
1.4 正交性
Orthogonality captures the notion of perpendicularity in vector spaces. It is one of the most important geometric ideas in linear algebra, allowing us to decompose vectors, define projections, and construct special bases with elegant properties.
正交性捕捉了向量空间中垂直性的概念。它是线性代数中最重要的几何概念之一,它使我们能够分解向量、定义投影,并构造具有优雅性质的特殊基。
Definition
定义
Two vectors are said to be orthogonal if their dot product is zero:
如果两个向量 的点积为零,则称它们正交:
This condition ensures that the angle between them is radians (90 degrees).
此条件确保它们之间的角度为 弧度(90 度)。
Example 1.4.1. In , the vectors and are orthogonal since
例 1.4.1。 在 中,向量 和 是正交的,因为
Orthogonal Sets
正交集
A collection of vectors is called orthogonal if every distinct pair of vectors in the set is orthogonal. If, in addition, each vector has norm 1, the set is called orthonormal.
如果一组向量中每对不同的向量都是正交的,则称该集合为正交向量。此外,如果每个向量的范数均为 1,则该集合称为标准正交向量集。
Example 1.4.2. In , the standard basis vectors
例 1.4.2。 在 中,标准基向量
form an orthonormal set: each has length 1, and their dot products vanish when the indices differ.
形成一个正交集:每个集的长度为 1,并且当索引不同时,它们的点积消失。
Projections
预测
Orthogonality makes possible the decomposition of a vector into two components: one parallel to another vector, and one orthogonal to it. Given a nonzero vector and any vector , the projection of onto is
正交性使得将一个向量分解为两个分量成为可能:一个与另一个向量平行,另一个 与其正交。给定一个非零向量 和任意向量 ,则 的投影 到 是
The difference
区别
is orthogonal to . Thus every vector can be decomposed uniquely into a parallel and perpendicular part with respect to another vector.
与 正交。因此,每个向量都可以唯一地分解为相对于另一个向量平行和垂直的部分。
Example 1.4.3. Let , . Then
例 1.4.3。 令 , 。然后
Thus 因此
where is parallel to and is orthogonal to it.
其中 与 平行, 与 正交。
Orthogonal Decomposition
正交分解
In general, if and , then
一般来说,如果 和 ,那么
where the first term is parallel to and the second term is orthogonal. This decomposition underlies methods such as least squares approximation and the Gram–Schmidt process.
其中第一项平行于 ,第二项正交。这种分解是最小二乘近似和格拉姆-施密特过程等方法的基础。
Notation
符号
-
: vectors and are orthogonal.
:向量 和 正交。
-
An orthogonal set: vectors pairwise orthogonal.
正交集:向量两两正交。
-
An orthonormal set: pairwise orthogonal, each of norm 1.
正交集:两两正交,每组范数为 1。
Why this matters
为什么这很重要
Orthogonality gives structure to vector spaces. It provides a way to separate independent directions cleanly, simplify computations, and minimize errors in approximations. Many powerful algorithms in numerical linear algebra and data science (QR decomposition, least squares regression, PCA) rely on orthogonality.
正交性赋予向量空间结构。它提供了一种清晰地分离独立方向、简化计算并最小化近似误差的方法。数值线性代数和数据科学中许多强大的算法(例如 QR 分解、最小二乘回归、主成分分析)都依赖于正交性。
Exercises 1.4
练习 1.4
-
Verify that the vectors and are orthogonal.
验证向量 和 是否正交。
-
Find the projection of onto .
找到 到 的投影。
-
Show that any two distinct standard basis vectors in are orthogonal.
证明 中的任意两个不同的标准基向量都是正交的。
-
Decompose into components parallel and orthogonal to .
将 分解为与 平行且正交的分量。
-
Let be orthogonal nonzero vectors. (a) Show that (b) For what condition on and does ?
令 为正交非零向量。
(a)证明
(b) 对 和 满足什么条件?