TubeSum ← Transcribe a video

How Many Holes Does This Mug Have?

0h 14m video Published Nov 18, 2025 Transcribed Jul 28, 2026 Stand-up Maths Stand-up Maths
Intermediate 8 min read For: Math enthusiasts with basic knowledge of topology or graph theory.
AI Trust Score 75/100
⚠️ Average / Some Fluff

"Delivers on the promise — a clear answer with solid mathematical reasoning and visual aids."

AI Summary

This video explores the topology of a specialized mug with multiple holes, using it to solve the classic utilities puzzle. Matt and James demonstrate how the mug's genus (number of holes) relates to graph theory and map coloring, culminating in formulas for required holes and colors on different surfaces.

[00:31]
The Mug with a Hole

James and Matt discuss a mug with a hole (topologically a torus) that allows solving the utilities puzzle, which is impossible on a flat surface.

[00:45]
Utilities Puzzle on Flat Surface

The puzzle requires connecting three utilities to three houses without crossing lines; it's proven impossible on a plane.

[02:01]
Solving on a Torus

A toroidal surface (like a doughnut or mug with handle) enables a solution by routing pipes through the hole and around the back.

[03:07]
Mug as a Doughnut

Topologically, a mug is equivalent to a doughnut (genus 1) because the handle creates a hole; the coffee cavity is just a dent.

[04:30]
Counting Holes on the New Mug

The new mug has more than one hole; discussion ensues about how many holes it has (ultimately genus 3).

[05:17]
Topological Transformation

Animations show how the mug can be deformed into a disc with three holes, confirming its genus-3 topology.

[08:06]
Formula for Required Holes

For n houses and m utilities, the required genus is given by ceil((n-2)*(m-2)/4). Example: 5 houses and 5 utilities need 3 holes.

[10:12]
Map Coloring on Surfaces

On a genus-g surface, the maximum number of colors needed is floor((7+sqrt(1+48g))/2). For a standard mug (g=1), it's 7 colors.

[12:55]
Extreme Genus Examples

With 100 colors, you can color maps on surfaces from genus 776 to 792. The formulas show many possible genus values yield the same color number.

[13:45]
Practicality and Fun

The mugs are available for purchase; viewers can also try with blank mugs and whiteboard markers.

Topology provides elegant formulas linking graphs and surfaces, and these mugs make abstract concepts tangible.

Mentioned in this Video

Study Flashcards (6)

What is the genus of a standard coffee mug?

easy Click to reveal answer

1 (one hole from the handle).

03:07

How many holes does the 'mug with a hole' have?

medium Click to reveal answer

3 (genus 3).

05:17

What is the formula for the required genus to embed a complete bipartite graph K_{n,m}?

hard Click to reveal answer

ceil((n-2)*(m-2)/4).

08:06

How many colors are needed to color any map on a torus?

medium Click to reveal answer

7.

10:43

What is the Heawood number for a surface of genus g?

hard Click to reveal answer

floor((7+sqrt(1+48g))/2).

11:43

Can 5 houses and 5 utilities be connected on a standard mug?

medium Click to reveal answer

No, it requires a genus-3 surface.

08:06

💡 Key Takeaways

📊

Impossible on a plane

Classic puzzle proves graph non-planarity; sets up need for higher genus surfaces.

00:45
💡

Mug equals doughnut

Clear topological equivalence between everyday object and mathematical surface.

03:07
🔧

Formula for holes

Provides a concrete mathematical tool to determine required genus for bipartite graphs.

08:06
📊

7 colors on torus

Extension of four-color theorem to higher genus surfaces; surprising jump from 4 to 7.

10:43
💡

100 colors for genus 776

Demonstrates scalability and fun extreme cases of the Heawood formula.

12:55

[00:00] [Matt] I don't think we could possibly improve on this calibre of maths-mug. [James] I think there is one way that we can improve our mug. [Matt] Mug with a hole!

[00:12] [Death-metal music plays] #We put a hole into this mug. Mug with a hole, hole in a mug# [SUM Theme]

[00:31] That was when James and I were here, many years ago, talking about this mug with a hole. Which is a very mathematically and topologically interesting object, which James was very excited about.

[00:45] First, we need to deal with the original, utilities puzzle. And the reason is if you're trying to solve this puzzle on a piece of paper,

[00:59] There is a fantastic 3Blue1Brown video about it. [Grant] Here's the thing about the puzzle, if you try it on a piece of paper, you're gonna have a bad time. So, the challenge is, can I link all 3 of these utilities up to all 3 of the houses?

