Monday, March 9, 2020

259: Is Reality Really Real?

Audio Link

Recently I read an amusing book by a cognitive scientist named Donald Hoffman, titled “The Case Against Reality”.    Hoffman argues that what we think we are perceiving as reality is actually an abstract mathematical model created by our neurons, with very little relationship to reality as it may actually exist.   Note that this is not one of those popular arguments that we’re living inside a computer simulation— Hoffman isn’t claiming that.   This also isn’t an argument about the limits of our perception, such as our inability to fully observe subatomic particles at a scale that would confirm or deny string theory.    He accepts as a starting point that we do actually exist and are perceiving something.    However, that ‘something’ that we seem to be perceiving is radically different from the core concepts of space, time, and general physics that we think we’re observing.

A key metaphor Hoffman points to is the idea of your computer desktop screen, where you see icons representing files and applications.   You can perform various actions on this screen, moving files between folders, starting applications, etc.   Some of them even have real consequences:   you know that if you drag a file into the trash and click the ‘empty trash’ button, the file will cease to exist on your computer.   Yet you are completely isolated from the world of electrical signals, semiconductor physics, and other real aspects of how those computer operations are actually implemented.   The ultra-simple abstract desktop serves your need for practical purposes in most cases.   Hoffman believes that our view of the universe is similar to a user’s view of a computer desktop:  we are seeing a minimal abstract model needed to conduct our lives.

It’s easy to argue, from observing more primitive animals in nature, that evolution does have a tendency to take shortcuts whenever possible.   Hoffman points out a number of funny examples, like a type of beetle that identifies females through their shiny backs, and can be fooled into trying to mate with a small bottle.   If the species could successfully perpetuate itself by using this shininess heuristic to quickly identify females with minimal energy, why would evolution bother trying to teach it to observe the world in more detail?   Hoffman calls this the FBT, or “Fitness Beats Truth” concept.   He even tries to raise it to the status of a theorem, by making various assumptions and then showing that given the choice between providing true perceptions or the minimal required to enable reproductive fitness in a particular area, the sensible minimal-cost evolutionary mechanism would always choose fitness over truth.

So, it this an unassailable proof that we are simply observing some complex computer desktop, rather than actually perceiving something close to reality?   Actually, I see a few issues with Hoffman’s argument.   The first one is that he dismisses far too casually the idea that maybe, once a certain amount of interaction with reality is needed, it’s easier for evolution to build actual reality-perceiving mechanisms than to come up with a new, complex abstraction that applies to the situation.    While a major computer chip manufacturer can do lots of work using abstract design schematics, for example, at some point they may need to debug key manufacturing issues.   When this happens they stop using purely abstract models, and look at their actual chips using powerful electron microscopes.    Isn’t it possible that evolution could reach a similar point, where there is a need for general adaptability, and the best way to implement it is to provide tools for observing reality?  

Another big argument in favor of our perceptions being close to reality is that we are able to derive very complex indirect consequences of what we observe, and show that they apply in practice.   For example, a century ago Einstein came up with the theory of relativity to help explain strange observed facts, such as the speed of light seeming to be the same for moving and nonmoving objects.   He and other scientists derived numerous consequences from the resulting equations, such as surprising time dilation effects.   Eventually these consequences became critical in developing modern technologies such as the Global Positioning System, which we use every day to accurately navigate our cars.   Could evolution have come up with such a self-consistent abstract system, originally in order to enable groups of advanced monkeys to more efficiently traverse the treetops and gather bananas?   I’m a bit skeptical.   I think for evolutionary purposes, our approximate abstract perception that the speed of light is 0 has been perfect for most of history, and our advanced observations beyond that are detecting a real level of reality that evolution wasn’t particularly caring about.

Finally, one other critical flaw is that Hoffman claims that even our core concepts such as space and time are part of this abstract model that evolution has created for us.   But evolution itself is a process that we have observed to occur in space and over time.  So if evolution has created some kind of abstract model for us, that in itself proves that space and time exist in some sense, or else the overall argument is self-contradictory due to the nonexistence of evolution.    I suppose you could rescue it by saying just enough of space and time is real to enable evolution, but that seems a little hokey to me.

So, for now, I’ll happily move on with my life in the belief that reality really does exist.    

And this has been your math mutation for today.


Saturday, January 25, 2020

258: Memory Or Knot

Audio Link

The discussion of computer memories and time in the last episode brought to mind another form of digital memory I’ve been planning to talk about at some point.   The short life span of our current computer memories is always a potential concern— as you can see in the chart linked in our show notes at, nearly all current forms of data storage, such as hard drives, flash memories, or floppy disks, will likely last less than 30 years.    For things that are important, data providers and backup services are continually copying and transferring our data.   But did you know that there is a simple form of digital storage that requires no ongoing power, and can last more than 500 years?    I am, of course, talking about the Inca system of knotted strings known as the quipu.

The quipu system, which was used by the Incas of Peru before the Spanish conquest in the 1500s, was actually quite sophisticated for its time.    The knotted strings represented a place-based number system, essentially assigning a region of the string to each digit of a number they wanted to store.   Thus, to record  the number 246 in a quipu, you would put 2 knots in the first region, 4 in the second, and 6 in the third.   They were even aware of the concept of 0 in a place-based system as well, a concept that was just emerging into common use in Europe when the Spanish began conquering the Americas.   The quipu properly represented the digit 0 by having no knots in the corresponding region.   

As another clever enhancement, they had a special type of knot, a “long knot” which involved extra turns of the string, which would always be used only to represent a digit in the ones place.    This way they didn’t have to waste a string if recording a number that was only a couple of digits:  they could start a new number in the next part of the string, by switching to long knots to show they were back in the ones place.   So if you had a 6-segment string, and wanted to store the numbers 246 and 123, you could put them both on the string, without any worry about it being confused for 246,123.  You just had to make sure that you tied the sections representing the 6 and the 3 with long knots.

With this system, the Incas had an easy and efficient way to do proper accounting for business, taxes, and similar issues.    Researchers are pretty certain that this interpretation of quipus is correct, since there are some cases where periodic summary quipus are placed that each show the sum of the previous set of quipus— it would be hard for these sums to work out correctly by luck alone.   There is actually a lot more to these quipus though:  there are many intricate quipus that don’t seem to be recording numbers, and likely have other meanings.   Sadly, the Spanish invaders didn’t think of trying to preserve the quipus or their interpretation, so we don’t have any records of detailed guidance from the original creators of the quipus.    About 900 known quipus have survived to the present day.

There have, however, been some intriguing developments in the last few decades, providing progress in interpreting the non-numerical aspects of this system.  Anthropologist Gary Urton of Harvard noticed that in an area where Spanish census takers had recorded 132 local lords paying tribute, there was a known quipu with exactly 132 strands.   This led to an interpretation where clans could be identified based on the way the quipu cords were attached to the main one.    Also, anthropologist Sabine Hyland from St Andrews University discovered a remote Peruvian village where there were locals who could connect narratives passed down through the generations to a particular set of quipus, leading to further breakthroughs in their interpretation.   She found 95 core combinations of color, fiber, and knot direction, which together may be interpretable as a phonetic system, essentially like letters of the alphabet.  The research is still in progress, but it may be that the quipus were effectively the equivalent of a full written language.

So, if you are nervous about the short lifespan of your computer data, go buy a bundle of strings and start knotting them in a well-defined pattern.   Anything you could save on your hard drive could easily be saved on a sufficient number of quipu strings, and might be more likely to be accessible to your great-great-great-grandchildren.  Just remember to tell someone what they mean before Spanish invaders come knocking at your door.

And this has been your math mutation for today.


Sunday, December 29, 2019

257: Turning Things Sideways In Time

Audio Link

I recently came across a reference to a famous quote by supercomputing pioneer Danny Hillis:   “Memory locations are wires turned sideways in time”.   When first hearing this, it sounds a bit mind-bending— how can you turn something sideways in time?    But once you recall the idea of time as a fourth dimension, the quote is pretty clever.    Normally, you think of an ideal wire as transferring a bit, the simplest piece of computer data, from one point of space to another.   And an ideal memory location stores a bit in a particular place now, so you can access it in the future.    Thus, if you could turn things sideways in time, transferring a movement along a line in space to a movement to a future point in time through a rotation in the fourth dimension, you could indeed transform a wire into a memory by simply carrying out such a rotation.    So many things in modern computing would be simpler if we could do this easily.

On the other hand, on closer scrutiny, the idea of memories as sideways wires in time doesn’t really seem that useful.   In practice, we must base computer memories on very different applications of physics than wires— simple dimensional rotations are just not in our current bag of manufacturing tricks.    And if you look more closely at wires, while they do carry bits to another point in space, they also carry them to a future point in time, due to propagation delay.   The fact that wires are not instantaneous, but have real delays, has become more and more significant as computing technology advanced; due to the infinitesimally sized components of current processors, they are a constant consideration for every designer.   So the conceptual rotation in time of a wire, to translate it to a memory, would be something less than 90 degrees, as wires already are turned a bit in the time direction.

