Bayesian sample size estimation for given HPD

In this case what is new_observed_X? Is it a random variable computed by something like np.random.binomial(1,p_true, size=s)? Or is it simply p_true*s (where s is sample size)?

Should there be repeated simulation or is this really a sufficient method? And if so, why?