title: Standard Normal Distribution z-value function in C#
body: <p>I been looking at the recent blog post by Jeff Atwood on <a href="https://blog.stackoverflow.com/2009/10/alternate-sorting-orders/">Alternate Sorting Orders</a>. I tried to convert the code in the post to C# but I ran into an issue. There is no function in .NET that I know of that will return the z-value, given the percentage of area under the standard normal curve. The recommended values to use for the algorithm are 95% and 97.5% which you can look up on the z-value table in any statistics book.</p>
  <p>Does anyone know how to implement such a function for all values of z or at least to 6 standard deviations from the mean. One way would be to hard code the values into a dictionary and use a look up but there has to be a way of calculating the exact value.
  My attempt at solving this was to take a definite integral of the standard normal curve function.</p>
  <p>y = (1 / (sqrt(2 * PI))) * e^(-(1/2) * x^2)</p>
  <p>This gives me the area under the curve between two x values but then I am stuck… Maybe I am way of base and this is not how you would do it?</p>
  <p>Thanks.</p>