Solving Problems Submitted to MAA Journals (Part 6d)

The following problem appeared in Volume 97, Issue 3 (2024) of Mathematics Magazine.

Two points P and Q are chosen at random (uniformly) from the interior of a unit circle. What is the probability that the circle whose diameter is segment overline{PQ} lies entirely in the interior of the unit circle?

As discussed in a previous post, I guessed from simulation that the answer is 2/3. Naturally, simulation is not a proof, and so I started thinking about how to prove this.

My first thought was to make the problem simpler by letting only one point be chosen at random instead of two. Suppose that the point P is fixed at a distance t from the origin. What is the probability that the point Q, chosen at random, uniformly, from the interior of the unit circle, has the desired property?

My second thought is that, by radial symmetry, I could rotate the figure so that the point P is located at (t,0). In this way, the probability in question is ultimately going to be a function of t.

There is a very nice way to compute such probabilities since Q is chosen at uniformly from the unit circle. Let A_t be the set of all points Q within the unit circle that have the desired property. Since the area of the unit circle is \pi(1)^2 = \pi, the probability of desired property happening is

\displaystyle \frac{\hbox{area}(A_t)}{\pi}.

Based on the simulations discussed in the previous post, my guess was that A_t was the interior of an ellipse centered at the origin with a semimajor axis of length 1 and a semiminor axis of length \sqrt{1-t^2}. Now I had to think about how to prove this.

As noted earlier in this series, the circle with diameter \overline{PQ} will lie within the unit circle exactly when MO+MP < 1, where M is the midpoint of \overline{PQ}. So suppose that P has coordinates (t,0), where t is known, and let the coordinates of Q be (x,y). Then the coordinates of M will be

\displaystyle \left( \frac{x+t}{2}, \frac{y}{2} \right),

so that

MO = \displaystyle \sqrt{ \left( \frac{x+t}{2} \right)^2 + \left( \frac{y}{2} \right)^2}

and

MP = \displaystyle \sqrt{ \left( \frac{x+t}{2} - t\right)^2 + \left( \frac{y}{2} \right)^2} =  \sqrt{ \left( \frac{x-t}{2} \right)^2 + \left( \frac{y}{2} \right)^2}.

Therefore, the condition MO+MP < 1 (again, equivalent to the condition that the circle with diameter \overline{PQ} lies within the unit circle) becomes

\displaystyle \sqrt{ \left( \frac{x+t}{2} \right)^2 + \left( \frac{y}{2} \right)^2} + \sqrt{ \left( \frac{x-t}{2} \right)^2 + \left( \frac{y}{2} \right)^2} < 1,

which simplifies to

\displaystyle \sqrt{ \frac{1}{4} \left[ (x+t)^2 + y^2 \right]} + \sqrt{ \frac{1}{4} \left[ (x-t)^2 + y^2 \right]} < 1

\displaystyle \frac{1}{2}\sqrt{   (x+t)^2 + y^2} +  \frac{1}{2}\sqrt{  (x-t)^2 + y^2} < 1

\displaystyle \sqrt{   (x+t)^2 + y^2} +  \sqrt{  (x-t)^2 + y^2} < 2.

When I saw this, light finally dawned. Given two points F_1 and F_2, called the foci, an ellipse is defined to be the set of all points Q so that QF_1 + QF_2 = 2a, where a is a constant. If the coordinates of Q, F_1, and F_2 are (x,y), (c,0), and (-c,0), then this becomes

\displaystyle \sqrt{   (x+c)^2 + y^2} +  \sqrt{  (x-c)^2 + y^2} = 2a.

Therefore, the set A_t is the interior of an ellipse centered at the origin with a = 1 and c = t. Furthermore, a = 1 is the semimajor axis of the ellipse, while the semiminor axis is equal to b = \sqrt{a^2-c^2} = \sqrt{1-t^2}.

At last, I could now return to the original question. Suppose that the point P is fixed at a distance t from the origin. What is the probability that the point Q, chosen at random, uniformly, from the interior of the unit circle, has the property that the circle with diameter \overline{PQ} lies within the unit circle? Since A_t is a subset of the interior of the unit circle, we see that this probability is equal to

