Description

For this project, I will be using the rejection sampling method to simulate random values from a continuous probability distribution with the pdf f(x) = x^2/9 for 0 < x < 3.

Generating Values

##  [1] 2.8214019 2.8705000 0.7382632 2.6686179 2.8890727 2.2753786 2.3967745
##  [8] 1.6828440 2.6851361 1.9953456 2.4439201 2.3830270 2.1305472 1.4259497
## [15] 1.0553937 2.9548709 2.6594072 2.3468829 1.7999669 2.7433146 1.2320693
## [22] 2.8058994 2.1617888 1.9436804 2.9394658 2.5281880 2.5423595 1.7158059
## [29] 1.9499555 2.2210031 1.8899192 2.6240470 2.5193033 2.1248710 2.9569227
## [36] 2.8119423 1.6262411 2.9021951 1.7791370 2.6131302 2.9156269 2.2757795
## [43] 2.9464211 2.3537258 0.4699106 2.1398370 2.5071265 2.5612901 2.9982136
## [50] 1.8517058

Superimposed Density Histogram

Estimated Values

## Sample Mean:  2.254599
## Sample Standard Deviation:  0.5766685
## Probability That X < 2:  0.2936

Theoretical Values

## Theoretical Mean:  2.25
## Theoretical Standard Deviation:  0.5809475
## Theoretical Probability That X < 2:  0.2962963

Rejection Rate

## [1] 0.669159

Findings