Are hotdogs sandwiches or tacos, and do they form a group?

This may sound stupid, but I promised it is related to science. So, I came across this meme recently, which has caused some level of uproar in the internet.


I don’t really know who made the original figure, but here is where I found the meme: [click the link ]

There are many reactions that this meme brings up, mainly “Who thought this was a good idea?” and “What? Why?”. And what I’m about to do is likely to generate similar reactions. Before going any further, there are some interesting implications for this “infographic”. The common factor across the different representations is that they mention cereal-based foods and the shape of the dough fits each category. Under this rule, a rare steak is technically a salad, which is a very interesting outcome. A pizza is a toast, but I can see that, in a certain way. There are some issues I have with this set, but I will mention them further below.

Now if you are a normal person, you see this meme, and maybe you go down on the comment section to argue whether or not hotdog is a sandwich or a taco (I’m gonna say this, depending on the hotdog, it can be a salad or sushi too). And then you move on with your life. Actually let me correct that. That’s not what a normal person would do, that’s what a sane person would do.

I was talking about the funny implications of this meme with a mutual of mine, when I noticed that tecnically a cake is sandwich on top of a toast, or vice versa(we actually had to account for the rotation of the toast so we would have a cake representation similar to the one shown in the graphic, so it is not an exactly commutative operation). And there you have it. The first mistake. Do not engage in abstract algebra for a meme, folks. You open a can of worms that is really nasty and hard to close. On the other hand, this is a good opportunity to talk about group theory, which is a fascinating subject.

You see, here we have a set a elements associated with a cube, it is a finite set, and it seems that if we combine them in a certain way, we get another element, also in the set. Hummm, closure. That smells like group theory to me. So yeah, I spent an whole afternoon trying to see the possible operations I could engage in with the shapes I had, and whether I could form a group under any of those operations.

Now first let’s define what a group is. I don’t really want to bore you with the details, but a group in abstract algebra is a mathematical object that satisfies a couple of properties, I’m going to use our food cube type to explain each property:

  • Closure – Any combination of two elements in our food group need to be part of the group as well, it needs to be another of the eight food types.
  • Associativity – This means that if we have three food types a b and c, combining a and b first before combining the result with c gives you the same food type if you combine b and c before combining with a (by the way, because we didn’t establish commutative as a necessary property, you need to mind the order of operation).
  • Identity – There is a food type, let’s call it e for now, such that any other food item a combined with it is equal to itself. (It’s kinda like adding zero to a whole number. Which is exactly why whole numbers form a group under addiction)
  • Invertibility – If you have a food type a, there is one food type b such that combining those food types together gives you the identity food type (kinda like adding positive and negative numbers together and getting zero). For every food type a, you only have one food type b.

Now that hopefully you have some idea of what these properties are, let me show you how a mathematician usually writes them:

Consider a set V and a binary operation ⊕. V forms a group under ⊕, denominated G =(V,⊕), if it obeys the group axioms:

  • Closure – ∀ a,b ∊ V, a⊕b ∊ V
  • Associativity – ∀ a,b,c ∊ V, (a⊕b)⊕c = a⊕(b⊕c)
  • Identity – ∃ e ∊ V : ∀ a ∊ V, a⊕e = a
  • Invertibility – ∀ a ∊ V, ∃ b and only one b ∊ V, a⊕b = e

It definitely has the convenience of being short and concise, but unless you are really into math, this looks like jibberish to you. Regardless, everything there is equivalent to the version we used for the food types.

Okay, so now we have established the properties of a group, and what we want to see is whether we our food type cube stuff satisfies that condition for some operation we have yet to determine.

First, let’s give the set a more usable format. The names are nice and all, but it’s gonna be a pain in the ass writing Salad ⊕Toast or Taco⊕Cake, so I came up with a simple way to label every item in the graphic.

Label Element

And now, the food type set is F = {0,t,s,T,S,q,c,C}. So, keep those labels in mind moving forward. Instead of Sandwich ⊕Toast, we have s⊕t, which is a lot more convenient to write in my opinion.

