## Thursday, December 17, 2015

### a universe of puzzles

In The Puzzle Universe: A History of Mathematics in 315 Puzzles (TPU), Ivan Moscovich stretches the concept of puzzles to encompass almost anything that combines curiosity and playfulness (playthinks is his preferred term for this more general category of puzzling items). No surprise - these playful curiosities are inherently mathematical. In an informal and accessible way, Moscovich details the development of these puzzles, revealing their surprising family resemblances and the deep mathematics behind their playful exterior.

An example of a playthink that might not at first inspection resemble a puzzle in the usual sense is the spirolateral (TPU puzzle 270). Drawn following basic rules, a family of interesting geometric objects emerges. The rule for drawing the third spirolateral is to draw a line 1 unit long, turn 90 degrees, draw a line 2 units long, turn 90 degrees, draw a line 3 units long, turn 90 degrees, and repeat. The general rule is to draw lines starting at 1 unit long and going up to n units long, turning 90 degrees between each line, and then repeating the process from 1 again. A natural thing to try in LOGO, the first few are shown below.

the first few spirolaterals

The puzzle-prompt is "what do the next two look like?" A natural question follows... what do they all look like? In answering the first question, you are following rules, in answering the second, you are using mathematical thinking.

a later spirolateral

TPU also demonstrates how to to read almost any mathematical object as a puzzle, which opens up pathways of inquiry of surprising richness. In Moscovich's treatment, a decorative pattern (see here and here) can become a puzzle (as in TPU puzzle 83) simply by asking questions like, "how many separate loops make up the image below?"

a decorative pattern

One of the pleasures of "recreational mathematics" is all the little discoveries you make about the simple patterns and relationships you are exploring. Reading TPU, you may find out that your recent breakthrough has been well known for a long time, was the basis for a 19th century children's game, or was proved by Gauss when he was ten. Finding out that the puzzles you've been playing with (and your inventive solutions) have a long history is a nice reminder that while you may be working on puzzles alone, you're not alone in working on puzzles. A while back, I was playing with punctured chessboards and knight tours - from TPU puzzle 100 I learned that an Italian mathematician devised a knight puzzle on a 3x3 punctured board in 1512.

a knight walks around a small punctured board

There are many familiar items in TPU: Pascal's triangle (TPU 119), the river crossing problem (TPU 73), liars and truthers (TPU 306, 307, 308), the Monty Hall problem (TPU 293),... I could go on. Something familiar, and something new can be found every few pages. Even for many of the more familiar items, Moscovich often has an unexpected connection to present. For example, I knew that the midpoints of any quadrilateral would form a parallelogram (TPU 130), but had not known that, in general, derived polygons formed by joining midpoints tend to become "more regular."

a derived parallelogram, some derived pentagons

While diving into the alternately obscure, well-known, and in some cases apocryphal origins of many puzzles and the mathematics associated with them, TPU provides a welcome counter-narrative to utilitarian accounts of the development of mathematics. More comprehensive historical treatments reveal, however, that the history of mathematics is richer (and stranger) than even TPU suggests. In some ways, a better title would just have been simply "mathematics in 315 puzzles," as TPU provides a gentle and accessible introduction to the essence of mathematical thinking.

The Puzzle Universe is a quixotic, informative, and enlightening encyclopedia of recreational mathematics. It should prove to be an inspiration to mathematical idlers, and a rich resource for learners and teachers who wish to be attuned to the playful and creative side of mathematics.

## Thursday, November 19, 2015

### friday fractals

Some Friday fractals, again, again.

## Thursday, October 22, 2015

### more pentagons, decagons, stars and rhombs

Kept adding on to one of the pentagon patterns from the previous post...

Eventually, ended up with  rough decagon shape - how many little decagons in there?

Zooming in, there are some nice patterns in there:

Yikes!

## Thursday, October 15, 2015

### out from a ring of pentagons

Looking at the Kepler pentagonal tiling, it seems there is skull staring back, warning me against spending too much time playing around with polygons.

But regular pentagons encourage time wasting by how they fail to fit together, forcing fusings and overlaps. For example, finding a way to build out from a central ring of ten pentagons, you might try a ring of ten fused decagons.

After another jagged ring of 30 pentagons, you can add another ring made of ten rings of pentagons joined by hexagons (formed from fused pentagons).
One more step, and the decagons seem to be drifitng outward - once overlapping, now with stars between them.

Or, you could start with a central ring of pentagons surrounded by five stars and five rhombs.

A slightly more compact ring of pentagon rings comes next.
And as they pull apart - more stars.

Just remember, those aren't crania, just decagons and pentagons.

## Wednesday, September 30, 2015

### more polynomial grid division

Update: try out the polynomial division example generator page here.

