Suppose there are n lines for a hotline.Whenever a customer calls the hotline, the call is forwarded to one of the n lines. And I want to assign  percentage of calling to each of the n lines. Suppose there are two lines and one line is assigned 60% and other is 40%, the total number of calls is 10 so the first line would receive 6 calls and second will get 4 calls.I know the percentage of calling to each line in advance but the problem is that I don't know the number of calls that would be received in a day.How can I distribute the number of calls without knowing the total calls?
Algorithm for percentage without knowing total number
design;algorithms
Do some bookkeeping about the already taken calls and calculate their distribution over the n lines. This gives you n percentage values (your already achieved distribution), which can be compared to the n percentages you want to achieve. Whenever a new call comes in, assign that call to the line with the highest deviation from the target value (note that as long as you don't hit the given distribution exactly, there is always a line which has too few calls so far, when compared to the target distribution).For example: after assigning the first call to line 1: total calls line1      total calls line2    perc.line 1    perc. line 2 1                      0                    100%             0%                                              *above 60%      *below 40% <- next call to 2 1                      1                    50%             50%                                              * below 60%:    *above40% next to line1 2                      1                    66%             33%                                             *above 60%      *below 40% <- next to line 2 2                      2                    50%             50%                                              * below 60%:    *above40% next to line1 3                      2                    60%             40%                                              * both hit the mark: next call arbitrary 4                      2                    66%             33%                                             *above 60%      *below 40% <- next to line 2 4                      3                    57.1%             42.85%                                             *below 60%      *above 40% <- next to line 1...EDIT: This approach could be further improved by not using the absolute difference, but choosing the line which minimizes the sum-of-squares of all deviations. That would also give you a better result in case you reach the target values exactly.