# Discrete Pareto Distribution

What would be the equation to describe a set of 10,000 bugs if you already know they have a pareto distribution.

In other words 2,000 of the bugs would equal 80% of all your problems.

I'm struggling to make the pareto and/or Zipf equation fit this model... It should be relatively simple.

I would like to make a simple "progress bar" type graph that will use this equation.

• To further clarify... fixing all 10,000 bugs would show a 100% progress bar, 2,000 would show 80%... etc Apr 28, 2013 at 3:43

A discrete Pareto distribution is normally known as the Riemann Zeta distribution which is ill-suited to your problem because it is unbounded above … whereas you seek a finite upper bound of $n=10000$.

Your other suggestion of a Zipf distribution seems more appropriate as it has a finite upper bound at $n$ elements, so let us use that. I am using the mathStatica/Mathematica combo here …

So, let $X \sim \text{Zipf}(n,a)$ with pmf $f(x)$:

       f  =  1/(HarmonicNumber[n, a] x^a);

domain[f] = {x, 1, n} && {n>0, a>0} && {Discrete};


The cdf, $P(X \leq x)$, is:

Prob[f]


You wish to find the value of parameter 'a' such that $P(X \leq 2000) = 0.8$, given $n=10000$. Solving this numerically yields:

So that's it … a $\text{Zipf}(n,a)$ pmf with $n = 10000$ and $a = 0.949588$, which will yield you:

• $P(X \leq 10000) = 1$

• $P(X \leq 2000) = 0.8$

Estoup
Finally, depending on how important it is that $P(X \leq 2000) = 0.8$, you might want to consider the simplified case of $a = 1$ which is known as an Estoup distribution with pmf:

 f  =  1/(HarmonicNumber[n] x)


and which will yield:

• $P(X \leq 10000) = 1$

• $P(X \leq 2000) = 0.835584$

I'm struggling to plot that cdf in wolfram mathematica... do you know the syntax for that?

Sure. Here is the cdf in InputForm ... just copy and paste:

F = Piecewise[{{1, x >= n}, {(-HurwitzZeta[a, 1 + Floor[x]] + Zeta[a])/HarmonicNumber[n, a], 1 <= x < n}}, 0]


If $n$ is small, you can see that this has a stepped structure:

Plot[F /. {n -> 14, a -> 2}, {x, 0, 14}, PlotRange -> All]


And, for your case, with very large n, it appears continuous, but is of course actually discrete, if you were to zoom in:

Plot[F /. {n -> 10000, a -> 0.949588}, {x, -10, 11000}, PlotRange -> All]


• Wow, thanks wolfies, this is a great start. I'm struggling to plot that cdf in wolfram mathematica... do you know the syntax for that? I want to mark this as answered but just want to make sure I can plot it. Apr 28, 2013 at 15:33
• @user2221361 updated :) Apr 28, 2013 at 16:38
• Awesome Wolfie! Thanks so much. Copying and pasting that piecewise function worked to show the general formula in pretty print but not able to get the "PLOT[F /. {n..." to work. But not a big deal. What would the E[X] be for that function. Just the derivative right? Apr 28, 2013 at 20:48
• It must work. It's Plot, ... not PLOT. Just copy and paste. If X~Zipf(n,a), then E[X] = HarmonicNumber[n, a - 1 ]/HarmonicNumber[n, a]. Apr 28, 2013 at 21:01