Geometric magic trick

This is a magic trick that my math teacher taught me when I was about 13 or 14. I’ve found that it’s a big hit when performed for grade-school children.

Magician: Tell me a number between 3 and 10.

Child: (gives a number, call it x)

Magician: On a piece of paper, draw a shape with x corners.

Child: (draws a figure; an example for x=6 is shown)

geom_magic1Important Note: For this trick to work, the original shape has to be convex… something shaped like an L or M won’t work. Also, I chose a maximum of 10 mostly for ease of drawing and counting (and, for later, calculating).

Magician: Tell me another number between 3 and 10.

Child: (gives a number, call it y)

Magician: Now draw that many dots inside of your shape.

Child: (starts drawing y dots inside the figure; an example for y = 7While the child does this, the Magician calculates 2y + x - 2, writes the answer on a piece of paper, and turns the answer face down.

geom_magic2Magician: Now connect the dots with lines until you get all triangles. Just be sure that no two lines cross each other.

Child: (connects the dots until the shape is divided into triangles; an example is shown)

geom_magic3Magician: Now count the number of triangles.

Child: (counts the triangles)

Magician: Was your answer… (and turns the answer over)?

The reason this magic trick works so well is that it’s so counter-intuitive. No matter what convex x-gon is drawn, no matter where the y points are located, and no matter how lines are drawn to create triangles, there will always be 2y + x - 2 triangles. For the example above, 2y+x-2 = 2\times 7 + 6 - 2 = 18, and there are indeed 18 triangles in the figure.

Why does this magic trick work? I offer a thought bubble if you’d like to think about it before scrolling down to see the answer.

green_speech_bubbleThis trick works by counting the measures of all the angles in two different ways.

Method #1: If there are T triangles created, then the sum of the measures of the angles in each triangle is 180 degrees. So the sum of the measures of all of the angles must be 180 T degrees.

geom_magic4Method #2: The sum of the measures of the angles around each interior point is 360 degrees. Since there are y interior points, the sum of these angles is 360y degrees.

geom_magic5The measures of the remaining angles add up to the sum of the measures of the interior angles of a convex polygon with x sides. So the sum of these measures is 180(x-2) degrees.

geom_magic6In other words, it must be the case that

180T = 360y + 180(x-2), or T = 2y + x - 2.

Welch’s formula

When conducting an hypothesis test or computing a confidence interval for the difference \overline{X}_1 - \overline{X}_2 of two means, where at least one mean does not arise from a small sample, the Student t distribution must be employed. In particular, the number of degrees of freedom for the Student t distribution must be computed. Many textbooks suggest using Welch’s formula:

df = \frac{\displaystyle (SE_1^2 + SE_2^2)^2}{\displaystyle \frac{SE_1^4}{n_1-1} + \frac{SE_2^4}{n_2-1}},

rounded down to the nearest integer. In this formula, SE_1 = \displaystyle \frac{\sigma_1}{\sqrt{n_1}} is the standard error associated with the first average \overline{X}_1, where \sigma_1 (if known) is the population standard deviation for X and n_1 is the number of samples that are averaged to find \overline{X}_1. In practice, \sigma_1 is not known, and so the bootstrap estimate \sigma_1 \approx s_1 is employed.

The terms SE_2 and n_2 are similarly defined for the average \overline{X}_2.

In Welch’s formula, the term SE_1^2 + SE_2^2 in the numerator is equal to \displaystyle \frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}. This is the square of the standard error SE_D associated with the difference \overline{X}_1 - \overline{X}_2, since

SE_D = \displaystyle \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}.

This leads to the “Pythagorean” relationship

SE_1^2 + SE_2^2 = SE_D^2,

which (in my experience) is a reasonable aid to help students remember the formula for SE_D.

green line

