Connexions

You are here: Home » Content » Matrix Arithmetic
Content Actions

Matrix Arithmetic

Module by: Melissa Selik, Richard Baraniuk

Summary: Describes basic matrix operations.

Matrix Addition

Given two m × n × m n matrices AA and BB, we define the sum to be the new m × n × m n matrix C = A + B C A B , where each entry, c i j c i j , is the sum of a i j a i j and b i j b i j .
a 1 1 a 1 2 a 1 n a 2 1 a 2 2 a 2 n a m 1 a m 2 a m n + b 1 1 b 1 2 b 1 n b 2 1 b 2 2 b 2 n b m 1 b m 2 b m n = a 1 1 + b 1 1 a 1 2 + b 1 2 a 1 n + b 1 n a 2 1 + b 2 1 a 2 2 + b 2 2 a 2 n + b 2 n a m 1 + b m 1 a m 2 + b m 2 a m n + b m n a 1 1 a 1 2 a 1 n a 2 1 a 2 2 a 2 n a m 1 a m 2 a m n b 1 1 b 1 2 b 1 n b 2 1 b 2 2 b 2 n b m 1 b m 2 b m n a 1 1 b 1 1 a 1 2 b 1 2 a 1 n b 1 n a 2 1 b 2 1 a 2 2 b 2 2 a 2 n b 2 n a m 1 b m 1 a m 2 b m 2 a m n b m n (1)
Example 1 
-1 7 9 4 5 2 2 2 0 + 3 2 4 3 1 8 -1 5 -2 = 2 9 13 7 6 10 1 7 -2 -1 7 9 4 5 2 2 2 0 3 2 4 3 1 8 -1 5 -2 2 9 13 7 6 10 1 7 -2

Scalar Multiplication

Given an m × n × m n matrix AA and a scalar kk, we define the product to be the m × n × m n matrix BB where b i j = k a i j b i j k a i j .
k a 1 1 a 1 2 a 1 n a 2 1 a 2 2 a 2 n a m 1 a m 2 a m n = k a 1 1 k a 1 2 k a 1 n k a 2 1 k a 2 2 k a 2 n k a m 1 k a m 2 k a m n k a 1 1 a 1 2 a 1 n a 2 1 a 2 2 a 2 n a m 1 a m 2 a m n k a 1 1 k a 1 2 k a 1 n k a 2 1 k a 2 2 k a 2 n k a m 1 k a m 2 k a m n (2)
Example 2 
-7 2 3 9 -11 3 -4 -1 -2 7 = -14 -21 -81 77 -21 28 7 14 -49 -7 2 3 9 -11 3 -4 -1 -2 7 -14 -21 -81 77 -21 28 7 14 -49

Matrix Multiplication

Given an m × n × m n matrix AA and an n × p × n p matrix BB we define the product C = A B C A B to be the m × p × m p matrix with entries given by c i j = k = 1 n a i k b k j c i j k 1 n a i k b k j This is also called the dot product of the iith row of AA and the jjth column of BB. This process can be described as simultaneously walking across each row of AA, column of BB pair, multiplying corresponding entries and adding them together.
This definition carries with it several properties:
  • The inner dimensions of the matrices being multiplied must agree. This is to say that AA must have as many columns as BB has rows.
  • Matrix multiplication does not commute (ie A B B A A B B A . In fact, this "reverse" operation may not even be defined since the inner dimensions will not necessarily agree.
  • An m × n × m n matrix AA defines a mapping from n n to m m . This can be seen by "premultiplying" an n × 1 × n 1 column vector xx by AA (i.e. A x A x ). The result of this can be shown to be an m × 1 × m 1 column vector. Thus the matrix A A mapped a length-nn vector to a length-mm vector.
Example 3 
-1 7 9 4 5 2 2 2 0 3 2 4 3 1 8 -1 5 -2 = 9 50 34 25 23 52 12 6 24 -1 7 9 4 5 2 2 2 0 3 2 4 3 1 8 -1 5 -2 9 50 34 25 23 52 12 6 24

Transposition

There are two forms of transposition, the standard transpose (denoted by a superscript TT) and the Hermetian or Conjugate transpose (denoted by a superscript HH or **). For matrices defined over the field of real numbers, these operations are exactly equivalent. However, for matrices defined over the field of complex numbers, the Hermetian transpose is found by taking the complex conjugate of each entry of the standard transpose.
Transposition of a matrix AA, results in a matrix A T A where a i j T= a j i a i j a j i This can also be viewed as converting the columns of AA to rows of A T A and vice versa or as reflecting the matrix AA across its main diagonal.
Note that the transposition of an m × n × m n matrix yields an n × m × n m matrix.
Example 4 
Original Matrix A =3+22+1-3+7-5+43-29+0 A 32 21 -37 -54 3-2 90 (3)
Standard Transpose A T=3+2-5+42+13-2-3+79+0 A 32 -54 21 3-2 -37 90 (4)
Hermetian or Conjugate Transpose AH=3-2-5-42-13+2-3-79-0 A 3-2 -5-4 2-1 32 -3-7 9-0 (5)

Comments, questions, feedback, criticisms?

Send feedback