NOW LET US – AI RAG SaaS Studio TP.HCM
NOW LET US
Digital Product Studio
Back to news
DEV-TOOLS...7 min read

The Shape of Inequalities

Share
NOW LET US Article – The Shape of Inequalities

Explore the deep connection between algebra and geometry by visualizing classic inequalities like HM-AM-GM-QM, turning abstract formulas into intuitive geometric shapes.

The Shape of Inequalities

... beneath a ð Waning Crescent *

…symmetry isn’t just a preference for “pretty” shapes.

Introduction

While I was randomly browsing the web, I came across this nice picture:

And it tickled my imagination a little, just enough to write this short post.

After writing my previous handout article regarding inequalities, I wanted to see if I could find ways to represent inequalities in a geometrical way (you know, classic circles, triangles, squares, cubes, rectangular prisms and the like). So I’ve been digging and improvising, and I’ve come up with some animations to help people get a geometrical intuition of things that are mostly studied in algebra and analysis.

Some of the animations are standard and are taught in the right kind of schools, but others have some originality. For those, I actually developed the ideas using pen, paper, and my own imagination. If somebody else already did that, it’s fine; I am not a fool to claim “real” originality when it comes to basic mathematics. The roads were already very circulated in the last 2000 years.

The HM-AM-GM-QM Inequality

This is the most popular inequality chain we encounter during our school years. To remind you of it, in case you’ve forgotten, the simple version for three numbers $a, b, c > 0$ is:

Or, in the even simpler two-variable case:

To decode the “alphabet soup,” here is what those letters actually stand for:

HM = Harmonic Mean

: Even if it sounds counterintuitive to an untrained eye, this mean appears in the very laws encoded in our universe. For example, if you go from point $A$ to point $B$ with a speed of $v_1$ and come back with a speed of $v_2$, what is your average speed? A bad student would say $v_{\text{avg}}=\frac{v_1+v_2}{2}$, but a good student would know it is actually the harmonic mean: $v_{\text{avg}} = \frac{2}{\frac{1}{v_1} + \frac{1}{v_2}}$. - GM = Geometric Mean

: The “growth” mean, useful for scaling and compounding. Much like the HM, this one appears in nature and in… simple finance. For example, if you are a stock investor and in the first year your portfolio grows by100%

, but the next year the market crashes by50%

, what was youraverage growth?- An investor bad at math would say: $\frac{100 + (-50)}{2} = 25%$.

  • A good investor would look at the growth factors: in the first year, the factor is $2.0$; in the second, it is $0.5$. Then it would average everything down like this: $ \text{Average Growth Factor} = \sqrt{2.0 \times 0.5} = 1.0$

  • This means your average growth is actually $0%$. You ended up exactly where you started, which, let’s be honest, is already better than most traders.

AM = Arithmetic Mean

: The classic average everyone knows and loves. Okay, maybeloveis a strong word for anaveragemath formula. - QM = Quadratic Mean:

Also known as theRoot Mean Square (RMS)appears in electrical engineering for example.- In Europe, the voltage is labeled as 230V. But this is not the actual averagevoltage people think. The actual value is determined with theRMS.

  • In Europe, the voltage is labeled as 230V. But this is not the actual

Now that things are clearer, let’s look at this inequality chain with a geometric eye. It’s amazing to see how things come to life.

The two circles

The first animation is actually the one I found in the picture.

We are given a large circle with center $O$ and a diameter $a$, meaning the radius is $R = \frac{a}{2}$. Then, there is another smaller circle with center $O’$ touching the first circle’s circumference from the outside. This second circle has a diameter $b$, so its radius is $r = \frac{b}{2}$. If we project the center of the smaller circle $O’$ onto the vertical line passing through $O$, we name that projected point $P$.

A right triangle $OPO’$ is formed with the following lengths:

  • The hypotenuse $OO’$ is the sum of the radii: $\frac{a}{2} + \frac{b}{2} = \frac{a+b}{2}$.
  • The horizontal leg $OP$ is the difference of the radii: $\frac{a}{2} - \frac{b}{2} = \frac{a-b}{2}$.
  • The vertical leg $O’P$.

