Explore Courses Blog Tutorials Interview Questions
+1 vote
in AI and Deep Learning by (50.2k points)

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).

1 Answer

0 votes
by (108k points)
edited by

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:

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:

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.

Browse Categories