The most visited post on this blog describes how to divide polynomials using the grid method, also known as the generic rectangle or reverse tabular method. I realize that people who are looking for instruction in such matters may not be not idlers or casual readers of math blogs - they are likely serious people who are preparing lesson plans, doing homework, or otherwise looking to divide some polynomials. So I thought it would be nice to provide a little more on this topic, and hopefully help out a bit. If you are among these folk, I recommend that you start with the original post, and then read over these additional examples. Also, things will make better sense if you have practiced multiplying polynomials using grids.

In a future post, I'm planning to outline another method of polynomial division that I call the backwards reverse tabular method, which gives a power series as a result, instead of a polynomial quotient and remainder. Following through on the backwards reverse tabular method requires an infinitely long grid, so I am saving it for when I have more time.

example 1

Let's try this one:

Before you start, you should know what sort of things to expect. Since we are dividing a third degree polynomial (the dividend) by a first degree polynomial (the divisor), the quotient is going to be a second degree polynomial (degree is 3 - 1) with a possible remainder of degree zero (the remainder will have a degree less than the divisor). The grid you are going to need will be a 2 (divisor degree + 1) by 3 (quotient degree + 1)  grid.

We are thinking of division as the reverse of multiplication. The question we are asking is: what quotient (across the top) do we need to multiply by the divisor (the far left column) to get the dividend (what gets filled in the table)?

In step 1, we put the highest term of the divisor in the first cell of the second row (or the first interior row, depending on how you are counting them). What do we need to fill in at the green circle so that when we multiply we get what is already in the grid? The answer is shown in step 2. In step 3 we fill in the additional cells of the grid that result from multiplying the value that we just put in the top row. We get a second degree term - but we know we don't want any of those (there are none in the divisor), so we put a value in on the diagonal that will cancel it out (step 4, below).

The process repeats itself for the second column (step 5), and eventually the third (step 6), until you have nothing left to fill in (step 7).

It looks like we are blocked now - we would like to keep filling in the grid so that it matches up with the dividend, but we have run out of cells: we'd like to complete the diagonal for the linear term (step 8, below). So, let's just add in the one cell we need  (step 9) - this will display the remainder, since there will not be any place to put a corresponding term in the top quotient row. [Not everyone includes the remainder on the grid, but I think it's a good idea to put it there, off to the side.]

We can now read the whole problem and its solution from the grid:

example 2

You may be forgiven if you believe this method might not work with divisors of higher powers. So lets try a sixth degree polynomial divided by a third degree polynomial.

Our dividend (degree 6) divided by our divisor (degree 3) will give us a quotient (degree 6 -3 = 3) and possibly a remainder (its degree less than that of the dividend, so less than 3). Our grid will be 4 (degree of divisor + 1) by 4 (degree of quotient + 1). Its a good idea to include a row of zeros for the missing linear term in the divisor (otherwise the diagonals will be messed up, and the grid will be harder to work with). Here is what you will start with:

Remember: Each upward sloping diagonal sums to a term in the original dividend, and you fill in cells in the second row to make this sum work out. The top row elements are chosen such that the multiplication works, and other cells down a column are just the result of filling in the grid by multiplication. In this case, we end up having to add 3 additional cells for the remainder:

It's easier than it first appears to be. Time for one more?

example 3

Apologies for the errors in the original version of this post. If you find any mistakes, please let me know. Thanks!

Other related posts:

## Friday, September 18, 2015

### two star patterns

Here are a couple of star patterns inspired by the examples and explanations given by Craig Kaplan on his Computer Graphics and Geometric Ornamental Design page. Both were done in GSP using rough approximations of the precise methods that Craig describes there.

## Monday, September 14, 2015

### decorative fusings of the dodecagon

In the middle of playing around with various tiles and patterns, I lucked onto a post from Alex Bellos from back in February, in which he gives instructions for some decorative geometric constructions. He suggests dusting off a geometry set to implement them, but I found GSP worked nicely.

If you start with the line AB and follow Alex's instructions, you'll end up something like the above. Hiding what we want to hide, and mapping A and B onto the other corners of the square using an iteration will give you something that looks very close to his finished product.

In more decorative versions, the edges that extend out weave together in a braided fashion, producing an even more striking effect. But it was one of the later examples from the post that I was more interested in, as it seemed to show a more general method of using overlapping regular polygons (in this case, regular dodecagons) to produce decorative patterns. In one example, the dodecagons intersect at the midpoints of their sides at 90 degree angles:

I found that having the dodecagons intersect at the midpoints of their sides at 30 and 60 degree angles produces another interesting pattern.

If instead of intersecting at midpoints, we intersect the dodecagons at vertices, we can get other patterns. Here's one where the dodecagons have the smallest of overlaps.

Overlapping a little more, you get a pattern that you can make from a standard set of pattern blocks.

Still with a greater overlap, you can make a nice rosette.

And this pattern below has dodecagons overlapping in two ways (a bit hard to see the second):

Well, that was fun. Any other decorative patterns from overlapping dodecagons? I'll finish off with that dodecagon rosette pattern around a dodecagon.

## Wednesday, September 9, 2015

### geometric mean and sieve

We usually think of the mean of two numbers a and c as their average b = 1/2(+ c). Another way to think of b is that it is the number that makes a, b, c an arithmetic sequence, so b is more properly called the arithmetic mean of a and c. Similarly, we can find the geometric mean of two numbers, a and c. This time, b will be the number that makes a, b, c into a geometric sequence. The geometric mean of two numbers a and c is given by b = sqrt (* c).

Here is a construction for the geometric mean of two numbers that uses a parabola in an interesting way:
1. Graph the parabola y = x^2.
2. Plot the points a and c on the y axis: let A be (0,a) and let C be (0,c).
3. Draw a line through A parallel to the x axis - the point where it touches the parabola's positive arm is A'. Do the same for C - the point where it touches the parabola's negative arm is C'.
4. Draw the line through A' C'.  The point where this line crosses the y axis is B = (0, b), where b is the geometric mean of a, c.

This construction of the geometric mean can be used to create a geometric prime sieve. Usually, we visualize the sieve of Eratosthenes on a number chart. Starting with 2, w cross out all the multiples of 2 (except for 2 itself): these numbers are clearly not prime. Then we continue with the first number that we did not cross out, 3, and cross out all its multiples (except for 3 itself)... if we continued indefinitely we will cross out all composites, leaving only primes behind (we have woven a sieve that only lets the primes fall through). Practically, if we are hunting for primes less than n, we only need to go as far as crossing out multiples of primes up to sqrt(n).

Here is how we can construct a similar prime sieve using a parabola - the geometric mean construction can help you see why we are able to hit all the composites.

1. Graph the parabola y = x^2.
2. Plot the points on the parabola obtained from x = -2, -3, -4, ...

3. Plot x = 2 on the parabola. Draw lines from this point on the parabola to each point drawn in step 2. The y-intercepts of these lines are the multiples of 2.

4. Plot x = 3 on the parabola. Draw lines from this point on the parabola to each point drawn in step 2. The y-intercepts of these lines are the multiples of 3.

5. Continue the process for x values that are not among the multiples found in previous steps.The numbers on the y axis, greater than 1 that are not touched by the constructed lines are the primes left behind by the sieve.

## Tuesday, August 25, 2015

### simple fun with R

I'm in the process of learning about the programming language R, and thought a nice way to get started would be to play with a few simple examples of things I've previously posted about. You can take any of these examples and try them out yourself by copying the code right into an in-browser R environment like R-fiddle.

The two baby R examples here make use of some of the built in math functions in R (sin, cos, and sqrt), and illustrate the vector-based approach that R takes. In R, instead of iterating using a while or for loop and applying functions to individual values, many functions are 'vectorized' so you can provide a whole vector of arguments to a function and it will do the iterating for you. Hopefully you will see what I mean in the examples below.

Example 1: Lissajous figures

R provides a number of ways of creating vectors - ordered collections of a single data type. One way to create a vector that is just a sequence of the form n, n + 1, n + 2, ... k is to use the colon notation n:k. Here (example 1a) some basic raw input the (vector t) has a scaling factor f applied to it. When you multiply a 'scalar' (actually, in R this is a one-element vector) by a vector, the scalar is applied to each element of the vector (as you might expect) to produce a new vector. Something a bit less expected is that functions like sin() are vectorized - if you provide a vector as an argument, they will produce a vector of the same size as a result, and the contents of the returned vector are what you would expect to get from applying the function to each element.

The plot() function is flexible - when a single vector is provided (example 1a) it will plot the ordered pairs (x, y) using elements of the vector as y values against x values inferred from each element's position in the vector (its index). When two vectors are provided (example 1b), the first vector provides the x values, and the second the y values (generally, R implements some 'recycling' behavior when the two vectors are not of equal length but the length of one is a multiple of the other). Finally, the plot() function offers some additional arguments for formatting the output.

A very different "synthetic" approach to drawing lissajous figures can be taken in Geometer's Sketchpad, as mentioned here.

Example 2: Phyllotaxis spirals

Something that takes getting used to: sqrt(t)*cos(t) is not merely the multiplication of two numbers, it is the position-wise multiplication of two vectors (lists of numbers): t is a vector, sqrt(t) is a vector made up of the square roots of the elements of t, cos(t) is a vector made up of the cosines of the elements of t, and sqrt(t)*cos(t) is a vector made up elements obtained by multiplying the ith element of sqrt(t) by the ith element of cos(t). This is not the normal 'mathematical' way of multiplying vectors, but it is consistently used throughout R to achieve its distinctive vectorized programming model.

There are some older posts on drawing spirals like this in Fathom and Tinkerplots (see here), and also in Processing (see here).

FWIW, these simple examples are on github - maybe more will join them later.