Monte Carlo Simulation - pair of dice roll
Mostra commenti meno recenti
Simulate rolling of a pair of dice over 10,000 trials and plot distribution of the # of rolls it takes to get "double 6" on a histogram graph.
I have attached the code I have written so far but need more help with defining parameters and plotting.

1 Commento
Erin Haque
il 26 Apr 2020
Risposta accettata
Più risposte (1)
David Hill
il 26 Apr 2020
Modificato: David Hill
il 26 Apr 2020
x=sum(randi(6,10000,2),2);
y=find(x==12);
y=diff([0,y]);
histogram(y,'BinMethod','Integers');
Categorie
Scopri di più su Mathematics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
