All posts
12 min read

Can you make a 3-way Venn diagram? Part 1

Quite impossible to make - or is it?


Open any Venn diagram and it is quietly lying to you. Two well centered circles with the same size - a comfortable overlap to the eye - while the real numbers behind them never match the picture.

Doesn’t that bother you? Look at this lie on the left vs an honest Venn diagram on the right:

How can we draw diagrams such that the size of every circle and every overlap is proportional to the data?

Next, what if we want that for three circles?

Let’s warm up with two circles and look at three right after.


Round 1: Normal Venn diagrams

Make each set/group a circle whose area XX equals the group’s size, so its radius rr is:

r=X/πr = \sqrt{X / \pi}

Two groups that share elements become two overlapping circles, meeting in a lens. Pull the circles apart and the lens shrinks; push them together and it grows. So if you know how big you want the overlap to be, you just need the right center-to-center distance DD.

The lens area AA between circles of radii aa and bb at distance DD is1 2 3

A=a2cos1 ⁣D2+a2b22Da+b2cos1 ⁣D2+b2a22Db12(D+a+b)(D+ab)(Da+b)(D+a+b)(1)A = a^2\cos^{-1}\!\frac{D^2+a^2-b^2}{2Da} + b^2\cos^{-1}\!\frac{D^2+b^2-a^2}{2Db} - \tfrac{1}{2}\sqrt{(-D+a+b)(D+a-b)(D-a+b)(D+a+b)}\qquad\qquad\qquad\qquad\qquad(1)
Derivation

The two circles of radius aa and bb cross along a shared chord of height 2h2h. The chord sits a distance d1d_1 from the first center and d2d_2 from the second, splitting the lens into two circular segments, such that d1+d2=Dd_1 + d_2 = D. Solve the triangular system for d1,hd_1,h knowing a,b,Da,b,D. You obtain:

d1=D2+a2b22Dd2=Dd1h=12D(D+a+b)(D+ab)(Da+b)(D+a+b)d_1 = \frac{D^2+a^2-b^2}{2D}\\ d_2 = D - d_1\\ h = \tfrac{1}{2D}\sqrt{(-D+a+b)(D+a-b)(D-a+b)(D+a+b)}

The area of each segment can be obtained by computing the area of the full arc from each circle (on a given circle of radius rr, an arc of angle θ\theta has area Aarc=θr2A_{arc} = \theta r²) and subtract the triangle between the chord and the center of each circle. The angle θ\theta for each circle can be computed as cos1cos^{-1} of the corresponding triangle sides. The formula above falls out.

Now, we want this backwards: pick the overlap AA, get DD. Algebra cannot isolate DD , so we need to solve for it numerically. A few steps of bisection or Newton’s method finds it in an instant. It is important to note that monotonicity of the function ensures the method converges (you can see this intuitively speaking, as separating the circles only ever shrinks the overlap, so exactly one distance hits your target for any valid target).

Monotonicity

Differentiate the area formula and we get:

dAdD=2h\frac{dA}{dD} = -2h

where 2h2h is the length of that shared chord. The overlap shrinks exactly as fast as the chord is long, proving the function is monotonic.

Bonus - why this is secretly Kepler's equation

Make the two circles of equal radius rr and replace D=2rcos(φ/2)D = 2r\cos(\varphi/2), where φ\varphi is the angle the chord subtends at the center. The lens area collapses to

A=r2(φsinφ)A = r^2(\varphi - \sin\varphi)

Something minus its own sine, set equal to a target: that is Kepler’s equation.

Kepler ran into it working out where a planet sits on its elliptical orbit at a given moment. His version is M=EesinEM = E - e\sin E, linking the mean anomaly MM (the fraction of the orbital period elapsed of a planet around its star) to the eccentric anomaly EE (the angular position covered by the planet), given the orbit eccentricity ee.4 The catch: sine is transcendental, so there is no closed-form way to solve for EE - in fact, astronomers spent centuries inventing numerical tricks to crank it out.4 5 Our overlap-versus-distance problem is the very same equation in disguise (the eccentricity = 1 case), which is a strange and pleasant thing to bump into while drawing circles.

We’ll add at the end a demo for you to create your own.


Round 2: The third circle - and the catch

Now add a third circle. We have 7 constraints:

  • 3 areas for each set
  • 3 pair-wise overlaps (A-B, A-C, B-C)
  • 1 triple overlap (A-B-C)

