Tuesday, September 29, 2009

Is zero a triangular number?

Neil Sloan's On-Line Encyclopedia of Integer Sequences, which everyone who works seriously (or recreationally) with integer sequences regards as the ultimate authority, lists the triangular numbers as sequence A000217, and unambiguously includes 0 as a triangular number:
0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820, 861, 903, 946, 990, 1035, 1081, 1128, 1176, 1225, 1275, 1326, 1378, 1431,...
It was brought to my attention that all the references on this blog to triangular numbers (and to all other polygonal numbers) have omitted the 0 and started at 1. Please bear this omission in mind when browsing these pages - sometimes you might want to add a zero to the beginning of the sequences (but sometimes maybe not).

I am consoled, only somewhat, by the fact that wikipedia and mathworld (two other august authorities on sequence-related matters) also omit the zero from their triangular number lists.

This reminds me of the age-old question:

Is zero a natural number?

Putting the definition of the natural numbers on the chalkboard is always dangerous - you risk having some student insist that your definition is wrong, wrong, wrong because they were taught that natural numbers included (or excluded) zero, and yours doesn't. It seems that most sources, including Sloan's OLEIS, say that 0 is not natural (see A000027).

I suspect that (most) mathematicians do not care (much) about this - they just redefine the term "natural number" to be what they need it to be at the moment they happen to be using it. If they need a zero, they add a zero, and move on.

Wikipedia suggests that when you encounter a situation where it might matter, one should use $\mathbb{N}_0$ when zero is to be included, and $\mathbb{N}$ when it isn't (or when it doesn't matter).

The comparison between the triangulars and the naturals is not spurious. Wikipedia defines the triangulars as sums of the naturals (I, somewhat strangely, tend to think of naturals as one-dimensional triangular numbers). If this is your chosen definition then you are likely not to include zero, and you might use this formula:
\[t_n = \sum^{n}_{i=1}i.\]
However, if we want to rehabilitate this particular formula for the triangulars + 0, we just need to adjust the index:
\[t_n = \sum^{n}_{i=0}i\]
What about other triangular number formulas? Can they all include zero too? Well, the simplest, $t_n = \frac{n(n+1)}{2}$ works just fine when you let $n=0$.

Sometimes, when we are thinking of how they relate to the binomial coefficients, we might want to use this formula:

\[t_n = \left( \begin{array}{c} n +1 \\2\end{array} \right) \]

This might give you pause, because when $n = 0$ we seem to be "out of bounds." Luckily we have:

\[\left(\begin{array}{c} n \\r \end{array}\right) = 0 \mbox{ for } r > n\]

Which is exactly what we need.

As far as the posts on this blog are concerned, the only way of expressing the triangulars that needs obvious modification in order to work for the triangulars + 0 is the generating function:

\[g(x) = \frac{1}{\left( 1-x \right)^{3}} = 1 +3x + 6x^2 + 10x^3 + ...\]

which gives the triangulars as in the coefficients on the right hand side. To have a generating function for the triangulars + 0 you need to modify this to be:

\[g(x) = \frac{x}{\left( 1-x \right)^{3}} = 0 +x +3x^2 + 6x^3 + 10x^4 + ...\]

Multiplying by $x$ is the generating-function equivalent to shifting indexes, which is what we had to do for our first formula.

Thanks to Alexander Povolotsky for bringing these issues to light.

Sunday, September 27, 2009

means and trigonometric ratios

I recently noticed that two earlier posts contain an identical diagram (surprising how these things slip by). Both instances of the diagram come from old high school textbooks, one dedicated to geometry and the other to algebra. The first occurrence of the diagram was intended to provide an explanation for the names of the  "secant" and "tangent" trig ratios. The diagram occurred again to provide a geometric construction for the arithmetic, geometric, and harmonic means of two lengths.

If we merge the two uses of the diagram, we get some simple identities that relate the means of the lengths to the trig ratios of an angle. Proving them uses only the definitions of the means, the pythagorean theorem and the basic trig ratio definitions.

Consider two lengths, a and b. Assume that $a \leq b$, and construct the segments as shown. PQ is the length a and PR is the length b.