\displaystyle \frac{\hbox{area}(A_t)}{\hbox{area of unit circle}} = \frac{\pi \cdot 1 \cdot \sqrt{1-t^2}}{\pi (1)^2} = \sqrt{1-t^2}.

In the next post, I’ll use this intermediate step to solve the original question.

Solving Problems Submitted to MAA Journals (Part 6c)

The following problem appeared in Volume 97, Issue 3 (2024) of Mathematics Magazine.

Two points P and Q are chosen at random (uniformly) from the interior of a unit circle. What is the probability that the circle whose diameter is segment \overline{PQ} lies entirely in the interior of the unit circle?

As discussed in the previous post, I guessed from simulation that the answer is 2/3. Naturally, simulation is not a proof, and so I started thinking about how to prove this.

My first thought was to make the problem simpler by letting only one point be chosen at random instead of two. Suppose that the point P is fixed at a distance t from the origin. What is the probability that the point Q, chosen at random, uniformly, from the interior of the unit circle, has the desired property?

My second thought is that, by radial symmetry, I could rotate the figure so that the point P is located at (t,0). In this way, the probability in question is ultimately going to be a function of t.

There is a very nice way to compute such probabilities since Q is chosen at uniformly from the unit circle. Let A_t be the probability that the point Q has the desired property. Since the area of the unit circle is \pi(1)^2 = \pi, the probability of desired property happening is

\displaystyle \frac{\hbox{area}(A_t)}{\pi}.

So, if I could figure out the shape of A_t, I could compute this conditional probability given the location of the point P.

But, once again, I initially had no idea of what this shape would look like. So, once again, I turned to simulation with Mathematica. As noted earlier in this series, the circle with diameter \overline{PQ} will lie within the unit circle exactly when MO+MP < 1, where M is the midpoint of \overline{PQ}. For my initial simulation, I chose P to have coordinates (0.5,0).

To my surprise, I immediately recognized that the points had the shape of an ellipse centered at the origin. Indeed, with a little playing around, it looked like this ellipse had a semimajor axis of 1 and a semiminor axis of about 0.87.

My next thought was to attempt to find the relationship between the length of the semiminor axis at the distance t of P from the origin. I thought I’d draw of few of these simulations for different values of t and then try to see if there was some natural function connecting t to my guesses. My next attempt was t = 0.6; as it turned out, it looked like the semiminor axis now had a length of 0.8.

At this point, something clicked: (6,8,10) is a Pythagorean triple, meaning that

6^2 + 8^2 = 10^2

(0.6)^2 + (0.8)^2 = 1^2

(0.8)^2 = 1 - (0.6)^2

0.8 = \sqrt{1 - (0.6)^2}

Also, 0.87 is very close to \sqrt{3}/2, a very familiar number from trigonometry:

\displaystyle \frac{\sqrt{3}}{2} = \sqrt{1 - (0.5)^2}

So I had a guess: the semiminor axis has length \sqrt{1-t^2}. A few more simulations with different values of t confirmed this guess. For instance, here’s the picture with t = 0.9.

Now that I was psychologically certain of the answer for A_t, all that remain was proving that this guess actually worked. That’ll be the subject of the next post.

Solving Problems Submitted to MAA Journals (Part 6b)

The following problem appeared in Volume 97, Issue 3 (2024) of Mathematics Magazine.

Two points P and Q are chosen at random (uniformly) from the interior of a unit circle. What is the probability that the circle whose diameter is segment \overline{PQ} lies entirely in the interior of the unit circle?

As discussed in the previous post, I guessed from simulation that the answer is 2/3. Naturally, simulation is not a proof, and so I started thinking about how to prove this.

My first thought was to make the problem simpler by letting only one point be chosen at random instead of two. Suppose that the point P is fixed at a distance t from the origin. What is the probability that the point Q, chosen at random, uniformly, from the interior of the unit circle, has the desired property?

My second thought is that, by radial symmetry, I could rotate the figure so that the point P is located at (t,0). In this way, the probability in question is ultimately going to be a function of t.

There is a very nice way to compute such probabilities since Q is chosen at uniformly from the unit circle. Let A_t be the probability that the point Q has the desired property. Since the area of the unit circle is \pi(1)^2 = \pi, the probability of desired property happening is

