Uploaded image for project: 'Hama'
  1. Hama
  2. HAMA-905

Fix Pi Estimator Example

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.6.4
    • 0.7.0
    • examples

    Description

      Fix Pi Estimator Example

      I think we should skip the sqrt method in [1] and change the if condition based on formula 6 on page 2 in [2].

      IF (x^2 + y^2 <= 1) THEN
       SUM = SUM +1
      END IF
      

      Because the Equation of the Circle is

      x^2 + y^2 = r^2
      x^2 + y^2 = 1 (with r=1 in unit circle)
      -> (x^2 + y^2 <= 1)
      

      Thanks!

      [1] https://github.com/apache/hama/blob/trunk/examples/src/main/java/org/apache/hama/examples/PiEstimator.java#L62-64
      [2] http://arxiv.org/pdf/1404.1499v2.pdf

      Attachments

        1. HAMA-905_2.patch
          3 kB
          Martin Illecker
        2. HAMA-905.patch
          0.8 kB
          Edward J. Yoon

        Activity

          People

            bafu Martin Illecker
            bafu Martin Illecker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: