# Exponential formula to assign list items an equally distributed percentage

I am going to explain this as best as I can:

We have a number of list items, that dynamically changes (sometimes it has 5 items sometimes it has 7 items or 43 items, etc.) We are trying to find a relevant prioritypercentage to assign to each list item (starting from bottom to top) but cannot figure out a formula to do so based on the number of items.

For example (percentages are COMPLETE guesses):

Is there a formula that will take a number and distribute 100 points exponentially or any other way as shown below?

A list item with 2 items:

1. List item 1 (75%)
2. List item 2 (25%)

A list item with 3 items:

1. List item 1 (50%)
2. List item 2 (30%)
3. List item 3 (20%)
-

Here's one way: if you have $n$ items, assign the 1st one ${2n\over n(n+1)}$, the 2nd one $2(n-1)\over n(n+1)$, then $2(n-2)\over n(n+1)$, etc, down to the last getting $2\over n(n+1)$.

For 2 items, this gives 2/3, 1/3.

For 3 items, 1/2, 1/3, 1/6.

For 4 items, 40%, 30%, 20%, 10%.

It's not "exponential", but it's easy....

-
I chose this one because it's simplest and easiest to implement. Thank you. – masedesign May 18 '11 at 1:33

If you want each one to be smaller than the last by a ratio $r$, the sum of $1+r+r^2+\dots+r^{n-1}$ ($n$ terms) is $\frac{1-r^n}{1-r}$ so you could give $100\frac{r^{i-1}(1-r)}{1-r^n}$ to iterm $i$, where $i$ ranges from $1$ to $n$. So for $r=\frac{2}{3}, n=4$, the sum is $\frac{65}{27}$ and the points are about $41.53, 27.69, 18.46, 12.30.$ Does this work for you?

-
Thanks very much. Gerry's was simpler but this allows me to tweak the ratio if needed, so this will also come in handy. Much appreciated all! – masedesign May 18 '11 at 1:34