estimate_pi2: Estimate Pi from random sampling with Rcpp integration

Description Usage Arguments Value Author(s) Examples

Description

Compute an approximation of pi by drawing x and y coordinates from a uniform distribution and checking whether or not they fall inside a unit circle.

Usage

1
estimate_pi2(B = 5000, seed = 10)

Arguments

B

A numeric (integer) used to denote the number of sample coordinates used to approximate pi

seed

A numeric used to control the seed of the random number generator used by this function.

Value

A list containing the following attributes:

estimated_pi

Estimated value of pi

points

Dataframe of the generated coordinates with an indication whether or not the coordinate is inside the circle

Author(s)

Vanessa Armistead

Bart Roes

Luisa Pricken

Ameni Rouatbi

Examples

1

amenirouatbi/ptds2018hw4g3 documentation built on May 3, 2019, 7:39 p.m.