Another interesting thing about this concept of rotating in time is that, once you think about it, it’s not really a statement about modern computing technology, just about thinking of converting a transfer in space to one in time as a dimension.   You can apply it in a lot of other cases.   How about this one:  “Podcasts are just radio shows turned sideways in time”.   That kind of applies, right?    But we don’t even need to constrain ourselves to modern high-tech.    Couldn’t we just as easily say “Cassette tapes are concerts turned sideways in time?”    Or “Government laws are king’s proclamations turned sideways in time?”   In some sense, the evolution of modern life fits in here too— can’t we say that “Genes are biological mutations turned sideways in time”?    Even the ancient Greeks could have gotten into the act, by saying “Papyrus scrolls are Plato’s lectures, turned sideways in time.”    Sure, all of them do sound profound to some degree on first hearing, but are really just clever restatements of the idea of time as a dimension.

Another interesting aspect of this quotation is Hillis’s concern with “deep time”, the idea that he wants to somehow be able to communicate information about our current society long distances along the time dimension.    Already we barely know what our predecessors 3000 or so years ago thought about and how they lived.    We may seem to have generated a lot of information in our current civilization, but if there was some major disaster and we spent a few years without power to refresh our computer memories, hardly any of it would survive.   Our mass-produced physical books are much less hardy, for the most part, than the ones created by ancient Greeks and Romans, so even written information would disintegrate very quickly.   And what about 10,000 years from now?    We know basically nothing about any human civilization that may have existed that long ago.

To address this problem, Hillis became involved in the Long Now Foundation, an organization that attempts to look at long-term problems facing humanity in the 10,000 year range.   One of their key projects is to create the Clock of the Long Now, which you may recall me mentioning in an earlier podcast:   it’s a clock that is built to last at least 10,000 years, by being put in a sheltered location and not requiring any external source of power.   They are even trying to take human factors into account, for example by not allowing any expensive materials in the construction, so there will be no incentive for future thieves to destroy and loot it.   And it is only allowed to use materials available during the Bronze Age, so it will still be repairable after a general societal collapse if needed.    Though if society has collapsed to the point where Math Mutation podcasts are gone, will there really be a point to our race continuing to survive?    In any case, Jeff Bezos seems to think so, since he has spent over 40 million dollars funding this clock’s construction.

And this has been your math mutation for today.


Saturday, November 30, 2019

256: Crazy Eyed Fish

Audio Link

In the last episode I talked a bit about Richard Dawkins’s book “Climbing Mount Improbable”, explaining how arguments about the mathematical impossibility of evolution tend to overlook some details of how it actually works.   Today we’re going to talk about another interesting mathematical aspect of evolution that Dawkins discusses in that book, the rise of symmetry.  We all know that most modern animals seem to mostly exhibit symmetry along at least one axis.  Some have argued that this is evidence of intelligent planning, similar to a computer-based CAD design done with attention to appearance, beauty, or other subjective standards.   But actually, if you think about how evolution works, there are several natural selection pressures which would inherently push multicellular creatures towards symmetry as they evolve.

One of the most basic observations is that if you’re a creature that simply floats in the water, is anchored to a point on the ground, or doesn’t move much, you have a natural notion of “up” and “down”, but most other directions are equivalent.   Up is the place where sunlight comes from, while Down is the direction where gravity pulls you.   Aside from this distinction, you don’t want to favor particular other directions, since you don’t know where your food will happen to come from.   So if you evolve some useful new feature, like a starfish’s arms, the most efficient design will equally space them around you, enabling their use in all directions.   A natural form of mutation is to duplicate a body part.   These simple observations result in the radial symmetry we see in creatures like jellyfish and starfish.

In the case of creatures that intentionally move for a while in a consistent direction, new factors come into play.   You still have the natural concepts of up and down, since the sun and gravity are almost always going to be critical factors.   But now whenever you are moving, you also have a definite direction of motion, usually towards your food.   Thus you want to have a mouth at one end, and your waste disposal method at the other, so you leave your waste behind rather than wasting energy uselessly re-eating it.    But the directions perpendicular to your motion, the left and right, are still essentially equivalent, so biasing your body in favor of one side would be disadvantageous, or even lead to pulling you around in circles if it affects your method of movement.    

I think the most interesting examples of evolution are the rare exceptions to the above rules, where a formerly symmetric animal finds benefits in breaking that symmetry.   For example, flatfish like flounders and sole look pretty bizarre to us, as they lie on the bottom of the water with both eyes facing upward, one in the “proper” location and the other oddly misplaced on the fish’s face.   They evolved from typical symmetric, nice-looking fish that swam vertically in the water, and in fact are born in a similar form.   But when some of them developed a behavioral mutation and discovered they could feed efficiently by laying on the bottom, selection pressure gradually created mechanisms that moved the now useless bottom eye around to the top as the fish grows.   The resulting arrangement is bizarre-looking due to its asymmetry, but of course quite functional for the fish.   And remembering our discussion in the last episode, how evolution must proceed from very small, not-too-improbable steps:  a series of mutations that gradually move the existing eye to an awkward but functional position is much more likely than a lucky, almost impossible mutation that would rearrange the eyes to symmetrical positions on top of the fish.      

And of course, we can’t forget the many cases where a useful body feature doesn’t directly affect a creature’s interaction with the outside world, so can evolve asymmetrically with no problem.   How many medical comedies have you seen on TV with a cliche situation where someone starts to cut on the wrong side to remove someone’s appendix?   We actually have many internal organs in asymmetric positions— in fact, to a designer who valued the beauty of symmetry, human (and most animal) internal organ arrangements are a total mess.    Maybe in a few years we’ll understand DNA well enough to redesign ourselves in a nice, truly symmetric, pattern.

And this has been your math mutation for today.


Sunday, October 6, 2019

255: Mountain Climbing With Dawkins

Audio Link

Back in episode 118, we discussed some of the flaws in probabilistic arguments against evolution:  the claims that advanced forms of life are so improbable that the math simply disallows the possibility that it could have evolved.    And we do have to admit, looking at some basic components of the human body, like our rather complex eye, it does seem unlikely that such a feature could just show up by random chance.   These kind of arguments continue to show up again and again in popular literature, but they demonstrate a basic misunderstanding of some of the key concepts of evolution and of probability.   Recently I’ve been reading another great book by Richard Dawkins, “Climbing Mount Improbable”, that addresses this argument in more detail, so I thought it might be worth revisiting these ideas in this podcast.  

Dawkins introduces a central metaphor, Mount Improbable, a huge mountain that represents the pinnacle (as we see it) of human evolution.    Suppose you are approaching the mountain, and in front of you see a sheer cliff, with the peak a mile above.    You might wonder:  how could anyone ever get to the top of this mountain?   It’s likely you would judge the task impossible, and turn around and go home rather than attempting it.   

But suppose the opposite site of the mountain looks completely different.   There is a gentle slope, leading upwards from the seashore, where you travel hundreds of miles horizontally to get to that one mile elevation.   While it would take a lot of time, gradually walking up such a slope is not impossible at all:  at any given moment, you are comfortably rising a barely perceptible amount, and getting closer and closer to the peak.   Eventually you will reach it, having taken a lot of time but not encountered any other difficulty.    From the cliff, you might stare down at the foolish tourists below as they gape at your amazing mountain climbing feat.

Essentially, evolution is like this long journey up the mountain.   Evolution’s critics are right that a mutation that suddenly creates a major new feature in an animal is nearly impossible— but biologists don’t claim that that’s what happens anyway.   The classic complaint is that a sudden mutation creating a humanlike eye in an eyeless creature would be equivalent to a tornado blowing through a junkyard and suddenly creating a Boeing 747 airplane.    However, the role of random mutation in the evolutionary process is that of creating tiny incremental improvements:  whenever a small genetic change makes a creature more likely to reproduce, that change will gradually become more and more prevalent in its species’ gene pool.   The gradual, incremental effect of all these changes, each one of which is a tiny improvement on the previous creature, is what causes evolution.   The sum total of such gradual improvements leads eventually to what appear to be extremely complex features.

Now, you might say that this all sounds great, but doesn’t explain the “irreducibly complex” features of the human body, like the eye.   Half an eye, or a small piece of an eye, is certainly useless, so how can an eye gradually develop?    How can it be possible that a series of incremental improvements leads from no eye to a human eye?   Dawkins actually goes into detail on this particular example, since it comes up so often.   The basic point is that there is indeed a set of gradual stages that can be observed in the development of the eye, if you look closely at a wide variety of primitive creatures.   The idea that the eye is irreducibly complex is simply an assumption, a knee-jerk reaction that overlooks the details discovered by centuries of scientific study.

