Skip to content

jakevossen5/pi-generator-from-random-numbers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-generator-from-random-numbers

This program generates random numbers, and calculates Pi based off the odds that those two numbers are co-prime. This was mostly just an excuse for me to learn concurrency in Rust, which I was fairly successful with. Change the num_runs variable to increase or decrease the number of trials.

This was inspired by this video by Matt Parker.

If you like this, you might also be interested in my pi-generator-from-blocks repository, where I calculate Pi using elastic collisions.

Usage

From homebrew

You can install this from my homebrew tap by running =brew install jakevossen5/taps/pi-generator-from-random-numbers, then running pi-generator-from-random-numbers RUNS where RUNS is the number of iterations that you want.

From source

  • Clone / download this repository
  • Install rust
  • Run with cargo run RUNS where RUNS is the number of iterations you want.

About

Generates Pi from random numbers and co-primes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages