PMF given this equation

The questions says
Consider roling a dice two times. Let X1 is the random number you get for the first rolling, and X2 is the random number of the second rolling.
(a) Generate 1,000,000 random number of X1 and 1,000,000 of X2. Get the PMF of min(X1,X2)
Which I have accomplished with the code at the end of this post.
(b) Calculate the PMF of min(X1,X2) using the equation given in the class notes.
This is were I am a bit stumped. The equation given is
and I'm unsure how to use this equation to find the PMF in Matlab.
(c) Compare the results of (a) and (b) and plot them on the same figure.
I think I can figure out this part once I get b.
clc;
clear
rng(0, 'twister');
X1 = randi([1 6], 1, 1000000);
X2 = randi([1 6], 1, 1000000);
samp = min(X1, X2);
pmf = histcounts(samp, [unique(samp) Inf], 'Normalization', 'probability');
bar(pmf)

Respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 27 de Abr. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by