The AM-GM inequality (arithmetic mean-geometric mean) states that for nonnegative real numbers \(x_i\), we have
\(\displaystyle \frac{1}{n} \sum_{i=1}^n x_i \geq \sqrt[n]{\prod_{i=1}^n x_i}\)
with equality iff all \(x_i\) are equal. The LHS is the arithmetic mean (commonly referred to as simply the “average”) and the RHS is the geometric mean. This inequality is useful because it gives a way to relate sums of numbers with their products.
In this article, we’ll take a look at an interesting connection between the 3-variable AM-GM inequality and the determinant of a particular matrix. We’ll see this connection also reveals when AM-GM holds for negative numbers, and it can be used to produce stronger versions of the inequality.
(Note on sources: the 3-variable factorization and determinant are “folklore” which I learned back in my math competition days. The remaining results are my own, although I don’t claim to be the first to have derived them.)
Factorization through determinants
The 3-variable AM-GM inequality is:
\(\displaystyle \frac{a+b+c}{3} \geq \sqrt[3]{abc}\)
If we collect terms on one side,
\(\displaystyle a + b + c – 3\sqrt[3]{abc} \geq 0 \ \ \ \ \ (1)\)
There’s a surprising way to factorize this, which we will demonstrate in this section. A nice way to arrive at this factorization is to look at the determinant:
\(\displaystyle \begin{vmatrix}x&y&z\\z&x&y\\y&z&x\end{vmatrix} = x^3+y^3+z^3-3xyz \ \ \ \ \ (2)\)
Notice that the RHS of (2) is the same as the LHS of (1) after substituting \(x = \sqrt[3]a\), etc.
Let’s take advantage of the properties of the determinant. First, adding one row to another leaves the determinant unchanged. Let’s add the second and third rows to the first:
\(\displaystyle \begin{vmatrix}x&y&z\\z&x&y\\y&z&x\end{vmatrix} = \begin{vmatrix}x+y+z&x+y+z&x+y+z\\z&x&y\\y&z&x\end{vmatrix}\)
Another property of determinants is that we can factor out scalar multiples of the rows. So, let’s factor out x+y+z from the first row:
\(\displaystyle = (x+y+z) \begin{vmatrix} 1&1&1\\z&x&y\\y&z&x\end{vmatrix}\)
Expand the remaining determinant and write as sum-of-squares:
\(\displaystyle = (x+y+z)(x^2+y^2+z^2-xy-yz-xz)\)
\(\displaystyle = \frac{1}{2}(x+y+z)((x^2-2xy+y^2)+(y^2-2yz+z^2)+(z^2-2xz+x^2))\)
\(\displaystyle = \frac{1}{2}(x+y+z)((x-y)^2+(y-z)^2+(z-x)^2)\)
Thus we have discovered the factorization
\(\displaystyle x^3+y^3+z^3-3xyz = \frac{1}{2}(x+y+z)((x-y)^2+(y-z)^2+(z-x)^2)\)
Clearly \((x-y)^2+(y-z)^2+(z-x)^ 2\geq 0\). If we assume our variables are non-negative, then \(x+y+z\geq 0\) as well. Altogether,
\(\displaystyle x^3+y^3+z^3-3xyz \geq 0\)
If we substitute \(x = \sqrt[3]a\), etc., then we recover the 3-variable AM-GM inequality given by (1).
Furthermore, this factorization easily implies the equality conditions. We have equality iff
\(\displaystyle \frac{1}{2}(x+y+z)((x-y)^2+(y-z)^2+(z-x)^2) = 0\)
So, either
- x+y+z=0, which (assuming positive variables) is equivalent to x=y=z=0
- Or, \((x-y)^2+(y-z)^2+(z-x)^2=0\), iff x=y=z
Therefore, we have equality iff x=y=z.
Extending AM-GM(3)
We’ve established the factorization of the AM-GM difference:
\(\displaystyle \frac{a+b+c}{3}-\sqrt[3]{abc} = \frac{1}{2}\left(\sqrt[3]a + \sqrt[3]b + \sqrt[3]c\right)\left((\sqrt[3]a – \sqrt[3]b)^2 + (\sqrt[3]b – \sqrt[3]c)^2 + (\sqrt[3]c – \sqrt[3]a)^2\right)\)
Let’s use this factorization to extend and sharpen the AM-GM inequality. The second factor is clearly always nonnegative. So, the AM-GM inequality holds whenever the first factor is nonnegative, giving us the generalization:
AM-GM(3) extended to negative reals: When a, b, and c are real numbers, possibly negative, the 3-variable AM-GM inequality
\(\displaystyle \frac{a+b+c}{3} \geq \sqrt[3]{abc}\)
holds iff either \(a=b=c\) or \(\sqrt[3]a + \sqrt[3]b + \sqrt[3]c \geq 0\). Equality occurs iff \(a=b=c\) or \(\sqrt[3]a + \sqrt[3]b + \sqrt[3]c = 0\).
We can also sharpen the AM-GM inequality for positive reals by shrinking the factors while preserving nonnegativity. For example, the factor \(\sqrt[3]a + \sqrt[3]b + \sqrt[3]c\) can be shrunk by applying the AM-GM inequality itself:
\(\displaystyle \sqrt[3]a + \sqrt[3]b + \sqrt[3]c – 3\sqrt[9]{abc} \geq 0\)
Thus,
\(\displaystyle \left(\sqrt[3]a + \sqrt[3]b + \sqrt[3]c – 3\sqrt[9]{abc}\right)\left((\sqrt[3]a – \sqrt[3]b)^2 + (\sqrt[3]b – \sqrt[3]c)^2 + (\sqrt[3]c – \sqrt[3]a)^2\right) \geq 0\)
Expanding this gives a messy but stunning inequality:
AM-GM(3) sharpened: For nonnegative reals a, b, and c, we have
\(\displaystyle \frac{a+b+c}{3} \geq \sqrt[3]{abc} + \frac{1}{2}\sqrt[9]{abc}\left((\sqrt[3]a – \sqrt[3]b)^2 + (\sqrt[3]b – \sqrt[3]c)^2 + (\sqrt[3]c – \sqrt[3]a)^2\right)\)
Equality occurs iff \(x=y=z\).
Circulant matrix determinants
It’s not a coincidence that the highly symmetric matrix of (2) had a determinant with a nice factorization. In fact, this is a specific instance of the properties of circulant matrices.
Let’s go further with our factorization of the determinant. Let \(\omega = \frac{1}{2}(-1+i\sqrt{3})\) be a primitive third root of unity, thus \(\omega^3 = 1\). To exploit the circular symmetry of our matrix, the trick is to apply the Fourier transformation:
\(\displaystyle \begin{vmatrix}1&1&1\\1&\omega&\omega^2\\1&\omega^2&\omega\end{vmatrix} \begin{vmatrix}x&y&z\\z&x&y\\y&z&x\end{vmatrix} \begin{vmatrix}1&1&1\\1&\omega^2&\omega\\1&\omega&\omega^2\end{vmatrix} = \begin{vmatrix}x+y+z&x+y+z&x+y+z\\x+\omega^2y+\omega z&\omega x + y + \omega^2z&\omega^2x+\omega y+z\\x+\omega y + \omega^2z&\omega^2x+y+\omega z&\omega x + \omega^2 y + z\end{vmatrix} \begin{vmatrix}1&1&1\\1&\omega^2&\omega\\1&\omega&\omega^2\end{vmatrix}\)
\(\displaystyle = \begin{vmatrix} 3x+3y+3z&(1+\omega+\omega^2)(x+y+z)&(1+\omega+\omega^2)(x+y+z)\\(1+\omega+\omega^2)(x+y+z) & 3x+3\omega^2y+3\omega z &(1+\omega+\omega^2)(x+y+z)\\(1+\omega+\omega^2)(x+y+z) & (1+\omega+\omega^2)(x+y+z) & 3x+3\omega y+3\omega^2 z \end{vmatrix}\)
We have \(1+\omega+\omega^2=0\), so we’re left with a diagonal matrix:
\(\displaystyle = \begin{vmatrix} 3x+3y+3z&0&0\\0 & 3x+3\omega^2y+3\omega z &0\\0 & 0 & 3x+3\omega y+3\omega^2 z \end{vmatrix}\)
The determinant of a diagonal matrix is the product of the diagonal elements:
\(\displaystyle = 3^3(x+y+z)(x+\omega y + \omega^2z)(x+\omega^2y+\omega z)\)
To finish up, we need the determinants of the original Fourier transformation matrices:
\(\displaystyle \begin{vmatrix}1&1&1\\1&\omega&\omega^2\\1&\omega^2&\omega\end{vmatrix}=-\begin{vmatrix}1&1&1\\1&\omega^2&\omega\\1&\omega&\omega^2\end{vmatrix}= 3\omega^2-3\omega = -3\sqrt{3}i\)
We cancel out those two determinants and are left with the factorization:
\(\displaystyle \begin{vmatrix}x&y&z\\z&x&y\\y&z&x\end{vmatrix} =(x+y+z)(x+\omega y + \omega^2z)(x+\omega^2y + \omega z)\)
We have the relationship that \(\omega = \overline{\omega^2}\), where \(\overline{c}\) is complex conjugation. Therefore, when \(x, y, z\) are real,
\(\displaystyle x+\omega^2 y + \omega z = \overline{x+\omega y + \omega^2 z}\)
This allows us to relate our second and third factors:
\(\displaystyle \begin{vmatrix}x&y&z\\z&x&y\\y&z&x\end{vmatrix} =(x+y+z)(x+\omega y + \omega^2z)\overline{(x+\omega y + \omega^2z)}\)
\(\displaystyle =(x+y+z)|x+\omega y + \omega^2z|^2\)
In the previous section, we had to write \(x^2+y^2+z^2-xy-yz-xz\) as a sum of squares to prove it was positive. With this factorization, we see it can also be written as \(|x+\omega y + \omega^2z|^2\), giving another proof that this factor is always positive.
More variables
The natural next question to ask is, does this technique extend to more variables? In particular, if a circulant matrix has nonnegative entries, is its determinant nonnegative, and does it relate to the AM-GM inequality?
Hopefully it’s not surprising that the formula for the determinant of a circulant matrix generalizes. Let n be the number of variables (also the number of rows and columns of our matrix) and let \(\zeta\) be a primitive nth root of unity. Let \(x_i\), i=0 to n-1, be our variables, such that the first row of the circulant matrix is \([x_0, x_1, \ldots, x_{n-1}]\). Then the determinant is
\(\displaystyle \det = \prod_{i=0}^{n-1} \sum_{j=0}^{n-1} \zeta^{ij} x_j\)
Is the determinant always positive if the \(x_i\) are? No, for n even, it’s easy to find counterexamples. For instance,
\(\displaystyle \begin{vmatrix} 1&2\\2&1 \end{vmatrix} = -3\)
Larger even n also have counterexamples. However, for n odd, we will prove the following lemma:
Sufficient conditions for nonnegative determinant: For odd n, the circulant matrix with first row \([x_0, x_1, \ldots, x_{n-1}]\), with \(x_i\) real, has nonnegative determinant if the sum of the \(x_i\) is nonnegative.
To prove this, we’ll use the same trick we did for the n=3 case: pair off factors that are complex conjugates. Since \(\zeta^i = \overline{\zeta^{n-i}}\), we have
\(\displaystyle \det = \left(\sum_{j=0}^{n-1} x_j\right) \prod_{i=1}^{n-1} \sum_{j=0}^{n-1} \zeta^{ij} x_j\)
\(\displaystyle = \left(\sum_{j=0}^{n-1} x_j\right) \prod_{i=1}^{(n-1)/2} \left(\sum_{j=0}^{n-1} \zeta^{ij} x_j\right) \overline{\left( \sum_{j=0}^{n-1} \zeta^{ij} x_j \right)}\)
\(\displaystyle = \left(\sum_{j=0}^{n-1} x_j\right) \prod_{i=1}^{(n-1)/2} \left|\sum_{j=0}^{n-1} \zeta^{ij} x_j\right|^2\)
Now it’s clear all the factors are nonnegative if the sum of the \(x_i\) is, too, which proves the lemma.
To answer our final question, how does this determinant relate to AM-GM? We’ve already seen that for n=3, we get the AM-GM inequality. For n=1, we get the trivial 1-variable AM-GM inequality. However, for n=5, there are more terms. Let’s take a look at what we can get from it.
Five variables
Before expanding out the 5×5 determinant, we’ll introduce some notation to simplify the presentation. Let \(C_5\) be the set of cyclic permutations on the numbers (0, 1, 2, 3, 4), and let \(S_5\) be all the permutations. Define the cyclic and symmetric sums as:
\(\displaystyle \sum_\textbf{cyc} f(x_0, x_1, x_2, x_3, x_4) = \sum_{\sigma \in C_5} f(x_{\sigma(0)}, x_{\sigma(1)}, x_{\sigma(2)}, x_{\sigma(3)}, x_{\sigma(4)})\)
\(\displaystyle \sum_\textbf{sym} f(x_0, x_1, x_2, x_3, x_4) = \sum_{\sigma \in S_5} f(x_{\sigma(0)}, x_{\sigma(1)}, x_{\sigma(2)}, x_{\sigma(3)}, x_{\sigma(4)})\)
Then the 5×5 circulant determinant is:
\(\displaystyle \begin{vmatrix} x_0& x_1& x_2& x_3& x_4 \\ x_4&x_0& x_1& x_2& x_3\\ x_3&x_4&x_0& x_1& x_2\\x_2&x_3&x_4&x_0& x_1\\ x_1&x_2&x_3&x_4&x_0\end{vmatrix} = \sum_\textbf{cyc} x_0^5 – 5x_0^3(x_1x_4 + x_2x_3) + 5x_0(x_1^2x_4^2 + x_2^2x_3^2) – x_0x_1x_2x_3x_4\)
To establish full symmetry (rather than just cyclic symmetry), we’ll sum over all permutations of the variables:
\(\displaystyle \sum_\textbf{sym} \begin{vmatrix} x_0& x_1& x_2& x_3& x_4 \\ x_4&x_0& x_1& x_2& x_3\\ x_3&x_4&x_0& x_1& x_2\\x_2&x_3&x_4&x_0& x_1\\ x_1&x_2&x_3&x_4&x_0\end{vmatrix}\)
\(\displaystyle = 5 \sum_\textbf{sym} x_0^5 – 5x_0^3(x_1x_4 + x_2x_3) + 5x_0(x_1^2x_4^2 + x_2^2x_3^2) – x_0x_1x_2x_3x_4\)
\(\displaystyle = 5 \sum_\textbf{sym} x_0^5 – 10x_0^3x_1x_2 + 10x_0^2x_1^2x_2 – x_0x_1x_2x_3x_4\)
This has all the terms of AM-GM plus some extras. As per the results of the previous section, this is nonnegative if \(\sum x_i \geq 0\). Hence,
\(\displaystyle \sum_\textbf{sym} x_0^5 – 10x_0^3x_1x_2 + 10x_0^2x_1^2x_2 – x_0x_1x_2x_3x_4 \geq 0\)
Dividing by 120, we may state an extension of AM-GM as follows:
AM-GM(5) extended to negative reals: If \(\sum x_i \geq 0\), then
\(\displaystyle \frac{x_0^5+x_1^5+x_2^5+x_3^5+x_4^5}{5} \geq x_0x_1x_2x_3x_4 + C\)
where
\(\displaystyle C = \frac{1}{12} \sum_\textbf{sym} x_0^3x_1x_2 – x_0^2x_1^2x_2\)
Next, we’ll show that the quantity C is positive if the \(x_i\) are. To prove this, we can use 2-variable AM-GM:
\(\displaystyle \frac{x_0^3x_1x_2 + x_0x_1^3x_2}{2} \geq \sqrt{x_0^4x_1^4x_2^2} = x_0^2x_1^2x_2\)
Take the symmetric sum:
\(\displaystyle \sum_\textbf{sym} \frac{x_0^3x_1x_2 + x_0x_1^3x_2}{2} \geq \sum_\textbf{sym} x_0^2x_1^2x_2\)
Simplifying gives:
\(\displaystyle \sum_\textbf{sym} x_0^3x_1x_2 – x_0^2x_1^2x_2 \geq 0\)
Therefore, we have proven:
AM-GM(5) sharpened: For nonnegative reals \(x_i\), we have
\(\displaystyle \frac{x_0^5+x_1^5+x_2^5+x_3^5+x_4^5}{5} \geq x_0x_1x_2x_3x_4 + C\)
where
\(\displaystyle C = \frac{1}{12} \sum_\textbf{sym} x_0^3x_1x_2 – x_0^2x_1^2x_2\)
Furthermore, \(C \geq 0\).