Wednesday, March 25, 2015

are you experienced?

Don't despair
A search for "math" in the iTunes store is likely to disappoint (maybe "maths" or "mathematics" would provide better results). I haven't tried Math Drills Lite - it is likely the last thing I would want to download, yet it comes up first.


A sad situation

But this is happy post, because there is a math app, well, more of an interactive book, that is engaging, interesting, well written, and attractively designed, that conveys mathematics as its practitioners and enthusiasts see it: beautiful and creative, not dry and confusing. Mathema, written by two mathematicians, Hugo Parlier and Paul Turner, is an accessible math app/book for students, teachers, and general folk that seeks to provide its readers (interactors?) with authentic mathematical experiences that capture the process and feelings associated with doing mathematics.

What does doing mathematics feel like?
Structured around three core mathematical experiences, Mathema presents visually interesting puzzles and games, and then proceeds to introduce the math that can be used to make sense of them. Along the way, we get excursions into graph theory, metric spaces, algebraic structures, and other advanced topics (for a popular book), but always grounded in answering questions that naturally arise in each investigation.


The Dominoes Puzzle: its solvabilty 
depends on where you put the holes

The first mathematical experience includes some familiar mathematical recreations made fresh by the interactive capabilities of the "book." The process of doing mathematics (encountering a problem, making a conjecture, using logical reasoning, and benefiting from some key insight) and the feelings of doing math (enjoyment, frustration, satisfaction) are presented through the "Dominoes Puzzle": can you cover a chessboard with two missing squares with dominoes without overlap or gaps? I shared this part of the experience with a ten year old, who enjoyed trying to cover the board missing corners with the dominoes, agreed with the hypothesis that it was impossible after trying it a few times, and then listened to and understood the proof that explained why it could not be done. I'd suggest that the target audience for the rest of the book is a bit older, but it was very nice to see how well and simply this first part of the book accomplished its goal.

Mathematical Games for a new generation
The Dominoes Puzzle might be familiar to some as the "mutilated chessboard" problem from  Martin Gardner's first Scientific American collection (problem 3 in Nine Problems), but the presentation in Mathema is much more complete and inviting. Actually being able to place the dominoes on the virtual (unmarked) chessboard is a great advantage of the ebook format (no chessboards were harmed, no actual dominoes required), and being able to move the holes around extends the puzzle meaningfully. The first experience also includes an explanation of why the game Hex (also written about by Gardner in his first book of Scientific American columns, who tells us that the game was co-invented by Piet Hein and John Nash) can always be won. Here again, the interactive nature of the book is used to advantage. Back in the 1950s, Martin Gardner suggested to readers that a Hex board of their own "can easily be drawn on heavy cardboard or made by cementing together hexagonal tiles." The software version of Hex in Mathema beats cardboard and cement, and being able to quickly generate many complete honeycomb patterns leads naturally to the hypothesis that you will always have a path from one side of the board to its opposite.


A portion of a Honeycomb pattern:
these tell us about the winnability of Hex

The "chroma square" puzzle of the second experience is suggestive of a two dimensional Rubik's cube, and learning the trick to solving them quickly gave me an unreasonably great sense of accomplishment. The idea of treating these puzzles as mathematical objects and considering the space of all chroma squares is well presented, and the excursion into abstraction is repaid when the method for solving the puzzle is used to prove a couple of interesting things about all possible chroma squares and how they relate to each other. The third and final mathematical experience allows you to play with a more dynamic system of "flows." At first flows seem to bear little resemblance to the puzzles of the first two sections, but Mathema shows that by a thoughtful process of making definitions, these too can be analyzed using mathematical thinking.


Fans blow particles within a disk
creating a flow

Why does it work?
The visual and interactive way Mathema is designed, with its scrolling, flipping, and zooming, is a significant part of its appeal and its ability to engage. I think there are more important things that it does right that have nothing to do with technology, however. How the authors understand authentic learning experiences is key. What is "authentic" math? - the mistake that some people continue make is to assume that to make mathematics interesting and relevant it must be connected to some practical or real-world application. Puzzles, patterns, games, and aesthetically interesting images are the real hooks that make math interesting, and understanding this is part of Mathema's appeal. Another thing Mathema does right is recognizing that mathematics is most relevant and interesting when it is presented in a non-curricular way: not as topics that are isolated from each other and blocked off from amateurs, but instead as a way of making sense of the world that is available to anyone who wants to use it, and applicable almost anywhere.

Thursday, March 19, 2015

a tile arrangement, or airport fun

Is there anything nicer than a notebook with grid-lined pages? Maybe, but they are pretty nice - and I count myself very fortunate to have just obtained a new one. 


And thanks mostly to a longish wait in the Vancouver airport, this is what ended up on page one.


The image on the tiles are the simplest non-trivial knot, the trefoil, which you could also put together using these other tiles.

Along a given row or column (following the slight skew), the tiles are alternately rotated back and forth by 90 degrees - in the rows they alternate between being placed at 0 and 90 degrees or at 270 and 180 degrees, and down the columns they alternate between being placed at 0 and 270 degrees or at 90 and 180 degrees. This placement allows the tiles to rotate as they revolve around each of the smaller black squares (which are 1/16th the size of the trefoil tile). In the picture below, as you follow the tiles clockwise around the small squares marked A the trefoil tiles rotate clockwise, but as you follow the tiles clockwise around B they rotate counterclockwise.



Tuesday, January 27, 2015

bus number factoring


