Tag Archives: Facebook

The unreasonable effectiveness of math, and Facebook (part 3)

Ok, by the end of this post, I will finally make you say "whoa!"

Two posts ago, I talked about "the unreasonable effectiveness of mathematics" -- the surprising and amazing success that mathematics has had describing phenomena in the real world. I also showed this graph I put together of the number of Facebook users over time:

Then, last time I went on a big long digression to introduce you to differential equations. I introduced the differential equation

[frac{dx}{dt} = rx ]

which describes a particular scenario of growth in continuous time. More specifically, the left side of the equation is just formal mathematical notation for change, known as a derivative. If x(t) is the amount of money in your savings account, what this equation says is that at every moment in time, the way your bank account changes is that it accrues r times the amount of money currently in the account. This is called continuous compounding. The solution to the differential equation -- meaning the formula that x(t) actually follows -- is

[ x(t) = x_0 mathrm{e}^{r t} ]

where x_0 is the amount of money you start out with. This is exponential growth. If you don't withdraw anything, and if your bank doesn't fold, then your money grows forever.

And now we are ready for the new stuff. In reality, nothing can grow forever. All growth in the world is bounded by some constraints. Think about population. The famous Malthusian idea of growth, proposed in the late 18th century, is the one we have already discussed: unbounded exponential growth. Thomas Malthus was thinking about growth in the context of the human population on Earth. But in 1838 a guy named Pierre François Verhulst wrote a paper whose French title translates as "A notice on the Law that Population Growth Follows" in which he pointed out that populations really can't grow forever because of constraints such as limited food and space. This same idea was highlighted in a 1920 paper by Pearl and Reed called "On the Rate of Growth of the Population of the United States Since 1790 and its Mathematical Representation." The differential equation that Verhulst, Pearl, and Reed had in mind to describe constrained growth is known as the logistic model, which can be written as

[frac{dx}{dt} = rx(1 - x/K) ]

where x(t) describes the population size over time. The constant r is a growth rate, and plays the same role as r in our bank account problem, except than instead of dollars reproducing, we are now thinking of people reproducing. However, in our money problem, the growth percentage was always r. In the logistic model, it's not. To see this, think of rearranging the right hand side of the equation. You could write it as

[frac{dx}{dt} = [r(1 - x/K)]x. ]

Instead of multiplying x by r as in the bank account problem, we are multiplying it by r(1-x/K), which depends on the actual value of x! If x is very small, this prefactor is essentially equal to r, and growth will be (nearly) exponential, like in the bank account problem. But then, as x grows, the prefactor gets smaller and smaller, meaning that growth slows down. This is how we capture limited resources. In fact, when x=K, the prefactor is zero! The parameter K is known as the carrying capacity -- it is meant to capture the maximum population that an environment with limited resourced can support. Also notice that if x happened to be bigger than the carrying capacity K, the prefactor would be negative, and so the rate of change of the population would be negative, which means the population would shrink. People would die off because of the unavailability of resources.

The logistic differential equation has solution

[x(t) = frac{C mathrm{e}^{rt}}{1+frac{C}{K}mathrm{e}^{rt}}. ]

You can trust me that this is the solution. If you ever decide to learn differential equations, you'll be able to obtain it yourself. Now, remember that r measures growth in the absence of constraints, and the carrying capacity that measures the constraints is K. The number C just depends on how much population you start out with. If the population starts under the carrying capacity, the solution has a characteristic s-like shape that looks like this:

In this example, the carrying capacity is K=1 and you can see that x(t) levels off to that value towards the right, that is, for later values of t.

In case you are thinking "who cares? How could this ever describe anything in real life?" let me go ahead and make you say "whoa!" two times.

First, we have Georgy Gause, who in 1932  wrote a paper with the awesomely grandiose title "Experimental Studies on the Struggle for Existence." Gause let some yeast grow in a lab experiment, and he plotted the amount of yeast over time (shown as symbols below). Then he also plotted solutions to the logistic equation (drawn in as curves). Here's what he got:

