I am not sure if any language(preferably C# .NET) supports non-uniform random number generator. Is there any? I was wondering what could be the best design approach to implement our own non-uniform random number generator?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I was able to created semi non uniform distribution using uniform distribution for my requirements. Basically I generate the required M numbers from 1 to N range and then again just generate (N-M) numbers and throw them away. Like this way when I generate next set of numbers, I get almost equal probability for all numbers between 1 to N. It worked for me!
Example code in C#: