|
|
|
|
|
Determinant and Inverse of a 2x2 Matrix
How to Examples Exercise How to: Let's start with some 2x2 matrix, A = [a b; c d]. To find what we call the determinant of A, we find the following value: determinant = a*d - b*c Or, more generally: determinant = A(1, 1)*A(2, 2) - A(1, 2)*A(2, 1) To find the determinant of A directly, without doing the calculation ourselves: determinant = det(A) This will find the determinant of any square matrix, A. However, determinants will not be covered in more detail until Chapter 6. One thing that we use the determinant for is to test whether a matrix is invertible or not. A matrix is invertible IF AND ONLY IF its determinant DOES NOT EQUAL zero. So long as we know our determinant is non-zero, in the 2x2 matrix case, there is an easy way to find its inverse matrix: B = inv(a) = (1/(a*d - b*c))*[d -b; -c a] = (1/determinant)*[d -b; -c a] And here you can see why it is important that our determinant is non-zero, otherwise we would have undefined division. Examples: Given the matrix R = [1 4; 2 10], let's find its determinant and then its inverse matrix by the method above: determinant = 1*10 - 2*4 determinant = R(1, 1)*R(2, 2) - R(2, 1)*R(1, 2) OR determinant = det(R) MATLAB informs us that determinant = 2 in all the above methods. Now let's practice finding the inverse matrix ourself without using inv(R): B = (1/determinant)*[10 -4; -2 1] This tells us that B = [5 -2; -1 0.5], which is the same answer we would get by using inv(R). Exercise: |