From here, form the circle whose diameter is RQ as shown.With O as the center, construct the tangent to the circle from the point P. Mark the point of tangency as S. The angle POS is marked $\theta$.

Note that the radius of the circle is $r = \frac{b-a}{2}$, and the arithmetic mean am, geometric mean gm, and harmonic mean hm are given by:
\[am = \frac{a+b}{2}\]
\[gm = \sqrt{ab}\]
\[hm = \frac{2}{\frac{1}{a}+\frac{1}{b}}\]
As described briefly in the earlier post, these ratios appear in the construction where the length OP is arithmetic mean, the length PT is the harmonic mean, and the length SP is the geometric mean of a and b.

If you explore the diagram further with the angle $\theta$ in mind, you'll find that $am = r\sec{\theta}$,  $gm = r\tan{\theta}$, and $hm = r\sin{\theta}\tan{\theta}$ (note that the constructed arithmetic mean lies on the secant of the circle, and the constructed geometric mean lies on the tangent). Also, we have
\[\frac{am}{gm}=\frac{gm}{hm} = \csc{\theta}\]
Maybe there is nothing too surprising here, but I like that two important sets of ratios - the trigonometric ratios and the means - are connected by a simple construction.

I found a variaiton on this diagram in A text book of geometrical drawing by William Minifie - it attempts to capture quite a few constructed ratios (including the antiquated versed sine) in a single diagram.

Wednesday, September 23, 2009

envelope of the Wallace line

I was looking at  Heinrich Dorrie's 100 Great Problems of Elementary Mathematics, and problem 53, which involves a surprising hypocycloid construction, caught my attention. The problem is "to determine the envelope of the Wallace line of a triangle" and the solution is "Steiner's three-pointed hypocycloid."

The construction of Stiener's hypocycloid  lends itself well to GSP, and also shows how naming coincidences lead to strange juxtapositions.

If you google "Wallace Line" you'll find that the Internet knows not about a mathematical construction, but rather about a line that divides Indonesia into two ecological regions whose fauna are generally described as Australian on one side and Asian on the other. This Wallace line is named after Alfred Wallace, the naturalist who is known for prompting Charles Darwin to publish his Origin of Species.

Searching a little more, you will find that the line that we are concerned with is more frequently called the Simson-Wallace line - that name  might remind you of Wallace Simpson, famous for her marriage to Prince (formerly King) Edward in 1936.

Wallace Simpson, not Simson-Wallace

Names aside, the Wallace line construction extends just a little from the construction of the circumcircle, and then the Steiner hypocycloid emerges when we look at the family of all Wallace lines.

The triangle and circumcircle
0. Start with a triangle whose sides have been extended
1. Construct the perpendicular bisectors of the sides of the triangle
2. Construct the circumcenter as the point of intersection of the bisectors
3. Construct the circumcircle, C, whose center is the circumcenter and whose perimeter crosses the verticies of the original triangle.

The Simson-Wallace (or just plain Wallace) Line
4. Choose a point P on the circumcircle C
5. Form the three lines through P perpendicular to each side.
6. Form the line, w,  that passes through the points of intersection of each perpendicular with its respective side - this is the Wallace Line.

The envelope and "Steiner hypocycloid"
We want to explore the family of Wallace lines as the point P moves around the circle. In GSP we can do this using the Locus construction (I think that families of lines are generally called a "pencil" rather than "locus", and that the latter term is usually reserved for families of points, but this distinction might be antiquated).
7. Select the Wallace line, w, the point P, and the circle C
8. Construct the locus generated by w as P moves about C

A GSP file for the construction is here.
Some good descriptions of the Simson-Wallace line and this construction can be found on Cut the Knot and Wolfram Mathworld. There is an interactive activity for constructing the Simson-Wallace Line on the NCTM Illuminations site here.

a bit more origami

This is just a footnote to an earlier post on origami.

