Where Do Those Undergraduate Divisibility Problems Come From?
16 Jan 2025
Oftentimes in your “intro to proofs” class or your first “discrete math” class
or something similar, you’ll be shown problems of the form “prove that for
I want to give some sort of attribution for this, since I remember reading about this exact topic… like a long time ago. Maybe 6 or 7 years ago? I’m sure that I saved the relevant article1 in my zotero, but I can’t find it for the life of me! Regardless, I want to emphasize that the whole idea for this topic (using Pólya-Redfield counting to build these divisibility problems) is not mine.
I’ve wanted to write a post on Pólya-Redfield counting for years now, since it was a pet topic of mine as an undergrad, but I think I was always planning too big a scope. This is a very bite-sized problem, and I won’t go into the theory very deeply, so I think it should make for a blog post I can finish in a day2.
Let’s get to it!
Ok, first, how might we come up with problems like this? We want a polynomial
But what are sources of integers? If we put our combinatorial hats on, we learn
that we had better be counting something! That’s the quickest way to
ensure that we get an integer answer at the end of the day. So we want a
polynomial so that as we vary
At this point, you might be inspired by The Lemma Which is Not Burnside’s,
which says that when a group
where
This is great, since in some sense it’s “where division comes from”. I don’t want to get into categorification here, but when we say we’re thinking of numbers as the cardinality of some set (to guarantee they’re integers) we’re really categorifying our problem. There’s been lots of work showing how various operations on numbers lift to categorified operations on the category of finite sets, and the only way I know of to categorify division is to take the orbits of some group action3. Hopefully this also serves to show that categorification doesn’t need to be scary! It can be incredibly simple, just thinking about finite sets and what we can do to them… Though maybe people who read my blog are already convinced of that, haha.
Regardless, this orbit-counting formula is close to what we want! It gives
us access to division. So if we could only find a family of sets
This is exactly what Pólya-Redfield counting buys us! I really want to write a blog post with lots of pretty pictures that explains this in detail, but maybe just for today I’ll allow myself to be a bit less thorough. If you want to see this motivated with pretty pictures, I’ll point you to some slides by my undergrad advisor Klaus Sutner4. These are from the 2023 version of the class where I first met him back in… 2017? It’s better to not think about that, haha.
Moving on, say we have a set
where
This is exactly what we want, since it tells us that the polynomial
Again, unfortunately I’ll leave the derivation of this formula (and the many many other useful things the Pólya-Redfield theory buys you) for another day, but at least we can do some quick examples!
First, say we want to count the number of bracelets you can make with
so we want to count the number of ways to color this picture with
Now choose an isomorphism between the colorable places of our configuration
and the standard set of size
After making this identification our action is a map
Element |
Image in |
Number of Cycles, |
Using this, we see that the number of bracelets with
Since this is counting the number of orbits, it must be an integer, and so
for every
Let’s see a harder one, which (in the interest of speed) I stole from Klaus’s lectures:
How many ways can you fill a tic-tac-toe board with
We have configurations like the following
(I’ve already chosen a bijection between our colorable places and the
standard set with
Now we want to color each slot
Notice we’re also not worried about which colorings come from actual games of tic-tac-toe!
How does Pólya-Redfield tell us to proceed? Well, the dihedral group
so that, in cycle notation:
Since
xxxxxxxxxx
# Build a permutation group generated by r and s as above
r = '(1,7,9,3)(2,4,8,6)(5)'
s = '(1,3)(4,6)(7,9)(2)(5)(8)'
G = PermutationGroup([r,s])
# print the cycle decomposition of every element of G
for g in G:
print(g.cycle_string(singletons=True))
As a cute exercise for those new to group theory, try computing
these 8 permutations yourself! Can you figure out which one comes from
which element of the dihedral group? Can you see how they relate to the
usual presentation
From here it’s easy to read off the polynomial! If we have
Since we’re trying to color the board with only two colors,
Now we’ve really made two predictions here. First, that
First, we can just plug in a few thousand
xxxxxxxxxx
foundException = False
for n in range(1,10000):
p = n^9 + 4*n^6 + n^5 + 2*n^3
if (p % 8) != 0:
foundException = True
print("uh oh! P({0}) is not a multiple of 8!".format(n))
break
if not foundException:
print("^_^")
Second, we know there’s only
xxxxxxxxxx
from itertools import product
colors = [0,1]
boards = (((a,b,c), \
(d,e,f), \
(g,h,i)) \
for (a,b,c,d,e,f,g,h,i) in \
product(colors,repeat=9))
def rotate(b):
((a,b,c), \
(d,e,f), \
(g,h,i)) = b
return ((g,d,a), \
(h,e,b), \
(i,f,c))
def reflect(b):
((a,b,c), \
(d,e,f), \
(g,h,i)) = b
return ((c,b,a), \
(f,e,d), \
(i,h,g))
# this is actually kind of stupid, and computes
# the orbit with duplicates... But that's fine
# for numbers this small.
def orbit(b):
return [b, \
rotate(b), \
rotate(rotate(b)), \
rotate(rotate(rotate(b))), \
reflect(b), \
rotate(reflect(b)), \
rotate(rotate(reflect(b))), \
rotate(rotate(rotate(reflect(b))))]
seen = []
for b in boards:
if set(seen).isdisjoint(orbit(b)):
seen.append(b)
print(len(seen))
So there we go! This actually ended up taking two days to write, since yesterday I got distracted from my distraction when I was talking to a friend about connections and how curvature is related to force in physics. I realized I don’t actually understand that as well as I thought I did, so I had to spend some time rereading a bunch of physics stuff, which was super fun, even if it took a while, haha.
If you’re ever on a deserted island and you find yourself needing polynomials whose outputs are always divisible by some fixed number, this is an endless source! You might ask if every such polynomial arises from Pólya-Redfield counting in this way, and that’s obviously false (since, for instance, we’ll never get any constant terms)… But it’s not obviously false that every such polynomial arises from Pólya-Redfield counting after a change of variables! So with no intuition at all for whether it’s true or false, let me pose that as a conjecture:
Conjecture:
If
Maybe
For anyone interested in thinking about this conjecture, it’ll be nice to know that every polynomial sending integers to integers is an integer linear combination of binomial coefficients (see here). Amusingly, this was also shown by Pólya!
You can push this further (as mentioned in the same wikipedia article) to
note that
As a cute aside, we’ve actually talked about this basis for polynomials in terms of binomial coefficients before! Seeing them turn up here was like seeing an old friend.
Thanks again for hanging out, all! This was super fun, and it was a nice diversion from the blog post about my thesis work. It’s loooong, but really interesting, and I think people will enjoy it. This stuff relating fukaya categories, topological field theories, and representation theory is some of the coolest math I’ve ever seen, and I couldn’t have asked for a more fun thesis topic.
Of course, I also need to get the topological topos posts cleaned up and submitted to journals, and I have a fun project that I want to finish up which will be interesting to categorical logicians and algebraic geometers! (At least, algebraic geometers of a certain kind, haha). There’s always more to do, but that’s part of the fun of it! After two months applying to postdocs and barely doing any math at all, I’m thrilled to be back at it ^_^.
Alright, stay safe, all! We’ll talk soon 💖
-
or maybe it was a blog post or an mse question or something… Or maybe a footnote in a published paper? Part of why I can’t find it is because I don’t remember anything about where I read it! And back when I was an undergrad I was much worse about leaving myself searchable notes so I can quickly find interesting things again. ↩
-
If you’re curious why I decided to make this blog post now, I just started learning about cluster algebras today, and in the first lecture of Pavel Galashin’s series on the subject he mentions a recurrence relation which magically always gives integers, despite division happening. This reminded me of these polynomials which always give outputs divisible by some number (which is an easier version of the same phenomenon), and I went looking for the original article to share on mastodon. I couldn’t find it, so… I guess I’m writing one!
John Baez and Jim Dolan and I also talked about species and structure types in our last meeting, and so I think I was also somewhat primed to think about generating functions and Pólya-Redfield counting based on that conversation. ↩
-
You need groupoids and “groupoid cardinality” to have access to division in general, since this lets you get rational numbers (and even certain real numbers!) as cardinalities. See, for instance, John and Jim’s famous paper From Finite Sets to Feynman Diagrams or this MO post for more. ↩
-
I saved a copy of these slides local to this blog to make sure they’re always available, but if you want them right from the horse’s mouth you can find them here, and a course schedule with all the available lecture slides here. ↩
-
As long as I’m missing my undergrad years, I’ll pass on an insight from one of my favorite undergrad professors Clinton Conley about this seemingly weird
:Remember when you were learning how to graph functions and if you want to move the graph of
to the right by , you look at the function ? This trips up a lot of students first learning things, since it seems backwards to subtract to move to the right, especially since moving up and down has the much more sane behavior that moves you up by units!This is the same phenomenon, where the action on the input is contravariant (and we act on
by the inverse of ) while the action on the output is covariant (and we act on by )!There’s also something to be said here about left vs right actions, but I won’t say it, haha. Hopefully this Clinton-ism helps this make more sense, since I remember it really helped me when I was younger! ↩
-
I guess my type theory background is showing in this notation, haha. ↩
-
I think when most people talk about these bracelet problems, they quotient by the dihedral group instead of the cyclic group. This is because you can flip a bracelet over in 3D, so you have access to reflections too. I’m ignoring that for the sake of the example, though, and just counting things up to rotation. ↩
-
This is also a much more efficient source of polynomials for undergrad divisibility problems, but it wouldn’t have been anywhere near as fun! ↩