The first stage in eye development is light-sensitive spots, a relatively simple feature to randomly appear.   Since many primitive forms of life get their energy from sunlight, this is pretty basic— some form of interaction with light is almost inherent to the concept of life on Earth.   Once you have a light-sensitive spot, you can detect a looming predator nearby…  but you can do it even better if that spot is slightly indented, so you can get a basic idea of the direction light is reflected from, by seeing which of your light-sensitive cells in the indented spot get activated.    Developing such an indentation in a spot on the body is another relatively simple mutation to arise randomly.

Once you have an indented light-sensitive spot, there are a few simple types of mutations that would improve it.   Increasing the number of individual light-sensitive cells will increase your accuracy, so the natural selection will move in this direction.  Also, deepening the indentation, and partially closing the top like a pinhole camera, are also simple improvements that can increase visual precision.    And once you have such an indented region full of light-sensitive spots, some kind of fluid over them would both help focus light and provide some degree of protection— so mutations that create such fluid, or a membrane covering that eventually fills with fluid, would be very useful.   And so on.   I won’t go into all the details here, but you can find a lot more information in the book.   The key point is that there really is a gradual, slow path up Mount Improbable leading from simple light-sensitive spots to a modern eye.

So, if you’re interested in biology and mathematics, but left uneasy by the implication in many poorly-written textbooks that impossibly unlikely random genetic mutations are required for advanced life to evolve, I would highly recommend Dawkins’ book.    The concept that evolution claims a tornado through a graveyard created a 747 is a fundamental misunderstanding of how probability fits into the theory.   Dawkins makes a very strong case that the impossibly looming probabilistic cliffs of evolution have gentle, highly probable slopes lurking just out of sight on the other side.

And this has been your Math Mutation for today.


Sunday, August 18, 2019

254: How To Annoy Your Cat

Audio Link

If you have a pet cat like I do, you’ve probably noticed their impressive agility:  they can jump or fall from pretty high up, and always seem to land on their feet.   This isn’t just an urban legend— it has been noticed for centuries.   Famous 19th-century scientists including George Gabriel Stokes and James Clerk Maxwell took time off from their revolutionary developments in physics and calculus to ponder the mathematics of falling cats.   For someone with a basic understanding of modern physics, cats’ ability to rotate in midair and always land on their feet might seem a bit miraculous:  due to conservation of angular momentum, you might at first think they shouldn’t be able to do this without some starting rotation being provided when they fall.   Actually, that concern is a bit of an oversimplification, since a cat is not a rigid body.    But still, before modern times, the most common thought was that cats are “cheating”— a falling cat simply pushes off against its starting point, or against the arms of whoever is dropping it, to create the proper rotation.

However, in the 1890s, French scientists Etienne-Jules Marey developed the technique of “chronophotagraphy”, where a series of photos could be taken at very high speed, exposing details of movements that were previously too rapid for human observation.   By using this method to watch falling cats, he was able to put to rest the notion that they were using their starting point as a fulcrum.    Angular momentum is the key— but rather than thinking of the cat as a single rigid body with a global momentum, it’s best to look at the front half and the rear half separately.    As later researchers pointed out, the best way to think about a falling cat is to model it as a pair of loosely connected cylinders, with one representing the cat’s front half, and the other representing its rear half.

So, how does the cat do it?   The key actually is that same angular momentum that was originally confusing the problem, but applied a bit more carefully.   You should think about how a spinning dancer or figure skater spreads their arms out to slow down, or pulls them in to speed up.   This is because the total angular momentum of a spinning body is approximately constant.   (Of course it’s only truly constant if the system is closed, and the spin will inevitably slow due to friction, etc, but let’s ignore that for now.)    Masses that are distant from the center of a spinning object have greater momentum, so if those masses are pulled inward, for the total momentum to be constant, the body must spin faster.   And likewise if those masses are pushed outward, the spinning must slow down.

Thus, the cat can use differing angular momentum of its front and rear halves to its advantage.   First it pulls in its front paws while spreading its rear paws, causing the front part to rotate faster than the rear.   Then it does the reverse to reorient its rear half, until both its front and rear are in the right position.   Cats may also use some other related techniques, exploiting their non-rigidness in various ways; some pretty complex physics papers have been published on the topic, which you can find linked at the articles in the show notes.   Apparently this work has ended up having some very useful applications, such as finding ways for astronauts to better control their motion in space while using less energy.

