0

I'm trying to brainstorm an algorithm that can "fairly" distribute customers to a seller, but I'm having trouble putting it into practice.

I have this concept of customer and sellers. A customer comes in one at a time, and has 100 sellers to choose from.

Each seller has a level though between 1-10. The amount of sellers with a specific level is arbitrary, and changes frequently, aka there could be 5 sellers at level 10 one day, and then 15 level 10 sellers the next.

The problem is that these levels are weight. For example there is a 50% chance that the customer will be assigned to a level 10 sellers, 25% chance to a level 9, etc where level one being the lowest chance (5% let's say).

How can I make a formula that given a customer, it will randomly choose between 1-10, but has a higher chance of choosing somewhere closer to 10 than 1?

codebytesfl
  • 198
  • 1
  • 8
  • Does this answer your question? [Generate random numbers with a given (numerical) distribution](https://stackoverflow.com/questions/4265988/generate-random-numbers-with-a-given-numerical-distribution) – Abhinav Mathur Oct 31 '20 at 20:50
  • Does this answer your question? [Data structure for loaded dice?](https://stackoverflow.com/questions/5027757/data-structure-for-loaded-dice) – Peter O. Nov 01 '20 at 00:23

0 Answers0