vendredi 3 mars 2023

Split an amount into 2 random groups by Gauss bell

Let's suppose I've 100 items and I need to split them into two groups.

Options can be:

  1. Divide by 2, so I get exactly 50 and 50

  2. Select a random number between 1 and 100 and then separate that amount from the rest.

In option 2, 1 item has the same probability than 50 items (1/100) But in the reality, I imagine a Gauss bell where for e.g., 50 has the most probability, 49 and 48 the less, 47 and 46 more less, and so far.

Question:

How can simulate that "random with probability" selection?
Is there any function to do this in .NET 6?

By the way I'm working in C# but I think I can handle the lines, so that's why I don't write code here, but not the logic.

Thanks in advance




Aucun commentaire:

Enregistrer un commentaire