The study
One sample
in the categorynot in the category
Sample proportions, assuming H0 is true
Simulated P-value
P-value from the z-test
Assume the null hypothesis is true, simulate sample after sample, and see how often a result as extreme as yours occurs.