POV-Ray : Newsgroups : povray.off-topic : A small statistics question Server Time
15 Oct 2026 02:53:25 EDT (-0400)
  A small statistics question (Message 1 to 29 of 29)  
From: Invisible
Subject: A small statistics question
Date: 26 Nov 2007 05:36:26
Message: <474aa1aa$1@news.povray.org>
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?


Post a reply to this message

From: M a r c
Subject: Re: A small statistics question
Date: 26 Nov 2007 05:48:44
Message: <474aa48c$1@news.povray.org>
"Invisible" <voi### [at] devnull> a écrit dans le message de news: 
474aa1aa$1@news.povray.org...
> 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?

Did you look in POV-Ray rand.inc? :-)

Marc


Post a reply to this message

From: Invisible
Subject: Re: A small statistics question
Date: 26 Nov 2007 05:59:56
Message: <474aa72c$1@news.povray.org>
M_a_r_c wrote:

> Did you look in POV-Ray rand.inc? :-)

That's cute. No, I didn't - I'm at work right now. :-P

Besides, I doubt that precise distribution is present. ;-)


Post a reply to this message

From: scott
Subject: Re: A small statistics question
Date: 26 Nov 2007 06:05:32
Message: <474aa87c$1@news.povray.org>
> 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?

#if( rand(s1) < 0.1 )
 #local N = rand(s1) * 29970 +  30;
#else
 #local N = rand(s1) *   300 + 100;
#end


Post a reply to this message

From: Invisible
Subject: Re: A small statistics question
Date: 26 Nov 2007 06:09:58
Message: <474aa986$1@news.povray.org>
scott wrote:

> #if( rand(s1) < 0.1 )
> #local N = rand(s1) * 29970 +  30;
> #else
> #local N = rand(s1) *   300 + 100;
> #end

Mmm, yeah, I guess that would work. :-)


Post a reply to this message

From: Warp
Subject: Re: A small statistics question
Date: 26 Nov 2007 07:03:56
Message: <474ab62c@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> 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?

http://en.wikipedia.org/wiki/Poisson_distribution

-- 
                                                          - Warp


Post a reply to this message

From: Invisible
Subject: Re: A small statistics question
Date: 26 Nov 2007 07:37:28
Message: <474abe08@news.povray.org>
Warp wrote:

> http://en.wikipedia.org/wiki/Poisson_distribution

Ooo... trippy:

http://en.wikipedia.org/wiki/Inverse_transform_sampling


Post a reply to this message

From: Alain
Subject: Re: A small statistics question
Date: 26 Nov 2007 16:02:29
Message: <474b3465$1@news.povray.org>
Invisible nous apporta ses lumieres en ce 2007/11/26 05:36:
> 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?
A possibility: Use the division of some random numbers. The divider must have a 
range starting at 1.
Samples: rand(X)*29970/(rand(X)*Z+1)+30
(rand(X)+rand(X))*14985/(rand(X)*Z+1)+30

Adjusting Z will shift the peak. Low Z for high location, larger Z for lower 
location.

-- 
Alain
-------------------------------------------------
Everybody should believe in something: I believe I'll have another drink.


Post a reply to this message

From: John VanSickle
Subject: Re: A small statistics question
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

From: Alain
Subject: Re: A small statistics question
Date: 26 Nov 2007 19:24:29
Message: <474b63bd$1@news.povray.org>
Invisible nous apporta ses lumieres en ce 2007/11/26 05:36:
> 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?
A possibility: Use the division of some random numbers. The divider must have a
range starting at 1.
Samples: rand(X)*29970/(rand(X)*Z+1)+30
(rand(X)+rand(X))*14985/(rand(X)*Z+1)+30



-- 
Alain
-------------------------------------------------
Everybody should believe in something: I believe I'll have another drink.


Post a reply to this message

From: Mueen Nawaz
Subject: Re: A small statistics question
Date: 26 Nov 2007 22:58:02
Message: <474b95ca$1@news.povray.org>
Warp wrote:
> Invisible <voi### [at] devnull> wrote:
>> 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?
> 
> http://en.wikipedia.org/wiki/Poisson_distribution

	I'd have used a Gaussian - any particular reason to choose a Poisson?

