# Realistic Example of Power-Law Distribution?

I'm missing a bit of inbetween-math, and having some trouble understanding this, but:

I want to generate a set of data that follows a power law. Let's say I have 10,000,000 people who like a power-law-distribution of 1,000,000 items, sorted into groups by popularity. Could someone give me an example of/explain to me:

• How many people like the 25 most-popular items? How many like the next 50 most-popular items? How many like the next 100? Etc. In simplest-terms/math possible, how do I calculate the number of liked-items for person-N?

• Could you break this down for me a bit? Is there a more specific description of what kind of power law this graph follows?

I apologize for my lack of background-knowledge here--I'm coming from a non-mathematical background. Thanks!

## 2 Answers

Power law is a ranked distribution. Let us assume that we have the twitter personalities on the x-axis and the number of followers they have on the y-axis. The distribution is plotted in such a way that the personality with the highest number of followers is introduced on the first position of the x-axis, the personality with the second highest number of followers is introduced on the second position of the x-axis, so on and so forth, and the last personality on the x-axis has the least number of followers.

The plot can be modeled as y = C(x^-a) Apply log on both sides : log(y) = log(C) - a.log(x) -a is the slope the line and C is some control parameter. substitute the ranked numerical user id (for twitter personality) at 'x', and set the C and -a values. This results in mapped 'y' (number of twitter followers) value.

• Thanks! First paragraph makes complete sense, but what's "a" and what's "C"? I guess I learn more by example. Is there any way you could take a guess at C and a for this graph? – Will Jan 23 '13 at 8:46
• @Will: a good was is to fix 'C' and 'a' is to visualize the plot and see if that makes a good fit. This is just to begin with. However, you can look into model fitting literature to choose one of the good automatic methods to fit the curve. – Vikram Jan 25 '13 at 16:31
• Not math-minded enough I guess. I'm coming from a programming background with little math. – Will Feb 4 '13 at 1:07

If the popularity of your items follow a strict or pure power-law distribution, then they have a mathematical form like this

$p(x)=\frac{\alpha-1}{x_{\rm min}}\left(\frac{x}{x_{\rm min}}\right)^{-\alpha}$

where $\alpha$ is the scaling parameter or exponent of the distribution, and $x_{\rm min}$ is the smallest value for which the power-law form holds. To make things simply, let's assume that $x_{\rm min}=1$. This simplifies the distributional form to simply

$p(x)=(\alpha-1)x^{-\alpha}$

where $x$ is the number of people who like a randomly selected item from your set. Note that if $2 < \alpha < 3$, which is the usual range of $\alpha$ observed in empirical data sets, then you can get a few items that are enormously popular.

To ask how many people $n_k$, within a population of $N$ people total, like the $k$ most popular items (which generalizes your question about $k=25$), we simply integrate the distribution like this

$n_k=N \int_k^\infty p(x) {\rm d}x = N \, (\alpha-1)\int_k^\infty x^{-\alpha} {\rm d}x = N \, k^{-\alpha+1}$

That is, we integrate the distribution from $k$ to $\infty$, which gives us the fraction of the total distribution that lies above the value $k$; we then multiply this fraction by the total population $N$ to get the number of people $n_k$ that like the top $k$ items.

The link you gave didn't work, so I can't comment on it specifically, but the standard techniques for deciding whether some data do or do not follow a power-law distribution are described in Clauset, Shalizi and Newman, "Power-law distributions in empirical data." SIAM Review 51(4), 661-703 (2009), which you can find on the arxiv. They also provide implementations of their methods on their website here.

Also, I should point out that just because some data look like a straight line on log-log axes is not sufficient evidence to say they follow a power law! Data drawn from many heavy-tailed distributions, like the log-normal and the Weibull, can look straight on a log-log plot, but they most definitely are not power laws.