# Online Probability Simulation for Compound Events

I'm teaching Grade 9 Probability. We need to compare Experiment Probabilities (Relative Frequencies) with Theoretical Probabilities for Simple and Compound Events. I want to come up with and Online tool to generate such data for compound events made from a variety of simple events. Eg the result of flipping a coin and rolling a dice 10 times. Other simple events could be spinners or drawing balls. It is assumed that the two events are independent and done with replacement where necessary (eg drawing 1 cards and returning it and then drawing another card).

I would expect sequences like (H,1),(H,4),(T,1),(H,6),...

After searching online I've found the following online tools for generating random selections: http://www.shodor.org/interactivate/activities/ExpProbability/ https://www.mathsisfun.com/data/spinner.php, https://wheelofnames.com/

The problem is these tools only seem to allow simple events (eg a spinner Red) or sometimes particular compound events (eg two dice (1,3) or multiple flips of a coin (H,T) ).

Does anyone know of any online tools to generate multiple random selections of compound events? I'm after something which runs in the browser with a very accessible interface. It would be great to allow them to drag and drop icons representing the elements.

• this doesn't answer your question but you can implement this in excel or google sheets with conditional formatting. cell references, and other intermediate built in functions. You probably wouldn't have time this year but it could be done over prep/planning periods and be ready for next semester or year. I know of link but its syntax are somewhat peculiar, and targets D&D, and is only useful for lecture demos. Commented Nov 11, 2023 at 1:08

It's really easy to write a script to do this, so I wrote one for you that runs entirely in the browser and allows you to edit the sample space elements: https://www.pythonmorsels.com/p/24dps/

Just go to that link, click "Run", and it will spit out a sequence just as you described. If you want to change the sample spaces of the events or the number of samples, you can just edit those fields in the code and click "Run" again.

I know this is not "drag-and-drop" as would be ideal but I would be surprised if 9th graders had trouble doing something as simple as editing a list of elements and clicking a big green "Run" button.

Here is an example in Mathematica:

In[7]:= RandomChoice[Tuples[{Range[6], {H, T}}], 10]

Out[7]= {{5, T}, {3, T}, {4, H}, {6, T}, {3, T}, {4, H}, {1, H}, {6, H}, {5, H}, {3, T}}


The sample spaces of the simple events can easily be swapped out.

Though this is not online nor accessible to the average grade 9 student!