-- 
Isn't it counterproductive to have incandescent bulbs in a fridge?


                    /\  /\               /\  /
                   /  \/  \ u e e n     /  \/  a w a z
                       >>>>>>mue### [at] nawazorg<<<<<<
                                   anl


Post a reply to this message

From: Invisible
Subject: Re: A small statistics question
Date: 27 Nov 2007 04:21:10
Message: <474be186$1@news.povray.org>
Mueen Nawaz wrote:
> Warp wrote:
>> Invisible <voi### [at] devnull> wrote:
>>> 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?
>> http://en.wikipedia.org/wiki/Poisson_distribution
> 
> 	I'd have used a Gaussian - any particular reason to choose a Poisson?

100 and 400 are both nearer to 30 than to 30,000?


Post a reply to this message

From: Tim Attwood
Subject: Re: A small statistics question
Date: 27 Nov 2007 05:50:07
Message: <474bf65f$1@news.povray.org>
Depends on how efficient or accurate it needs to be.

A simple but inefficient way is to create a curve
function that represents the desired distribution,
generate two random numbers representing an
X,Y vector on the chart, then reject the points
above the curve, and use the X value of accepted
points as the random value.

An efficient but more complicated method is
to create a bar graph approximation of the
distribution curve, then "stack" the rectangles.
Then you can create an X,Y vector guaranteed
to be inside the stack of rectangles, then figure
the X offset of the rectangle based on Y and
use X + X offset @ Y as your random value.


Post a reply to this message

From: Tom Galvin
Subject: Re: A small statistics question
Date: 28 Nov 2007 10:34:39
Message: <474d8a8f$1@news.povray.org>
Invisible wrote:
> scott wrote:
> 
>> #if( rand(s1) < 0.1 )
>> #local N = rand(s1) * 29970 +  30;
>> #else
>> #local N = rand(s1) *   300 + 100;
>> #end
> 
> Mmm, yeah, I guess that would work. :-)


I saw the question, came to the same answer, and anticipated the same 
response, even it had been in haskell.  Don't you have some flirting you 
should be catching up with?


Post a reply to this message

From: Invisible
Subject: Re: A small statistics question
Date: 28 Nov 2007 10:37:50
Message: <474d8b4e$1@news.povray.org>
Tom Galvin wrote:

> I saw the question, came to the same answer, and anticipated the same 
> response, even it had been in haskell.  Don't you have some flirting you 
> should be catching up with?

That requires a partner. :-P


Post a reply to this message

From: Bill Pragnell
Subject: Re: A small statistics question
Date: 28 Nov 2007 10:49:49
Message: <474d8e1d$1@news.povray.org>
Invisible wrote:
> Tom Galvin wrote:
> 
>> I saw the question, came to the same answer, and anticipated the same 
>> response, even it had been in haskell.  Don't you have some flirting 
>> you should be catching up with?
> 
> That requires a partner. :-P

You could always flirt with yourself. Mind you don't go blind, though.


Post a reply to this message

From: Orchid XP v7
Subject: Re: A small statistics question
Date: 28 Nov 2007 16:57:14
Message: <474de43a$1@news.povray.org>
Bill Pragnell wrote:

> You could always flirt with yourself. Mind you don't go blind, though.

Oh that's cute. :-P


Post a reply to this message

From: M a r c
Subject: Re: A small statistics question
Date: 28 Nov 2007 17:09:25
Message: <474de715@news.povray.org>
"Bill Pragnell" <bil### [at] hotmailcom> a écrit dans le message de news: 
474d8e1d$1@news.povray.org...
>
> You could always flirt with yourself. Mind you don't go blind, though.

Let's not forget the kittens
http://en.wikipedia.org/wiki/Image:God-kills-kitten.jpg

Marc


Post a reply to this message

From: Orchid XP v7
Subject: Re: A small statistics question
Date: 28 Nov 2007 17:27:22
Message: <474deb4a$1@news.povray.org>
M_a_r_c wrote:

> Let's not forget the kittens

http://lolcat.com/godkills.html


Post a reply to this message

From: Sabrina Kilian
Subject: Re: A small statistics question
Date: 28 Nov 2007 23:54:02
Message: <474e45ea$1@news.povray.org>
Orchid XP v7 wrote:
> M_a_r_c wrote:
> 
>> Let's not forget the kittens
> 
> http://lolcat.com/godkills.html

Ceiling cat is watching you kill kittens?


Post a reply to this message

