Skip to content

Latest commit

 

History

History
40 lines (23 loc) · 1.29 KB

README.md

File metadata and controls

40 lines (23 loc) · 1.29 KB

Random Generator Test 🎲📊

A simple C++ project to test the randomness of a generator and estimate the value of π using Euclid's Algorithm for GCD.

Overview

This project generates an array of random integers and calculates the probability that the GCD (Greatest Common Divisor) of randomly chosen pairs is 1. The estimation of π is then derived from this probability using the formula: π ≈ √(6 * (N/2) / Count), where N is the array size.

How to Run

  1. Clone the repository:

    git clone https://github.com/snigdhab7/Testing_Random_Generator.git
  2. Import the project into your preferred C++ IDE.

  3. Build and run the file. Link to Random Generator Test Code File

  4. The console will display the estimated value of π based on the random generator.

Sample Output

Estimation of PI

Further Improvements

  • Enhance the randomization algorithm.
  • Implement additional statistical tests.
  • Share your findings and improvements with the community.

Contributions 🤝

Contributions are welcome! Feel free to open issues and pull requests.