Skip to content

Hypersphere volume computation for low dimensionality using Monte Carlo techniques and threaded Ruby

License

Notifications You must be signed in to change notification settings

ColinShaw/ruby-monte-carlo-hyperspheres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N-Dimensional Hypersphere Volumes in Ruby

This is a really basic implmentation of Monte Carlo integration for computing the volume of hyperspheres in low dimensions. The point of it definitely is not the accuracy or speed of the computation, but rather the simplicity of implementation. This could be considered a template for cases where parallelizable processes, such as Monte Carlo processes, having an easily crafted computation kernel, want to be threaded.

You can run the example like:

ruby sphere_cli.rb 2 100000

to perform 100,000 iterations of the Monte Carlo integration for a hypersphere of dimension two. Or run the tests in the /spec folder. It is possible tests could fail if the RNG does not produce acceptably distributed output.

About

Hypersphere volume computation for low dimensionality using Monte Carlo techniques and threaded Ruby

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages