# random variable with normal distribution

1 visualizzazione (ultimi 30 giorni)
Tony il 11 Nov 2013
Risposto: Roger Stafford il 11 Nov 2013
Hello, here is the problem:
A random variable obeys a normal distribution. It has a mean value equal to 100 and a standard deviation equal to 3. Find the probability that:
x < 98
98 < x < 104
x > 98
I have a slight idea i know how to find mean using mean(x) and randn(x) for some random number but no idea how to tie them together.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (3)

Matt J il 11 Nov 2013
See the erf() command.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Image Analyst il 11 Nov 2013
If you want to do it empirically (like Monte Carlo), you can use this:
numberOfNumbers = 1000000; % Whatever number you want.
% From the help:
randomNumbers = 100 + 3 * randn(1, numberOfNumbers);
% Count number less than 98
count = sum(randomNumbers < 98)
fprintf('The number of numbers less than 98 = %g%%\n',...
count * 100 / numberOfNumbers);
Repeat for other ranges.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Roger Stafford il 11 Nov 2013
The Statistics Toolbox function 'normcdf' is just what you need.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Triangular Distribution in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by