Each bus in Ottawa has a four digit number that identifies it (like 4476 above). One thing to do while riding, if you don't have a bus transfer to play with, is to pass the time factoring that bus identifier (it's also printed on the inside of the bus, in case you miss it getting in).

We all know some basic divisibility rules to help with factoring: If it ends in a zero, it's divisible by 10, if it's even then its divisible by 2, if it ends in a 5 then it's divisible by 5. You may know that if the last two digits of a number are divisible by 4 then the whole number is also divisible by 4 (because 100 is divisible by 4, so for example a number xy76 for any old xy will be divisible by 4 because xy76 = xy00 + 76,  and both parts of the sum are divisible by 4).

Digital roots help us with multiples of 3. If a number's digital root is 3, 6, or 9, then that number is divisible by 3. A digital root is easy to calculate: You just keep summing the digits of a number until you get a single digit answer - if your answer is not a single digit, you just do it again.  For example, the digital root of 4476 is found by first calculating 4 + 4 + 7 + 6 = 21, and then 2 + 1  = 3. So 4476 is divisible by 3.

So, we know 4476 is divisible by 4 and 3. Now if you can do some dividing in your head while sitting on the bus, you'll figure out that 4476/12 = 373. Now you might try a bunch of things to factor some more, but eventually you will decide that 373 is likely prime, and it is. So 4476 = (2^2)*3*373.

I recently learned that you can also use the double digital root to help with factoring. The double digital root of a number is calculated by grouping the number's digits into pairs (starting from the right) and adding them, repeating until you get a double digit number. So 4476 gives 44 + 76 = 120, and then 1 + 20 gives 21.

How can this be helpful? Just as the digital root of n is congruent to n mod 9, the double digital root of n is congruent to n mod 99. The digital root of n helps us identify multiples of 3: if the digital root of a number is equal to a multiple of 3 (3, 6, or 9) that means that the original number when divided by 9 has a remainder divisible by 3, which means the original number is divisible by 3 also. The double digital root can help us identify multiples of 11 in a similar way (since 99 is a multiple of 11). The rule is: if the double digital root is a multiple of 11, then so is the original number. So double digital roots help identify multiples of 11 that are multi-digit numbers (not always easy) by reducing the problem down to identifying multiples of 11 that are two digit numbers (which is easy).

The double digital root of 4476 is 21, not a multiple of 11 (and we saw above that 4476 is not a multiple of 11 either). Lets try 1320: the double digital root is 13 + 20 = 33, which is divisible by 11, and it turns out that 1320 = 11 * 120. For another example, use this method to confirm that 3740 is also divisible by 11.

To be honest, I have not been on an Ottawa bus whose number is a multiple of 11 yet, but if that exotically numbered public transport is out there, I'll know it when I see it.


Tuesday, December 2, 2014

Some notes on the Kaprekar function




Consider a 3 digit number, say 395. Take its digits and form the greatest and least possible 3 digit numbers and subtract them: 935 - 359 = 594. Now do the same with the result:  954 - 459 = 495. Try it again, and you see that the process has hit a fixed point: 954 - 459 = 495.


The Kaprekar function involves taking a number, computing two shuffles of its digits (the shuffle with the greatest value, and the one with the least value), and then taking the difference of those two shuffles. So for an integer n, if g is the number you get from re-arranging the digits of n from greatest to least, and l is the number you get from re-arranging the digits of n from least to greatest, then the Kaprekar function is (n) = g - l. If you repeatedly apply the Kaprekar function to an integer n, you may end up converging to a constant value. For any n whose digits are all the same, you automatically converge to 0. Surprisingly, for any 3 digit number whose digits are not all the same, k will converge to 495 (as is the case with the numbers in this plot), for any 4 digit number whose digits are not all the same, k will converge to 6174. Numbers with more than 4 digits apparently do not have a single convergent value, but bounce around within sets of values.


The pattern on the left comes from making 9 columns of numbers, the leftmost column is a listing of 100 to 199 (starting at the bottom), the rightmost column is a listing of 900 to 999. These are coloured based on how quickly each number causes the Kaprekar function to converge to a constant value. Mathworld shows a similar plot for four-digit numbers taken from an article that appeared in Mathematics Teacher.



Here's a few examples of 3 digit numbers converging to 495:

949 -> 495 (white)
950 -> 891 -> 792 -> 693 -> 594 -> 495 (dark pink)
951 -> 792 -> 693 -> 594 -> 495 (somewhat dark pink)
952 -> 693 -> 594 -> 495 (somewhat light pink)
953 -> 594 -> 495 (light pink)
954 -> 495 (white)

949 converges quickly: 994 - 499 = 495; 953 takes a little longer, first you get 953 - 359 = 594. and then 594 gives us 954 - 459 = 495. You can test out the other chains, and also try it with any three digit number whose digits are not all the same: they always end up at 495. A 3 digit number whose digits are all the same gives 0.

Here are two observations that help me understand what is going on with this:

(1) If you take the difference of two shuffles of the same number, the result is always divisible by 9.

(2) Any number that is divisible by 9, when shuffled, will also be divisible by 9.

I found these two things very surprising at first, but both can be understood if you think about digital roots.

When you apply the Kaprekar function to a number, your result is not just any old number, but a member of a much smaller set: the multiples of 9. And since many of those multiples of 9 are just shuffles of other multiples of 9, they behave the same when the Kaprekar function is applied to them.

Why does the pattern for the three digit numbers seem to repeat and shift up to the right? The shift corresponds to adding 111. Adding 111 generally increases each digit by 1 (except if one of the digits is a 9), leaving the difference between the greatest and least shuffles unchanged.