Creating a matrix with the binomial distribution as entries.

2 views (last 30 days)
How can I create a 6 × 6 matrix with P (Xi = j − 1) in the (i, j)-position where Xi has the binomial distribution with parameters n = i−1 and p = 1/4.

Answers (1)

Star Strider
Star Strider on 15 Oct 2016
I’m not certain what you’re asking. If I’m guessing correctly, the binornd function may be what you want.
See if this works:
Nmtx = [0:5]' * [1:6];
R = binornd(Nmtx, 1/4); % Output Matrix
Experiment with ‘Nmtx’ to get the result you want.
  2 Comments
Shane Kosir
Shane Kosir on 15 Oct 2016
What is the Nmtx operation? Basically I need to create a matrix where the (i,j) entries of the 6x6 matrix correspond to the binomial distribution with parameters n=i-1 and p=1/4. I know what they should be just need helping coding that in.
Star Strider
Star Strider on 16 Oct 2016
If you know what they should be, please post an example.
I have no idea what you want.
Once I know, coding it might be relatively straightforward.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!