Would greatly appreciate any help on the math concept here. I’m working in MS Excel, so if anyone can speak to that specifically, that would be an added bonus.

I have a Monte Carlo simulation to illustrate the likelihood of an event happening (let’s say winning on a slot machine). I can make a histogram to show all the different frequencies of the event and their relative likelihoods.

Now, each time the event occurs, it pays some amount of money, which is also variable. I have a second Monte Carlo simulation showing all the different possible payouts and their relative frequencies.

Mathematically, how do I combine these two distributions into a single illustration of what a person might win on the slot machine?

Say I run 1,000 simulations of frequency in Column A ( =NORMINV(RAND(),mean,standard_dev) )

And 1,000 simulations of the winnings in Column B. I had figured I would just make a Column C which is frequency times winnings (Column A times Column B), and plot those 1,000 products on a histogram to show the overall expectation of winning in terms of dollars. But I’m afraid that perhaps it shouldn’t be that simple….

Mathematically, is there a flaw in this logic?

Thank you!!


1 Answer 1


Assuming I correctly followed what you're doing (some details would need to be clarified to be certain), this should be correct.

We could consider it as an application of the law of total expectation. Specifically, consider it in this form:

... if $\{ A_i \}_i$ is a finite or countable partition of the sample space, then $${\displaystyle \operatorname {E} (X)=\sum _{i}{\operatorname {E} (X\mid A_{i})\operatorname {P} (A_{i})}.}$$

You wish to estimate the expected winnings by simulation, so you'd multiply expected winnings under each outcome ($E(X_i|A_i)$ by the proportion of times it occurs (estimating $A_i$).

The desired expectation would be the sum over all of those products.

Similarly, if the outcome given event $A_i$ in turn depends on still other events (denoting those in turn by variables $B$, $C$ etc), you could simulate over those events and replace the expectation with the value of the conditional outcome (which will again be a matter of using simulation to approximate the expectation; once your expectations are all fixed numbers, you can regard it as simply applying the definition of expectation under some countable set of outcomes).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.