Answer the question
In order to leave comments, you need to log in
How to generate results for a test randomly, with a given probability of each result?
It is necessary to write a function that will fill in the scores for the test randomly, so that the probabilities are: score < 50% - 12.5%, score < 75% - 37.5%, score < 90% - 37.5%, score <= 100% - 12.5%. In this case, the estimate can only be an integer percentage of a given interval, and if possible, this should be done without using additional tables.
Help, I don't know how to do this
Answer the question
In order to leave comments, you need to log in
The odds are 1:3:3:1. Generate a random number from 0 to 7. For 0, give a random number < 50. For 1-3, a random number from 50 to 74, for 4-6, give an answer from 75 to 89, for 7, give a number from 90 to 100.
What numbers from the interval to give out in the task is not said. You can somehow randomly equally probable or somehow normally generate or even throw out the middle of the interval always.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question