peep into pi

Post on 06-May-2015

2.646 Views

Category:

Technology

6 Downloads

Preview:

Click to see full reader

DESCRIPTION

A method to compute PI using distributed, browser-based methods.

TRANSCRIPT

Peep Into πVishnu Gopal vish.inBarcamp Kerala 5

Sunday 3 May 2009

Please visit peepapp.com

Sunday 3 May 2009

Area of a circle = πr2

Sunday 3 May 2009

π = 22 / 7

(Archimedes, 212 B.C, 3 decimal places)

Sunday 3 May 2009

π = 355/113

(Zu Chong Zhi, 480 A.D. 7 decimal places)

Sunday 3 May 2009

But what is the exact value of π?

Sunday 3 May 2009

π is both Irrational and Transcendental

Sunday 3 May 2009

Formulae for π

Sunday 3 May 2009

Dartboard Algorithm

Sunday 3 May 2009

Area of circle / Area of square = π / 4

AaBb r

Sunday 3 May 2009

There are other formulae, like Bellard’s approximation

1000 iterations gives 3000 decimal places

Sunday 3 May 2009

Distributed computing

Sunday 3 May 2009

BOINC: SETI@HOME

Sunday 3 May 2009

Server sends pieces of data to be processed, workers calculate, send data back,

server aggregates and displays result.

Worker 1

Server

Worker 2

Worker 3

Worker 4

Sunday 3 May 2009

Pieces of data: MapCalculate

Aggregates: Reduce

Sunday 3 May 2009

This is essentially Google’s MapReduce

Sunday 3 May 2009

Finding workers should be as easy as possible.

Sunday 3 May 2009

Communication should be really easy & capable

Sunday 3 May 2009

We change the architecture a bit.

Sunday 3 May 2009

Workers = a browserCoordinator = a websiteMaster = a web-service

Worker 1

Coordinater

Worker 2

Worker 3

Worker 4

Master

Master n2

Master n3

Sunday 3 May 2009

Enter peepapp.com

Sunday 3 May 2009

A browser nowadays is very capable & speedy.

Sunday 3 May 2009

The coordinator functions simply as a message queue

Sunday 3 May 2009

Master nodes can reside anywhere & take any form.

Sunday 3 May 2009

Map & Reduce is done by Master node

Sunday 3 May 2009

Calculate is done by the worker nodes

Sunday 3 May 2009

peepapp.com current status: map not done.

Sunday 3 May 2009

The demo becomes more accurate with more people

Sunday 3 May 2009

Peep architecture: nginx, passenger, sinatra/ruby,

starling, memcached

No RDBMS, woot!

Sunday 3 May 2009

Contributing to a job is as easy as visiting a web page.

Sunday 3 May 2009

Further plans: Make creating a job easy too.

Sunday 3 May 2009

Contributing to a job is as easy as visiting a web page.

Sunday 3 May 2009

FinisQuestions?

@vishmaker on Twitter

Sunday 3 May 2009

top related