Module 5_ Probability Assignment DS
Module 5_ Probability Assignment DS
Basics of Probability
2. Write a function to estimate the probability of getting at least one "6" in 10 rolls
of a fair die.
Steps
a. Simulate rolling a die 10 times using a loop.
b. Track trials where at least one "6" occurs.
c. Calculate the proportion of successful trials.
3. A bag contains 5 red, 7 green, and 8 blue balls. A ball is drawn randomly, its color
noted, and it is put back into the bag. If this process is repeated 1000 times, write a
Python program to estimate:
a. The probability of drawing a red ball given that the previous ball was blue.
b. Verify Bayes' theorem with the simulation results.
Steps
a. Use random sampling to simulate the process.
b. Compute conditional probabilities directly from the data.
4. Generate a sample of size 1000 from a discrete random variable with the following
distribution:
- P(X=1) = 0.25
- P(X=2) = 0.35
- P(X=3) = 0.4
Compute the empirical mean, variance, and standard deviation of the sample.
Steps
a. Use numpy.random.choice() to generate the sample.
b. Use numpy methods to calculate mean, variance, and standard deviation.
Continuous Random Variables
Note : After completing the code, submit it in .ipynb format along with a brief
explanation for each part in your own words.