If you are not saying "whoa!" let me assure you that you really should be. Yeast are living organisms with their own complicated biology. Even a controlled lab culture is a complicated environment. And yet somehow, a single differential equation does a good job describing yeast population growth.

And second, we have -- finally -- Facebook. When I plotted the data showing the number of active Facebook users over time, I saw the s-shape, which screamed "logistic." So I did a quick fit of the data to a logistic curve. That is to say, I tried to find values of r, K, and C so that the logistic curve would do a good job approximating the many data points. While there are lots of fancy ways to do more precise curve fitting, I wanted to show you that it doesn't take fancy skills to do at least a heuristic job, so I just did some trial and error and came up with r=0.085, k = 1100, and C=3.06. Here's the result, with the actual Facebook data plotted (again) as blue dots and the logistic curve in red:

Crazy, right?! Note that I have included times well beyond those where the Facebook data is available -- or in other words, I've extended the horizontal axis a bit -- to give a sense of what the future holds. From our choice of K = 1100 we can predict that Facebook will max out at 1100 million -- or 1.1 billion -- active users.

People are complicated creatures. Social networks are complicated. People's access to and relationship with technology is complicated. And yet one simple differential equation seems to do a good job matching the Facebook data.

Talk about the unreasonable effectiveness of mathematics.

The unreasonable effectiveness of math, and Facebook (part 2)

Last time, I started talking about Facebook. My goal is to make you say "whoa!" when you see how simple mathematical models can describe really complicated things in the real world. This post is a necessary digression on the way to understanding the Facebook example from last time. So you will have to postpone "whoa!" for one more day.

Since we are in the midst of an economic depression, let's talk about money. Suppose you have a savings account that yields interest on whatever you current balance is. And say that you deposit 100 January 1. Suppose also that your interest gets compounded at a rate of 0.004074 per month, or 0.4074% per month. This means that on February 1, if you haven't touched your account, you will suddenly have about100.41. We can write this as

[100 (1+0.004074)^1 = 100.41.]  And then, if you don't touch your account for another month, then on March 1 you will have  [100 (1+0.004074)^2 =100.82.]

This is called compounding. After the second month, you didn't just earn interest on your original 100; you also earned it on the interest you had already earned. In fact, after 12 months, you will have  [ 100 (1+0.004074)^{12} =105.00. ]

We say that the annualized percentage rate is 5%. In other words, in terms of your bottom line, earning 0.4074% per month 12 times a year on an untouched account is that same as earning 5% one time at the end of the year.

This example so far has ben set in what we call discrete time. Compounding happens at distinct moments (for instance, the end of each month). But what if instead of happening at distinct moments, things happen at every moment in time? In case that made your brain explode, suppose that instead of earning 0.4074% once per month, you earned half of that, namely 0.2037%, twice a month. In this case, instead of ending up with 100.05, you'd end up with100.05 and an additional 1/2 cent. This is close to, but not the same as, our original example. And then imagine that you earned a quarter of the original interest rate, but compounding happened four times a month. Then you'd end up with 100.05 and an additional 7/10 cent. And suppose you take this to the extreme -- earning less interest at each compounding event, but having correspondingly more compounding events. Then you end up with what's known as a <em>continuous time</em> problem. Something (namely, interest compounding) happens at every single moment in time. And by the way, in that limit, your bank account balance at the end of a year would be105.01. In short, you'd earn a whopping extra cent due to the continuous, rather than discrete, compounding.

A common way to describe a problem where something grows in continuous time is to use a differential equation. I'm about to write down a simple differential equation which I call "the most important differential equation in the world." My students know it by this name. If you ask them "what's the most important differential equation in the world," they will write down this equation. If you write down the equation and ask them the name, they'll tell it to you. The equation is

[frac{dx}{dt} = rx. ]

This equation can describe our continuously compounded interest problem. In that case, x is the amount of money in your savings account, and it depends on time t measured in months. The left side of the equation is just formal mathematical notation for change, known as a derivative. I'll post more on derivatives another time. For now, when you see dx/dt, you should replace it in your head with "how quickly my bank balance is changing over time." Then there's an equals sign, which means that on the right hand side of the equation, we are going to put in the proper rule describing a savings account. The parameter r is the rate of continuous compounding. So the equation says that at every moment in time, the way your bank account changes is that it accrues r times the amount of money currently in the account. If we want to have an annualized rate of 5%, it turns out that we need to choose r to be about 0.0040658, which is close to, but not the same as, the value of 0.004074 needed to earn 5% annual when compounding only takes place 12 times a year, rather than continuously. To restate: if your 100 earns 0.40658% interest at every moment in time, then at the end of a year, you will have105.

One advantage of having a differential equation description of something is that it is sometimes possible to solve the differential equation, that is, to write down a formula for the unknown function x(t) which in our case describes the amount of money in the bank account over time. If you start out with 100 and the interest rate isr=0.0040658, then  [ x(t) = 100 mathrm{e}^{0.0040658 t} ]  wheret, remember is measured in months. You can plug in any value oftto find out how much money you have at that time. Very convenient. If you plugt = 12months into this formula, you'll get outx(12) = 105.

Believe it or not, we are now ready to move back to Facebook... tomorrow. But I swear, I am going to make you say "whoa!" and it will have been worth the wait.

The unreasonable effectiveness of math, and Facebook (part 1)

In this post and the post that will follow next week, I want to make you say "whoa." Specifically, I want to make you say "whoa" by showing you how complicated things in real life can sometimes be described by amazingly simple mathematical equations. These equations are simple enough that even the most mathematically phobic and/or inexperienced among you will be able to handle them.

With the goal of making you say "whoa" in mind, let's talk about The Unreasonable Effectiveness of Mathematics in the Natural Sciences. In 1960, Nobel prize winning physicist and mathematician Eugene Wigner wrote a paper with this title. His main point was to ask the philosophical question "Why on earth does mathematics do such a good job describing stuff in the real world?" In 1980, applied mathematician Richard Hamming followed up Wigner's paper with a similarly-but-slightly-more-succinctly-titled homage, The Unreasonable Effectiveness of Mathematics.

Wigner and Hamming were trying to understand how it can be that by pushing around a bunch of abstract mathematical symbols, we can discover how electromagnetic waves behave, or what trajectory a launched missile will follow, or countless other phenomena. Wigner and Hamming were thinking mostly of physics and engineering, and indeed, these areas were the focal application areas of mathematics for quite a long time. Starting in the mid-to-late 20th century, though, there was explosive growth in the application of mathematics to biology. So in addition to describing physical and engineering systems, math does an uncanny job describing the human immune system, the spread of disease within a population (which I will post about sometime soon), the march of evolution, and much more. Even more recently, math has crossed over to the realm of describing social systems. Indeed, much of my own research is about aggregations formed by social organisms: think fish schools, bird flocks, and swarms of locusts.

Speaking of social phenomena, let's talk about Facebook. Since this is a blog, and since you are reading it on a computer, I dare not even bother to explain to you what Facebook is. Chances are that you are a Facebook user, whether you are the type who logs in every day or the type who created an account but has abandoned it. Yesterday, I came across this data on the number of active Facebook users over time. Now, I am not sure how "active" is defined, but still, I was curious about the data, so I did the simplest thing possible, namely, make a graph. Here's what I got:

Hmmm, I thought, those points look like they are tracing out a pretty well-defined curve. That's amazing! But what curve is it? (The mathematicians among you can likely tell from one glance at the picture.)

In the next post, we'll answer this question very explicitly. First we will have to go on a digression that relates to money and differential equations. Please don't be put off. Even if you are a total non-mathematician, you can still learn about differential equations. Seriously. Get yourself ready, and we'll talk about it next week.