Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math

Topic: How to make weighted random numbers?
Replies: 7   Last Post: Feb 28, 2009 3:49 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
matt271829-news@yahoo.co.uk

Posts: 2,136
Registered: 1/25/05
Re: How to make weighted random numbers?
Posted: Feb 27, 2009 10:18 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Feb 28, 2:36 am, Rich Grise <r...@example.net> wrote:
> Say, I want to fill a sphere uniformly with random dots; the logical way
> to do that in r,theta format; otherwise to make a sphere, you'd have to
> do  some heroic math on the three dimension (or is there some
> quick-n-dirty formula that can do it in one flop, that they don't tell
> us high school (and Tech School, don't forget!) ?
>
> Either way. I don't want a uniform sphere - more like density through the
> center looks like a bell-shaped curve, i.e., denser in the middle?


You can choose the distance from the dot to the centre, r, according
to whatever distribution you want (e.g. Gaussian), and then place the
dot at a uniformly random point on the surface of a sphere of radius
r, chosen using a method such as the one given at
http://mathworld.wolfram.com/SpherePointPicking.html



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.