Row and column vectors

In linear algebra, a column vector with ⁠m⁠ elements is an m×1 matrix consisting of a single column of ⁠m⁠ entries. Similarly, a row vector is a 1×n matrix, consisting of a single row of ⁠n⁠ entries. For example, ⁠𝒙⁠ is a column vector and ⁠𝒂⁠ is a row vector:

𝒙=[x1x2⋮xm],𝒂=[a1a2…an].

The transpose (indicated by T) of any row vector is a column vector, and the transpose of any column vector is a row vector: [x1x2…xm]T=[x1x2⋮xm],[x1x2⋮xm]T=[x1x2…xm]. Taking the transpose twice returns the original (row or column) vector: ⁠(𝒙T))T=𝒙⁠.

The set of all row vectors with n entries in a given field (such as the real numbers) forms an n-dimensional vector space; similarly, the set of all column vectors with m entries forms an m-dimensional vector space.

The space of row vectors with n entries can be regarded as the dual space of the space of column vectors with n entries, since any linear functional on the space of column vectors can be represented as the left-multiplication of a unique row vector.

Notation

To simplify writing column vectors in-line with other text, sometimes they are written as row vectors with the transpose operation applied to them.

𝒙=[x1x2…xm]T

Some authors also use the convention of writing both column vectors and row vectors as rows, but separating row vector elements with commas and column vector elements with semicolons (see alternative notation 2 in the table below).[citation needed ]

Row vectorColumn vector
Standard matrix notation
(array spaces, no commas, transpose signs)
[x1x2…xm] [x1x2⋮xm] or [x1x2…xm]T
Alternative notation 1
(commas, transpose signs)
[x1,x2,…,xm] [x1,x2,…,xm]T
Alternative notation 2
(commas and semicolons, no transpose signs)
[x1,x2,…,xm] [x1;x2;…;xm]

Operations

Matrix multiplication involves the action of multiplying each row vector of one matrix by each column vector of another matrix.

The dot product of two column vectors a, b, considered as elements of a coordinate space, is equal to the matrix product of the transpose of a with b,

𝐚⋅𝐛=𝐚T𝐛=[a1⋯an][b1⋮bn]=a1b1+⋯+anbn,

By the symmetry of the dot product, the dot product of two column vectors a, b is also equal to the matrix product of the transpose of b with a,

𝐛⋅𝐚=𝐛T𝐚=[b1⋯bn][a1⋮an]=a1b1+⋯+anbn.

The matrix product of a column and a row vector gives the outer product of two vectors a, b, an example of the more general tensor product. The matrix product of the column vector representation of a and the row vector representation of b gives the components of their dyadic product,

𝐚⊗𝐛=𝐚𝐛T=[a1a2a3][b1b2b3]=[a1b1a1b2a1b3a2b1a2b2a2b3a3b1a3b2a3b3],

which is the transpose of the matrix product of the column vector representation of b and the row vector representation of a,

𝐛⊗𝐚=𝐛𝐚T=[b1b2b3][a1a2a3]=[b1a1b1a2b1a3b2a1b2a2b2a3b3a1b3a2b3a3].

Matrix transformations

An n × n matrix M can represent a linear map and act on row and column vectors as the linear map's transformation matrix. For a row vector 𝐫, the product 𝐫M is another row vector 𝐫′:𝐫′=𝐫MAnother n × n matrix Q can act on 𝐫′:𝐫″=𝐫′QOne can also write 𝐫″=𝐫′Q=𝐫MQ where the matrix product transformation MQ maps 𝐫 directly to 𝐫″. Further transformations can be added to the right of previous outputs.

To apply the same transformations to a column vector 𝐜, both M and Q must be transposed:MT𝐜=𝐜′Additionally, the transformation matrix must occur on the left side of 𝐜 (otherwise the operation is undefined since the number of columns in M would not match the number of rows in 𝐜). Further transformations must be added to the left of previous outputs:QT𝐜′=𝐜″Leading to the expression 𝐜″=QTMT𝐜 for the composed output from 𝐜 input.

See also