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)
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!