Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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%)
share|improve this question

2 Answers 2

up vote 1 down vote accepted

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....

share|improve this answer
    
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?

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.