Question: How would I code this in matlab? I have a probability problem where there are 4 possible outcomes x = {1,2,3,4}. The probability of getting

How would I code this in matlab?

I have a probability problem where there are 4 possible outcomes x = {1,2,3,4}. The probability of getting x = 1 is 2/5, probability of getting x = 2 is 3/10, probability of getting x = 3 is 1/5, and getting a 4 is 1/10. Therefore p(x) = {2/5, 3/10, 1/5, 1/10}.

My expected value is 2. How did i get this? E(X) = x*p(X=x). So basically E(x) = (1)(2/5) + (2)(3/10) + (3)(1/5) + (4)(1/10) = 2

If i calculate the variance 2 = 1

And my standard deviation = 1

I need to graph this probability distribution function and show how i get my expected value, variance, std dev, and probability. How would i perform an operation on matlab to show all this?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!