WOLFRAM NOTEBOOK

WOLFRAM|DEMONSTRATIONS PROJECT

Extracting Pi from Image Data

image
Mandrill
samples
500
1000
10000
100000
500000
recalculate
π approximation
3.12322
im
::shdw
:Symbol im appears in multiple contexts {Notebook$$17$435917`,Notebook$$10$435904`}; definitions in context Notebook$$17$435917` may shadow or be shadowed by other definitions.
fr
::shdw
:Symbol fr appears in multiple contexts {Notebook$$17$435917`,Notebook$$10$435904`}; definitions in context Notebook$$17$435917` may shadow or be shadowed by other definitions.
pi
::shdw
:Symbol pi appears in multiple contexts {Notebook$$17$435917`,Notebook$$10$435904`}; definitions in context Notebook$$17$435917` may shadow or be shadowed by other definitions.
In 1881, Ernesto Cesàro [1] proved that the probability that two random integers are relatively prime is
6/
2
π
0.61
. In this Demonstration, the pairs of random integers are chosen from among the pixel values of selected images.
Using enough random pairs of pixel data from almost any sufficiently complex picture gives an approximation of
π
with between 1 and 4 correct digits.
Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.