There is a really nice TED talk by Robert Lang where he explains why we like to use mathematics to solve problems (like, how to make paper bugs with legs): it lets us have dead people do our work for us. A bit more blunt than the "standing on the shoulders of giants" metaphor, but same idea. A similar talk is available here, courtesy of the MAA. The Between the Folds blog recently pointed out a nice online National Geographic article and blog post on origami that touch on points that are developed a bit more fully in the Lang lectures.

Finally, here is a trio of great origami blogs: The Fitful Flog, Origami Tessellations, and Student Flotsam and Origami Jetsam.

Tuesday, September 15, 2009

Rosencrantz, Guildenstern & the gambler's fallacy

The opening of Tom Stoppard's play has Rosencrantz and Guildenstern  flipping coins and noticing that the 'laws of probability' seem to be suspended (you should check out the opening scene of the film here, or read the opening of the play here) - the coin always comes up heads. What the characters are experiencing certainly defies common sense, but perhaps it is common sense that is (at least in part) in the wrong.

A good question to ask is, would Rosencrantz and Guildenstern be as alarmed if the coin flips alternated exactly between heads and tails? They should be, but if their psychology is anything like most people's, it would probably take them longer to clue in to the problem. A 'perfectly fair' coin that alternates between heads and tails is just as absurd (and just as unlikely) as a 'completely unfair' coin that always turns up heads, but it seems to be closer to our expectations of how coins should behave.

In his book, Innumeracy, John Allen Paulos presents this problem (as a contest between Peter and Paul, rather than Rosencrantz and Guildenstern), and notes that most people, like our protagonists, expect coin flips to be evenly distributed between heads and tails (but perhaps not perfectly so).  Paulos sets up the problem like this:
Imagine two players, Peter and Paul, who flip a coin once a day and who bet on heads and tails, respectively. Peter is winning at any given time if there have been more heads up until then, while Paul is winning if there’ve been more tails.
Would you expect Peter or Paul to have a long winning (or losing) streak? Or would you expect them to usually alternate between being the winner (or loser)? Paulos continues:
Peter and Paul are each equally likely to be ahead at any given time, but whoever is ahead will probably have been ahead almost the whole time.
The false expectation that the results should more-or-less alternate in order to 'average out' is sometimes referred to as the (false) 'law of averages' or the gambler's fallacy. The (true) law of large numbers, which asserts that for a large samples the number of heads will be roughly equal to the number of tails, does not imply that a head becomes more likely after a string of tails, or vice versa.

The plots below show a game of 100 coin flips - the law of large numbers (regression to the mean) is apparent in the first plot, while the second plot, in which the number of tails is subtracted from the number of heads, shows no evidence for the law of averages (heads is ahead most of the time).

By undermining our expectation, this  simple experiment provides a moment of disequilibration, and, as Paulos suggests, it may help us realize that we shouldn't put too much emphasis on winning or loosing streaks in games, sport, finance, or life - they are a normal occurrence.

A Fathom file to explore the coin game simulation is here, and a completed file that includes plots and charts is here.

Thursday, September 10, 2009

geometric programming and trig functions

One of the most helpful ways to think about how to interact with dynamic geometry programs is to consider 'sketching' as programming (an unhelpful way to think of sketching is to think of it as drawing). This orientation is explained nicely by R. Nicholas Jackiw and William F. Finzer in Programming by Geometry:
Constructing a sketch in GSP is programming, in the straightforward sense of building a functional system which maps input to output. The unconstrained elements of the sketch... constitute the program's inputs or parameters. The relationships between parts of the sketch ... correspond to a program's production statements. In GSP's case, the semantics of the production language are governed by traditional Euclidean constructions.
The remarkable characteristic of GSP's system comes from the realization that a program's structure -- i.e. its "source code" -- and its output are isomorphic. When the student completes the specification, or coding, of the centroid construction in the above example, he or she has at the same time located a specific centroid. By manipulating the vertices of the triangle (the program's inputs), the student generates further output. Significantly, these manipulations are performed in the same domain, that of planar geometric objects, as the act of constructing the initial sketch.
Playing with hypocycloid constructions recently reminded me how nicely Sketchpad explorations help make the connection between circular motion and trig functions. For example, the sketches here include one that was inspired by a simple harmonic motion demo, and one that explores lissajous figures.

A nice overview that includes some similar sketches is given in a talk, Trig Comes Alive, by Scott Steketee from last year's NCTM annual conference.

Wednesday, September 9, 2009

a neglected sequence

Looking at some old texts (from the 1930s, mostly) I came across a type of sequence that was once part of the standard curriculum along side the familiar arithmetic and geometric varieties.  As far as I know, this third sequence type, harmonic sequences, is no longer part of any standard high school curriculum (please correct me if I am wrong).

Arithmetic sequences have a common difference between terms \[t_{n}=t_{n-1}+d\]
Geometric sequences have a common ratio \[t_{n}=t_{n-1}r\]
Harmonic sequences have the defining property that the reciprocals of their terms have a common difference (i.e. their reciprocals form an arithmetic sequence).
\[\frac{1}{t_{n}}=\frac{1}{t_{n-1}} +d\]
\[t_{n}=\frac{t_{n-1}}{1+ dt_{n-1}}\]
When you set the first term and the difference to 1, you get a harmonic sequence that has come to be known as the harmonic sequence, namely:
\[1, \frac{1}{2}, \frac{1}{3}, \frac{1}{4}, ... \]
If a, b, c are three three terms of an arithmetic sequence, the middle term b is the 'arithmetic mean' of a and c, which is generally what we mean by "the mean" or average of a and c: \[b = \frac{a+c}{2} \] Similarly, if a, b, c are three terms of a geometric sequence, then b is the 'geometric mean' of a and c: \[b = \sqrt{ac} \] Not too surprisingly then, if a, b, and c form a harmonic sequence, then b is the 'harmonic mean' of a and c: \[b = \frac{2ac}{a+c} \]
What might be surprising at first is that if you have two numbers, say a and c, then the harmonic, geometric and arithmetic means of a and c form a geometric series (or put another way, the geometric mean of a and c is also the geometric mean of the harmonic and arithmetic means of a and c).

The algebra textbooks that I looked at did not present any applications of harmonic means or sequences (the exercises were restricted to formula manipulation), and the harmonic sequence does not seem to provide a very applicable 'model of growth', which is how the other sequences are generally presented. Harmonic relationships come up frequently in geometry, however, and one text did feature a nice construction for all three means (see below).

In this construction (GSP file here), O is the center of the circle, and PR is a secant that goes through O. SP is tangent to the circle, and ST is at right angles to the secant PR. If we let a = PQ and b = PR, PO gives the arithmetic mean of a and b, PS gives their geometric mean and PT gives their harmonic mean. (Proof left as an exercise :)

I couldn't locate the texts I consulted in Google books, but for some other examples of how harmonic sequences were presented, see these:
H. S. Hall, S. R. Knight, Higher algebra: a sequel to elementary algebra for schools. Macmillan, 1894. (page 47)
O. Lodge, Easy mathematics, chiefly arithmetic..., Macmillan, 1906. (page 339)

Tuesday, September 1, 2009

scrambler fractal

The image at the top of the post shows the first five generations of the family of curves obtained from the 'scrambler' construction that I described briefly in the last post. These curves are generated by the equations
where n is the generation (starting at 0), and the sign of the coefficients in the expression for y are chosen to yield the different branches of the family. In the diagram above, if you choose all positive coefficients, you get the curves on the extreme left, while if you choose positive for the first term but negative for the rest, you get the curves on the extreme right.

The curves formed by choosing alternate + and - signs are the ones most closely related to the 'scrambler' that got this started.  This choice has each circle turning in the direction opposite to the circle that preceded it, and generates the 'propeller' curves that lie in the center right of the diagram above.

One way to express this branch of the family is

GSP was used for the first few generations, but to look at this for very large n, I resorted to writing a short (surprisingly short) Processing program that gave these pictures for generations 0-7, and 20:

Looking at the images above and the one below, you can see that as n goes to infinity a fractal emerges that displays nice self-similarity along each propeller blade.

A text file with the Processing source code for drawing the fractal is here.

Update: A post about the leftmost curve on the chart above ("brain fractal") is here.