[01:19] I'm complete stuck when I try to run the gas pipeline, because this house here is completely surrounded by this barrier. So no matter what I do, I can run it to the other ones, I can get it, er, all the way up to that one.

[01:36] Oh no, wait, I can sneak it in here - here it is, I can run that one, phew! But I, absolutely, cannot run the gas to that house, there;

[01:48] because this is absolutely impossible on a flat surface. It is, however, possible on a "doughnut" or a "toroidal" surface. So we have, uh, a, uh, a exact recreation of the mug.

[02:01] Um-um, Producer Nicole was able to put that together. Um, the houses are the same size, just some of them are closer. Er, now, because unlike the flat plain, where there's no way to get the pipes to cross,

[02:19] Because here, what you can do is you can send one pipe up the top and instead of it going, So if I had one pipe coming up, so the green's on the right and I had the red on the left,

[02:36] 'cos the red, I can send all the way, like, all the way around like that, and under. Whereas, this one here, I can send it down an then out the other side and up over here.

[02:52] So, because of the global topology of the surface, it is solvable. And what James Grime realised is that, famously, a mug is a doughnut; or, at least, it is topologically equivalent to a doughnut because it has a hole in it.

[03:07] Not the hole where the coffee goes, that's just a dent, it's got an actual hole over here. And, because it's a glazed surface, and that's the original one we made a short run of. Now, this is like the commercial one, which I was drinking coffee out of a second ago.

[03:21] So you can use whiteboard markers and you can try and solve it. and another pipe over the handle, it can be solved.

[03:35] So, I love this mug so much because it's like capitalising on the "mug is a doughnut" thing. You can just get, like, any blank mug, get some whiteboard markers and you can try and solve it.

[03:47] But for me I love this object. Which is why you may have noticed, in a lot of my videos, throughout now many years. Ok, you can see what I'm doing on the side...

[04:01] A truncated icosahedron... Hello and welcome to The Maths Show... 5 degrees...

[04:16] Fifty-times... But now, there's a new mug in town and when James first made these, I had a few questions. [Shopping channel music plays][Matt] First of all, how many holes does this mug have?

[04:30] [Matt] Yeah, because it, there-there's still the handle one over here. [Matt] No one turn any of this into a .gif. [Matt] And, 'cos there's like a tube, there, so it-does that.

[04:45] [James] Yeah, I, do you know when I first saw this kind of mug before. Was it 2, was it 3, was it 2.5, is this like a perforated torus?

[05:01] [James] So th-this is, this is how you solve it, ok, this is how you imagine it. [Matt] Ok, yeah. [James] Right, now let's start with a bridge,

[05:17] [Matt] 1 hole. Now I'm going to take my clay pancake and sort of fold it up into a mug shape. [James] And I'm drill a hole now through...

[05:32] [James] 2 holes. Add a handle to it. [Matt] A mug with 3 holes. [Death-metal music plays] #We put a hole into this mug. Mug with a hole, hole in a mug#

[05:50] Don't worry if you found past-James's discussions about pancakes a little hard to follow. You really need to kind-of be able to see it happening to properly get your head around it. And I was inspired by the classic animation, we just got this off Wikipedia,

[06:06] And, for me, that really helps clarify exactly what's going on. I thought I'd try and do an equivalent for the Mug-With-A-Hole.

[06:19] I'm not able to do good 3D renders, so I thought I'd ask a few of my friends to help out. So, she does VFX for films and is hugely overqualified for this task.

[06:34] I asked her, very nicely to animate it and she came up with this fantastic animation. You still have to watch it a couple of times to track the bit, like the under the bridge bit becoming a tube.

[06:48] And then she's made the whole thing a little bit transparent so you can see the tube move around. You can convince yourself that yes, the mug with a hole is equivalent to a disc with 3 holes in it.

[07:04] Erm, I should say for completeness, the other friends who got back to me when I did a call-out. And they said they had an excellent way to demonstrate, erm, this becoming a doughnut with 3 holes in it.

[07:23] [SUM Theme] [Rob] You're a pretzel. [James] 5 houses, 5 utilities, we've got 25 lines.

[07:39] [James] Right, so compare that with the classic mug, here. No, 25 lines, so it can be done, yeah, I've definitely done this before.

[07:52] Right, because you've got to go through the middle hole. But then you've got to go in and under it. [Matt] Could we have done 5 utilities with fewer holes?

