Hi guys i have this exercise:"Two dice are loaded by ballasting the face "one" in order to increase the probability that the opposite face will come out, that is "six"; precisely we have Pr (1) = 0.12, Pr (6) = 0.4 for one die and Pr (1) = 0.10, Pr (6) = 0.30 for the other, while the remaining faces are equiprobable. Devise a procedure to simulate the launch of a pair. Then generate, starting from a generator U (0, 1), a sequence of N = 1000 launches and plot the relative frequency of the following events: {P uncount = 12}, {P uncount = 2}, {P uncount = 9} running {1, 2, · · · 1000}. Calculate the mean and standard deviation of the indicators of the events considered. Comment on the results obtained" I have no idea how to simulate the launch of 2 trick dices.Thanks for help

Réponses (1)

Image Analyst
Image Analyst le 27 Mar 2022

0 votes

You can use rand(). I don't have any that adjusts the probability from uniform/equal, but that's easy to do. I do have some card demos though. I also have a demo about non-transitive dice. They're attached if you're interested.

3 commentaires

Gianluca Di pietro
Gianluca Di pietro le 27 Mar 2022
Hi,yes i have found RandSrc in a tool and i used It and It works good 👌 i have a question : i have a time Vector N from 1 to 1000 and Another Vector F that contains 1000 values of frequency,if i want to plot Frequency functions of N what can i do?i use plot(n,f) but the fact Is that the command makes a Linear interpolation between values.For example i have a frequency at N=2 and another at N=3 but between N=2&3 i dont want a Linear interpolation of values but i want a step behaviour,so It must be costant between N=2&3.. ..how can i plot in that way? It Is a discrete function so i dont want values between values of N
Yes, use bar or stairs instead of plot();
probabilities = rand(1, 8); % Whatever...
probabilities = probabilities / sum(probabilities); % Normalize.
subplot(2, 1, 1);
bar(probabilities);
grid on;
subplot(2, 1, 2);
stairs(probabilities, 'LineWidth', 3);
grid on;
xlim([0, 9]);
Gianluca Di pietro
Gianluca Di pietro le 27 Mar 2022
Thank you very much!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Installing Products dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by