Logistic function
Based on Wikipedia: Logistic function
The S-Curve That Shapes Everything
There's a mathematical curve hiding everywhere you look. It describes how rumors spread through a population, how diseases sweep across continents, how neurons fire in your brain, and how species fill up their ecosystems. It's called the logistic function, and once you understand it, you'll see it everywhere.
The curve looks like a stretched-out letter S lying on its side. It starts nearly flat at the bottom, rises with increasing steepness through the middle, then flattens out again as it approaches its ceiling. This simple shape captures something profound about how things grow in the real world: not forever, but until something stops them.
Why Things Don't Grow Forever
Imagine a single bacterium in a petri dish full of nutrients. That bacterium divides in two. Those two divide into four. Four become eight, then sixteen, thirty-two, sixty-four. This is exponential growth, and it's terrifyingly fast. Left unchecked, a single bacterium could theoretically produce enough descendants to outweigh the Earth in a matter of days.
But of course, that never happens. The petri dish runs out of food. Waste products accumulate. Space becomes scarce. The growth slows, then stops.
This is exactly what the logistic function captures. It describes growth that starts exponentially but hits a ceiling—what mathematicians call the "carrying capacity." In the bacterium example, the carrying capacity might be determined by how much nutrient is in the dish. For a population of deer in a forest, it might be how much food the forest can produce each year. For a viral video, it might be the total number of people on the internet.
The Birth of a Mathematical Idea
The logistic function was invented by a Belgian mathematician named Pierre François Verhulst in the 1830s. He was trying to solve a problem that had puzzled thinkers for decades: how do human populations actually grow?
The prevailing model at the time was simple exponential growth—the same pattern as our petri dish bacteria in their early, optimistic phase. But Verhulst recognized that this couldn't be right for real populations. Resources are finite. Land runs out. Food production has limits. There must be some kind of brake on the system.
Working under the guidance of Adolphe Quetelet, a pioneer of social statistics, Verhulst developed his modification. He published a brief note in 1838, then expanded his analysis in 1844, and finally applied it to model the growth of the Belgian population.
Verhulst called his creation the "logistic" curve. Nobody knows exactly why he chose that word. It's not related to "logistics" in the military or business sense—that word comes from the French term for lodgings. The best guess is that Verhulst was making a clever mathematical joke. His discussion preceded the logistic curve with descriptions of "arithmetic" growth (adding a constant amount each step) and "geometric" growth (multiplying by a constant factor each step). "Logistic" was probably meant to suggest a third type, with the name derived from ancient Greek mathematical terminology.
Three Numbers Tell the Whole Story
The logistic function is completely determined by just three numbers. Understanding what each one does gives you remarkable power to describe all sorts of real-world phenomena.
The first number is the carrying capacity, often labeled L. This is the ceiling—the maximum value the function can ever reach. In population terms, it's how many individuals an environment can sustainably support. In technology adoption terms, it might be the total number of potential users. The function gets closer and closer to this value but never quite touches it.
The second number is the growth rate, typically called k. This controls how steep the middle part of the S-curve is. A high growth rate means the transition from bottom to top happens quickly and sharply. A low growth rate stretches the transition out, making the curve more gradual. Think of the difference between a viral TikTok video (high k) and the slow adoption of electric vehicles (lower k).
The third number is the midpoint, usually written as x₀. This is simply where the curve's center lies along the horizontal axis—the point where growth is fastest and the function equals exactly half its carrying capacity. For a product launch, this might be the moment when adoption tips from early adopters to the mainstream market.
The Standard Form
Mathematicians often work with a simplified version called the standard logistic function. They set all three parameters to the most convenient possible values: the carrying capacity equals one, the growth rate equals one, and the midpoint sits at zero. This strips away the details of any particular application and reveals the pure shape of the curve.
In this form, the function equals one-half when x equals zero—right at the midpoint, as you'd expect. When x is a large negative number, the function is very close to zero. When x is a large positive number, it's very close to one. And the transition happens in a surprisingly narrow band: by the time x reaches six, the function is already more than 99.7 percent of the way to its ceiling. By negative six, it's less than 0.3 percent above zero.
This means that in practical calculations, you rarely need to worry about values of x outside the range from negative six to positive six. The function has essentially reached its limits by then.
Beautiful Symmetry
The logistic function has an elegant property that's worth appreciating: it's perfectly symmetric about its midpoint.
Here's what that means. If you pick any point on the rising part of the curve and measure how far it is above zero, that distance exactly equals how far the corresponding point on the opposite side is below the ceiling. The approach to the ceiling mirrors the departure from zero.
Another way to see this: if you rotate the entire curve 180 degrees around its center point, it maps perfectly onto itself. The curve is the same shape whether you're looking at it right-side up or upside down.
This symmetry isn't just mathematically pretty—it reflects something true about many real growth processes. The early struggle to get off the ground often resembles, in mirror image, the final struggle to eke out the last bits of growth as you approach saturation.
The Logistic Function's Secret Identity
Here's something that surprises many people when they first encounter it: the logistic function is just the hyperbolic tangent in disguise.
The hyperbolic tangent, written tanh, is a fundamental function that appears throughout mathematics and physics. It describes the shape of a hanging cable, appears in the mathematics of special relativity, and crops up in statistical mechanics. It ranges from negative one to positive one, centered at zero.
The logistic function is simply the hyperbolic tangent that's been shifted up and rescaled to range from zero to one instead. Take the hyperbolic tangent, add one to it, divide by two, and you've got the logistic function. They're the same curve wearing different outfits.
This connection hints at something deep. The logistic function isn't some arbitrary construction—it's woven into the mathematical fabric of reality, connected to fundamental structures that appear across different branches of mathematics and science.
Inverse Operations: From Probability to Log-Odds
Every function has an inverse—a way to run the operation backwards. For the logistic function, the inverse is called the logit function (sometimes spelled "logit" as a blend of "logistic unit").
The logit takes a probability—a number between zero and one—and converts it into something called the log-odds. If you have a 75 percent chance of winning a bet, what are your odds? Three to one in your favor (three ways to win for every one way to lose). The log-odds is simply the logarithm of that ratio.
Why would anyone want to work with log-odds instead of plain probabilities? The answer lies in their mathematical behavior. Probabilities are trapped between zero and one, which makes them awkward to work with in many statistical procedures. Log-odds can range from negative infinity to positive infinity, which is much more convenient for mathematical manipulation.
Statisticians use this trick constantly in a technique called logistic regression, which despite its name is actually used for classification problems—predicting which category something belongs to rather than predicting a number. The logistic function bridges the gap between unconstrained mathematical quantities and bounded probabilities.
Where You'll Find This Curve
The logistic function appears in an almost absurdly wide range of fields. Here are some of the places it turns up:
- Ecology and population biology: This was the original application. How many rabbits can Australia support? How will an invasive species spread through a new habitat? The logistic function provides the basic framework.
- Epidemiology: The spread of diseases through populations follows logistic dynamics. Early spread is exponential as each infected person passes the disease to many others. But as more people become infected (or immune), fewer susceptible targets remain, and growth slows.
- Technology adoption: The famous S-curve of technology diffusion—from innovators through early adopters, early majority, late majority, and laggards—is a logistic curve. Smartphones, internet access, electric vehicles, and countless other technologies have followed this pattern.
- Neural networks: Artificial neurons often use the logistic function as their "activation function"—the rule that determines whether and how strongly they fire. The function's smooth S-shape allows for efficient learning algorithms.
- Economics: Market saturation, the diffusion of innovations, and various growth models all employ logistic dynamics.
- Chemistry: Certain autocatalytic reactions—reactions whose products speed up the reaction itself—follow logistic kinetics.
- Linguistics: The spread of new words or grammatical constructions through a language community can be modeled logistically.
- Political science: The adoption of new policies or the spread of political movements sometimes follows these curves.
The function's ubiquity isn't coincidental. Whenever you have growth that's proportional to both how much you have and how much room remains, you get logistic dynamics. This situation is remarkably common in nature and society.
The Three Phases of Growth
The logistic curve divides naturally into three phases, each with its own character.
In the first phase, growth is essentially exponential. The quantity is small relative to the carrying capacity, so there's plenty of room to grow. Each unit produces more units, and the total grows faster and faster. On the graph, this is the lower part of the S-curve, curving upward with increasing steepness.
In the second phase, growth is nearly linear. You're in the steep middle section of the S-curve, where the graph looks almost like a straight line. Growth is fast but steady—neither accelerating nor decelerating significantly. This is often the most dramatic phase from a human perspective, when change is most visible.
In the third phase, growth slows as saturation approaches. You're nearing the carrying capacity. Most of the potential has been realized. Each increment is harder to achieve than the last. The curve flattens out, asymptotically approaching but never quite reaching its ceiling.
This three-phase pattern explains why predictions about growth are so often wrong. In the exponential phase, people underestimate how fast things will grow. In the saturation phase, people overestimate remaining potential. Only in the middle phase do intuitions tend to be accurate.
Connections to the AI Infrastructure Buildout
Understanding the logistic function provides useful perspective on debates about artificial intelligence infrastructure investment—including questions about whether we're in a bubble.
Every major technology follows an S-curve. Early investment looks speculative and risky. Middle investment captures the main growth phase. Late investment fights for scraps as the market saturates.
The crucial questions are: Where on the curve are we? What's the true carrying capacity? And how steep is the growth rate?
If the carrying capacity for AI services is enormous—say, because AI will eventually handle a huge fraction of all cognitive work—then we might still be in the early exponential phase despite all the investment so far. The current scale might be tiny compared to what's coming.
But if the practical applications of current AI technology are more limited, or if fundamental constraints kick in sooner than expected, the carrying capacity might be much lower. In that case, growth could be much closer to the saturation phase than investors realize.
The logistic function can't tell you which scenario is correct. But it does provide the right mental framework for thinking about the question. It reminds you that exponential growth doesn't continue forever, that saturation always eventually arrives, and that the transition between phases can be surprisingly sharp.
Why the Curve Is Smooth
One elegant feature of the logistic function is that it's infinitely smooth—differentiable as many times as you want. There are no corners, kinks, or sudden changes anywhere along the curve.
This smoothness comes from the exponential function that underlies the logistic. The exponential is the smoothest function in all of mathematics, in a precise technical sense. It's its own derivative. The logistic function inherits this smoothness.
Smoothness matters for both practical and theoretical reasons. For practical applications like neural networks, smoothness means you can use gradient-based optimization—algorithms that follow the slope of the function to find good solutions. Without smoothness, these algorithms break down.
For theoretical purposes, smoothness lets you take Taylor series expansions, apply calculus techniques, and generally use the powerful machinery of analysis. The logistic function is mathematically well-behaved in every way you might want.
Generalizations and Variations
The basic logistic function is just the beginning. Researchers have developed numerous variations for specific applications.
The generalized logistic function adds more parameters to control the shape of the curve more precisely. You can make the S-curve asymmetric, so growth accelerates faster than it decelerates (or vice versa). You can shift when the inflection point occurs. You can adjust how sharply the curve bends at its extremes.
For population models, various carrying capacity functions let the ceiling itself change over time. A growing food supply might raise the carrying capacity, while environmental degradation might lower it.
In machine learning, variations of the logistic function compete with each other as activation functions. The rectified linear unit, or ReLU, isn't an S-curve at all but has become popular for its computational efficiency. Other variants like the softplus function smoothly approximate ReLU while retaining some sigmoid-like properties.
Each variation trades off different properties: computational speed, mathematical convenience, biological plausibility, or fit to particular data sets. The standard logistic function remains the default because it balances all these considerations reasonably well.
A Final Thought
Pierre François Verhulst couldn't have imagined all the places his curve would appear. He was trying to model Belgian population growth, a very specific practical problem. But he stumbled onto something universal—a mathematical form that captures a fundamental pattern in how bounded growth works.
The logistic function is what happens when enthusiasm meets constraint, when potential meets reality, when "how much do we have" combines with "how much room is left." That combination turns out to describe an enormous range of phenomena, from bacteria in a dish to ideas spreading through society to neurons firing in a brain learning something new.
The S-curve isn't just a mathematical abstraction. It's a window into how the world actually works—one elegant equation that explains a remarkable amount about growth, limits, and the shape of change itself.