[08:06] [James] So absolutely not, no. So you need 3 holes to solve this problem for 5 utilities. Now, if we'd done 4 utilities, 4 houses; that, in fact, can be solved with a 1 hole mug.

[08:22] If you've got one of these classic mugs, ok, make it harder. Ok, we're just going to draw in an extra house, we'll have an extra utility there.

[08:34] [James] And we can still solve this, on the classic mug, with 4 houses, 4 utilities. But, if you want to go up a step; you do want to go up a step, 5 houses, 5 utilities.

[08:46] [Matt] But James, how will I know for any number of utilities, how many holes my mug will require? [James] There is a formula for that. [James] There is, there is a formula, check out this formula.

[09:01] [Shopping channel music plays] The question a lot of people have now is why is there an equation for working out how many holes a mug has to have to be able to put a utilities puzzle on it?

[09:18] And it's because this is actually a whole other, interesting and serious bit of mathematics. We're trying to link graphs, oh what people often call "networks". Which is what we are using this to force you to try to do, draw a planar network.

[09:32] And what genus surface those graphs can be drawn on, or embedded into, And genus is just how many holes does the surface have.

[09:45] This doughnut is genus 1, single hole. This surface, on the mug here, is genus 3. And so what these are doing is just saying what genus do you need to be able to have

[10:00] a graph that links "n"-points to all of "m"-points, but none of th-the 2 sets connect to themselves. This is actually called a "Complete, Bi-Partite Graph".

[10:12] you could have different numbers of houses, different numbers down here. And it's a very interesting, worthwhile bit of mathematics to investigate how these sort of networks behave And I enjoy them so much, you may have noticed a mug over here I've not been talking about.

[10:30] which, on a flat surface, if you divide it up into regions and you want to have them all different colours, You have to have, er, 4; 4 or fewer.

[10:43] But that's only for a flat surface, genus-0, eugh. Whereas, genus-1 you might need 7 colours. Which is why I designed this mug to show, on a doughnut, it's possible to force 7 different colours.

[11:01] And every single region touches all 6 other regions, to show that this is a colouring-in pattern that forces you to use 7 colours.

[11:13] I will put the design in the description below if you'd like to make your own one of these. And I think it's really interesting that the 4-Colour Problem on a flat map, But, if we want to combine it all together.

[11:30] How many colours would you need to colour in any conceivable map on a genus-3 mug. New equation.

[11:43] where you round up to the nearest whole number. You've not got to round down to the nearest whole number. And this is subtly different because this equation,

[11:56] you put in the number of the 2 sets of nodes on your graph and it will tell you what genus you need. This is the other way around, you put in the genus you've got, and it will tell you the maximum of colours you might need to colour any conceivable map or,

[12:12] you know, collection of contacting regions on that surface. And, for a standard mug, you put 1 in there and this gives you 7. If you had genus-2, 2-handles, this would give you 8.

[12:28] And if you were to put in 3, for our friend here, it would give you 9. So technically, if you have one these mugs, you can divide it up into 9 regions,

[12:40] such that every single region contacts all 8 other regions. Or potentially, you can definitely do it such that it will force you to need 9 colours. Subtly different, I do not want to accidently state something that's not completely precise.

[12:55] And why stop there? Let's say you had a mug with 6 holes, you'd need 12 colours. Because both of these involve rounding, you can have multiple values that go in and give you the same output.

[13:11] Indeed, if you had 100 different colours at your disposal, that would do everything from a mug with 776 handles right up to a mug with 792 handles.

[13:27] Now that's a mug with a lot of holes, we didn't do a new version of the-the song for that. So that's it with mugs with holes in them, or different numbers of handles. Or, depending on if we can find a supplier, toroidal balloons.

[13:45] Occasionally we're like the world's only stockist of toroidal balloons, they're real hard to come by. If we have any, they'll be on the website, erm, but occasionally we're out. Although, that's why we filmed a thing about this many years ago, it was right before the pandemic,

[14:02] And it felt a bit ridiculous to put the video out So now we have loads of mugs, we're finally making the video. And I have to thank past-Matt and past-James for their incredible patience.

[14:17] But you don't need to buy them, just get blank mug, you can do, well. You can get other mugs with hole, like this is an off-the-shelf thing - would you believe? So you could just get a generic mug and draw on it and explore these things.

[14:32] Thank you so much for watching and I hope you all now go and enjoy a nice hot mug of topology. [Shopping channel music]

More from Stand-up Maths

View all

⚡ Saved you 0h 14m reading this? Transcribe any YouTube video for free — no signup needed.