Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
N-sphere
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Uniformly at random on the {{math|(''n'' β 1)}}-sphere === [[File:2sphere-uniform.png|thumbnail|A set of points drawn from a uniform distribution on the surface of a unit {{math|2}}-sphere, generated using Marsaglia's algorithm.]] To generate uniformly distributed random points on the unit {{tmath|(n-1)}}-sphere (that is, the surface of the unit {{tmath|n}}-ball), {{harvtxt|Marsaglia|1972}} gives the following algorithm. Generate an {{tmath|n}}-dimensional vector of [[normal distribution|normal deviates]] (it suffices to use {{tmath|N(0, 1)}}, although in fact the choice of the variance is arbitrary), {{tmath|\mathbf x {{=}} (x_1, x_2, \ldots, x_n)}}. Now calculate the "radius" of this point: :<math>r=\sqrt{x_1^2+x_2^2+\cdots+x_n^2}.</math> The vector {{tmath|\tfrac 1r \mathbf x}} is uniformly distributed over the surface of the unit {{tmath|n}}-ball. An alternative given by Marsaglia is to uniformly randomly select a point {{tmath|\mathbf x {{=}} (x_1, x_2, \ldots, x_n)}} in the unit [[hypercube|{{mvar|n}}-cube]] by sampling each {{tmath|x_i}} independently from the [[continuous uniform distribution|uniform distribution]] over {{tmath|(-1, 1)}}, computing {{tmath|r}} as above, and rejecting the point and resampling if {{tmath|r \geq 1}} (i.e., if the point is not in the {{tmath|n}}-ball), and when a point in the ball is obtained scaling it up to the spherical surface by the factor {{tmath|\tfrac 1r }}; then again {{tmath|\tfrac 1r \mathbf x}} is uniformly distributed over the surface of the unit {{tmath|n}}-ball. This method becomes very inefficient for higher dimensions, as a vanishingly small fraction of the [[unit cube]] is contained in the sphere. In ten dimensions, less than 2% of the cube is filled by the sphere, so that typically more than 50 attempts will be needed. In seventy dimensions, less than <math>10^{-24}</math> of the cube is filled, meaning typically a trillion quadrillion trials will be needed, far more than a computer could ever carry out.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
N-sphere
(section)
Add topic