From: Bill Pragnell
Subject: Re: A small statistics question
Date: 29 Nov 2007 07:00:30
Message: <474ea9de@news.povray.org>
Sabrina Kilian wrote:
> Orchid XP v7 wrote:
>> M_a_r_c wrote:
>>
>>> Let's not forget the kittens
>> http://lolcat.com/godkills.html
> 
> Ceiling cat is watching you kill kittens?

A new euphemism is born: "sorry I didn't hear the phone, I was upstairs 
killing the kittens..."

:)


Post a reply to this message

From: Tim Cook
Subject: Re: A small statistics question
Date: 29 Nov 2007 08:34:49
Message: <474ebff9$1@news.povray.org>
You're only half right:  every time a *guy* masturbates, God kills a 
kitten.  Every time a *girl* masturbates, an angel gets its wings.

;)

-- 
Tim Cook
http://home.bellsouth.net/p/PWP-empyrean

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

From: Invisible
Subject: Re: A small statistics question
Date: 29 Nov 2007 08:41:25
Message: <474ec185$1@news.povray.org>
Tim Cook wrote:
> You're only half right:  every time a *guy* masturbates, God kills a 
> kitten.  Every time a *girl* masturbates, an angel gets its wings.
> 
> ;)

Woah... I seem to have stumbled into a very scary place here... o_O


Post a reply to this message

From: Tom Galvin
Subject: Re: A small statistics question
Date: 29 Nov 2007 14:22:22
Message: <474f116e$1@news.povray.org>
Sabrina Kilian wrote:
> Orchid XP v7 wrote:
>> M_a_r_c wrote:
>>
>>> Let's not forget the kittens
>> http://lolcat.com/godkills.html
> 
> Ceiling cat is watching you kill kittens?

Hai! Teh blessigs of teh Ceiling Cat b pwn u, lol!

http://www.lolcatbible.com/index.php?title=Genesis_1


Post a reply to this message

From: Tom Galvin
Subject: Re: A small statistics question
Date: 29 Nov 2007 14:27:34
Message: <474f12a6@news.povray.org>
Invisible wrote:
> Tom Galvin wrote:
> 
>> I saw the question, came to the same answer, and anticipated the same 
>> response, even it had been in haskell.  Don't you have some flirting 
>> you should be catching up with?
> 
> That requires a partner. :-P

I don't think you understand what flirting is.  It's how you get a partner.


Post a reply to this message

From: Orchid XP v7
Subject: Re: A small statistics question
Date: 29 Nov 2007 16:42:30
Message: <474f3246@news.povray.org>
Tom Galvin wrote:

> Hai! Teh blessigs of teh Ceiling Cat b pwn u, lol!
> 
> http://www.lolcatbible.com/index.php?title=Genesis_1

Oh.

My.

God.



It's true: *everything* exists on the Internet! 0_0


Post a reply to this message

From: Invisible
Subject: Re: A small statistics question
Date: 30 Nov 2007 04:07:46
Message: <474fd2e2@news.povray.org>
Tom Galvin wrote:

> I don't think you understand what flirting is.  It's how you get a partner.

OK, I rephrase: I'd still need somebody to flirt at. :-P

(Leaving aside the small matter that I've never flirted with anybody in 
my life and I wouldn't even begin to know how...)


Post a reply to this message

From: Michael Zier
Subject: Re: A small statistics question
Date: 30 Nov 2007 04:15:22
Message: <474fd4aa$1@news.povray.org>
Am Fri, 30 Nov 2007 09:07:45 +0000 schrieb Invisible:

> (Leaving aside the small matter that I've never flirted with anybody in
> my life and I wouldn't even begin to know how...)

For starters: Look at your target and smile... (I know it's hard, been 
down that road too.)


Post a reply to this message

From: Orchid XP v7
Subject: Re: A small statistics question
Date: 30 Nov 2007 14:19:44
Message: <47506250$1@news.povray.org>
Michael Zier wrote:
> Am Fri, 30 Nov 2007 09:07:45 +0000 schrieb Invisible:
> 
>> (Leaving aside the small matter that I've never flirted with anybody in
>> my life and I wouldn't even begin to know how...)
> 
> For starters: Look at your target and smile... (I know it's hard, been 
> down that road too.)

Bah. I smile at people all the time! They *still* don't like me very much...


Post a reply to this message

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