Sunday, July 20, 2014

Inverse of a 4x4 Matrix

In my previous post
(http://mikemstech.blogspot.com/2014/07/c-matrix-inversion-with-latex-output.html)
I demonstrated an application that can generate the steps to show the
inversion of a matrix by Gauss Jordan elimination.

In a few posts, I plan to answer the following questions:
What is the inverse of a 1x1 Matrix?
What is the inverse of a 2x2 Matrix?
What is the inverse of a 3x3 Matrix?
What is the inverse of a 4x4 Matrix?

Back to Mike's Big Data, Data Mining, and Analytics Tutorial

The inverse of a 4x4 matrix is defined as follows. For a 4x4 matrix:

$$\begin{pmatrix}a &b &c &d \\e &f &g &h \\i &j &k &l \\m &n &o &p \end{pmatrix}$$

The inverse of the matrix simplifies to:

Row 1, Column 1:

$$\frac{f k p-f l o-g j p+g l n+h j o-h k n}{p (a f k-a g j-b e k+b g i)-a f l o+a g l n+a h j o-a h k n+b e l o-b g l m-b h i o+b h k m+c (e j p-e l n-f i p+f l m+h i n-h j m)+d (-e j o+e k n+f i o-f k m-g i n+g j m)}$$

Row 1, Column 2:

$$\frac{-b k p+b l o+c j p-c l n-d j o+d k n}{p (a f k-a g j-b e k+b g i)-a f l o+a g l n+a h j o-a h k n+b e l o-b g l m-b h i o+b h k m+c (e j p-e l n-f i p+f l m+h i n-h j m)+d (-e j o+e k n+f i o-f k m-g i n+g j m)}$$

Row 1, Column 3

$$\frac{b g p-b h o-c f p+c h n+d f o-d g n}{p (a f k-a g j-b e k+b g i)-a f l o+a g l n+a h j o-a h k n+b e l o-b g l m-b h i o+b h k m+c (e j p-e l n-f i p+f l m+h i n-h j m)+d (-e j o+e k n+f i o-f k m-g i n+g j m)}$$

Row 1, Column 4

$$\frac{d g j - c h j - d f k + b h k + c f l - b g l}{b h k m - b g l m - a h k n + a g l n - b h i o + a h j o + b e l o - a f l o + d (g j m - f k m - g i n + e k n + f i o - e j o) + (b g i - a g j - b e k + a f k) p + c (-h j m + f l m + h i n - e l n - f i p + e j p)}$$

Row 2, Column 1

$$\frac{-e k p+e l o+g i p-g l m-h i o+h k m}{p (a f k-a g j-b e k+b g i)-a f l o+a g l n+a h j o-a h k n+b e l o-b g l m-b h i o+b h k m+c (e j p-e l n-f i p+f l m+h i n-h j m)+d (-e j o+e k n+f i o-f k m-g i n+g j m)}$$

Row 2, Column 2

$$\frac{-d k m + c l m + d i o - a l o - c i p + a k p}{b h k m - b g l m - a h k n + a g l n - b h i o + a h j o + b e l o - a f l o + d (g j m - f k m - g i n + e k n + f i o - e j o) + (b g i - a g j - b e k + a f k) p + c (-h j m + f l m + h i n - e l n - f i p + e j p)}$$

Row 2, Column 3

$$\frac{-a g p+a h o+c e p-c h m-d e o+d g m}{p (a f k-a g j-b e k+b g i)-a f l o+a g l n+a h j o-a h k n+b e l o-b g l m-b h i o+b h k m+c (e j p-e l n-f i p+f l m+h i n-h j m)+d (-e j o+e k n+f i o-f k m-g i n+g j m)}$$

Row 2, Column 4

$$\frac{a g l-a h k-c e l+c h i+d e k-d g i}{p (a f k-a g j-b e k+b g i)-a f l o+a g l n+a h j o-a h k n+b e l o-b g l m-b h i o+b h k m+c (e j p-e l n-f i p+f l m+h i n-h j m)+d (-e j o+e k n+f i o-f k m-g i n+g j m)}$$

Row 3, Column 1

$$\frac{e j p-e l n-f i p+f l m+h i n-h j m}{p (a f k-a g j-b e k+b g i)-a f l o+a g l n+a h j o-a h k n+b e l o-b g l m-b h i o+b h k m+c (e j p-e l n-f i p+f l m+h i n-h j m)+d (-e j o+e k n+f i o-f k m-g i n+g j m)}$$

Row 3, Column 2

$$\frac{-a j p+a l n+b i p-b l m-d i n+d j m}{p (a f k-a g j-b e k+b g i)-a f l o+a g l n+a h j o-a h k n+b e l o-b g l m-b h i o+b h k m+c (e j p-e l n-f i p+f l m+h i n-h j m)+d (-e j o+e k n+f i o-f k m-g i n+g j m)}$$

Row 3, Column 3

$$\frac{a f p-a h n-b e p+b h m+d e n-d f m}{p (a f k-a g j-b e k+b g i)-a f l o+a g l n+a h j o-a h k n+b e l o-b g l m-b h i o+b h k m+c (e j p-e l n-f i p+f l m+h i n-h j m)+d (-e j o+e k n+f i o-f k m-g i n+g j m)}$$

Row 3, Column 4

$$\frac{-a f l+a h j+b e l-b h i-d e j+d f i}{p (a f k-a g j-b e k+b g i)-a f l o+a g l n+a h j o-a h k n+b e l o-b g l m-b h i o+b h k m+c (e j p-e l n-f i p+f l m+h i n-h j m)+d (-e j o+e k n+f i o-f k m-g i n+g j m)}$$

Row 4, Column 1

$$\frac{-e j o+e k n+f i o-f k m-g i n+g j m}{p (a f k-a g j-b e k+b g i)-a f l o+a g l n+a h j o-a h k n+b e l o-b g l m-b h i o+b h k m+c (e j p-e l n-f i p+f l m+h i n-h j m)+d (-e j o+e k n+f i o-f k m-g i n+g j m)}$$

Row 4, Column 2

$$\frac{a j o-a k n-b i o+b k m+c i n-c j m}{p (a f k-a g j-b e k+b g i)-a f l o+a g l n+a h j o-a h k n+b e l o-b g l m-b h i o+b h k m+c (e j p-e l n-f i p+f l m+h i n-h j m)+d (-e j o+e k n+f i o-f k m-g i n+g j m)}$$

Row 4, Column 3

$$\frac{c f m - b g m - c e n + a g n + b e o - a f o}{b h k m - b g l m - a h k n + a g l n - b h i o + a h j o + b e l o - a f l o + d (g j m - f k m - g i n + e k n + f i o - e j o) + (b g i - a g j - b e k + a f k) p + c (-h j m + f l m + h i n - e l n - f i p + e j p)}$$

Row 4, Column 4

$$\frac{-c f i + b g i + c e j - a g j - b e k + a f k}{b h k m - b g l m - a h k n + a g l n - b h i o + a h j o + b e l o - a f l o + d (g j m - f k m - g i n + e k n + f i o - e j o) + (b g i - a g j - b e k + a f k) p + c (-h j m + f l m + h i n - e l n - f i p + e j p)}$$

Back to Mike's Big Data, Data Mining, and Analytics Tutorial