Naturally, a big problem that students encounter when using Welch’s formula is that the formula is really, really complicated, and it’s easy to make a mistake when entering information into their calculators. (Indeed, it might be that the pre-programmed calculator function simply gives the wrong answer.) Also, since the formula is complicated, students don’t have a lot of psychological reassurance that, when they come out the other end, their answer is actually correct. So, when teaching this topic, I tell my students the following rule of thumb so that they can at least check if their final answer is plausible:

\min(n_1,n_2)-1 \le df \le n_1 + n_2 -2.

To my surprise, I have never seen this formula in a statistics textbook, even though it’s quite simple to state and not too difficult to prove using techniques from first-semester calculus.

Let’s rewrite Welch’s formula as

df = \left( \displaystyle \frac{1}{n_1-1} \left[ \frac{SE_1^2}{SE_1^2 + SE_2^2}\right]^2 + \frac{1}{n_2-1} \left[ \frac{SE_2^2}{SE_1^2 + SE_2^2} \right]^2 \right)^{-1}

For the sake of simplicity, let m_1 = n_1 - 1 and m_2 = n_2 -1, so that

df = \left( \displaystyle \frac{1}{m_1} \left[ \frac{SE_1^2}{SE_1^2 + SE_2^2}\right]^2 + \frac{1}{m_2} \left[ \frac{SE_2^2}{SE_1^2 + SE_2^2} \right]^2 \right)^{-1}

Now let x = \displaystyle \frac{SE_1^2}{SE_1^2 + SE_2^2}. All of these terms are nonnegative (and, in practice, they’re all positive), so that x \ge 0. Also, the numerator is no larger than the denominator, so that x \le 1. Finally, we notice that

1-x = 1 - \displaystyle \frac{SE_1^2}{SE_1^2 + SE_2^2} = \frac{SE_2^2}{SE_1^2 + SE_2^2}.

Using these observations, Welch’s formula reduces to the function

f(x) = \left( \displaystyle \frac{x^2}{m_1} + \frac{(1-x)^2}{m_2} \right)^{-1},

and the central problem is to find the maximum and minimum values of f(x) on the interval 0 \le x \le 1. Since f(x) is differentiable on [0,1], the absolute extrema can be found by checking the endpoints and the critical point(s).

First, the endpoints. If x=0, then f(0) = \left( \displaystyle \frac{1}{m_2} \right)^{-1} = m_2. On the other hand, if x=1, then f(1) = \left( \displaystyle \frac{1}{m_1} \right)^{-1} = m_1.

Next, the critical point(s). These are found by solving the equation f'(x) = 0:

f'(x) = -\left( \displaystyle \frac{x^2}{m_1} + \frac{(1-x)^2}{m_2} \right)^{-2} \left[ \displaystyle \frac{2x}{m_1} - \frac{2(1-x)}{m_2} \right] = 0

\displaystyle \frac{2x}{m_1} - \frac{2(1-x)}{m_2} = 0

\displaystyle \frac{2x}{m_1} = \frac{2(1-x)}{m_2}

xm_2= (1-x)m_1

xm_2 = m_1 - xm_1

x(m_1 + m_2) = m_1

x = \displaystyle \frac{m_1}{m_1 + m_2}

Plugging back into the original equation, we find the local extremum

f \left( \displaystyle \frac{m_1}{m_1+m_2} \right) = \left( \displaystyle \frac{1}{m_1} \frac{m_1^2}{(m_1+m_2)^2} + \frac{1}{m_2} \left[1-\frac{m_1}{m_1+m_2}\right]^2 \right)^{-1}

f \left( \displaystyle \frac{m_1}{m_1+m_2} \right) = \left( \displaystyle \frac{1}{m_1} \frac{m_1^2}{(m_1+m_2)^2} + \frac{1}{m_2} \left[\frac{m_2}{m_1+m_2}\right]^2 \right)^{-1}

f \left( \displaystyle \frac{m_1}{m_1+m_2} \right) = \left( \displaystyle \frac{m_1}{(m_1+m_2)^2} + \frac{m_2}{(m_1+m_2)^2} \right)^{-1}

