CodingTrain / CodingTrain/Suggestion-Box

Generating PI from random numbers

Open
#1,263 2 comments 0 reactions 0 assignees View on GitHub
Pi Day
Dominant language
No language data
Stars
570
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Get 2 random numbers, check if they are coPrime (they do not share a factor). The algorithm for this might be interesting too.
Keep doing this and the ratio of tries that you get 2 coprime numbers to the total number of tries is an approximation of 6/PI^2.
See the "standupmaths" video : https://www.youtube.com/watch?v=RZBhSi_PwHU&t=885s

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.