Now, what kind of operation we want? Because it turns out there are quite a few ones we can use. I figured I would use a couple of constraints and assumptions to make things easier, like I’m not going to explore every single case (maybe some other day).

So what are the constraints and identities I will be using?

  1. First, the elements are invariant under rotation. This is convenient for some of our next assumptions, after all, a sandwich is still a sandwich whether or not the bread slices are horizontal or vertical.
  2. Combining the same pair of elements in any order give the same result (this is commutativity)
  3. We are also going to assume closure and consider only operations that satisfy that property.
  4. These are actually two alternative routes we can take for the operations we will define.
    • For the first few cases we will consider the operations as being done in such a way as to minimize overlapping of the colored faces of the cube. That is to say the elements suffer rotations in such a way that when combined the overlap of their faces is the minimum possible.
    • For the latter operations, we will consider operations done in such a way to maximize face overlap.
  5. Perpendicular crossing between faces leads to the crossing faces being removed for any operation.

With these assumptions, we can then define two operations (actually four, depending on whether we are considering minimal or maximal face overlap).

The first operation, which we can denote as disjoint union ⊕, is where we combine the faces of two elements removing all overlapping faces, and the result should be a shape contained in the set.

The second operation, which we can denote as an intersection ⊗, is where we removing all non-overlapping faces, leaving only the overlapping faces behind.

So we have everything we need for a group (if these even form a group), so what do we do now? Well, we are lucky to be dealing with a small finite set, so there is a perfect tool to be used. Cayley tables!! I’m going to go in more detail about them later, but just know that they are a great way to explore the properties of small groups (or not groups).

So, first looking for the disjoint union ⊕ with minimal overlapping, we have this figure

Now because we had already assumed closure, we don’t need to check for that property. The first observation we can make is that there is an identity element under this operation, which is 0 (Salad). No matter which food type we choose, the outcome of the disjoint union is always the original food type.

We can try to check for associativy, but in advance I can tell is not going to work out (in large part, because the website where I draw this Cayley table told me), but we can try to use one example that doesn’t satisfy the property, just one is enough for a proof after all.

(t⊕s)⊕T = T⊕T=S

t⊕(s⊕T) = t⊕q = c

S≠c, therefore associativity does not hold.

Unless you want to argue a calzone is a Sushi, but we are not ready for that discussion (if anything, Calzone is an onigiri).

So, yeah, sadly, this is not a group, but it satisfies some neat properties. Closure being our initial assumptions means that this set forms a magma (cool name) under any of the operations we will consider. Having an identity element, makes it a unital magma, and while there are invertible elements, they don’t form a Latin square (we will talk about them later, but to give an idea, think of Sudoku), so we can’t say the set obeys the invertibility property. It is a cool name, but it is a shame it isn’t a group. It is a commutative unital magma, for compensation.

Now, if instead we were considering the intersection with minimal overlap (minimal intersection if you will), we would get a different picture:


Holy shit, that’s completely different. We completely lost the identity here (c would be the closest thing, if not for the cake. Oh cake. Always making people’s heads roll). On the other hand we get associativity. We still don’t have an inverse, but there is the aparition of an interesting element, the zero or absorbing element, ∃ 0 ∊ V : ∀ a ∊ V, a⊗0 = 0, and this means that if the disjoint union can be thought of as an addiction, this intersection is kinda similar to a multiplication. Also there are plenty of elements that combined with themselves give back zero. These elements are known as nilpotent (a≠0, a⊗a = 0), and they are quite interesting.

Again, having closure, and in this case associativity, but no identity or invertibility, makes this a semigroup. Specifically a commutative regular semigroup with nilpotent elements and a zero element. A regular semigroup means that there are some invertible elements, just that they do not satisfy the conditions for invertibility (there being one and only one inverse for every element), which is to be expected from existence of a zero element.

I'm gonna go at a short tangent here to complain a bit. In a lot of ways, I feel like the cake is the element that really ruins any chance of getting a nice picture out of this, like seriously, every one of the other food types show a nice pattern by filling the faces of a cube and then some asshole decided to put another plane RIGHT IN THE MIDDLE. What could be a cute mathematical object became a fucking monstruosity. Hereby, for the sake of mathematical integrity, I propose that the cake is in fact not a fundamental element for the standard model of food, but rather a composite. Yes, I am taking the string theorist approach to this problem. If it is not mathematically pretty, it's wrong and not worth it. 

Rant finished. Going back, if we consider our options with maximal overlap, would the pictures change in any significant way? Let’s see by first looking at the disjoint union.

We get zero as an identity element, just like in the previous case. It is not just a commutative unital magma like the previous case, because now every element of the set is it’s own inverse. That satisfies the invertibility property, as nothing really suggests the inverse needs to be different from the original element. But these algebraic objects are still special. If it was a group, it would be a group of exponent 2, (a≠e, a⊕a = e). So I guess it is a commutative unital magma of exponent 2. Not a particularly pleasant name to say out loud.

If we look at the intersection with maximal overlap (or maximal intersection):

Yeah, you get associativity again, and because of the cake, calzone is not an identity element, which means, this remains a commutative semigroup, this time without nilpotent elements. Still got the zeroth element. We got now idempotent elements instead where a⊗a = a, for any a.

Now we have discussed disjoint unions and intersections. In set theory these are kind of the opposite, disjoint union shows the parts of the sets that do not overlap, while intersection returns just the parts of the sets that do overlap. If we want to just combine the sets, both overlapping and non overlapping bits we do a union (Note: a union is not the same as a disjoint union), rather we can define a disjoint union of two sets can be described as a union of two sets minus the intersecting (or overlapping) regions.

For sets A and B, a disjoint union is defined as:

A ⊔ B = (A ∪ B)\(A ∩ B)

Thus a union can also be defined in function of the disjoint union and intersection:

A ∪ B = (A ⊔ B) ⊔ (A ∩ B)

We can also define a union operation for our case by a similar reasoning, for some food type of our set.

a∘b = (a⊕b) ⊕ (a⊗b)

with the same constraints and assumptions aplicable to it. One thing of note is that by having the Cayley table for the disjoint union and intersection, you can easily compute the Cayley table for a regular union. I could prove this, but I would rather leave it as a exercise to the reader. At most, I can make a sketch of the idea:

By closure, we know that a⊕b=c and a⊗b=d are elements of our set (they are food types). Thus a∘b in the Cayley table for the union is equal to c⊕d in the disjoint union, for any a, b, c, d in the food type set.

Let’s have our first look at a regular union with minimal overlap:

Interestingly, this graph is similar to the disjoint union with minimum overlap, aside from the fact than now, c (Calzone) is similar to an absorbing element, and if not for C (cake) it would probably be one. This makes sense, because we think of our operations as analogues for set operations, 0 (salad) is our null set, while c (Calzone) is our full set. So we are in a way looking at set of sets and subsets. Sadly, it also does not form a group, and honestly at this point it is rather hopeless to continue that pursuit, I am only really doing this for completion’s sake.

By looking instead at a regular union for maximal overlap, we get this picture

Just like in the last case we got that 0 is the identity and c is almost an absorbing element. Still not a group, and still no associative property or invertibility. We also see all elements being idempotent.

In a way, that is sort of by design, since the operations we used are set operations. Are there other operations we could have used, including ones where we did have a group? Yeah probably, we can actually generate those randomly with Cayley tables. But my weird aesthetic sense would not be satisfied with that, I wanted to actually come up with an operation that I could see being done with actual food, and that didn’t require modifying the original elements.

In a future post, I will go into more detail about many of the stuff I brought up here, Cayley tables and how they may or may not relate to matrices, Latin squares and Sudoku, set operations and how you can think of them in algebra, and maybe even whether or not hotdogs are tacos, sandwiches or toasts. When will that post come out? Humm, trust me, it will eventually.

Do I have a good track record on posting follow-up tangents to previous posts? Leave your opinion down below. Before I forget and since I’ll probably not post anything until 2022, happy holidays and a (hopefully) great (or just better) new year.


DAR Wallace, “Groups, Rings and Fields”, 1998, chapter 4 – Introduction to groups

The site I use for the Cayley tables: Cayley Table Applet

One thought on “Are hotdogs sandwiches or tacos, and do they form a group?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s