# Thread: a problem !!!

1. ## a problem !!!

hello ,veryone!
I have a problem with number generator of IMSL 5.0 for C#.
How can I find random number for Beta distribution ? "nextbeta()" get random number which the "x" btween 0 and 1,but what about "x" btween 0 and 50
Which function should I use and how?
eagerly Regards  Reply With Quote

2. Since NextBeta() returns (0,1) and you need that distribution on (0,50), just multiply the result by 50.  Reply With Quote

3. thank you for your help! ed ! what about x(a,b)[b>a]?how can i do that?  Reply With Quote

4. Originally Posted by beardgh
what about x(a,b)[b>a]? how can i do that?
I'm not sure what you're asking here -- can you clarify?  Reply With Quote

5. thank you ,ed!
"nextbeta()" get random number which the "x" btween 0 and 1,but what about "x" btween "a" and "b"?
Which function should I use and how?  Reply With Quote

6. I see now. To get a number in the range (a,b) from a distribution that gives you (0,1), you just need to multiply by the new range (b-a) and then add a as in:

v = NextBeta(p,q) * (b-a) + a  Reply With Quote

7. I began to think that this is the case：v = NextBeta(p,q) * (b-a).You helped me a lot of busy,ed.Thank you !!   Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•