why cumulative percentage is used to generate random values

or why sum percentage is used to generate random values

Cumulative percentage or sum percentage is used to generate random values because it provides a way to allocate probabilities to different outcomes or events. In many cases, the occurrence of these outcomes is not equally likely, and a cumulative percentage allows us to represent the likelihood of each outcome.

When generating random values, we often require a way to select one outcome among many possible options based on their respective probabilities. By using cumulative percentage or sum percentage, we can assign a range of values to each outcome that corresponds to its probability. This range is proportionally distributed based on the likelihood of each outcome occurring.

To generate a random value within the specified probability distribution, a random number generator is used to select a number within the range of the cumulative percentage values. This number then determines which outcome is chosen.

In summary, using cumulative percentage or sum percentage simplifies the process of assigning probabilities to outcomes and enables the generation of random values that follow a specified probability distribution.