# Probability density function

1. Oct 6, 2012

### g.lemaitre

1. The problem statement, all variables and given/known data

I want to calculate the probability of a random sample falling between 2 z scores using the way real mathematicians do it not the fake way by resorting to tables. Ok, so the book outlines the equation below but says that it requires calculus which is beyond the scope of this course. I know calculus so let's do it.
2. Relevant equations

z = (x - μ)/σ

3. The attempt at a solution

Let's say x = 21, μ = 14 and σ = 6

thus

(21 - 14)/6 = 1.16, according to the tables the probability of a random sample falling between the z scores 0 and 1.16 is .3770

Now, let's use the calc equation:

$$\frac{\exp\frac{1}{2}(\frac{21-14}{6})^2}{6 \sqrt{2\pi}}$$

= .0336, not .3770, so I'm doing something wrong

Last edited by a moderator: Oct 7, 2012
2. Oct 6, 2012

### g.lemaitre

hold on, I'm forgetting what tags are used to enclose latex.

3. Oct 6, 2012

well $$is the way to enclose latex, it's not working on my computer. 4. Oct 6, 2012 ### Ray Vickson You need a second bracket } after the 2\pi, because without it you have \frac{}{ (no closure). So you have written [tex] \frac{\exp\frac{1}{2}(\frac{21-14}{6})^2}{6 \sqrt{2\pi}}$$
and called this the calc equation. Well, it is nonsense! The actual probability that an N(0,1) random variable falls between 0 and 1.16 is
$$\int_0^{1.16} \frac{1}{\sqrt{2\pi}} \exp(-z^2/2)\, dz,$$ which is a non-elementary integral; that is, there is no finite formula to express an integral of the form
$$G(a) = \int_0^a \frac{1}{\sqrt{2\pi}} \exp(-z^2/2)\, dz,$$ for general values of 'a' (although exact values are available for some special values of 'a'). This is a *theorem*: it is impossible to express G(a) in finitely many elementary terms. It not that nobody has been smart enough to figure out a formula; it is a rigorously-proven fact that it is impossible to write such a formula. Basically, even if you write down a complicated formula taking 1 million pages to write out, it still won't represent G(a)! Not even 1 billion pages are enough. So, when we want to compute G(a) we must resort to the use of tables or numerical integration methods or approximate formulas. Don't scorn tables---they (or their modern equivalents) are necessary.

Anyway, using tables (or Maple, which I prefer) the answer for that integral is 0.3769755969, approximately.

RGV

5. Oct 6, 2012

### g.lemaitre

when I did the calculations I got .204. Without the negative sign, since z is squared, i got .78

6. Oct 6, 2012

### Ray Vickson

You are NOT computing the integral, which is what needs to be done. Of course we can calculate f(z) for any z, but that is not the point. We need to calculate the INTEGRAL of f(z) for z from 0 to 1.16, and that is a much different problem. It needs tables or equivalent.

RGV