Calculates the determinant of the matrix [[a, b], [c, d]] as ad − bc and the four entries of its inverse. When the determinant is zero there is no inverse.
Explanation
For a two by two matrix both the determinant and the inverse have short closed forms, so there is no need for elimination or any general algorithm.
A=(acbd),detA=ad−bc A−1=ad−bc1(d−c−ba) - a, b, c, d — the four entries: a and b on the top row, c and d on the bottom
- detA — the determinant, ad−bc
- A−1 — the inverse, the matrix that multiplies with A to give the identity
To build the inverse: swap a and d, flip the signs of b and c, then divide everything by the determinant.
Example
Take a=4, b=7, c=2, d=6. The determinant is
detA=4×6−7×2=24−14=10 It is not zero, so an inverse exists:
A−1=101(6−2−74)=(0.6−0.2−0.70.4) Notes
- A determinant of 0 means there is no inverse, since the formula would divide by zero. The calculator reports the matrix as singular.
- The determinant vanishes exactly when the two rows, or equivalently the two columns, are parallel, one being a multiple of the other.
- The absolute value of the determinant is the area of the parallelogram spanned by the two rows. Zero area means that parallelogram has collapsed onto a line.
- To check your work, multiply A by A−1 and confirm you land on the identity matrix (1001).