# Matrix B

 1 2 3 4 4 6 2 1 1 5 5 1 2 3 3 2
 -63

# Solution

A determinant is a mathematical object that associates a scalar to a [n x n] square matrix M. This scalar value can be represented by det(M) or |M|. For this solution |M| shall be used.

To find the determinant of a matrix with a size greater than [2 x 2] requires three main steps. The first step is to get the minors of the first row of matrix M and find their determinants. The second step is to get the cofactors of the first row of matrix M. The third step is to multiply the determinants of the minor matrices by the matrix cofactors.

Step 1, the minors of the first row of matrix M can be found by a process called determinant expansion by minors. A matrix minor is found by removing the row and column a minor is on, with the remaining matrix elements forming the minors of that matrix. Repeating this process for the first row in the matrix M will result in n determinants of minor matrices given matrix dimensions of [n x n].

By applying the row and column removals for each element in the first row of matrix M, the following minor matrices can be seen:
M.1 andM.2 andM.3 andM.4

 1 2 3 4 4 6 2 1 1 5 5 1 2 3 3 2

 1 2 3 4 4 6 2 1 1 5 5 1 2 3 3 2

 1 2 3 4 4 6 2 1 1 5 5 1 2 3 3 2

 1 2 3 4 4 6 2 1 1 5 5 1 2 3 3 2

The minors of matrix M are re-written below, the determinant of each minor can then be calculated by applying the same methods as described in this solution, unless a minor is of the dimensions [2 x 2], then the (a * d) - (b * c) formula would apply:
M.1 andM.2 andM.3 andM.4

 6 2 1 5 5 1 3 3 2

 4 2 1 1 5 1 2 3 2

 4 6 1 1 5 1 2 3 2

 4 6 2 1 5 5 2 3 3

To find |M.1|, which is greater than [2 x 2], the minors of the first row of matrix M.1 must be found by applying determinant expansion by minors, which will reveal the following minor matrices:
M.1.1 andM.1.2 andM.1.3

 6 2 1 5 5 1 3 3 2

 6 2 1 5 5 1 3 3 2

 6 2 1 5 5 1 3 3 2

After re-writing the minor matrices we can calculate their determinants:
M.1.1 andM.1.2 andM.1.3

 5 1 3 2

 5 1 3 2

 5 5 3 3

Find the determinant of the minor matrix M.1.1:

For a [2 x 2] matrix, the following formula is used to calculate the determinate:
If matrix M =
 a b c d
Then |M| = (a * d) - (b * c)

Therefore, to calculate the determinate for M.1.1, multiply a by b then subtract the product of b multiplied by c, which will result in:
 (5 * 2) - (1 * 3)

|M.1.1|: 7

Find the determinant of the minor matrix M.1.2:
 (5 * 2) - (1 * 3)

|M.1.2|: 7

Find the determinant of the minor matrix M.1.3:
 (5 * 3) - (5 * 3)

|M.1.3|: 0

Get cofactors by applying the following signing pattern to the matrix:

 + - + - + - + - +
applied
to
 6 2 1 5 5 1 3 3 2
=6; -2; 1

Calculate the determinant by multiplying each cofactor by a corresponding minor matrix determinant:
 (6 * 7) + (-2 * 7) + (1 * 0)

|M.1|: 28

To find |M.2|, which is greater than [2 x 2], the minors of the first row of matrix M.2 must be found by applying determinant expansion by minors, which will reveal the following minor matrices:
M.2.1 andM.2.2 andM.2.3

 4 2 1 1 5 1 2 3 2

 4 2 1 1 5 1 2 3 2

 4 2 1 1 5 1 2 3 2

After re-writing the minor matrices we can calculate their determinants:
M.2.1 andM.2.2 andM.2.3

 5 1 3 2

 1 1 2 2

 1 5 2 3

Find the determinant of the minor matrix M.2.1:
 (5 * 2) - (1 * 3)

|M.2.1|: 7

Find the determinant of the minor matrix M.2.2:
 (1 * 2) - (1 * 2)

|M.2.2|: 0

Find the determinant of the minor matrix M.2.3:
 (1 * 3) - (5 * 2)

|M.2.3|: -7

Get cofactors by applying the following signing pattern to the matrix:

 + - + - + - + - +
applied
to
 4 2 1 1 5 1 2 3 2
=4; -2; 1

Calculate the determinant by multiplying each cofactor by a corresponding minor matrix determinant:
 (4 * 7) + (-2 * 0) + (1 * -7)

|M.2|: 21

To find |M.3|, which is greater than [2 x 2], the minors of the first row of matrix M.3 must be found by applying determinant expansion by minors, which will reveal the following minor matrices:
M.3.1 andM.3.2 andM.3.3

 4 6 1 1 5 1 2 3 2

 4 6 1 1 5 1 2 3 2

 4 6 1 1 5 1 2 3 2

After re-writing the minor matrices we can calculate their determinants:
M.3.1 andM.3.2 andM.3.3

 5 1 3 2

 1 1 2 2

 1 5 2 3

Find the determinant of the minor matrix M.3.1:
 (5 * 2) - (1 * 3)

|M.3.1|: 7

Find the determinant of the minor matrix M.3.2:
 (1 * 2) - (1 * 2)

|M.3.2|: 0

Find the determinant of the minor matrix M.3.3:
 (1 * 3) - (5 * 2)

|M.3.3|: -7

Get cofactors by applying the following signing pattern to the matrix:

 + - + - + - + - +
applied
to
 4 6 1 1 5 1 2 3 2
=4; -6; 1

Calculate the determinant by multiplying each cofactor by a corresponding minor matrix determinant:
 (4 * 7) + (-6 * 0) + (1 * -7)

|M.3|: 21

To find |M.4|, which is greater than [2 x 2], the minors of the first row of matrix M.4 must be found by applying determinant expansion by minors, which will reveal the following minor matrices:
M.4.1 andM.4.2 andM.4.3

 4 6 2 1 5 5 2 3 3

 4 6 2 1 5 5 2 3 3

 4 6 2 1 5 5 2 3 3

After re-writing the minor matrices we can calculate their determinants:
M.4.1 andM.4.2 andM.4.3

 5 5 3 3

 1 5 2 3

 1 5 2 3

Find the determinant of the minor matrix M.4.1:
 (5 * 3) - (5 * 3)

|M.4.1|: 0

Find the determinant of the minor matrix M.4.2:
 (1 * 3) - (5 * 2)

|M.4.2|: -7

Find the determinant of the minor matrix M.4.3:
 (1 * 3) - (5 * 2)

|M.4.3|: -7

Get cofactors by applying the following signing pattern to the matrix:

 + - + - + - + - +
applied
to
 4 6 2 1 5 5 2 3 3
=4; -6; 2

Calculate the determinant by multiplying each cofactor by a corresponding minor matrix determinant:
 (4 * 0) + (-6 * -7) + (2 * -7)

|M.4|: 28

Step 2, the cofactors of the first row of matrix M are found by applying the following signing pattern to a corresponding element in the first row of M:

 + - + - + - + - + - + - + - + -
applied
to
 1 2 3 4 4 6 2 1 1 5 5 1 2 3 3 2
=1; -2; 3; -4

Step 3, calculate the determinant by multiplying each cofactor by its corresponding minor matrix determinant (e.g. first cofactor * |M.1|, second cofactor * |M.2|, ....) and adding the results:
 (1 * 28) + (-2 * 21) + (3 * 21) + (-4 * 28)