I have created a random uniform distribution with values between $5$ and $6.5$. I have also found the mean. I am stuck on a problem that asks how many values are higher than the mean.
How would I do this? I've tried the length(find(x)) function but it did not work. help please?
pd=makedist('Uniform','Lower',5,'Upper',6.5)
average_height=mean(pd)
length(find(pd>5.75))`
I don't see that you have specified how many observations you have chosen at random from $Unif(5, 6.5).$ So it is not clear what you are trying to do or what you are asking.
This is a symmetrical distribution with mean and median 5.75. About half of your observations should exceed 5.75.
With
m = 10^6observations, we have the following simulation in R.The vector
x > 5.75is logical, having elementTRUEfor values of x greater than 5.75, andFALSEotherwise. The sum of a logical vector treats eachTRUEas a 1 and eachFALSEas a 0. Thus the last statement provides a count of the observations exceeding 5.75.