POV-Ray : Newsgroups : povray.off-topic : A small statistics question : Re: A small statistics question Server Time
11 Oct 2024 05:19:16 EDT (-0400)
  Re: A small statistics question  
From: John VanSickle
Date: 26 Nov 2007 16:25:49
Message: <474b39dd$1@news.povray.org>
Invisible wrote:
> OK, so unlike the Euler project, *this* question has some practical use. 
> ;-)
> 
> Anybody have any idea how I can make a program generate random numbers 
> between 30 and 30,000, but so that "most" of the numbers generated are 
> actually in the range 100 - 400?

Well, one step is to develop a random number generator that kicks out a 
number from 1 to 1000, with the frequency peaking at 10.  Then generate 
30 such numbers and sum them.

Or,

Generate 29970 random numbers from 0 to 1.  Multiply each one by 29970. 
  For each product that is less than 220, add one to your running tally.

When you're all done, add 30 to the tally.

The tally will be a number between 30 and 30000, with the results 
clustering around 250.

Regards,
John


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.