Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 757581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:22:48+00:00 2026-05-14T15:22:48+00:00

I want to generate random numbers with a range (n to m, eg 100

  • 0

I want to generate random numbers with a range (n to m, eg 100 to 150), but instead of purely random I want the results to be based on the normal distribution.

By this I mean that in general I want the numbers “clustered” around 125.

I’ve found this random number package that seems to have a lot of what I need: http://codeproject.com/KB/recipes/Random.aspx

It supports a variety of random generators (include mersiene twister) and can apply the generator to a distribution.

But I’m confused, if I use a normal distribution generator the random numbers are from roughly -6 to +8 (apparently the true range is float.min to float.max).

How do a scale that to my required range?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:22:49+00:00Added an answer on May 14, 2026 at 3:22 pm

    A standard normal distribution has mean 0 and standard deviation of 1; if you want to make a distribution with mean m and deviation s, simply multiply by s and then add m. Since the normal distribution is theoretically infinite, you can’t have a hard cap on your range e.g. (100 to 150) without explicitly rejecting numbers that fall outside of it, but with an appropriate choice of deviation you can be assured that (e.g.) 99% of your numbers will be within the range.

    About 99.7% of a population is within +/- 3 standard deviations, so if you pick yours to be about (25/3), it should work well.

    So you want something like: (normal * 8.333) + 125

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to generate unique random, N-valued key. This key can contain numbers and
I want to generate the random numbers using this loop. When i runs the
I want to generate random numbers, but these numbers should be somewhat biased, so
I want to generate random numbers in the range 1-10. The requirement is that
i want to generate an array of random numbers for example if the range
I want to generate random numbers in the range -1, 1 and want each
I want to generate random numbers within a range and the generated numbers should
Possible Duplicate: Generate Random numbers uniformly over entire range I want to generate the
I need to generate 238 numbers, with a range of 1-4, but I want
i want to generate a sequence of unique random numbers in the range of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.