f \left( \displaystyle \frac{m_1}{m_1+m_2} \right) = \left( \displaystyle \frac{m_1+m_2}{(m_1+m_2)^2} \right)^{-1}

f \left( \displaystyle \frac{m_1}{m_1+m_2} \right) = \left( \displaystyle \frac{1}{m_1+m_2} \right)^{-1}

f \left( \displaystyle \frac{m_1}{m_1+m_2} \right) = m_1+m_2

Based on the three local extrema that we’ve found, it’s clear that the absolute minimum of f(x) on [0,1] is the smaller of m_1 and m_2, while the absolute maximum is equal to m_1 + m_2.

\hbox{QED}

In conclusion, I suggest offering the following guidelines to students to encourage their intuition about the plausibility of their answers:

  • If SE_1 is much smaller than SE_2 (i.e., x \approx 0), then df will be close to m_2 = n_2 - 1.
  • If SE_1 is much larger than SE_2 (i.e., x \approx 1), then df will be close to m_1 = n_1 - 1.
  • Otherwise, df could be as large as m_1 + m_2 = n_1 + n_2 - 2, but no larger.

Statistical significance

When teaching my Applied Statistics class, I’ll often use the following xkcd comic to reinforce the meaning of statistical significance.

significant

The idea that’s being communicated is that, when performing an hypothesis test, the observed significance level P is the probability that the null hypothesis is correct due to dumb luck as opposed to a real effect (the alternative hypothesis). So if the significance level is really about 0.05 and the experiment is repeated about 20 times, it wouldn’t be surprising for one of those experiments to falsely reject the null hypothesis.

In practice, statisticians use the Bonferroni correction when performing multiple simultaneous tests to avoid the erroneous conclusion displayed in the comic.

Source: http://www.xkcd.com/882/

Engaging students in a different discipline

I have no expertise about how to teach any other subject besides mathematics. But this article from the May/June 2013 issue of the Stanford alumni magazine made a lot of sense to me about how to teach history to middle- and high-school students. The basic principle appears to be the same that governs my classes: figure out a way to make students want to come to class each day. A sample quote:

I easily could have told them in one minute that the Dust Bowl was the result of overgrazing and over-farming and World War I overproduction, combined with droughts that had been plaguing that area forever, but they wouldn’t remember it.” By reading these challenging documents and discovering history for themselves, he says, “not only will they remember the content, they’ll develop skills for life.

For history, the widespread implementation of this teaching philosophy has apparently been hindered by the lack of adequate teaching materials, which is also addressed in this article.

Dimensions

As described by the March 2013 issue of the American Mathematical Monthly, the (free!) two-hour movie Dimensions  is “an impressive computer-generated video of almost 2 hours that describes geometry in two, three and four dimensions. The video assumes an elementary geometry background possessed by most viewers and leads up to an interesting geometric structure, the Hopf fibration of the unit sphere in four-dimensional space.”

The website of this project can be found at http://www.dimensions-math.org.

Here’s the 4-minute trailer for the movie:

This full two-hour movie was uploaded to YouTube in several chapters. The full YouTube playlist is given here.

The links to the 9 separate chapters are below.

 

Put Understanding First

From a great article by G. Wiggins and J. McTighe, “Put Understanding First,” Reshaping High Schools, Vol. 65, No. 8, pp. 36-41 (May 2008)

Out-of-context learning of skills is arguably one of the greatest weaknesses of the secondary curriculum—the natural outgrowth of marching through the textbook instead of teaching with meaning and transfer in mind. Schools too often teach and test mathematics, writing, and world language skills in isolation rather than in the context of authentic demands requiring thoughtful application. If we don’t give students sufficient ongoing opportunities to puzzle over genuine problems, make meaning of their learning, and apply content in various contexts, then long-term retention and effective performance are unlikely, and high schools will have failed to achieve their purpose.