Suppose I have a deck of four cards: The ace of spades, the ace of hearts, and two others (say, 2C and 2D).
You draw two cards at random.
Scenario 1: I ask you "Do you have the ace of spades?" You say "Yes." Then the probability that you are holding both aces is 1/3: There are three equiprobable arrangements of cards you could be holding that contain AS, and one of these is AS+AH.
Scenario 2: I ask you "Do you have an ace?" You respond "Yes." The probability you hold both aces is 1/5: There are five arrangements of cards you could be holding (all except 2C+2D) and only one of those arrangements is AS+AH.
Now suppose I ask you "Do you have an ace?"
You say "Yes."
I then say to you: "Choose one of the aces you're holding at random (so if you have only one, pick that one). Is it the ace of spades?"
You reply "Yes."
What is the probability that you hold two aces?
Argument 1: I now know that you are holding at least one ace and that one of the aces you hold is the ace of spades, which is just the same state of knowledge that I obtained in Scenario 1. Therefore the answer must be 1/3.
Argument 2: In Scenario 2, I know that I can hypothetically ask you to choose an ace you hold, and you must hypothetically answer that you chose either the ace of spades or the ace of hearts. My posterior probability that you hold two aces should be the same either way. The expectation of my future probability must equal my current probability: If I expect to change my mind later, I should just give in and change my mind now. Therefore the answer must be 1/5.
Naturally I know which argument is correct. Do you?
I know this was trying to be funny, but that algorithm didn't really use simulation to estimate 7 x 5. It just calculates 7 x 5 a bunch of times and takes the average, with the added step of multiplying and dividing by AB.
But then, I'm maybe not creative enough to come up with an algorithm that would actually output an approximation of 7 x 5 using some probabilistic method that doesn't include calculating 7 x 5.
Yeah, I guess I should have made the effort to understand the principles of the subject I was reading about rather than do a random trivial programming exercise with no general applicability whose dominance by simple mathematics I could have predicted a priori.