To compute $O’P$, we just apply Pythagoras’s theorem:

$OO’$ is the AM

for $a$ and $b$, while $O’P$ is the GM

for $a$ and $b$. Notice how the GM

(a leg) is always smaller than the AM

(the hypotenuse). In the one particular case where the circles are the same size ($a=b$), the leg $OP$ becomes zero, and the GM

coincides with the AM

. Lovely!

The Semicircle

This is the “classroom” strategy, the visual I was taught in school.

We start with a semicircle with center $O$ and a total diameter of $a + b$. We pick a point $P$ on the circumference and project it down onto the diameter at point $P’$. This forms a right triangle $POP’$ (the letters were conveniently chosen so the visual “pops”).

In this triangle:

  • The horizontal leg is $OP’ = \frac{|a - b|}{2}$.
  • The hypotenuse $OP$ is the radius, which is half the diameter: $OP = \frac{a+b}{2}$.

We need to compute the vertical segment $PP’$, and for this, we are going to use Pythagoras’s theorem:

In essence, weâre looking at the same idea as before, just through a different “mechanic.” We take a diameter of length $a + b$ and split it into two segments, $a$ and $b$.

As you move the separator in the animation, itâs easy to see the machinery at work: the blue line (GM

=$PP’$) is always trapped inside the circle, so it can never be taller than the red radius (AM

=$OP$). They only hit the same height at the very top, when $a = b$.

Now, to complicate things further, let’s add the QM

(Quadratic Mean) into the picture. To do this, we will have to:

  • Draw a radius $OM$ that is perpendicular to our diameter $a+b$. Since $OM$ is a radius, we know $OM = \frac{a+b}{2}$.
  • Connect points $M$ and $P’$ with a new segment.

By looking at the visual, we can see a new right triangle ($MOP’$) is formed, with its two legs being:

  • $OM = \frac{a+b}{2}$
  • $OP’ = \frac{|a-b|}{2}$

To compute the hypotenuse $MP’$, we simply apply Pythagoras again:

We observe now that $MP’$ plays the role of the QM

of $a$ and $b$. Because $MP’$ is the hypotenuse and $OM$ (the radius/AM) is just a leg, the QM

will always be bigger than the radius, unless $a=b$. In that specific case, $P’$ moves to the center $O$, the leg $OP’$ vanishes, and we get QM = AM

.

And finally, let’s not forget about the HM

. This is the most subtle of them all. To make it “appear,” let’s project the point $P’$ onto the segment $OP$. We will call this new projection point $N$.

To compute $PN$, which is the actual HM

, we use the properties of the right triangle $OPP’$. Since $PN$ is a segment on the hypotenuse formed by the altitude from the right angle (wait, actually, we use the area or similarity here!), the math works out beautifully:

Weâve done it! We have the whole “alphabet soup” chain packed into one single semicircle:

  • $PN$ is the HM

(the small segment) - $PP’$ is the GM

(the vertical altitude) - $OP$ is the AM

(the radius) - $MP’$ is the QM

(the big hypotenuse)

Itâs easy to see the hierarchy now. Unless $a=b$, the segments will always stay in their lane: $PN < PP’ < OP < MP’$. Everything is connected. Again, lovely!

The Container

This is not a proof of the AM-GM inequality, but rather a beautiful consequence of it.

The idea for this visual came to me because I recently solved the problem “Container With Most Water”. That coding problem isn’t strictly related to the inequality, but the concept of a container holding water rang a bell…

Think of a container $ABCD$ which is a square. The side of the square is $AB = \frac{a+b}{2}$. This means the area of our square is $\text{Area}_{ABCD} = \left(\frac{a+b}{2}\right)^2$.

Now, let’s introduce a second container: a rectangle $A’B’C’D’$ where the width $A’B’ = a$ and the height $A’D’ = b$. We consider the sum $a+b$ to be fixed, but we start morphing the rectangular container, meaning when we take something from $b$, we put it back into $a$

© 2026 Now Let Us. All rights reserved.

Source: Hacker News

Advertisement
Ad slot ready: 5887729102

More in this category

EXPLORE TOPICS

Discover All Categories

Deep dive into the specific technology sectors that matter most to you.