Chapter one: the six essential elements of mathematics. I decided to organize my book around six really fundamental concepts that have origins from thousands of years ago or centuries ago, which are very familiar in the early stages to most people, but mathematicians have developed over time to become extremely sophisticated. Numbers is the first concept, and then algebra, geometry, probability, analysis, and dynamics. These are all very basic concepts, but they've evolved into very sophisticated mathematics. But if you strip away all the technical complexities, they really are just extremely intuitive concepts, and the mathematics that we developed is just a precise language to describe it really, really carefully and in a way that allows you to think really clearly about these concepts.
Numbers are one of the oldest mathematical inventions and still the most useful, really. We have records of carvings on bones that predate the alphabet or other writing. And it was invented multiple times by multiple civilizations. If we didn't have numbers, we would have to always speak poetically when trying to describe any situation, and it would always be a little bit imprecise, and the next person who's communicating what you're saying would get it slightly different. It allows for precision. Numbers are placeholders for concepts like quantity and size and magnitude into very portable things that you can communicate to other people who may not have directly interacted with the objects you're describing. And once you try and describe a very complicated scenario with many moving parts, you need numbers and everything else that's born on top of that.
Humans are not really wired to think in numbers. If you don't have the ability to think quantitatively, to measure both the benefits and the costs of an action and which one is bigger, you can make some life choices that you'll regret later, that you spend a lot of resources for very little gain. The first step in being able to think more quantitatively for these things is to understand numbers and then more advanced mathematical topics like probability and algebra on top of that. Basic things like agriculture or trade could not have happened without the ability of numbers to measure large quantities of grain, and actually the ability to tax — you can't have a civilization without taxation, unfortunately, and that requires mathematics and numbers.
Of course, not everything is quantitative. You know, if you want to go on a date, you shouldn't be measuring the cost and benefits of your prospective partner. Okay, some things should still be very subjective and personal, but there are increasingly in this modern world lots of decisions, for example in finance or in medicine, where some quantitative thinking is very helpful. The thing about numbers is that they take on a life of their own, because once you have the concept of number, you can study numbers abstractly, divorced from their actual application. And you find patterns, and you find often that it's very natural to extend the number system that you have to create new numbers which you wouldn't have thought would be applicable to your original context, but they fit very, very well into the number system.
If you're counting sheep, you know, sometimes you want to add sheep and you want to subtract sheep. And so very soon you develop the notions of addition and subtraction. But you realize if you are only counting counting numbers — 1, 2, 3, 4 — you find that you can always add these numbers together, but you can't always subtract. If you subtract four from three, it doesn't make any sense. You can't take away four sheep from three sheep. But patterns in the numbers themselves are so regular that if you just blindly apply the rules of arithmetic, it feels like you should be able to take away three from four and have a new number. And it took a while, but eventually people realized that you can invent these negative numbers, and you can add negative numbers to your number system, and zero. And zero took a long time to actually realize it was a good addition to the number system, and you still get all the nice laws of arithmetic.
For example, if you take a number A and you subtract B and then you add back B again, you get back to A. That's one of the laws of arithmetic, and it still works even when you have negative numbers. Similarly, we learned to divide numbers by another, and we created fractions, and fractions fit very well into this number system. And then there was a shock. We found that there were numbers somehow between all these rational numbers, all these fractions — there were numbers like the square root of two which could not be expressed as any ratio. And this was a big shock, actually. I mean, these numbers are literally called irrational numbers, which is Latin for, you know, insane — not unreasonable numbers — but they do exist, and they're very useful. You can never write down all their digits on a finite sheet of paper. It is very, very useful to have all these extra numbers lying around.
And then eventually we tried to take square roots of regular numbers, which we couldn't do in a regular number system, and we invented complex numbers, and that turned out to be extremely useful for electromagnetics and quantum mechanics. It's remarkable that these number systems, which were often invented just so that we could be better at solving equations and solving practical problems, end up actually being the most natural language to describe very, very complicated phenomena in the real world, like quantum mechanics, for instance.
Algebra is the second layer of abstraction over numbers. So with numbers, we took concrete things like a bunch of sheep or a quantity of water or whatever, and we replaced these quantities with numbers that you can then apply operations to — addition, subtraction, division, and so forth. Algebra goes one step further and tries to not look at specific numbers like seven or 17. First of all, replace numbers by even more generic placeholders. We give them names like x and y, but to also study the operations themselves — plus and times and all these other operations — and ask what properties do the operations have, not just the numbers. And so people discovered that these operations that are so useful in arithmetic themselves have many fascinating properties.
So addition has a property called commutativity. If you add A to B, that's the same as adding B to A. And that turns out to be an extremely useful property for helping you solve problems involving addition. Similarly for multiplication, and all the other basic arithmetic operations obey these very simple laws. Later on we discovered that these laws also hold for other operations. For example, if I want to take, say, an object and I rotate it, I can rotate it by 30 degrees and then rotate by another 60 degrees. But if I rotate it in the other order — rotate by 60 degrees first and 30 degrees next — I end up with the same position that I started with. These two rotations are commutative. So even though that operation has nothing to do with — it's not really an addition or multiplication in a traditional sense of numbers — it has the same algebraic structure.
On the other hand, some things do not obey the commutative law. Like if I put on my socks and then I put on my shoes, I get a different outcome than if I put on my shoes first and then I put on my socks. Those two operations do not commute. Certain operations obey nice laws like the commutative law, and certain operations don't. Sometimes you see a match. The laws that you are presented with are very similar to laws that we already understand for, say, numbers. And then because of that we can take intuition and ideas and proofs and a theory of numbers, and we can transfer them to a different setting.
For example, matrices are a much more complicated concept than numbers. Not just one number, but it's a whole square array of numbers. But it turns out that matrices obey very similar laws of algebra to numbers. And if you are very good at manipulating numbers, you can start to manipulate matrices the same way. And many of our modern technologies, for example large language models, are based on being able to manipulate matrices very, very efficiently. Once you have abstracted to numbers and into algebra, then you are working with equations that involve variables like x and y, and x may have had some physical meaning and some specific value. But often it can clarify your thinking to not focus on the specific values of these numbers or what they represent and just manipulate these equations by pure algebra, just by moving symbols around. When you first learn this, it feels very disconnected from your actual experience. But it is a very powerful technique.
One early use of algebra was the story of Johannes Kepler, who was this astronomer and scientist who was one day walking down the streets of his hometown and he saw the wine market, and wine sellers were selling wine by the barrel — some large barrels and some small barrels — but they were able to figure out how much wine was in each barrel so that they could pay the wine sellers for these barrels. If you have a barrel and you want to compute how much wine there is there, you know, you could pour it out into cups and so forth, but it was very tedious. But what fascinated Kepler was that the person in charge of the market had a very, very efficient way to measure the volume of the barrel.
He just had a stick with various markings on it, and there was a bung hole in the middle of the barrel, and he just poked the stick down the barrel into the corner and just saw how far the stick went, and he could measure, and just based on what that marking was, he could say, "Oh, this is, you know, 30 gallons or whatever of wine," and then they could price it. This astounded Kepler, how you could just take this one measurement of just this one sort of diagonal and work out the shape of the volume, because some barrels could be very tall and skinny or short and wide, and somehow this one measurement was somehow able to compute the volume. He did the math. This was a puzzle to him. So he went home and he wrote out some equations. Assume my barrel is — maybe the radius of the barrel is r and the height is h.
You know, nowadays with modern algebra, like this is a question you can assign to a high school student. It's almost precisely one of these word problems that we love to give our students, and you can compute the volume and you compute this length. And he found that the length did not completely determine the volume, but a wine seller would want to sell as much wine as possible, and you know, you would want to sort of maximize how much volume you could get for a given length. Reasoning that, you know, all these merchants were trying to maximize their profit, even though he couldn't quite solve the equations right away, if he added this profit incentive, he did some rudimentary what we would now call calculus. And that turned out to almost exactly match the shape of the barrels that actually were sold in the marketplace. And his formulas did actually match what people used with very high precision.
So he actually explained these rules, which I think the marketplace had come up with over time just by empirical measurement. But he had found a very satisfactory explanation, and I think this was part of the inspiration for the theory of calculus developed by Newton and Leibniz a few centuries later.
Geometry is literally Greek for measurement of the earth. Since antiquity it was important to know, you know, how many miles it was to travel from one place to another and how to navigate, you know, in the ocean or out in the wilderness by the stars. We needed to understand how to use things that we could observe like angles and distances for very practical problems like transportation. Just like numbers have got various patterns like a plus b equals b plus a, once you start measuring distances between different points and angles, there are lots and lots of relations between all those measurements as well. So geometry obeys laws just like numbers obey laws.
So for example, one law is similarity. Once you know that two shapes are similar, you know they have the same angles and things, then all their sides are proportionate. Once you know that the side of the big triangle is, say, two times as big as the side of the small triangle, then you know that all the other sides of the big triangle are also two times as big. The proportions are equal. The reason why this is so useful is that it allows you to predict the measurement of distances or scales that you couldn't directly reach, you couldn't directly measure. You can look at a distant mountain and you might be able to actually estimate how far away it is because you know something about how tall it is and the angle of elevation, is you can use a similar triangle and you make a scale model.
So for example, now you can navigate and you can see how to get to a distant location even if you can't see it directly from your sailboat or whatever. And even in ancient Greek times, they were able to measure distances to the moon and the sun, which they could not possibly measure directly. But just through the laws of geometry, which they had — similar triangles and things like that, which they had already worked out at that time — they could actually get reasonably good measurements, you know, without any satellites or advanced technology. Once you know geometry, you can really extend your senses well beyond what you can just touch and measure directly.
The fourth math essential is probability, which is the standard way that mathematicians try to encapsulate one of the basic features of the real world, which is uncertainty. In your primary or high school classes when you teach mathematics, we often present very sanitized, predictable word problems. You know, Annie has 30 apples. She gives half of them to James. You know, how much does James have, and whatever, where everything is precise and you know all the information. But in the real world, there is uncertainty and there's unpredictability. So, you know, when you flip a coin, maybe it is heads, maybe it is tails.
Now, if you know exactly how much force you apply to a coin and you knew all these measurements, you could maybe do enough of a simulation to actually predict exactly which way the coin will land. But this is extremely difficult, and often you don't have that data. What was eventually realized is that rather than try to compute exact answers all the time for every single outcome, sometimes you just have to accept that there's a range of outcomes to a given measurement. But what's important is which ones are more frequent and which ones are less frequent.
And the first people to realize this was important were gamblers, because, you know, gamblers would gamble on certain events like trying to bet that certain die rolls would sum up to a certain number or whatever, and if they could calculate the odds correctly they could make money, and if they didn't calculate the odds correctly they would lose money in the long run. The mathematics of probability was created by several letters that some gamblers wrote to their mathematician friends asking for help trying to optimize their gambling strategies. Probability has blossomed well beyond its gambling roots. You know, anytime we have a system too complicated to model all the way from first principles, there's going to be some stochasticity, and we want to have a probabilistic model. So whether it's a stock market or whether a drug is going to be successful, we turn to probability now quite often.
Now sometimes we don't know what the odds are. So probability works best when it involves an event that happens over and over again. You know, there are thousands and thousands of trials, and we can start getting a good measure of the odds. If it's an event that only happens once in a century, it may not quite be the right mathematics, and we're still trying to work out mathematics for extremely rare events that is a better replacement for probability, and there are some miracles that make it effective.
So you may think that every time you do a different experiment — you know, so instead of doing a medical trial, you're trying to understand just the outcome of a die roll or what genetic traits are going to emerge from evolution or whatever — and you would think that in every different circumstance you get all these different distributions, you know, so some distributions will be heavy-tailed and some will be narrow and whatever. But there are these funny laws in probability called universality laws, that even very general types of random systems, various common shapes emerge. The most famous of which is the Gaussian, or what's called the bell shape, that many distributions — like if you take the distribution of heights of men or women, they form almost a perfect bell curve. We actually have good explanations now. We have understood probability well enough that we can explain quite a few of these universal laws from mathematics, although some are still mysterious.
Analysis is how mathematics deals with two things. One is inaccuracy in our measurements — that sometimes it's not so much randomness but just imprecision. Analysis is sort of the mathematics of error bars, where we've realized that sometimes we need to understand not only what the numerical value of various quantities are, but how much uncertainty we have, what are the plus and minus error bars around them. But these are concepts that you can't even talk about — I mean, if just having only qualitative language of big and small is not — it only works up to a point.
We may measure, say, the length of an object, and it's roughly 2 meters, but maybe 2 meters plus or minus 10 centimeters. There's an approximation and there's an error. And ideally you want the errors to be zero, but in the real world we can't always make the errors entirely zero. But sometimes if we can make the errors smaller and smaller, and if we keep making more and more precise measurements, we can make the errors shrink to zero. But it may take an infinite amount of precision or infinite amount of time to get the error all the way down to zero.
Analysis is also about how we take limits and how we deal with infinities. In algebra, the laws of algebra work very well when you're just taking a finite number of operations. If you're just taking five things and you're adding them together, there's no problem. You can rearrange them in any order. But once you start trying to work with an infinite number of operations, there are some funny paradoxes that show up, that sometimes you can rearrange an infinite number of objects and you end up with a different sum than before you rearranged, which doesn't happen with finite sums.
For example, if you're always betting on, say, roulette on red and black, you win 50% of the time and you lose 50% of the time. There is a theorem that there is no strategy that will allow you to constantly win, that will guarantee you a win in the long run, as long as you only have a finite amount of money. No betting strategy can beat the house, basically. And so there is a strategy of always doubling down when you lose and just betting bigger and bigger numbers. And the moment — as long as you win at least once — you will get your dollar. So there was some way to constantly beat the house. But the problem is that it assumes that you have an infinite amount of money.
What the strategy is doing is that it is compressing all the risk of losing money into this very, very small event where you're always losing. At some point, you know, you're betting millions of dollars, and at some point you become bankrupt. So analysis helps you understand exactly what these tail risks are and how to reason with infinities in a way in which you avoid all these paradoxes. Yeah, there was a lot of very inaccurate mathematics that predated analysis, where people were just saying, "Oh, if I do this infinitely often, I can get rid of all these problems." And it took a while to realize that infinity is a very dangerous beast if you're not trained to deal with it properly.
But we need to deal with infinities all the time in the real world. Well, maybe not infinities, but we need to deal with very large numbers. But infinity is a very good approximation for understanding how we deal with large numbers. But it has to be used with care. So one famous demonstration of the unintuitive nature of infinity is what's called the infinite monkeys theorem. The common way to phrase this is that if you have an infinite number of monkeys in a room, or maybe just one monkey typing infinitely forever on a typewriter and just hitting keys at random, then usually the monkey will just type nonsense and gibberish, but every so often the monkey will type a word — know, the, or it — and sometimes it will type a sentence.
But the infinite monkey theorem is that if you wait long enough, or you have enough monkeys, you're almost certainly guaranteed eventually that the monkey will type whatever you like, like the complete works of Shakespeare or Hamlet or Wikipedia or anything. And you can prove this mathematically, that as long as the probability of the monkey doing it at least once is positive — it doesn't matter how small, as long as it's positive — if you wait long enough, eventually the probability that this particular pattern gets hit will eventually go to one.
It's like if you play Russian roulette and you only have one bullet in the revolver and you keep firing. It doesn't matter how many chambers you have, eventually it will fire and you'll get your hit. For any given word or sentence or paragraph or whatever, your monkey will eventually create this text, but the time taken grows exponentially with the size of the text. So if it's just a four-letter word, it might just take an hour or so of typing before the monkey gets it. But if it's already, say, a seven-letter word — the word Shakespeare, for instance — then that may already take years. A sentence, you know, it might take millennia, and actually to get even a fraction of Hamlet, I think even just a page would take way more than the age of the universe before you'd actually see it.
So infinity is actually just a placeholder for a number, anything which could potentially be far larger than any fixed number that you could come up with. You know, even though in the real world you don't have infinitely many monkeys, you don't have infinite budget. Often we reason with infinity first as an idealized situation to see what is possible, and then from there we can turn to the more quantitative questions of exactly what can we do with finite resources. But first you understand what to do with infinite resources.
When I was a kid, I used to play a lot of computer games. For many computer games, there were certain cheats you could put in your games. You could give yourself infinite health or infinite ammunition. And it was sometimes helpful to play that game first with those cheats, where you didn't have to worry about managing your health potions or your ammo or whatever, and just see how to solve the game, and then you could play it on a harder mode and then see how to do things more efficiently. So many problems in math are actually solved this way.
One thing that distinguishes math from other disciplines is that we have the freedom to fail, because failure is very cheap in mathematics. You know, if you're running a business and you make a bad business decision and your company goes bankrupt, that's a terrible mistake. You know, if you're a surgeon and you cut the wrong thing, that's a terrible mistake. But if you're trying to solve a math problem and you make an incorrect assumption or something and it doesn't work, it's not really that much of a bad mistake. You just try again. It's actually a good move when you're trying to solve a math problem is to just first make an idealized assumption. Assume that you have, you know, an infinite amount of energy or zero friction or some other unrealistic assumption, solve the problem then, and then try to get from the infinite world back to the finite world. And this is where analysis comes in to sort of carefully see what features of infinite mathematics still work in the finite world and which ones break down.
Dynamics is the mathematics of change over time. It's the study of the rules of incremental change, how a state evolves from one time to the next, all kinds of emergent and interesting behavior which you may not expect from the initial rules. So we have found that even very simple rules can generate extremely complicated emergent behavior if you iterate them long enough. Evolution is a good example in biology. You know, you have a bunch of organisms and they reproduce, and the fitter ones survive more often than the weaker ones, and the organisms have certain traits that they can pass down to descendants. And these are very simple rules, and it turns out that you can create a massive diversity of species and predator-prey relationships and incredibly complicated dynamics.
If you're on the freeway and you have all these cars, and each car is just trying to move as fast as it can given the car in front of it, you know, so if there's too many cars in front, you'll slow down. If there's not many cars, you speed up. And each individual car is not doing anything very complicated. It's just trying to optimize its flow. But when you put all the cars together and you see what it does to the whole network, you get these amazing emergent phenomena like traffic waves. You get these waves that can compress and grow, kind of like a slinky. If you mess around with a slinky, you can have a compression wave and an expansion wave, and it leads to phenomena which you wouldn't initially expect, like if there is a traffic shock — like there's an accident and then the cars pile up — then even when the traffic accident is removed and there's no obstruction to travel, the laws of traffic, if you iterate the dynamics, you can actually do the math and you can see that it takes a while for the compression wave to dissipate.
And so living in Los Angeles, this is a phenomenon that I've encountered quite often, that sometimes I encountered a slowdown in traffic and there was no accident or no immediate cause. It was because many hours ago there was something that caused a slowdown, but the dynamics — it takes a certain amount of time for the wave to dissipate. You know, once you understand the dynamics really well, you can do modeling and simulation, and then you can do things like you can make predictions, like if I add another lane to this freeway, will the traffic get better? In fact, sometimes it doesn't. These paradoxes where actually sometimes closing off certain lanes of traffic can actually make the global traffic flow faster.
Now some dynamics are predictable. Sometimes we have equilibria, which are states that just stay the same for all time, and sometimes these equilibria are stable. Well, if you move a little bit away from that state, you come back to that state. Like if you have a pendulum that's going straight down, that's a stable equilibrium. And if you modify it a little bit, you perturb it, it will sort of move a little bit and it'll get back towards a stable equilibrium. But if you make a pendulum upside down, it's balancing on the tip. It could be an equilibrium. Like technically, it can stay in that position forever, but any slight perturbation will actually cause it to move away from the equilibrium over time. So it's important to know what equilibria are stable and which ones are not.
We are now facing a world of climate change where we have lived for 10,000 years in a climate in pretty close to an equilibrium state. Make it hotter or colder some years, but it would bounce back to equilibrium. And we're now actually in danger of leaving that equilibrium and to a much less stable dynamics, which is scary, but it needs to be modeled. And we may need to figure out how to adapt and change our agriculture and all our other practices. Understanding dynamics and which systems are stable, which ones are not, which ones are chaotic, which ones are predictable — it's actually extremely important.
There are very mundane things like predicting the weather. You know, we take for granted that we have accurate weather predictions for the next seven days. This is actually an amazing achievement of atmospheric scientists. They collected lots and lots of data, but they also solved a lot of dynamical systems problems that allowed, over the years, got the error rate down to a point where we can actually reliably predict weather forecasted to, say, a week in advance. It's still not completely 100% accurate, but it's much more accurate than just guessing.
Systems which involve a lot of humans are still very unpredictable. So the dynamics of the stock market or politics — this is well beyond the ability of current dynamical systems theory to model. But natural systems and some human systems like traffic, we can actually model. So it is a fairly advanced area of mathematics. We often need a lot of computer simulations and we need to solve very advanced differential equations, but it can give some very valuable insights.
One of the discoveries of dynamical systems is that most systems exhibit what's called chaos. And this came as a surprise in the 17th century. So Newton, when he introduced the law of gravitation, one of the great successes of this theory was that it explained the motion of the moon around the earth and the earth around the sun. He could explain retroactively all these funny laws of Kepler, like why planets move in ellipses and things like that. And so he solved what we now call the two-body problem: that if you have two massive objects like the sun and the earth, and you move them around and you govern them by a single law of motion — Newton's inverse square law of universal gravitation — he could solve the equations using his newly derived theory of calculus, and he could have perfect formulas for the orbits, and they were perfect ellipses, exactly verifying Kepler's theory. It was an amazing achievement.
Once he solved the two-body problem, it was very natural, and many of Newton's successes — and I think also Newton himself tried to solve the three-body problem. I think Newton once said that this was the only problem that ever gave him a headache, because no matter what he tried, he could not get an exact solution. Leading societies of the time offered major prizes for anyone who could write the solution. This was considered one of the major open problems in mathematics. We still do not have an exact solution for these equations. And the belief now is that there isn't really one that you can write down as a nice, neat formula.
But when you actually look at the numerics, you see that it is not some nice periodic pattern. It often stays periodic for a long period of time, but then suddenly it will change to something a little bit different, and then it will change yet again. We suspect now that our solar system, which currently has, what, eight planets or something, that in the past there were other planets that were in the system, and they mostly moved in sort of elliptical orbits, as according to Kepler. Every so often, the little interactions between the gravitational forces of Jupiter, or Mars, and so forth, would jiggle these planets a little bit out of their usual orbit, and occasionally they would just veer off completely, and sometimes two planets would collide, or one would escape the solar system.
And you know, for example, there's an asteroid belt, which we believe is the remnant of a collision from millions of years ago. Even the most stable of systems, like the solar system, that looks like it hasn't changed for millennia, there are long-term instabilities in that system. Once you move beyond the simplest of systems, there's lots of little tiny unpredictable or very hard to predict deviations that occasionally can pile up, just like occasionally a bunch of monkeys can sort of write the works of Shakespeare. Occasionally, gravitational perturbations can set an entire planet off course.
So often, actually, in the most advanced forms of dynamics today, even if you start off with a completely deterministic system with no unpredictability whatsoever, we find that the best way to model it actually is to approximate it using probability and just assume that there's going to be some random fluctuations back and forth, and eventually your predictions will just get blurrier and blurrier, which — and that just seems to be a fundamental feature of chaos, which many systems have. So these six essentials — they don't describe all the mathematics, but they do describe six of the great themes that mathematics tries to encapsulate, and this is much more precise. This is just a taste of what goes on these days.
Chapter two: how math solves the problems of science. I view STEM as a whole ecosystem. At the bottom there's basic research, like mathematics and some other fundamental sciences, where we pursue things mostly driven by curiosity. We see a phenomenon that is crying out for an explanation or further study. It may not be a phenomenon that we urgently need to solve right now for an immediate problem, but it's something that looks like it should have an interesting answer. And so mathematics is almost entirely curiosity-driven like that. There's some pattern in numbers. There's some pattern in shapes. People just observed while trying to do something else, and we want to understand it better.
At some point, other scientists are able to connect that pattern to something that they're studying, and some mathematical numerical pattern might show up in the behavior of insects in a swarm or in a stock market or whatever. And then sometimes once you understand it, you can actually convert it into some useful technology, or you can have a company that actually makes some money out of somehow some service related to exploiting that phenomenon. We often don't see that. I mean, that's much further down the pipeline.
What you do need is that you do need the people doing the basic sciences to talk to the people doing applied sciences, and they have to talk to people who are doing engineering, and they have to talk to people in industry. If you didn't have one of these communities, then you wouldn't have this pipeline of getting from curiosity-driven questions to actual, you know, commercial results, you know, like the ability to communicate across the planet with almost zero cost.
This is part of what Eugene Wigner calls the unreasonable effectiveness of mathematics in the physical sciences. He observed that mathematicians often discover concepts such as complex numbers or curved space or whatever, just because it seems to be a natural extension of the mathematical objects they're already studying. And then 10, 20, 50 years later, some scientists discover that these concepts that were introduced for fun or for play were in fact almost exactly what was needed to understand some new type of science. So that's a really amazing phenomenon, and we still don't have a good explanation really for why that actually works.
So one historical example of how curiosity-driven mathematics led to a really deep scientific advance was the story of the parallel postulate. Euclid, in like the 3rd century BC, introduced the notion of proof, of being able to explain complicated results in geometry in this case from simpler axioms. For example, that the sum of angles of a triangle always added up to 180 degrees. He was able to explain that in terms of simpler axioms. He laid out five axioms of geometry that he thought he reduced all the other facts he knew about points and angles and lines to these five statements, and four of them were very straightforward, like if I give you two points, there's always a line you can draw between them, right, things like that. These are very straightforward, non-controversial axioms.
But there's one axiom which is called the parallel postulate, which gave him a lot of grief, and in fact his original version was very, very complicated. It got simplified, but even the simplified version was controversial. The simplified version is that if you have a line and you have a point, and the point is not on the line, then there's exactly one line you can draw through that point which is parallel to the first line. By parallel I mean that it never crosses this first line. So that was this axiom: that you can always draw a parallel line through any other point, and there's only one. You cannot draw two parallel lines.
Once you have that, you can do all kinds of things. You can derive what I just said, the angles of a triangle add up to 180 degrees, and all the other classic results of Euclidean geometry. But it was a very ugly axiom compared to the other four, which were really elegant. Eventually they realized that what they had done was that there actually were multiple geometries beyond Euclidean geometry. There's something called spherical geometry, where there's no parallel lines at all. So in spherical geometry, instead of lines you have great circles, like the equator or a longitude. And these great circles on the sphere, they always intersect. You can never make two parallel great circles. So there are no parallel lines.
And then there's this weirder geometry, which is harder to visualize, called hyperbolic geometry, where lines actually diverge from each other, and you have lines that start off looking parallel but they move further and further apart, and in fact now there are actually multiple parallel lines you can draw from one point to a given line. And those two geometries are entirely self-consistent, and eventually it was just accepted that there were more geometries out there than just Euclidean geometry. So these were the first two non-Euclidean geometries to be discovered: spherical geometry and hyperbolic geometry.
But once we had sort of freed our notion that there was only one geometry, this opened all the floodgates, and people studied all kinds of other geometries. So all kinds of curved spaces, you know, spaces that were shaped like donuts or had twists in them. There are geometries where, you know, if you're right-handed, you can go off explore the universe and come back, and if you start off right-handed, you will come back left-handed. That there are geometries where you can change your orientation just by travel, which is very unintuitive, or you can come back smaller or larger than what you started with.
People developed all these geometries, and they developed a very nice language for describing all these geometries. It's called Riemannian geometry after Bernhard Riemann. But it was a curiosity. I mean, these abstract curved spaces, but you know, the universe we lived in seemed completely flat.
But then Einstein, when he was trying to understand gravity, he eventually came to the conclusion that what gravity was doing was it was bending space and time in a certain way, and he needed a language to describe how space and time could bend in such a way that light rays would become not straight, and sometimes, you know, they would hit each other or diverge. He asked his mathematician friend if there was any existing mathematics that would describe this, and here he said, "Oh yeah, there's this bright chap Bernhard Riemann who developed this theory." But it turned out to be almost exactly the right language to describe the Einstein equations.
There's a notion of curvature, that some space can have positive curvature, negative curvature, in Riemannian geometry, and the Einstein equations turned out extremely simple to state in this language: that basically mass and energy create curvature, that the curvature of space and time is proportional to how much mass and energy you have in your system. And that's basically the Einstein equations. Now, solving them is a different matter. They're extremely hard to model. Even the question of how to model two colliding black holes, we can barely do it with modern supercomputers. But stating the equations is actually extremely natural once we had this language.
Another example of how mathematical curiosity led to really practical developments centuries later is the story of sphere packing. There was some British sailor who was just curious about the question of, you know, there's a certain number of cannonballs they had to stack in the hold of their ship, and these are round cannonballs, they're not square, so when you stack them there's a certain amount of wasted space, and he was curious what is the most efficient way to pack cannonballs so you can get the most cannonballs into a certain amount of space. And so he asked a physician friend, who happened to be Johannes Kepler, eventually proposed that the most efficient packing should be the same packing that you see nowadays in supermarkets when you pack oranges.
It's what's called a hexagonal close packing. You pack layer by layer. Each layer is sort of the triangular grid of cannonballs or oranges, and then you stack another triangular grid on top of it, just shifted by a little bit, and then you stack it back, and there's a regular pattern which is the most natural pattern, and it's about 76% efficient. And Kepler thought this was the best you could do, that there was no clever way to squeeze in any more space, but he couldn't actually prove it. So this became known as the Kepler conjecture, and it was one of the most famous unsolved problems in geometry for centuries.
In two dimensions, I think it was solved by about 1900 or something. Like you're packing discs in a plane, that's a simpler problem. That one, there's a similar lattice, a triangular lattice, and that was relatively easy to prove that this was the optimal one. Three dimensions are just too many possibilities. There was no way there. In fact, we still do not have a nice, simple proof of the conjecture that humans can completely understand by themselves.
The conjecture was eventually solved. It eventually got published, I think, in 1998, but it required computers. It was one of the first computer-assisted proofs. There was a team of referees who I think said that they could not verify all of the computations, but they at least believed that the strategy is correct, but there were still lingering doubts. It is only much more recently, 2014 I think, and finally the proof was converted to what is called a proof assistant language, a computer language that is specifically designed to check proofs with 100% certainty. So the Kepler conjecture is now formally verified. We are now 100% certain it is true.
But mathematicians were not content with just that, the three-dimensional problem, so they also asked what happens if you're in four dimensions or five dimensions or six dimensions. So here, of course, there is no practical — you know, I mean, there are no four-dimensional oranges or cannonballs that you...
would like to like to pack, but people still ask this question. People also ask what happens if instead of a continuous space, you have a discrete space. In particular, computer scientists, once computer science became developed, we realized that in addition to the geometry of regular space where XYZ, where coordinates are given by real numbers, we're interested in studying the geometry of strings of bits. So this is now very divorced sounding from the original sphere packing problem, both because now you have many many dimensions, like thousands and thousands of dimensions, and space is now discrete rather than continuous, but still it is geometry, and many of the techniques to understand sphere packing still work when you're in a setting.
And then it turned out that this setting of this problem of packing spheres as efficiently as possible into this big huge cube of bit strings turns out to be extremely practical. When cell phones became digital, every signal that you send, you know, like an image or a text, whatever, is encoded as some bit string, which is then sent over some wireless network, but there are other people also sending signals, and you don't want your signal to be corrupted by interference and be mistaken for someone else's signal. So you want to keep each different signal that comes out, you want to keep them as separated from each other in this space of bit strings as possible. And it turns out mathematically this problem of separating all these signals so that there's no way that one can be confused for another is almost exactly the sphere packing problem, except that it's in high dimensions and it's discrete.
All the mathematics, well, not all of it, but a lot of the mathematics that was used to understand sphere packings could be used to design really efficient sphere packing codes, and not just to design codes, but also to tell engineers what is the theoretical limit of communication, like what is the maximum number of bits per second you could possibly hope to send in a certain wireless spectrum. So that gave really good benchmarks to measure how efficient your protocol was. You could price how many billions of dollars you should pay for a certain wireless spectrum because now you know exactly how much data you can push through that. And so like the entire wireless telecommunication industry is based on being able to pack oranges in really high dimensions.
One of the applications of mathematics that I was involved in that I'm most proud of is the story of compressed sensing. So I was once at an interdisciplinary program at a math institute here in Los Angeles, and I met with a friend of mine who is a statistician, and he was working with an electrical engineer and trying to improve medical imaging, and specifically MRI scans. At the time, MRI scans were quite slow. You had to sit in this scanning machine for like three minutes so that you could collect enough data from all different angles that the scan could reconstruct a good image of your body and be able to pick up tumors or cysts or anything else which is sort of medically important to resolve. But if you only sat in the machine for a short period of time, like say half a minute, you will not get enough data. So if you tried the standard reconstruction algorithm from all the data to recover the image using what's called least squares approximation, which is the standard technique at the time, you would get an image that was so blurry and so low resolution that you could not tell anything useful for diagnosis purposes. So we had to sit in these machines for minutes and minutes, and if you were a kid, sometimes you had to be sedated because the kid would wriggle around and not follow instructions after like the second minute.
So they were trying a new technique, not least squares, something called total variation minimization. They had a hunch that this other method might perform a little bit better, but so they tried it on some test data. They were expecting a slightly sharper image than the least squares approximation, but they got perfect resolution, that they got back almost exactly the correct image even though they only took a few measurements. It would be like giving someone a crossword puzzle where you had only filled in, you know, 10% of the letters, and suddenly they could fill in all the other letters without having to look up the clues. They couldn't explain this, and they showed this to me. And my first instinct was, you made a mistake. You could not possibly have done what you said you did. And in fact, I'm going to prove to you that there was not enough information in the data that you took to make this measurement possible.
So I went home that night. I tried to write down a proof that there was no way to just correctly guess the right image from the small amount of data that they were measuring. And while writing it down, I found one of my steps does not work. And in fact, it showed the opposite, that if a certain measurement matrix had a certain property, then actually what they were doing was actually going to work. And then I checked that their measurement matrix actually did seem to obey this property. So I actually understood how the method worked. And so I went back to them the next day and explained this, and they got very excited, and we wrote a couple papers, and that got everyone else excited.
This method that they had stumbled upon was not completely new. There were seismologists who had discovered a similar method. So they had a different problem where they were trying to understand the fault lines, to locate the fault lines of a crust based on a small amount of seismic data, and astronomers had a similar problem that they were trying to measure the location of stars or something using a very small amount of observed data, and there are a couple other disciplines where a similar problem of trying to extract a high quality image from a very small amount of signal had occurred. In each case they had found some ad hoc fix that could kind of squeeze better resolution out of the data they had, but they could not explain mathematically why it worked.
The seismologist thought, 'Oh, here's a trick, but it only works for seismographs.' And the astronomers had a trick, but it only worked for astronomy. But once we found the mathematical explanation, we found that this was a general technique that we now call compressed sensing. And it's useful for MRI, but it's also useful for wireless broadband. It's useful for certain types of sensor networks. Once we figured out the underlying mathematics, we could see all the other applications that it's useful for. And so now compressed sensing is taught in textbooks right next to least squares. So sometimes with least squares it's the right thing to do, and sometimes compressed sensing is the right thing to do, sometimes neither. It's now a very well-developed theory. I was quite pleased to be involved at the very beginning of that.
It's a fascinating interplay between mathematics and science. So we have this unreasonable effectiveness of mathematics, where mathematical discoveries often end up being the best way to explain physical phenomena. Philosophers and historians have debated why this is the case. One of my theories is that whenever we learn anything, whether it's math or science or any other subject, the first theories or explanations that we make are often not the best. We don't understand what is the cleanest way to express something. And before you understand something completely, you might have an overly elaborate explanation for why something is true. But often the true explanation is more elegant and shorter and simpler than our initial attempts to describe the phenomenon.
But finding the short explanation takes time because you have to sort of unlearn certain assumptions that you might have that turn out to be incorrect. For example, with Einstein's theory of relativity, one of the key assumptions that people had before Einstein was that time was universal, everyone had the same notion of time. You know, that an hour for me is the same as an hour for you. That mindset really blocks you from finding the right way to explain gravity in particular. But once you accept that everyone has their own relative notion of time, then you can find the right language to explain things properly.
Mathematicians also try to take phenomena that they first understand using very inefficient language and try to condense it, try to find the most concise, elegant explanation of a mathematical phenomenon. And I think just because there's only so many ways you can say things concisely, it just happens that often the concise way to describe some mathematical phenomenon is also a concise way to describe a physical phenomenon. So that is my theory. Unfortunately, we only have one timeline of science. You only have one history of scientific development, and we have maybe a hundred turning points in science, and that's a little bit of data, and you can make some theories.
I would love in the future, in the far future, maybe we will meet other civilizations and we will see their history of science, and we will see whether they also had their version of Kepler and Einstein and Newton, and whether they followed a similar track or a completely different track. I don't know.
The funny thing about doing mathematics is that, so you know, there's this stereotype that, you know, we're all geniuses and, you know, we are stuck at a problem and then you get this eureka insight, a light bulb goes on, and like you get this genius idea out of nowhere. I would love for that to happen to me, actually. This does not happen so often to me. What does happen when I do work on a problem is that I try something and it doesn't work. Okay, I try something else and it kind of works, but it gets stuck at a certain point. But now at least I know kind of there's at least one obstacle, and I need to find some tool that will help me deal with that obstacle. And so maybe I will now identify a subproblem which has the same type of difficulty but is simpler, and I try to solve that one first. And if I can do that one, then I can try to scale up back to the original problem, and I go back and forth.
Often a lot of what you're doing is that you are exploring the negative space of the problem, like all the techniques that don't work, and eventually if you have enough of the negative space, the path forward becomes clear almost by elimination, that there's only sort of one thing to do that could work. Sometimes there's nothing that can work, and then you give up on the problem. But there's this repeated, what you might call failure, but it really is kind of just really understanding the limitations of what different approaches can do. And then after weeks or months, you know, of this, the answer becomes clear.
But by that point, it's so internalized what the difficulties are that it doesn't feel amazing to you anymore. It feels natural, like of course you had to do this because there's this difficulty. You must go around this pothole. You must do this step first because you know in five lines you're going to need this hypothesis to solve this problem. You just become so attuned to the problem that everything becomes natural. Yeah, or sometimes you never solve the problem because you never attune and you give up. The feeling I get is never so much eureka, but it's always, oh, how come I missed this early? I was so stupid. But often it's a constant experimentation and failure that really primes you to find, to accept the right solution.
There's this dramatic contrast between the standards we assign to outcomes and the standards we assign to process. So for outcomes, mathematics very famously has a very high standard of correctness. You know, for a given problem, there's a correct answer and lots of incorrect answers, and when we grade our students' homework in mathematics, you know, if you get your sign wrong or whatever and you got the wrong answer, you got all these negative marks. You get criticized if you make math mistakes in your final answer. One consequence of that is that many students who go through, you know, say a high school level of mathematics become very averse to making any mistakes whatsoever when they try to approach a math problem.
Paradoxically, the process of arriving at the answer is almost the complete opposite, where you almost have to make mistakes over and over again, and you have to try the stupid things first to appreciate why the clever things work. There's a quote by Niels Bohr, who's a physicist, who said that an expert is someone who has made all the mistakes that can be made in a very narrow field. You don't publish these mistakes. You execute these mistakes in your process in order to locate the correct answer, but only after exploring a lot of incorrect answers first. It's very important, I think, to normalize failure in the process, to disclose that behind every successful solution to a problem there are dozens of incorrect attempts. And it's not because the people trying these problems were stupid, but this is often just part of the learning process.