Question

Write a Code in Java or Python, for the following scenario(s): Consider three six-sided dice, and...

Write a Code in Java or Python, for the following scenario(s):

Consider three six-sided dice, and let random variable Y = the value of the face for each. The probability mass of function of Y is given by the following table:

y

1

2

3

4

5

6

otherwise

P(Y=y)

0.35

0.30

0.25

0.05

0.03

0.02

0

  1. Roll the three dice and let random variable X = sum of the three faces. Repeat this experiment 50000 times.

  1. Find the simulated probability mass function (pmf) of random variable X.
  2. Find the simulated mean of the random variable X.
  3. Find the simulated standard deviation of random variable X.
  4. Find the simulated P(2 < X < 13).
  5. Draw the histogram of the pmf of X.
  1. Generate 2000 samples of size 50000 values for the random X from distribution in part1. For each of these 2000 samples calculate the mean of X.

  1. Find the simulated probability that the mean is between 6.49 and 6.53 exclusive.
  2. Find the simulated mean of the means.
  3. Find the simulated standard deviation of the means.
  4. Draw the histogram of the means.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

A)

import numpy as np
import pylab as plt

N = 5 * 10**4
X = np.random.normal(size=N)

counts, bins = np.histogram(X,bins=50, density=True)
bins = bins[:-1] + (bins[1] - bins[0])/2

print(np.trapz(counts, bins))

B)

a = 1

b = 5 * 10**4

mean = (a+b)/2

print(mean)

C)

a = 1

b = 5 * 10**4

std = (b-a)**2/12

print(std)

D)

a = 2

b = 13

probabilty = 1/(b-a)

print(probability)

Add a comment
Know the answer?
Add Answer to:
Write a Code in Java or Python, for the following scenario(s): Consider three six-sided dice, and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT