Pi Approximation with Monte Carlo Method

Pi Approximation with Monte Carlo Method
Loading the math board and drawing, please wait…
2015-08-11 23:57
This example demonstrates how to approximate the value of pi (π) using the Monte Carlo method. Key mathematical concepts include probability and geometry. By constructing a square and an inscribed circle, and randomly generating points to count how many fall within the circle, the value of π can be estimated. GeoGebra commands used include Polygon, Vector, Sequence, and Sum. Suitable for high school mathematics education and learning probability and statistics.

GeoGebra Commands & Parameters

  1. Polygon((0, 0), (1, 0), (1, 1), (0, 1)) → poly1, a, b, c, d
  2. Vector((0.5, -0.05), (1, -0.05)) → u
  3. Sequence(RandomUniform[0, 1], k, 1, n) → list1
  4. Sequence(RandomUniform[0, 1], k, 1, n) → list2
  5. Sequence((Element[list1, k], Element[list2, k]), k, 1, n) → list3
  6. Sequence(If[(Element[list1, k] - 0.5)^(2) + (Element[list2, k] - 0.5)^(2) ≤ 0.5^(2), 1, 0], k, 1, n) → list4
  7. Sum(list4) → f