Matrix Calculator
Matrix Calculator
Matrix Calculator
Matrix A Input
row column
4 × 4
-0.433 0.749956
-0.5 14.012955999999999
0 0 0 1
Transpose Power of 2
Determinant Inverse × 3
Matrix B Input
row column
4 × 4
0 0 1 -3
0 0 0 1
Transpose Power of 2
Determinant Inverse × 3
Result
AB = 0.499956 0.866 0 -4.062132
-0.749956 0.432961896 -0.5 18.45878317
Copy To A -0.433 0.249978 0.866 -15.116176
Copy To B 0 0 0 1
Matrix addition
1 2 5 6
A= ;B=
3 4 7 8
In the above matrices, a1,1 = 1; a1,2 = 2; b1,1 = 5; b1,2
= 6; etc. We add the corresponding elements to obtain
ci,j. Adding the values in the corresponding rows and
columns:
a1,1 + b1,1 = 1 + 5 = 6 = c1,1
a1,2 + b1,2 = 2 + 6 = 8 = c1,2
a2,1 + b2,1 = 3 + 7 = 10 = c2,1
a2,2 + b2,2 = 4 + 8 = 12 = c2,2
Thus, matrix C is:
6 8
C=
10 12
Matrix subtraction
1 2 5 6
A= ;B=
3 4 7 8
a1,1 - b1,1 = 1 - 5 = -4 = c1,1
a1,2 - b1,2 = 2 - 6 = -4 = c1,2
a2,1 - b2,1 = 3 - 7 = -4 = c2,1
a2,2 - b2,2 = 4 - 8 = -4 = c2,2
Thus, matrix C is:
-4 -4
C=
-4 -4
Matrix multiplication
Scalar multiplication:
Matrices can be multiplied by a scalar value by
multiplying each element in the matrix by the scalar.
For example, given a matrix A and a scalar c:
1 2
A= ;c=5
3 4
The product of c and A is:
1 2 5 10
5× =
3 4 15 20
Matrix-matrix multiplication:
Multiplying two (or more) matrices is more involved
than multiplying by a scalar. In order to multiply two
matrices, the number of columns in the first matrix
must match the number of rows in the second matrix.
For example, you can multiply a 2 × 3 matrix by a 3 × 4
matrix, but not a 2 × 3 matrix by a 4 × 3.
Can be multiplied:
Cannot be multiplied:
5 6 1 1
1 2 1
A= ;B= 7 8 1 1
3 4 1
1 1 1 1
When multiplying two matrices, the resulting matrix will
have the same number of rows as the first matrix, in
this case A, and the same number of columns as the
second matrix, B. Since A is 2 × 3 and B is 3 × 4, C
will be a 2 × 4 matrix. The colors here can help
determine first, whether two matrices can be
multiplied, and second, the dimensions of the resulting
matrix. Next, we can determine the element values of
C by performing the dot products of each row and
column, as shown below:
20 23 4 4
C=
44 51 8 8
Below, the calculation of the dot product for each row
and column of C is shown:
c1,1 = 1×5 + 2×7 + 1×1 = 20
c1,2 = 1×6 + 2×8 + 1×1 = 23
c1,3 = 1×1 + 2×1 + 1×1 = 4
c1,4 = 1×1 + 2×1 + 1×1 = 4
c2,1 = 3×5 + 4×7 + 1×1 = 44
c2,2 = 3×6 + 4×8 + 1×1 = 51
c2,3 = 3×1 + 4×1 + 1×1 = 8
c2,4 = 3×1 + 4×1 + 1×1 = 8
Power of a matrix
1 3
A=
2 1
A raised to the power of 2 is:
2
1 3
A2 =
2 1
1 3 1 3
= ×
2 1 2 1
7 6
=
4 7
Transpose of a matrix
1 3
A=
2 1
1 2
AT =
3 1
20 23 4 4
B=
44 51 8 8
20 44
23 51
BT =
4 8
4 8
Determinant of a matrix
a b
A=
c d
The determinant of A using the Leibniz formula is:
a b
|A| = = ad - bc
c d
Note that taking the determinant is typically indicated
with "| |" surrounding the given matrix. Given:
2 4
A=
6 8
2 4
|A| = = 2×8 - 4×6 = -8
6 8
Determinant of a 3 × 3 matrix:
One way to calculate the determinant of a 3 × 3 matrix
is through the use of the Laplace formula. Both the
Laplace formula and the Leibniz formula can be
represented mathematically, but involve the use of
notations and concepts that won't be discussed here.
Below is an example of how to use the Laplace
formula to compute the determinant of a 3 × 3 matrix:
a b c
|A| = d e f
g h i
e f d f d e
= a -b +c
h i g i g h
From this point, we can use the Leibniz formula for a 2
× 2 matrix to calculate the determinant of the 2 × 2
matrices, and since scalar multiplication of a matrix
just involves multiplying all values of the matrix by the
scalar, we can multiply the determinant of the 2 × 2 by
the scalar as follows:
a b c
|A| = d e f
g h i
= a(ei-fh) - b(di-fg) + c(dh-eg)
This can further be simplified to:
|A| = aei + bfg + cdh - ceg - bdi - afh
This is the Leibniz formula for a 3 × 3 matrix.
Determinant of a 4 × 4 matrix and higher:
The determinant of a 4 × 4 matrix and higher can be
computed in much the same way as that of a 3 × 3,
using the Laplace formula or the Leibniz formula. As
with the example above with 3 × 3 matrices, you may
notice a pattern that essentially allows you to "reduce"
the given matrix into a scalar multiplied by the
determinant of a matrix of reduced dimensions, i.e. a 4
× 4 being reduced to a series of scalars multiplied by 3
× 3 matrices, where each subsequent pair of scalar ×
reduced matrix has alternating positive and negative
signs (i.e. they are added or subtracted).
The process involves cycling through each element in
the first row of the matrix. Eventually, we will end up
with an expression in which each element in the first
row will be multiplied by a lower-dimension (than the
original) matrix. The elements of the lower-dimension
matrix is determined by blocking out the row and
column that the chosen scalar are a part of, and
having the remaining elements comprise the lower
dimension matrix. Refer to the example below for
clarification.
Here, we first choose element a. The elements in blue
are the scalar, a, and the elements that will be part of
the 3 × 3 matrix we need to find the determinant of:
a b c d
e f g h
|A| =
i j k l
m n o p
f g h
= a j k l - ...
n o p
Next, we choose element b:
a b c d
e g h
e f g h
b i k l
i j k l
m o p
m n o p
Continuing in the same manner for elements c and d,
and alternating the sign (+ - + - ...) of each term:
a b c d
e f g h
|A| =
i j k l
m n o p
f g h e g h e f h e f g
=a j k l -b i k l +c i j l -d i j k
n o p m o p m n p m n o
We continue the process as we would a 3 × 3 matrix
(shown above), until we have reduced the 4 × 4 matrix
to a scalar multiplied by a 2 × 2 matrix, which we can
calculate the determinant of using Leibniz's formula.
As can be seen, this gets tedious very quickly, but it is
a method that can be used for n × n matrices once you
have an understanding of the pattern. There are other
ways to compute the determinant of a matrix that can
be more efficient, but require an understanding of
other mathematical concepts and notations.
Inverse of a matrix
1 0 0 0
1 0 0
1 0 0 1 0 0
; 0 1 0 ; ...
0 1 0 0 1 0
0 0 1
0 0 0 1
The n × n identity matrix is thus:
1 0 0 ... 0
0 1 0 ... 0
In = 0 0 1 ... 0
... ... ... ... ...
0 0 0 ... 1
Inverse of a 2 × 2 matrix:
To invert a 2 × 2 matrix, the following equation can be
used:
-1
a b
A-1 =
c d
1 d -b
=
det(A) -c a
1 d -b
=
ad - bc -c a
For example, given:
2 4
A=
3 7
1 7 -4
A-1 =
2×7 - 4×3 -3 2
1 7 -4
=
2 -3 2
3.5 -2
=
-1.5 1
If you were to test that this is, in fact, the inverse of A
you would find that both:
2 4 3.5 -2 3.5 -2 2 4
× and ×
3 7 -1.5 1 -1.5 1 3 7
are equal to the identity matrix:
1 0
I=
0 1
Inverse of a 3 × 3 matrix:
The inverse of a 3 × 3 matrix is more tedious to
compute. An equation for doing so is provided below,
but will not be computed. Given:
a b c
M= d e f
g h i
T
A B C
-1 1
M =
det(M) D E F
G H I
A D G
1
= B E H
det(M)
C F I
where:
A=ei-fh; B=-(di-fg); C=dh-eg D=-(bi-ch); E=ai-cg; F=-
(ah-bg) G=bf-ce; H=-(af-cd); I=ae-bd
4 × 4 and larger get increasingly more complicated,
and there are other methods for computing them.
about us | sitemap
terms of use | privacy policy
© 2008 - 2024 calculator.net