Done! This takes a couple seconds on my machine. You can imagine that if instead of a univariate distribution each individual sample was a 300-dimensional point, or if computing the acceptance ratios involved doing hundreds of computations instead of a simple call to a formula, it might take far longer. That makes the question of when to stop important: we don't always have the luxury of getting a million samples and hoping that the theoretical convergence guarantees apply then.
Done! This takes a couple seconds on my machine. You can imagine that if instead of a univariate distribution each individual sample was a 300-dimensional point, or if computing the acceptance ratios involved doing hundreds of computations instead of a simple call to a formula, it might take far longer. That makes the question of when to stop important: we don't always have the luxury of getting a million samples and hoping that the theoretical convergence guarantees apply then.