Suppose I've got a set of N items (e.g 5), sorted from most rare to least rare. I know at the end I want exactly Z total (e.g 15) items, where each item from my set is assigned a weight according to it's position in the set, creating a curve where items at the end of the set are more frequent.
A very basic example:
[a, b, c, d, e] => [a, b, b, c, c, c, d, d, d, d, e, e, e, e, e]
I'd like a parameter which can be changed to adjust the curve, to change the steepness. For example, by changing this parameter the results might look like this:
[a, b, c, d, e] => [a, a, b, b, b, c, c, c, d, d, d, e, e, e, e]
My thinking is to use something like y=a(1+b)^x, where X is it's index in the set and Y becomes the weight, but I don't know how to set it up so that I always get Z total items at the end, and every item in the set is included at least once in the results.
Sorry if some of the terminology isn't right!
Your question is really an apportionment problem, analogous to that for the House of Representatives: the fixed number of seats should be allocated in proportion to the state populations with the restriction that each state gets at least one representative.
The populations are the weights you ask about. You can use any increasing function of the index you like to adjust the allocations to favor elements nearer the end of the list.
There are several algorithms (but no formulas) that determine allocations given weights. None is free from paradox: see https://en.wikipedia.org/wiki/Apportionment_paradox.