Skip to content

yihui26/CloudComputing-Wk4-PiCalculation

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

CloudComputing-Wk4-PiCalculation

The program was on Cloudera, accessed by Oracle VM's VirtualBox. The codes were built in Java, and the compiled codes ran on Hadoop to test the accuracy of Pi.

Steps:

  1. Generate numbers from GenerateLargeRandomNumbers.java program
  2. PiCalculation.java program does map reduce methods to calculate Pi.

The general idea is that if you have a circle in a square and you throw darts randomly at the combination, you will have enough darts that would hit inside the circle, and outside the circle but in the square.

Since (Area of circle = pi * r^2 ) , (Area of square = 2r*2r = 4r^2), therefore (Area of circle/Area of Square = 1/4 pi).

With that in mind, (count of darts in the circle / total count of darts in the square)* 4 = estimated pi.

About

Coded a Pi calculation program using Java programming, and ran it with Hadoop on Cloudera.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages