Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
1 view
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: 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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...