4.2: Vectors
- Page ID
- 9969
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)For our purposes, a vector is a collection of real numbers in a one- dimensional array.1 We usually think of the array as being arranged in a column and write
\[x = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ | \\ x_n \end{bmatrix} \nonumber \]
Notice that we indicate a vector with boldface and the constituent elements with subscripts. A real number by itself is called a scalar, in distinction from a vector or a matrix. We say that \(x\) is an n-vector, meaning that \(x\) has \(n\) elements. To indicate that \(x_1\) is a real number, we write
\[x_1 \;∈ \;\mathbb{R} \nonumber \]
meaning that \(x_1\) is contained in \(\mathbb{R}\), the set of real numbers. To indicate that \(x\) is a vector of \(n\) real numbers, we write
\[x\;∈\;\mathbb{R}^n \nonumber \]
meaning that \(x\) is contained in \(R^n\), the set of real n-tuples. Geometrically, \(R^n\) is n-dimensional space, and the notation \(x\;∈\;\mathbb{R}^n\) means that \(x\) is a point in that space, specified by the \(n\) coordinates \(x_1,x_2,...,x_n\). The figure shows a vector in \(R^3\), drawn as an arrow from the origin to the point \(x\). Our geometric intuition begins to fail above three dimensions, but the linear algebra is completely general.
We sometimes find it useful to sketch vectors with more than three dimensions in the same way as the three-dimensional vector of the figure. We then consider each axis to represent more than one dimension, a hyperplane, in our n-dimensional space. We cannot show all the details of what is happening in n-space on a three-dimensional figure, but we can often show important features and gain geometrical insight.
Vector Addition
Vectors with the same number of elements can be added and subtracted in a very natural way:
\[x+y = \begin{bmatrix} x_1+y_1 \\ x_2+y_2 \\ x_3+y_3 \\ | \\ x_n+y_n \end{bmatrix}; x−y = \begin{bmatrix} x_1−y_1 \\ x_2−y_2 \\ x_3−y_3 \\ | \\ x_n−y_n \end{bmatrix} \nonumber \]
Exercise \(\PageIndex{1}\)
The difference between the vector \(x=\begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix}\) and the vector \(y=\begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}\) is the vector \(z=x−y=\begin{bmatrix} 1 \\ 1 \\ 0 \end{bmatrix}\). These vectors are illustrated in the Figure. You can see that this result is consistent with the definition of vector subtraction in the Equation. You can also picture the subtraction in the Figure by mentally reversing the direction of vector \(y\) to get \(−y\) and then adding it to \(x\) by sliding it to the position where its tail coincides with the head of vector \(x\). (The head is the end with the arrow.) When you slide a vector to a new position for adding to another vector, you must not change its length or direction.
Exercise \(\PageIndex{2}\)
Compute and plot x+y and x−y for each of the following cases:
- \(x=\begin{bmatrix}1\\3\\2\end{bmatrix},y=\begin{bmatrix}1\\2\\3\end{bmatrix}\)
- \(x=\begin{bmatrix}−1\\3\\−2\end{bmatrix},y=\begin{bmatrix}1\\2\\3\end{bmatrix}\)
- \(x=\begin{bmatrix}1\\−3\\2\end{bmatrix},y=\begin{bmatrix}1\\3\\2\end{bmatrix}\)
Scalar Product
Several different kinds of vector multiplication are defined.2 We begin with the scalar product. Scalar multiplication is defined for scalar \(a\) and vector \(x\) as
\[ax=\begin{bmatrix}ax_1 \\ ax_2 \\ ax_3 \\ | \\ ax_n\end{bmatrix} \nonumber \]
If \(|a|<1\), then the vector \(ax\) is "shorter" than the vector \(x\); if \(|a|>1\), then the vector \(ax\) is ‚"longer" than \(x\). This is illustrated for a 2-vector in the Figure.
Exercise \(\PageIndex{3}\)
Compute and plot the scalar product ax when \(x=\begin{bmatrix}1 \\ 1/2 \\ l/4 \end{bmatrix}\) for each of the following scalars:
- \(a=1\)
- \(a=−1\)
- \(a=−1/4\)
- \(a=2\)
Exercise \(\PageIndex{4}\)
Given vectors \(x,y,z∈\mathbb{R}^n\) and the scalar \(a∈\mathbb{R}\), prove the following identities:
- \(x+y=y+x\). Is vector addition commutative?
- \((x+y)+z=x+(y+z)\). Is vector addition associative?
- \(a(x+y)=ax+ay\). Is scalar multiplication distributive over vector addition?
Footnotes
- In a formal development of linear algebra, the abstract concept of a vector space plays a fundamental role. We will leave such concepts to a complete course in linear algebra and introduce only the functional techniques necessary to solve the problems at hand.
- The division of two vectors is undefined, although three different “divisions” are defined in MATLAB.