Back
Can you tell me anyways to generate non-uniform random numbers?
I am using Java but the code examples can be in whatever you want.
One way is to create a skewed distribution by adding two uniform random numbers together (i.e. rolling 2 dice).
Try generating uniformly distributed random numbers, then applying your inverted non-uniform cumulative distribution function to each of them.
You can also try the fast generation of non-uniform random numbers by referring the following link: https://oroboro.com/non-uniform-random-numbers/
There is also a link named A Java Programmer’s Guide to Random Numbers. Part 2: Not just coins and dice, which tells about the same concept. You can refer the following link for more information about the program: https://dzone.com/articles/java-programmer%E2%80%99s-guide-random-0
Watch this video for comprehensively learning Java programming language:
If you are looking to learn more about Java then you visit Java Tutorial. Also, if you are appearing for job profiles of Java Developer or Java Expert then you can prepare for the interviews on Java Interview Questions.
31k questions
32.8k answers
501 comments
693 users