Tuesday, October 3, 2017

a Truchet puzzle mystery

I thought it would be fun to create a page of Truchet puzzles, and while doing this I noticed something that surprised me: even though they were randomly generated, all puzzles of the same size had the exact same level of complexity.

a single puzzle piece
that can be rotated into 4 positions

In these puzzles, Truchet tiles like the one above are used to create a specific pattern. All the pieces are the same - it is just a question of rotating them correctly to make the pattern you are aiming for.

a Truchet puzzle: can you make this pattern
using only Truchet tiles?

We can make these Truchet puzzles a bit more interesting if we have a specific starting arrangement, and add the restriction of using the smallest number of moves (clockwise rotations of individual tiles) to get from the starting arrangement to the target arrangement.

how many clockwise rotations of tiles will it take to transform
the square on the left to the one on the right?

On this page, you can try out some puzzles like this. Because you are only allowed to rotate pieces clockwise, you may have to rotate a given tile 0, 1, 2 or 3 times in order to get it into the desired position.

Please give it a try: https://dmackinnon1.github.io/truchet/match.html

When setting up this puzzle page, I used a restricted set of arrangements for both the starting and target arrangements. For the starting arrangement, I have all the Truchet tiles in the same position. Let's call this  type of arrangement a uniform Truchet square. There will be 4 different uniform Truchet squares of a given size; here is one for n = 6:

a uniform Truchet square: all tiles
are in the same position

Because I like the way they look, I chose the target arrangements to always have 4-fold rotational symmetry. An important choice as it turns out. These Truchet squares have sides of even length, and can be divided up into 4 quadrants - as we move around the quadrants in a clockwise direction, the pattern in each quadrant is a 90 degree rotation of the pattern in the preceding quadrant.

you can make Truchet squares with 4-fold rotational
symmetry - they tend to look nice.

With these restrictions, I found that:
  • All 2x2 puzzles are solvable in 6 moves.
  • All 4x4 puzzles are solvable in 24 moves.
  • All 6x6 puzzles are solvable in 54 moves.
Mysteriously, no matter what pattern was chosen for the target, all puzzles of the same size required the same number of moves to solve. 

symmetric puzzles of the same size always
have the same number of required moves

In general, it turns out that for any Truchet square T with side length n and 4-fold rotational symmetry, T will always be 6*(n/2)^2 rotations away from any uniform Truchet square.

This was more puzzling than the original puzzles: how could my randomly generated puzzles all require the same number of moves to solve?

To understand why this is the case, we can find a way to count all the rotations required to transform a uniform Truchet square into one that has four-fold rotational symmetry, and see that this does not depend on a particular choice of either the starting arrangement or the target. This turns out to be easier than you might expect.
Let U be a uniform Truchet square of side length n, and T be a Truchet square with 4-fold rotational symmetry, also of side length n. We'll count how many rotations it takes to transform U into T
Let t1 be a tile in the first quadrant of U. If we consider its image under rotation into the other quadrants, we have a set of 4 tiles, t1, t2, t3, and t4. One of these will be aligned with the corresponding tile in T (since the tiles in T that lie in the same positions as t1, t2, t3, and t4 are rotated through all 4 positions, while the tiles of U are all in the same position). It will require 0 moves for this tile be put into the same position as the corresponding tile of T. As we move around the quadrants to the other images of our selected tile, they will all be in the same position (U is uniform), but the corresponding tiles of T will be rotated. The corresponding tiles of T will be 1, 2, and 3 rotations ahead from the tiles of U. So each tile in the first quadrant will, along with its images under rotation, contribute 0+1+2+3 = 6 rotations to the overall number of rotations required to transform U into T. There are (n/2)^2 tiles in the first quadrant, hence the total number of rotations required to transform U into T will be 6*(n/2)^2.
for a given n, it always takes the same number of moves
 to transform a uniform Truchet square U into another
one, T, if T has 4-fold rotational symmetry

The reason for all the puzzles requiring the same number of moves is the 4-fold symmetry of the target (and the uniformity of the starting arrangement). If we allowed non-symmetrical target arrangements, or varied the starting arrangements used, the number of rotations required to transform our starting arrangement into the target arrangement could lie anywhere between 0 and 3n^2.

a 24 x 24 Truchet square with 4-fold rotational
symmetry - starting from a uniform square, how
many moves would be required to re-create it? 

Why do the Truchet squares with rotational symmetry seem particularly nice? The human brain loves symmetry, but in the case of Truchet squares, it seems particularly appropriate to be drawn to arrangements like these. Individual Truchet tiles lack rotational symmetry - this lack of symmetry is what gives them their expressive power. By arranging them into a square pattern that does have rotational symmetry, we are overcoming the asymmetry of the original tile, appealing maybe to our need to unify opposites, or to express a sense of dialectical tension.

Some earlier posts on Truchet tiles:
truchet en plus
truchet tiles

Friday, September 15, 2017

a polynomial division calculator

Many visitors to this blog come to see the posts about dividing polynomials using the grid method (like this one).  A while ago, I put up a page which generates examples that (hopefully) illustrate this method.