\displaystyle \frac{\hbox{area}(A_t)}{\pi}.

So, if I could figure out the shape of A_t, I could compute this conditional probability given the location of the point P.

But, once again, I initially had no idea of what this shape would look like. So, once again, I turned to simulation with Mathematica.

First, a technical detail that I ignored in the previous post. To generate points (x,y) at random inside the unit circle, one might think to let x = r \cos \theta and y = r \sin \theta, where the distance from the origin r is chosen at random between 0 and 1 and the angle \theta is chosen at random from 0 to 2\pi. Unfortunately, this simple simulation generates too many points that are close to the origin and not enough that are close to the circle:

To see why this happened, let R denote the distance of a randomly chosen point from the origin. Then the event R < r is the same as saying that the point lies inside the circle centered at the origin with radius r, so that the probability of this event should be

F(r) = P(R < r) = \displaystyle \frac{\pi r^2}{\pi (1)^2} = r^2.

However, in the above simulation, R was chosen uniformly from [0,1], so that P(R < r) = r. All this to say, the above simulation did not produce points uniformly chosen from the unit circle.

To remedy this, we employ the standard technique of using the inverse of the above function F(r), which is clearly F^{-1}(r) = \sqrt{r}. In other words, we will chose randomly chosen radius to have the form R= \sqrt{U}, where U is chosen uniformly on [0,1]. In this way,

P(R < r) = P( \sqrt{U} < r) = P(U < r^2) = r^2,

as required. Making this modification (highlighted in yellow) produces points that are more evenly distributed in the unit circle; any bunching of points or empty spaces are simply due to the luck of the draw.

In the next post, I’ll turn to the simulation of A_t.

Solving Problems Submitted to MAA Journals (Part 6a)

The following problem appeared in Volume 97, Issue 3 (2024) of Mathematics Magazine.

Two points P and Q are chosen at random (uniformly) from the interior of a unit circle. What is the probability that the circle whose diameter is segment \overline{PQ} lies entirely in the interior of the unit circle?

It took me a while to wrap my head around the statement of the problem. In the figure, the points P and Q are chosen from inside the unit circle (blue). Then the circle (pink) with diameter \overline{PQ} has center M, the midpoint of \overline{PQ}. Also, the radius of the pink circle is MP=MQ.

The pink circle will lie entirely the blue circle exactly when the green line containing the origin O, the point M, and a radius of the pink circle lies within the blue circle. Said another way, the condition is that the distance MO plus the radius of the pink circle is less than 1, or

MO + MP < 1.

As a first step toward wrapping my head around this problem, I programmed a simple simulation in Mathematica to count the number of times that MO + MP < 1 when points P and Q were chosen at random from the unit circle.

In the above simulation, out of about 61,000,000 attempts, 66.6644% of the attempts were successful. This leads to the natural guess that the true probability is 2/3. Indeed, the 95% confidence confidence interval (0.666524, 0.666764) contains 2/3, so that the difference of 0.666644 from 2/3 can be plausibly attributed to chance.

I end with a quick programming note. This certainly isn’t the ideal way to perform the simulation. First, for a fast simulation, I should have programmed in C++ or Python instead of Mathematica. Second, the coordinates of P and Q are chosen from the unit square, so it’s quite possible for P or Q or both to lie outside the unit circle. Indeed, the chance that both P and Q lie in the unit disk in this simulation is (\pi/4)^2 \approx 0.617, meaning that about 38.3\% of the simulations were simply wasted. So the only sense that this was a quick simulation was that I could type it quickly in Mathematica and then let the computer churn out a result. (I’ll talk about a better way to perform the simulation in the next post.)

Solving Problems Submitted to MAA Journals (Part 4)

The following problem appeared in Volume 96, Issue 3 (2023) of Mathematics Magazine.

Let A_1, \dots, A_n be arbitrary events in a probability field. Denote by B_k the event that at least k of A_1, \dots A_n occur. Prove that \displaystyle \sum_{k=1}^n P(B_k) = \sum_{k=1}^n P(A_k).

I’ll admit when I first read this problem, I didn’t believe it. I had to draw a couple of Venn diagrams to convince myself that it actually worked:

