Question: A simulation that involves drawing two marbles out of a bag has already been done and the data from the simulation is provided for you

A simulation that involves drawing two marbles out of a bag has already been done and the data from the simulation is provided for you in a file called marbles-simulation.csv. The simulation was drawing from a bag that had 3 red marbles, 5 blue marbles, and 10 white marbles. The results of the simulation are stored in DataFrame with columns draw1 and draw2.
The values in the columns draw1 and draw2 are integers that represent a color. Specifically:
1-3 represents red,
4-8 represents blue, and
9-18 represents white
The results of this simulation are provided to you in a DataFrame named df. Using df, write the Python code to calculate the estimated probability of drawing exactly one red marble and one white marble and store that probability in a variable named prob. Make sure to return your variable at the end.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!