No, they're on topic, as long as you specify that it is a monte-carlo algorithm. Ideally, you'd specify the probability of success, but doing so is optional.
Why? Because the code isn't broken; it's doing exactly as stated.
Asking us to fix a monte-carlo algorithm to be perfect is off-topic however.