Not enough degrees of freedom. Each circle supposedly has 3 (radius + 2D position), making a total of 9 degrees of freedom (DOF). But, as you would hear in Physics, once we remove translation symmetry (2 DOF, as you can move the whole figure up-down right-left without changing anything) and rotational symmetry (1 DOF, as you can rotate the whole image around without changing anything), we end up with 3 lost degrees of freedom down to 6 DOF. In Mathematics, you would hear that without loss of generality you can pick circle A to be at the origin - fixing its 2 coordinates to (0,0)(0,0) - and circle B to be in the X-axis - fixing its coordinates to (DAB,0)(D_{AB},0) - reducing the system from 9 to 6 variables.

In short, 6 knobs and 7 regions, this means we have an over-determined system. We either give up on some constraint, or give up on our diagram. For now, let’s give up our triple middle overlap, and let the system fix it to whatever it wants to be.

Now it’s easy:

  1. the area/size of each group determines the size of each circle

  2. use equation 1 above to calculate the distances between the centers of each circle, DAB,DAC,DBCD_{AB}, D_{AC}, D_{BC}. Then DABD_{AB} uniquely determines the position of circle B, and DAC,DBCD_{AC},D_{BC} uniquely determine the position of C. If you solve the triangle for its position (xC,yC)(x_C,y_C) you get:

    xC=DAB2+DAC2DBC22DAB,yC=±DAC2xC2x_C = \frac{D_{AB}^2 + D_{AC}^2 - D_{BC}^2}{2D_{AB}}, \qquad y_C = \pm\sqrt{D_{AC}^2 - x_C^2}
    Derivation

    Write C=(xC,yC)C = (x_C, y_C). It must satisfy xC2+yC2=DAC2x_C^2 + y_C^2 = D_{AC}^2 and (xCDAB)2+yC2=DBC2(x_C - D_{AB})^2 + y_C^2 = D_{BC}^2. Subtract the second from the first: the yC2y_C^2 and the xC2x_C^2 both cancel, leaving a linear equation that hands you xCx_C directly. Put that back into the first equation to get yCy_C (take the positive or negative root if you want CC to sit above or below the A-B midline).

Once you have matched the three sizes and the three pairwise overlaps, every knob is spent, and the three-way overlap in the middle is just whatever the geometry leaves behind. You do not get to choose it, and no rearranging of circles will free it up.

Overall, you can draw a three-circle Venn that is honest about every size and every pair. The middle, though, draws itself.

How free is that middle, really?

Forget circles for a moment and just think in sets. The three-way overlap is not a fixed number at all - it can sit in a range.

The range above is an instance of the Fréchet bounds - general inequalities that constrain how much sets can overlap given only their pairwise intersections.6

It can never be larger than the smallest of the pairwise overlaps, since it lives inside all of them. And it gets pushed up from below when the pairwise overlaps are big: if AA shares a lot with both BB and CC, those two shared chunks are crammed into the same set AA and are forced to collide. Writing A,B,CA, B, C for the set sizes and AB,AC,BCAB, AC, BC for the pairwise overlaps, the middle can be anything from

max ⁣(0,  AB+ACA,  AB+BCB,  AC+BCC)\max\!\big(0,\; AB+AC-A,\; AB+BC-B,\; AC+BC-C\big)

up to min(AB,AC,BC)\min(AB,\, AC,\, BC).

Groups can land anywhere in that range. Circles cannot - they pick one value in it and freeze.


Interactive Demo 💡


The Verdict

It appears three honest circles is one wish too many. You can draw a three-circle Venn diagram that is perfectly honest about all three set sizes and all three pairwise overlaps. What you cannot pick is the patch in the very middle - the three-way overlap is decided for you the moment everything else is set.

But, still better than any tidy three-way Venn diagram you’ve been seeing around. Try it yourself in the demo above!

Conclusion: impossible to make? Not quite - just impossible with circles. Follow along for Part 2.


Sources

1 Weisstein, Circle-Circle Intersection, Wolfram MathWorld. https://mathworld.wolfram.com/Circle-CircleIntersection.html

2 Lens (geometry), Wikipedia. https://en.wikipedia.org/wiki/Lens_(geometry)

3 Weisstein, Lens, Wolfram MathWorld. https://mathworld.wolfram.com/Lens.html

4 Kepler’s equation, Wikipedia. https://en.wikipedia.org/wiki/Kepler%27s_equation

5 Weisstein, Kepler’s Equation, Wolfram MathWorld. https://mathworld.wolfram.com/KeplersEquation.html

6 Fréchet inequalities, Wikipedia. https://en.wikipedia.org/wiki/Fr%C3%A9chet_inequalities