Of course, pictures are not proofs, so I started giving the problem more thought.

I wish I could say where I got the inspiration from, but I got the idea to define a new random variable N to be the number of events from A_1, \dots A_n that occur. With this definition, B_k becomes the event that N \ge k, so that

\displaystyle \sum_{k=1}^n P(B_k) = \sum_{k=1}^n P(N \ge k)

At this point, my Spidey Sense went off: that’s the tail-sum formula for expectation! Since N is a non-negative integer-valued random variable, the mean of N can be computed by

E(N) = \displaystyle \sum_{k=1}^n P(N \ge k).

Said another way, E(N) = \displaystyle \sum_{k=1}^n P(B_k).

Therefore, to solve the problem, it remains to show that \displaystyle \sum_{k=1}^n P(A_k) is also equal to E(N). To do this, I employed the standard technique from the bag of tricks of writing N as the sum of indicator random variables. Define

I_k = \displaystyle \bigg\{ \begin{array}{ll} 1, & A_k \hbox{~occurs} \\ 0, & A_k \hbox{~does not occur} \end{array}

Then N = I_1 + \dots + I_n, so that

E(N) = \displaystyle \sum_{k=1}^n E(I_k) =\sum_{k=1}^n [1 \cdot P(A_k) + 0 \cdot P(A_k^c)] =\sum_{k=1}^n P(A_k).

Equating the two expressions for E(N), we conclude that \displaystyle \sum_{k=1}^n P(B_k)  = \sum_{k=1}^n P(A_k), as claimed.

Solving Problems Submitted to MAA Journals (Part 2b)

The following problem appeared in Volume 53, Issue 4 (2022) of The College Mathematics Journal. This was the second-half of a two-part problem.

Suppose that X and Y are independent, uniform random variables over [0,1]. Define U_X, V_X, B_X, and W_X as follows:

U_X is uniform over [0,X],

V_X is uniform over [X,1],

B_X \in \{0,1\} with P(B_X=1) = X and P(B_X=0)=1-X, and

W_X = B_X \cdot U_X + (1-B_X) \cdot V_X.

Prove that W_X is uniform over [0,1].

Once again, one way of showing that W_X is uniform on [0,1] is showing that P(W_X \le t) = t if 0 \le t \le 1.

My first thought was that the value of W_X depends on the value of X, and so it makes sense to write P(W_X \le t) as an integral of conditional probabilities:

P(W_X \le t) =  \displaystyle \int_0^1 P(W_X \le t \mid X = x) f(x) \, dx,

where f(x) is the probability density function of X. In this case, since X has a uniform distribution over [0,1], we see that f(x) = 1 for 0 \le x \le 1. Therefore,

P(W_X \le t) = \displaystyle \int_0^1 P(W_X \le t \mid X = x) \, dx.

My second thought was that W_X really has a two-part definition:

W_X =  \displaystyle  \bigg\{ \begin{array}{ll} U_X, & B_X = 1 \\ V_X, & B_X = 0 \end{array}

So it made sense to divide the conditional probability into these two cases:

P(W_X \le t) =  \displaystyle \int_0^1 P(W_X \le t, B_X = 1 ~\hbox{or}~ B_X = 0 \mid X = x) \, dx

=  \displaystyle \int_0^1 P(W_X \le t, B_X = 1 \mid X = x) \, dx + \int_0^1 P(W_X \le t, B_X = 0 \mid X = x) \, dx

My third thought was that these probabilities can be rewritten using the Multiplication Rule. This ordinarily has the form P(E \cap F) = P(E) P(F \mid E). For an initial conditional probability, it has the form P(E \cap F \mid G) = P(E \mid G) P(F \mid E \cap G). Therefore,

P(W_X \le t) = \displaystyle \int_0^1 P(B_X = 1 \mid X = x) P(W_X \le t \mid B_X = 1, X = x) \, dx

+ \displaystyle \int_0^1 P(B_X = 0 \mid X=x) P(W_X \le t \mid B_X = 0, X = x) \, dx.

The definition of B_X provides the immediate computation of P(B_X = 1 \mid X = x) and P(B_X = 0 \mid X = x):

P(W_X \le t) =\displaystyle \int_0^1 x P(W_X \le t \mid B_X = 1, X = x) \, dx

+ \displaystyle \int_0^1 (1-x) P(W_X \le t \mid B_X = 0, X = x) \, dx

Also, the two-part definition of W_X provides the next step:

P(W_X \le t) =\displaystyle \int_0^1 x P(U_X \le t \mid B_X = 1, X = x) \, dx

+ \displaystyle \int_0^1 (1-x) P(V_X \le t \mid B_X = 0, X = x) \, dx

We split each of these integrals into an integral from 0 to t and then an integral from t to 1. First,

\displaystyle \int_0^1 x P(U_X \le t \mid B_X = 1, X = x) \, dx

= \displaystyle \int_0^t x P(U_X \le t \mid B_X = 1, X = x) \, dx + \displaystyle \int_t^1 x P(U_X \le t \mid B_X = 1, X = x) \, dx.

We now use the following: if 0 \le x \le 1 and U is uniform over [0,x], then

P(U \le t) = \displaystyle \bigg\{ \begin{array}{ll} t/x, & t \le x \\ 1, & t > x \end{array}

We observe that t > x in the first integral, while t \le x in the second integral. Therefore,

\displaystyle \int_0^1 x P(U_X \le t \mid B_X = 1, X = x) \, dx = \int_0^t x \cdot 1 \, dx + \int_t^1 x \cdot \frac{t}{x} \, dx

= \displaystyle \int_0^t x  \, dx + \int_t^1 t \, dx.

For the second integral involving V_X, we again split into two subintegrals and use the fact that if V is uniform on [x,1], then

P(V \le t) = \displaystyle \bigg\{ \begin{array}{ll} 0, & t \le x \\ (t-x)/(1-x), & t > x \end{array}

Therefore,

\displaystyle \int_0^1 (1-x) P(V_X \le t \mid B_X = 0, X = x) \, dx

=\displaystyle \int_0^t (1-x) P(V_X \le t \mid B_X = 0, X = x) \, dx

+ \displaystyle \int_t^1 (1-x) P(V_X \le t \mid B_X = 0, X = x) \, dx

= \displaystyle \int_0^t (1-x) \cdot \frac{t-x}{1-x} \, dx + \int_t^1 (1-x) \cdot 0 \, dx

= \displaystyle \int_0^t (t-x)  \, dx.

Combining, we conclude that

P(W_X \le t) =  \displaystyle \int_0^t x  \, dx + \int_t^1 t \, dx + \displaystyle \int_0^t (t-x)  \, dx

=  \displaystyle \int_0^t [x + (t-x)]  \, dx + \int_t^1 t \, dx

=  \displaystyle \int_0^t t  \, dx + \int_t^1 t \, dx

=  \displaystyle \int_0^1 t  \, dx

= t,

from which we conclude that W_X is uniformly distributed on [0,1].

As I recall, this took a couple days of staring and false starts before I was finally able to get the solution.

Solving Problems Submitted to MAA Journals (Part 2a)

The following problem appeared in Volume 53, Issue 4 (2022) of The College Mathematics Journal. This was the first problem that was I able to solve in over 30 years of subscribing to MAA journals.

Suppose that X and Y are independent, uniform random variables over [0,1]. Now define the random variable Z by

Z = (Y-X) {\bf 1}(Y \ge X) + (1-X+Y) {\bf 1}(Y<X).

Prove that Z is uniform over [0,1]. Here, {\bf 1}[S] is the indicator function that is equal to 1 if S is true and 0 otherwise.

The first thing that went through my mind was something like, “This looks odd. But it’s a probability problem using concepts from a senior-level but undergraduate probability course. This was once my field of specialization. I had better be able to get this.”

My second thought was that one way of proving that Z is uniform on [0,1] is showing that P(Z \le t) = t if 0 \le t \le 1.

My third thought was that Z really had a two-part definition:

Z = \bigg\{ \begin{array}{ll} Y-X, & Y \ge X \\ 1-X+Y, & Y <X \end{array}

So I got started by dividing this probability into the two cases:

P(Z \le t) = P(Z \le t, Y \ge X ~\hbox{or}~ Y < X)

= P(Z \le t, Y \ge X ~\hbox{or}~ Z \le t, Y < X)

= P(Z \le t, Y \ge X) + P(Z \le t, Y < X)

= P(Y-X \le t, Y \ge X) + P(1 - X + Y \le t, Y < X)

= P(Y \le X + t, Y \ge X) + P( Y \le X + t - 1, Y < X)

= P(X \le Y \le X + t) + P(Y \le X + t - 1).

In the last step, since 0 \le t \le 1, the events Y \le X + t - 1 and Y < X are redundant: if Y \le X + t - 1, then Y will automatically be less than X. Therefore, it’s safe to remove Y < X from the last probability.

Ordinarily, such probabilities are computed by double integrals over the joint probability density function of X and Y, which usually isn’t easy. However, in this case, since X and Y are independent and uniform over [0,1], the ordered pair (X,Y) is uniform on the unit square [0,1] \times [0,1]. Therefore, probabilities can be found by simply computing areas.

In this case, since the area of the unit square is 1, P(Z \le t) is equal to the sum of the areas of

\{(x,y) \in [0,1] \times [0,1] : x \le y \le x + t \},

which is depicted in green below, and

\{(x,y) \in [0,1] \times [0,1] : y \le x + t - 1 \},

which is depicted in purple.

First, the area in green is a trapezoid. The y-intercept of the line y = x+t is (0,t), and the two lengths of t and 1-t on the upper left of the square are found from this y-intercept. The area of the green trapezoid is easiest found by subtracting the areas of two isosceles right triangles:

$latex \displaystyle \frac{(1)^2}{2} – \frac{(1-t)^2}{2} = \frac{1-1+2t-t^2}{2} = \frac{2t-t^2}{2}.

Second, the area in purple is an isosceles right triangle. The y-intercept of the line y=x+t-1 is (0,t-1), so that the distance from the y-intercept to the origin is 1-t. From this, the two lengths of 1-t and t are found. Therefore, the area of the purple right triangle is \displaystyle \frac{t^2}{2}.

Adding, we conclude that

P(Z \le t) = \displaystyle \frac{2t-t^2}{2} + \frac{t^2}{2} = \frac{2t}{2} = t.

Therefore, Z is uniform over [0,1].

A closing note: after going 0-for-4000 in my previous 30+ years of attempting problems submitted to MAA journals, I was unbelievably excited to finally get one. As I recall, it took me less than an hour to get the above solution, although writing up the solution cleanly took longer.

However, the above was only Part 1 of a two-part problem, so I knew I just had to get the second part before submitting. That’ll be the subject of the next post.

Thoughts on Numerical Integration (Part 23): The normalcdf function on TI calculators

I end this series about numerical integration by returning to the most common (if hidden) application of numerical integration in the secondary mathematics curriculum: finding the area under the normal curve. This is a critically important tool for problems in both probability and statistics; however, the antiderivative of \displaystyle \frac{1}{\sqrt{2\pi}} e^{-x^2/2} cannot be expressed using finitely many elementary functions. Therefore, we must resort to numerical methods instead.

In days of old, of course, students relied on tables in the back of the textbook to find areas under the bell curve, and I suppose that such tables are still being printed. For students with access to modern scientific calculators, of course, there’s no need for tables because this is a built-in function on many calculators. For the line of TI calculators, the command is normalcdf.

Unfortunately, it’s a sad (but not well-known) fact of life that the TI-83 and TI-84 calculators are not terribly accurate at computing these areas. For example:

TI-84: \displaystyle \int_0^1 \frac{e^{-x^2/2}}{\sqrt{2\pi}} \, dx \approx 0.3413447\underline{399}

Correct answer, with Mathematica: 0.3413447\underline{467}\dots

TI-84: \displaystyle \int_1^2 \frac{e^{-x^2/2}}{\sqrt{2\pi}} \, dx \approx 0.1359051\underline{975}

Correct answer, with Mathematica: 0.1359051\underline{219}\dots

TI-84: \displaystyle \int_2^3 \frac{e^{-x^2/2}}{\sqrt{2\pi}} \, dx \approx 0.021400\underline{0948}

Correct answer, with Mathematica: 0.021400\underline{2339}\dots

TI-84: \displaystyle \int_3^4 \frac{e^{-x^2/2}}{\sqrt{2\pi}} \, dx \approx 0.0013182\underline{812}

Correct answer, with Mathematica: 0.0013182\underline{267}\dots

TI-84: \displaystyle \int_4^5 \frac{e^{-x^2/2}}{\sqrt{2\pi}} \, dx \approx 0.0000313\underline{9892959}

Correct answer, with Mathematica: 0.0000313\underline{84590261}\dots

TI-84: \displaystyle \int_5^6 \frac{e^{-x^2/2}}{\sqrt{2\pi}} \, dx \approx 2.8\underline{61148776} \times 10^{-7}

Correct answer, with Mathematica: 2.8\underline{56649842}\dots \times 10^{-7}

I don’t presume to know the proprietary algorithm used to implement normalcdf on TI-83 and TI-84 calculators. My honest if brutal assessment is that it’s probably not worth knowing: in the best case (when the endpoints are close to 0), the calculator provides an answer that is accurate to only 7 significant digits while presenting the illusion of a higher degree of accuracy. I can say that Simpson’s Rule with only n = 26 subintervals provides a better approximation to \displaystyle \int_0^1 \frac{e^{-x^2/2}}{\sqrt{2\pi}} \, dx than the normalcdf function.

For what it’s worth, I also looked at the accuracy of the NORMSDIST function in Microsoft Excel. This is much better, almost always producing answers that are accurate to 11 or 12 significant digits, which is all that can be realistically expected in floating-point double-precision arithmetic (in which numbers are usually stored accurate to 13 significant digits prior to any computations).

Engaging students: Probability and odds

In my capstone class for future secondary math teachers, I ask my students to come up with ideas for engaging their students with different topics in the secondary mathematics curriculum. In other words, the point of the assignment was not to devise a full-blown lesson plan on this topic. Instead, I asked my students to think about three different ways of getting their students interested in the topic in the first place. I plan to share some of the best of these ideas on this blog (after asking my students’ permission, of course). This student submission again comes from my former student Angelica Albarracin. Her topic, from Pre-Algebra: probability and odds. green line How can this topic be used in your students’ future courses in mathematics or science? Probability is a topic that commonly appears in biology in the study of sexual reproduction. Both in freshman and college level biology, students are required to learn how to create and use Punnett squares. Punnett Squares are used to determine the likelihood certain alleles will appear in the offspring of 2 organisms. These alleles can do anything from determining eye color, to determining whether or not an organism will have a hereditary disease such as hemophilia. Though statistics is not a required mathematics class for high schoolers in the state of Texas, many students will end up encountering this class in high school and/or college as it pertains directly to many fields of study such as math, biology, chemistry, and physics. One of the most important concepts in statistics is the idea of statistical significance. Using the scientific method and other techniques for conducting a survey or experiment, it is easy to analyze, and record data. However, a major component of statistics is being able to interpret the implications of any given data. One of the biggest indicators that an experiment or survey that was conducted holds real implications is its statistical significance, which is essentially a measure of the probability of observing results as extreme as what was observed. green line How has this topic appeared in pop culture (movies, TV, current music, video games, etc.)? Speed running is a category of gaming that has become hugely popular over the years in which highly skilled and knowledgeable players compete amongst each other to complete a game as fast as possible. One of the most popular of these games in this scene is Minecraft and due to Minecraft’s popularity, speed runners of this game often come within seconds of world records, meaning every small optimization could be the difference between 1st and 2nd place on the leaderboards. Minecraft is a highly open and adventurous game primarily because each “world” is randomly generated, meaning that no two playthroughs are alike. This randomness not only encompasses world generation, but also factors into the availability of resources in the form of animals, enemies, and even ores used for building and crafting items. The most notorious section of the game where random generation plays a huge role in the speed run is in the collection of an essential item known as the ender pearl. In order to reach the final stage of the game, a minimum of 12 ender pearls are required, which can only be obtained from Endermen, a type of enemy in the game. Though ender pearls are considered an essential item for the completion of the game, it is theoretically possible to complete the game in its entirety without ever obtaining a single pearl.  This is due to a unique mechanic the game uses to allow the player into its final stages. Ender pearls are used in combination with a material called Blaze Powder to make a new item known as an Eye of Ender. Eyes of Ender are used to both locate a special portal to allow players into the “End” and to activate said portal. This portal (known as the End Portal) can only be activated with 12 eyes, but this is where the game’s inherent randomness plays an important factor. For each of the 12 slots in the portal dedicated to the placement of the eyes, there is a 10% chance that there will already be one inside, meaning the player would not need to provide one of their own. It is also important to note that while Eyes of Ender are used to locate this portal, it is completely possible to find this portal on your own, it is simply faster to use the Eye of Ender as a guide (and being faster is in the interest of speed runners). With this being said, the probability a player can complete the game without the usage of a single ender pearl is about 1 in 1 trillion! So, what’s the big deal? Speed runners can simply obtain the required pearls and ignore this possibility, right? Normally this would be the easy answer, but it becomes a bit more complex when we consider the nature of ender pearls. As mentioned earlier, ender pearls can only be obtained from endermen, and while their exact spawn rates are unknown, they are considered to be uncommon. In addition, each endermen has only a 50% chance of dropping an ender pearl upon defeat. If you consider this with the fact that enemies primarily spawn during the night cycle of the game, it is easy to see how obtaining these pearls can take a lot of time, something a speed runner wants to avoid at all costs. Consequently, runners are often put into a scenario in which they must balance their risk and reward. Though the probability a runner will encounter an End portal with all 12 eyes built in is near impossible, the likelihood that 2 or even 3 eyes would be there is not so low. Should a speed runner devote more time to finding ender pearls, though some of their effort maybe be for nothing, or should a runner find most of the pearls, and hope the rest are at the portal waiting? In a category of gaming where every second counts, probability can be used to figure out the most optimal answer to this question, and lead hopefuls to new world records. green line How can technology (YouTube, Khan Academy [khanacademy.org], Vi Hart, Geometers Sketchpad, graphing calculators, etc.) be used to effectively engage students with this topic? An important concept in probability is the Law of Large Numbers which states that “the relative frequency of an outcome approaches the actual probability of that outcome, as the number of repetitions gets larger” (see link below). This law can be easily observed through repeatedly tossing a coin or rolling a die, however, as the law suggests, this must be done a large amount of times. Tossing a coin 500 times in the classroom, while helpful to demonstrate this law in action, is time consuming and tedious. As a remedy to this, Texas Instruments developed an app for TI-84 graphing calculators called Probability Simulation.
In this free app, students can choose from a variety of actions to simulate such as tossing coins, rolling dice, picking marbles, and drawing cards. In the image above, the calculator is simulating the results of rolling two die. There are many useful features and settings within this app but two of the best ones are the ability to perform an action 50 at a time (indicated by +50) and a graph to keep track of the results of all previous actions. Having the ability to perform each action quickly and in large quantity makes this a much less time consuming and material intensive activity. In addition, having a graph documenting each result from previous actions also helps tremendously in demonstrating the Law of Large Numbers as it acts as a visual aid. In the picture above, the rough formation of a bell curve can be seen after 501 rolls. References: https://education.ti.com/en/building-concepts/activities/statistics/sequence1/law-of-large-numbers https://www.minecraftseeds.co/stronghold-with-end-portal/ https://www.speedrun.com/mc/full_game#Any_Glitchless

My Favorite One-Liners: Part 122

Once in my probability class, a student asked a reasonable question — could I intuitively explain the difference between “uncorrelated” and “independent”? This is a very subtle question, as there are non-intuitive examples of random variables that are uncorrelated but are nevertheless dependent. For example, if X is a random variable uniformly distributed on \{-1,0,1\} and Y= X^2, then it’s straightforward to show that E(X) = 0 and E(XY) = E(X^3) = E(X) = 0, so that

\hbox{Cov}(X,Y) = E(XY) - E(X) E(Y) = 0

and hence X and Y are uncorrelated.

However, in most practical examples that come up in real life, “uncorrelated” and “independent” are synonymous, including the important special case of a bivariate normal distribution.

This was my expert answer to my student: it’s like the difference between “mostly dead” and “all dead.”