SCIENTIFIC CALCULATOR

  ☾   ☀   Examples - Read Me - Tools

 Deg   Rad  This calculation:   Edit - Share - Print -
    Save

  • Press Ctrl-d to save this calculation as a bookmark.

- Reset


Let us estimate the value of Pi.
Throw 100 darts at 1x1 square with 1/4 of unit circle in it. Count hits outside the circle:
int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   1.0 [1]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   2.0 [2]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   3.0 [3]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   4.0 [4]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   4.0 [5]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   5.0 [6]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   7.0 [7]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   7.0 [8]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   9.0 [9]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   10.0 [10]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   12.0 [11]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   15.0 [12]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   16.0 [13]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   17.0 [14]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   18.0 [15]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   19.0 [16]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   19.0 [17]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   19.0 [18]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   23.0 [19]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   23.0 [20]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   24.0 [21]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   25.0 [22]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   26.0 [23]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   26.0 [24]
ans + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2) + int(rand**2 + rand**2)  =   28.0 [25]
4 * (1 - ans / 100)  =   2.88 [26]
Now hit the reload button of your browser repeatedly.
You should see the value of expression [26] fluctuate around 3.14.
CalculatorPi.com
  





About - Terms of Service - Visit us at Google +