Lab Activity - 3 - Product and Inverse of A Matrix
Lab Activity - 3 - Product and Inverse of A Matrix
ACTIVITY – 3
Objective :
To multiply two matrices and find out the inverse of a matrix using Microsoft Excel.
Pre-Requisite Knowledge:
● Knowledge of Excel
● In general, aij is an element lying in the ith row and jth column. We can also call it as the (i,
j)th element of A. The number of elements in an m × n matrix is equal to mn.
● The product of two matrices A and B is defined only if the number of columns of A is
equal to the number of rows of B.
● Multiplication of Matrices :
be two matrices of order m × n and n × p respectively such that the number of columns
in A is equal to the number of rows in B. Then the product of these two matrices is
defined as m × p matrix and is given by
In A.B, matrix A is called the pre-factor and matrix B, the post – factor.
● If A is a square matrix of order m, and if there exists another square matrix B of the same
order m, such that AB = BA = I (Identity matrix), then B is called the inverse matrix of A
and is denoted by A–1. In this case, A is said to be invertible.
Material Required
Procedure :
1. In order to multiply two matrices, we shall use the MMULT function. This function will
return the matrix product of the two given matrices. The general syntax of this formula is
=MMULT (array1, array2)
where array 1 is the first matrix to be multiplied and array 2 is the second matrix to be
multiplied such that the number of columns in the first matrix is equal to the number of
rows in the second matrix.
Begin by taking any two matrices and typing them in Excel sheet, as shown in fig. 3.1.
Fig 3.1
2. Let us label the two arrays (matrices) as A and B respectively. For this, click on the top left
cell in the first array, drag the cursor to the opposite corner so as to highlight all cells in
that array and release the cursor, right click on the mouse and choose Define Name.
Fig 3.2
3. Enter the label that you wish to give to the matrix, say A.
Fig 3.3
4. Now, in order to ascertain the product of A and B, we first need to select an area on the
worksheet where we need the product to be. This area should be two cells wide and two
cells high, as by multiplying the two given matrices, we shall get a 2 × 2 matrix. This is
because the matrix A has 2 rows while matrix B has 2 columns. Let us select the cell
range 14:J5.
5. Keeping all the cells (I4 to J5) selected, type the formula =MMULT(A,B) for getting the
product and press the ctrl and shift key simultaneously and press enter. The formula
entered will change to {=MMULT(A,B)}. The product of the two matrices shall appear as
the 2 × 2 array (as shown in fig 3.4.)
(Note : After entering the formula if the ctrl and shift key are not pressed simultaneously,
the result will appear only in one cell)
Fig 3.4
6. Now, to find the inverse of a matrix, input any 3 × 3 matrix in a new Excel sheet in cell
range B2:D4 and label it as P (as explained earlier). In order to find the inverse of P, select
an array of 3 × 3 cells and type the formula =MINVERSE(P) and press shift + enter. After
entering the formula, press the ctrl and shift key simultaneously and press enter. The
formula entered will change to {=MINVERSE(P)}. The inverse of matrix P i.e., P–1 will
be displayed on the screen (as shown in fig. 3.5).
(Note : After entering the formula if the ctrl and shift key are not pressed simultaneously,
the result will appear only in one cell)
Fig 3.5
Observation:
3 − 5
2 − 5 9 − 6 − 2 , then [AB] 90 9
If A =
7 23 36 − 31
1. and B = 2×2 =
6 4
6 1 32
1 0 5 − 24 20 − 5
2. If P = 2 1 6 , then P–1 = 18 − 15 4
3 4 0 5 − 4 1
Conclusion:
We have found the product of two matrices and the inverse of a given matrix by using Microsoft
Excel.
Applications:
1. Matrix multiplication is the most important matrix operation. It is widely used in areas such
as network theory, solution of linear systems of equations, transformation of co-ordinate
systems, and population modelling.
2. Inverse of a matrix is used to solve a system of linear equations. We can write a system in
matrix form as AX = B. Now, pre-multiplying both sides by the inverse of A, we get
X = A–1B.