Well, I am excited to say that the examples page has been enhanced with the addition of a simple calculator, which allows you to provide your own polynomials for dividing.

This is not a sophisticated calculator - the polynomials you provide need to be in expanded form, and they have to be single variable polynomials using "x" for the variable - don't try to be fancy or tricky, please.

For example, you may want to try something like this:
After you provide your polynomials, hitting the calculate button will trigger the parser, that will let you know of any errors. If all goes well, you are prompted to have the calculator show the answer:

If you click the Show Answer button, the answer and the grid used for division is shown.

Finally, clicking on the Show Additional Steps button will walk you through how the grid was filled in to obtain the answer.

I hope that this page turns out to be helpful. Please let me know of any issues you run into when using it.

Grid Division Calculator: dmackinnon1.github.io/polygrid/calc.html

Grid Division Example Generator: dmackinnon1.github.io/polygrid

Monday, July 17, 2017

interactive chladni figure page

A while back there were some posts about generating Chladni Figures using R scripts. These scripts generated some pretty nice images, I thought. But, to experiment a bit more it would be nice to have something interactive, so I put together this page, which you can use to make images like the one below.

Adding more vibrations to the surface, you can get some pretty intricate looking patterns:

If you would like to try it out, please visit: https://dmackinnon1.github.io/chladni/ (source here).

Saturday, April 29, 2017

truchet en plus

Since the previous post, I have been playing around with more variations on Truchet tiles (using this page). The variety of appealing patterns that you can create from these simple tiles is impressive.

the humble Truchet tile

For example, using this simple base tile you can create a path-like effect, even to the extent that paths can seem to weave under and over each other. The patterns below use this effect to suggest links and knots.

Truchet patters for two links (left)
and a trefoil knot (right)

Slight variations in the base tile can produce interesting effects. Here's an example that uses the traditional Truchet base tile.

Bulging the dark right triangle into a quarter circle allows us create something that looks quite different, even though it consists of exactly the same tile placements. Squares are replaced by circles, V-patterns replaced by tulips, and we end up with organic and densely packed patterns.

A common variation on the Truchet tile is the Smith tile, which consists of two quarter circles at opposite corners. Unlike the traditional Truchet, the Smith base tile has 180 degree symmetry, but because it lacks 90 degree symmetry, it can still be used to produce interesting and appealing patterns (if we had quarter circles in all four corners, the constructed patterns would always be the same - an array of circles). Using this tile, we end up with circles and blobby regions that create paths and zones across the grid.

A small change to the Smith tile allows us to eliminate the 180 degree symmetry and regain the expressiveness of the traditional tile patterns. For example replacing one of the quarter circles with a square means that some circles in our original pattern become squares, some remain circles, and some take on a lemon-shape, while the overall pattern retains the same topology as it has in the Smith version.

Another small change (using a diagonal line in place of the square) produces patterns that look quite different at fist: our paths now resemble strange jigsaw shapes. A closer look shows how the essential features are retained.

Even with all the possible variations, the original tile retains its charm. Can you see the four trefoils in the pattern below?

Sunday, March 26, 2017

truchet tiles

A short while back, I posted about the images found in books about Froebelian kindergarten exercises, like The Paradise of Childhood (on Google Books here). These old books provide great examples of patterns and designs that can be easily drawn by hand with graph paper, in many cases only using arrangements of congruent 45-90 triangles.

Nineteenth Century Froebelian Doodles

A surprising variety of patterns can be formed by restricting things even further, considering the case where each square is cut in half along a diagonal with half of the square coloured black, the other coloured white (i.e. no blank or completely filled squares, as are found in the images above).

Some arrangements of four Truchet Tiles

Arrangements of these tiles were studied extensively by Sebastien Truchet, whose book on the subject (Method for creating an infinite number of different designs with squares halved into two colours along a diagonal) can be found online here.

Truchet tiles, as they became known, have been studied extensively and generalised to include other tile sets that are not rotationally symmetrical. In the image below, we start with a traditional Truchet tiling, then only show the diagonals, and finally replacing the diagonals with quarter circles, centred around the vertices where the diagonals used to touch (these tiles, introduced by Cyril Stanley Smith, create interesting patterns of blob-like paths and circles).

Three popular variations on Truchet tiles:
traditional, diagonal, and semi-circles

To play around with these I've put together a "Truchet Tiles" page here.

There are a number of illustrations in Truchet's text that are worth checking out, and you can reproduce them using the page mentioned above. Here is tiling "38" from Truchet:

tile pattern 38 from Truchet

Here is the same tiling using the Truchet tile page, also rendered using only diagonals and the Smith tiles.
tile pattern 38, generated here

There are lots of questions that can be asked about arrangements of the tiles. Truchet enumerates some of the possible arrangements using symbols and illustrations - below are the first two tables of rows of tiles that he lists (how many will be in the next two tables?).

Here is another rendering of one of Truchet's original patterns, number 52:

And replacing the traditional truchet tiles with similarly oriented diagonal and Smith tiles -  as you might have noticed, doing this looses information by a factor of 2 for each tile:

Try out the Truchet tile page here: https://dmackinnon1.github.io/truchet/.

Update: More truchet fun in this post.