I am organizing a tour for the musicians in my orchestra, and I want to create a formula that will reduce the cost of this tour for each musician based on their percentage of attendance at rehearsals. I have $n$ musicians (around 30+), each one has $p_i$ percentage of attendance. There is $D$ amount of money to spend. Overall cost for a whole tour is $C$. Let's assume that $D\lt C$ and $x_i$ is amount of money for i-th musician. I know that:$$\sum_{i=1}^{n}x_i=D \land x_i \le \frac{C}{n}$$ I tried sth like that: $$x_i=p_i*\frac{D}{\sum_{j=1}^n p_j}$$ but in some cases I got $x_i \gt \frac{C}{n}$ (musician got more money than tour costs). Is there a simple solution to problem like this?
Asked
Active
Viewed 21 times