The most comprehensive experimental study on this topic is probably the 1998 paper from the “Annals of Improbable Research”, by an Italian scientist named Fiorella Gambali.   She claims to have dropped her cat, named Esther, 600 times from various heights from 1 to 6 feet, checking to see if it really did land on its feet.   If you’re ever traveling through Milan and see a woman covered with scratch and bite marks, that’s probably Dr Gambali.   Anyway, she concluded that a cat can stabilize itself during any drop from 2 feet or more, but can’t quite do it for a 1 foot drop.   That makes sense, since the two-phase method we described, of stabilizing the front and then the rear, probably takes a little time to execute.   Perhaps some more experimentation is needed, but I think I’ll just take her word for it rather than trying this on my cat.

And this has been your math mutation for today.


Sunday, July 21, 2019

253: Making Jewelry With Fermat

Audio Link

Whenever you hear the name of the 17th century French mathematician Pierre de Fermat, the first thing that comes to your mind is probably Fermat’s Last Theorem.   That, as I’m sure you remember, is his well-known unproven hypothesis about an + bn = cn not having whole number solutions for n>2.   That one is rightfully famous for having stumped the math community for hundreds of years, until Princeton professor Andrew Wiles finally proved it in the 1990s.   But Fermat was no one-theorem wonder.    He was quite an accomplished mathematician, and came up with many other interesting results, most of which are proven a lot more easily than his Last Theorem.   In particular, one of his best-known other ideas, “Fermat’s Little Theorem”, is arguably a much better legacy.   Aside from having been proven by Leibniz and Euler within a century of its proposal, its applicability in forming primality tests has made it a foundation of some of the algorithms used in modern cryptography.   These algorithms form the basis of systems like the RSA encryption used in many secure internet protocols.

So, what is Fermat’s Little Theorem?   Like his Last Theorem, it’s actually pretty easy to state:   For any prime number p and integer n, np - n is always divisible by p.   So, for example, let’s choose p = 3 and n = 5.   The theorem states that 53 - 5 will be divisible by 3.   Assuming you haven’t forgotten all your elementary arithmetic, you probably see that since 53 - 5 is 120, which is 3 times 40, the theorem works.   Since the theorem is true for all primes, it implies a basic test you can use to prove a number is composite, or non-prime:   if you are examining a potentially prime number p, pick another “witness” number n and check whether the condition of the Little Theorem holds true.   If it doesn’t, we know p isn’t prime.   Of course, this is a probabilistic test— you can get lucky with a nonprime number, like 341 which passes the test (with n = 2) but is equal to 31 times 11.   So you need to calculate the odds and choose samples accordingly.   Modern algorithms use more sophisticated techniques, but still build on this foundation. 

The reason Fermat’s Little Theorem came to mind recently was that I was browsing the web and saw a very nice common-sense proof of the theorem at the “Art of Problem Solving” site.   Like most math majors, I did learn about some proofs of this theorem in college classes, and it’s not too hard to jot down the proper equations, simplify, and prove it inductively using the algebra.   But I always prefer intuitive non-algebraic proofs where I can find them:  though there’s no logical excuse to doubt the bulletproof algebra, my primitive human brain still feels more satisfied with a proof we can visualize.    So, how can we prove that for any prime number p and integer n, np - n is always divisible by p, without using algebra?

Let’s visualize a jewelry-making class, where you are given a necklace that can fit up to p beads, each of which can come in n colors.   Actually, to help visualize, let’s use concrete numbers initially:  your necklace can fit 3 beads, each of which can come in up to 5 colors.     There are thus a total of 53 permutations of beads you can put together on a necklace:  5 choices for the first bead, times 5 for the second, times 5 for the third.     5 of these 53 combinations are necklaces where all the beads are the same color, so let’s put those aside for now.   If you look at any example configuration from the remaining 53 - 5 available, you will see that it actually must be one representative of a family of 3 necklaces.  For any necklace where all 3 beads are not identical, you can rotate it 3 ways, with each rotation being a valid combination.   Since every possible combination must be part of such of a family of 3, and there are no combinations from 2 families that can be equivalent, the number of remaining combinations must be divisible by 3.   Thus,  53 - 5 is divisible by 3, and the theorem holds.   Since this argument works for any prime p and integer n, it effectively proves the theorem.

Anyway, if you’re not already convinced, hopefully after doodling a few necklaces on a scratchpad, or taking your daughter to a jewelry-making class, you can see why the theorem holds.   I always like it when I see a simple intuitive argument like this for what seems at first to require messy algebra— even though we can’t know Fermat’s thought processes for sure, I wouldn’t be surprised if he did this kind of visualization when first coming up with the concept.

And this has been your math mutation for today.