the question is to simulate the result of tossing n die and generate a probability graph based on your simulation in python3
the result is supposed to be normal distribution, but mine isn't. i would like to know what's wrong in my code.
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
Note: Brother sometimes while uploading on HomeworkLib the indentations change. So, I request you to verify it with screenshot once. This is the link where I have saved the code to
https://onlinegdb.com/S13gIuDIB
Hi the code you provided is working absolutely fine. What I think is there is some error in hist type.
Below is my code to this problem
import random
import matplotlib.pyplot as plt
def roll_and_add_dice(num_dice,num_trials=10**4):
n=num_trials;
nd=num_dice;
out=[];
S=0;
for j in range(n):
for i in range(nd):
S=S+random.randint(1,7);
out.append(S);
S=0;
return out;
out=roll_and_add_dice(2);
plt.hist(out,density=True);
plt.show();
Kindly revert for any queries
Thanks.
the question is to simulate the result of tossing n die and generate a probability graph...
(b) IULUI SAPT Two dice are rolled. Find the probabilities of the following events. 13. The first die is 3 or the sum is 8. 14. The second die is 5 or the sum is 10. One card is drawn from an ordinary deck of 52 cards. Find the probabilities of drawing the following cards. 15. (a) A 9 or 10 (b) A red card or a 3 (c) A 9 or a black 10 (d) A heart or a...
part C (b) Consider the experiment on pp. 149-156 of the online notes tossing a coin three times). Consider the following discrete random variable: Y = 2[number of H-3[number of T). (For example, Y (HHT) = 2.2-3.1=1, while Y (TTH) = 2.1-3.2 = -4.) Repeat the analysis found on pp. 149-156. That is, (i) find the range of values of Y: (ii) find the value of Y(s) for each s ES: (iii) find the outcomes in the events A -Y...
Assignment Specifications We are going to use the Monte Carlo Method to determine the probability of scoring outcomes of a single turn in a game called Pig. Your Task For this assignment you will simulate a given number of hold?at?N turns of a game called Pig, and report the estimated probabilities of the possible scoring outcomes. You are NOT implementing the game of Pig, only a single turn of this game. The value of N will be acquired via user...