Solving normcdf for sigma

Hello
I am trying to solve the following equation for sigma but keep encountering errors: normcdf(1.43,1.415,sigma)-normcdf(1.4,1.415,sigma)=0.02 The code I've entered is: syms sigma solve(normcdf(1.43,1.415,sigma)-normcdf(1.4,1.415,sigma)==0.02)
Any help would be greatly appreciated.
Thanks

Answers (1)

The symbolic toolbox does not understand normcdf very well. But fzero will work just fine.
fun = @(sigma) normcdf(1.43,1.415,sigma)-normcdf(1.4,1.415,sigma)-0.02;
[sigma,fval] = fzero(fun,1)
sigma =
0.59835074767517
fval =
1.73472347597681e-17
As a test:
normcdf(1.43,1.415,sigma)-normcdf(1.4,1.415,sigma)
ans =
0.02
If you really, absolutely needed the utmost accuracy (why???) you could use the transformation for normcdf into erf. But that makes absolutely no sense in this context, since you have only 3 significant digits on your other numbers.

4 Comments

Hi, Sorry the answer is incorrect but there may be somethint wrong with my equation. If you would be able to solve this problem it would be most helpfull: A manufacturer produces bolts that are specified to be between 1.4 and 1.43 cm in diameter. Its production produces results in a bolts diamaeter being normally distributed with mean 1.415cm. What is the maximum value of sigma that will permit no more than 2% of the bolts to be outside the specifications.
Of course it would be helpful for me to do your homework. However, Answers is not a homework service. Since you did make some effort on this, and you were not too far off in what you tried, I'll give you one major hint, in that I'll tell you what you did compute.
What you computed was the value of sigma that has exactly 2% of the mass INSIDE those limits. Yet, you were asked to find exactly the opposite.
"2% of the bolts to be OUTSIDE the specifications."
So, how might you change what you did to solve the question? I can think of two simple ways to change your solution to arrive at a reasonable answer, but this is your homework, not mine. So you need to do the thinking.
I tried switching the 0.02 to 0.98 because this would then calculate all the values within the specifications? However, it produces NaN.
I suggest that you plot the function
fun = @(sigma) normcdf(1.43,1.415,sigma)-normcdf(1.4,1.415,sigma)-0.98;
to see where its zero is approximately located.
Best wishes
Torsten.

Sign in to comment.

Categories

Find more on Mathematics in Help Center and File Exchange

Tags

Asked:

on 8 Apr 2018

Commented:

on 9 Apr 2018

Community Treasure Hunt

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

Start Hunting!