A random number generator from a specified distirbution | XM Community
Skip to main content

Dear all,
As the question describes, I'd like to generate a random number but from a specific distribution. For example, there is 80% chance that the random number is 1, 10% chance that the number is 2 and 10% chance it is 3. I tried both the random generator from the piped text and Randomiser. But I failed to specify the distribution that the random number is drawn from. Any idea how to accomplish this?

Thank you very much!

You'll have to build it yourself.
The easiest solution is to define your distribution, put it in an array and pull one number randomly from that array.
In the example you've given above, you'll have to create an array with eight 1s, and one each of 2 and 3.
Then pull one number randomly from the array.


Maybe you can try a formula based on the minutes of the hour the survey is taken. If it's between 0 and 47 (70% of 60 mins) is 1, between 48 and 53 (10% of 60 mins) is 2 and between 54 and 60 is 3.


Thank you both for your excellent ideas! I'll give them a try.


Thank you, xwan8838 for being open to suggestions! 😀


Leave a Reply