Monday, 7 April 2014

Sol LeWitt Solution


Last time I introduced the Sol LeWitt’s problem, devised by the eminent mathematical reporter Barry Cipra. The challenge was to take the tiles, as presented in the left image of Figure 1 and rearrange them such that all the lines form continuous rows, columns and diagonals across the grid. As I revealed there are many solutions, one such solution is presented in the right image of Figure 1.
Figure 1. Left: the original Sol LeWitt tiles. Right: an arrangement in which all lines cross the entire grid.
I also mentioned that there were some special relationships between certain solutions. For example rotating a solution through 90 degrees, reflecting it, or performing a combination of these two operations generates another, related solution. Furthermore, we can take the topmost row (or the leftmost column) and moving it all the way to the bottom (or to the right). Explicitly, a set of solutions can be drawn on the surface of a torus.

This leaves us with a new question. Are there any solutions which cannot be generated in such a way? Namely, starting from one solution are their other “distinct” solutions, which cannot be created through rotations, reflections or row/column operations. Each distinct solution will then generate a different solution set, which will lead to different to tori.

The famous mathematician John Conway demonstrated that there are actually three distinct solutions, from which all others can be derived. One has been given above. Can you find the other two possible distinct solutions?

As I was talking to Barry about this puzzle he told me a nice anecdote, where he had used this puzzle in a workshop involving maths teachers and maths researchers that had been paired together. He said that the teachers were constantly moving the pieces around, effectively using trial and error, whilst their researcher partner would sit back and think about the pieces. Eventually, one researcher claimed that the puzzle was impossible, not a moment later his partner produced a working solution! Let this be a lesson to any mathematician. Theory is all well and good, but practical intuition is invaluable.

Monday, 24 March 2014

The Sol LeWitt puzzle

One of my favourite puzzles created by Barry Cipra was originally not a maths puzzle at all. The puzzle is based on a design by artist Solomon LeWitt. Sol LeWitt (after whom the puzzle is named) was a conceptual artist who often featured geometric and combinatorial themes to give a minimalist style to his works. His etching picture, titled Straight Lines in Four Directions and All Their Possible Combinations, is illustrated below in Figure 1, on the left.

Figure 1. Left: the Sol LeWitt tiles. Right: an example of a red line connecting the edges through all the tiles and an example of a blue line that does not.

To everyone except Barry this image simply showed 16 squares with lines drawn on them. However, Barry’s imagination was ignited when he noticed that some of the lines extend continuously from one side of the large square to another (red diagonal line in the right-hand of Figure 1), whilst others do not (blue horizontal line in the right-hand of Figure 1).

From this simple setting Barry asked the question:
"Is it possible to rearrange the tiles such that the resulting 4x4 grid has a pattern that allows all horizontal, vertical and diagonal lines to extend continuously across the grid, without interruption?"
 Importantly, you are not allowed to rotate any of the pieces!

The simple answer is yes, you can produce such a pattern. In fact there are quite a few solutions to the problem! Have a go yourself. Cut out the squares and see you if can find one of them. Although finding one solution is satisfying, the more interesting investigation is finding a link between solutions.

Produce a few solutions and see if you can see some relation between them. Once you spot the link you will see how to produce many more solutions very easily. Not bad for a simple work of art!

Next time I will fill in the rest of the details, by presenting not only a solution but also furnishing you with the solution link that I am alluding to.
Good luck

Monday, 10 March 2014

Barry's journey through science journalism.

This week we continue with Barry Cipra’s life story and delve more into his career, whilst see just how much luck you need to enjoy a career in science journalism.
________________________________________________________________
________________________________________

How did you get your big break?
Figure 1. Barry Cipra. Photo by Marlene Knoche
I had links with Lynn Steen from when I was St Olaf’s college. He is a very good writer and was very active in maths education. Early on he discovered that I was a fairly good writer and I often spoke to him about taking my mathematical writings further. In my mind I would follow in the popular science footsteps of Martin Gardener, or Ian Stewart. I had no notion of science writing as a journalist. It was Lynn that pushed me towards reporting.

It was around this time, early 1987, that Gina Kolata left Science magazine for the New York Times. She had done all of the maths news reporting for Science magazine. Lynn, being amongst other things the maths secretary of AAAS, which publishes Science magazine, called up the editor and put my name forward. Much of the credit, and blame, for what I have become is directly attributable to Lynn Steen!

It only dawned on me later how unusual it was to get a call from the editor of one of the most prestigious journals in the world and have them ask me to write for them. That’s why I always try and offer any help I can give to the new generation of science writers.

As you say, you were very lucky to get your big break into science journalism. Do you think it is easier, or harder, now-a-days to make a career in science writing?
Honestly, I don’t know.

What is true is that because there are so many more possible sources of self publishing there are many more people doing it. Most of this is unpaid and done purely as a hobby, but occasionally it does attract attention of people which then pushes them towards further opportunities. In essence it’s a buyer’s market. Editors have more choice of science writers to choose from.

What is your favourite area to report on?
I try to report on as wide a range of topics as possible, so I don’t get trapped in a single niche. I enjoy reporting on the applications on mathematics, not only because they’re very important, but also (being a lazy journalist) you can easily connect it to your audience’s experiences.

One of my favourite stories was from mathematical economics, where they were trying to match donors and recipients for kidney transplants. Alvin Roth, the man behind this research, recently won the economics Nobel prize, partly for this work. I like to think my article bought his work to the attention of the judges!
Overall it’s a good topic because the problem is easy to explain, the mathematics is fairly simple and the dramatic outcome is amazing. Importantly, with just a little maths you gain the ability to prove that your system is completely resistant to people trying to cheat the system.

Perhaps my favourite piece of all time was on rotationally symmetric Venn diagrams. It was easily explainable maths linked with incredibly beautiful results.
[Barry expanded on this greatly and will be the subject of an article later]

What advice would you give to the next generation of science writers?
Firstly, I would say: don’t do it! I was very lucky to get the breaks I did. However, if that doesn’t dissuade you I would firmly recommend one of these formal science writing courses, such as the one University of California, Santa Cruz. They produce first rate reporters, who all speak highly of the program.

A key piece of advice I can give for a successful career in journalism is find a good editor and be able to take criticism. By the very nature of writing it is very easy to get into a mental rut of saying things in one way. It is very useful to get someone else to look at your work and give an alternative explanation.
________________________________________________________________
________________________________________
Although this is the end of Barry’s biography, we are not done with him yet. Over the next few posts I will highlight a few of the beautiful puzzles and games that he introduced to me.

Monday, 24 February 2014

The making of Barry Cipra

On the second of October 2013 I got the chance to meet up with mathematical journalist Barry Cipra. He is a regular contributor to SIAM news as well as a correspondent for Science magazine. He writes the “What’s Happening in the Mathematical Sciences” series, and is the author of “Misteaks... and How to Find Them Before the Teacher Does: A Calculus Supplement”.

He was in Oxford to cover the opening of the new Mathematical Institute and the accompanying Clay conference which presented talks on the cutting edge of pure mathematics. However, my interest was piqued when he gave a talk called
“The benefits of not paying attention”.
Being a huge maths puzzle fan I turned the tables on Barry and so the reporter became the reported.

Over the next few weeks I will present Barry’s interview, in which we touch on: his history, his suggestions for people trying to break in to science journalism and, finally, some puzzles that he created when his attention should have been elsewhere.
________________________________________________________________
________________________________________
Since your job is to take mathematical ideas and make them understandable to a general audience, could you describe your Ph.D work on modular forms?
Figure 1. Barry Cipra.
There is a famous sequence in a documentary of Fermat’s last theorem, in which a number of eminent mathematicians such as Peter Sarnak and John Conway were asked to describe modular forms… they all just laughed. However, I will try my best.

Modular forms are analytic functions that embody all sorts of number theoretic information. The specific thing I worked on was something called the Shimura lift [1], which allowed us to map modular forms of half integral “weight” to integral weight. Shimura’s original work was incredibly general, but only kicked in when the weight was 5/2, or larger. My work at Maryland was to reduce this to weights of 3/2.

As you can see, my work was very technical. Personally I am impressed at how much I can remember from over 30 years ago!

Where did your career take you after Ph.D?
During my first post-doc at MIT I began talking to a visitor of the chemistry department, who was really a mathematician at heart. We spoke about a problem he was having in ferromagnetism and its links to the Ising model, which is a problem in statistical physics. From our work together I wrote a beginners guide to the Ising model and its underlying mathematics. This led to me receiving a highly complementary letter through the mail, written in shaky handwriting, from a 90 year old Ernst Ising. I really should get the letter out some time to ensure that he really was saying nice things about me. At least I don’t remember him pointing out mistakes.

I then had a string of further post-docs and when I came to the end of my last one I looked around at academic positions and the alternatives of getting a “real job”. Luckily I had a number of contacts who pushed me in a different direction.

When was the decision to move towards journalism? Was it a conscious decision? Or was it a more gradual process?
It was pretty conscious as I’ve always had an interest in writing; ever since grade school. My only formal training was a journalism class I took at my high school and then worked on the school newspaper the following year.

Do you miss doing, rather than reporting, maths?
I still dabble in low level, recreational style problems. I try to come up with problems that may have some deeper connections. Quite a few of the problems I’ve generated are simple to state but defy simple explanations. However, if there is any true significance in my questions, I leave that up to the researcher trying to find the answer.

I did collaborate with some people from St Olaf’s college on a “billiards in polygons” problem, particularly in right angled triangles. We proved that if you started on one of the sides that wasn’t the hypotenuse and shot the billiard ball at a right angle from your chosen starting point then for almost all starting points, the trajectory is periodic.

My main role in all of this was to say,
“I don’t really understand what you just said, could you explain it a bit more?” and then, hopefully, “ah yes, I see we can now make that mathematically rigorous”.
________________________________________________________________
________________________________________
Next time Barry will be giving us a few tips on how best to go about getting into science journalism. See you then.

[1] A a pertinent paper can be found here. Although it is not for the faint hearted, or those without a degree in modular forms, you can clearly see from the first few lines that they use Cipra’s theorem. Sadly, being an applied mathematician I will never have theory named after me.

Friday, 14 February 2014

Be my mathematical Valentine.


Looking for an unusual gift to give your love this Valentine's day? Is the significant figure in your life a mathematician? Realise that you haven't bought anything and quickly need to knock something up? Then look no further as what could be more romantic than mathematics?

The simplest thing you could do is text the one you love with a simple `I <3 U'. However, if your partner really is a mathematician, then I would suggest sending `I/3 < U' instead and let them work out the message.

For those who are willing to go that extra mile (and have Matlab) here are a few suggestions of how to produce a Valentine token with a uniquely numerical twist.

1) The easiest method way to produce a heart is to use parametrized functions as seen in Figure 1. In fact the code to produce the heart in Figure 1 is so simple that I decided to use Matlab's annotation facilities to add an arrow to the picture. The whole code to produce this image can be found below.
Figure 1. Produce a number of values of t spanning $-\pi$ to $\pi$. Calculate the appropriate values of x and y and, finally, plot them. 

2) A slightly different heart shape can be produced using an implicitly defined set of points given by the equation shown in Figure 2. This equation is slightly harder to plot because given a value of x you have to solve a cubic equation to work out the corresponding value of y. Thankfully, we're able to let Matlab bare the brute force work and simply plot the delightful result.
Figure 2. Unlike the previous equation were we were able to calculate x and y explicitly, this equation has no such nice closed form solution, or parametrization.
3) For those of you with a love that cannot be contained within two dimensions there is also a three-dimensional heart shape shown in Figure 3. Once again, this is slightly more difficult than the previous example. Not only do we have to contend with an implicit equation, but it is in three variables, instead of two! In fact I was unable to plot the equation easily using the basic functionality of Matlab, so I resorted to using one of the files from the file exchange, Ezimplot3.
Figure 3. A fully rendered three-dimensional heart produced using Ezimplot3.
4) Finally, the last one has a special place in my heart for a number of reasons. Each year I get my wife n roses for the n years that we have been together. Often I try to vary the type I get. For example, one year I got roses made of wood, another year I got roses made of feathers. Last year I decided to make her a rose using my coding abilities. This is shown in Figure 4.
Figure 4. A rose by any other name would smell like a Turing pattern.
Regular readers will no doubt know that Alan Turing's theory of Morphogenesis is my favourite piece of mathematics. So, I used an image of a rose to form the initial condition of a Turing pattern and you can see the whole evolution of the pattern in Figure 4.

As I say, this animation is very special to me, so unlike the other images, I won't be giving the code out for it. However, for the interested party, the coding behind it is not too difficult. All you need to do it to load a grey scale image into Matlab and use the image values as a two-dimensional network on which you run the reaction-diffusion equations.
________________________________________________________________
________________________________________
CODES
CODE 1
%% Clear variables
clear
close
clc

%% Set up figure size
screen_size = get(0,'screensize');
figure_position =[0 0 500 screen_size(4)/1.2];
h=figure('outerposition',figure_position);

%% Variables
fs=50; %Fontsize
t=linspace(-pi,pi,1000);
x=16*sin(t).^3;
y=13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t);

%% Plot
area(x,y,'facecolor','r','edgecolor','none')

%% Add in the text
text(0,15,'I','fontsize',fs,'HorizontalAlignment','center','color','b')
text(0,0,{'x=16sin(t)^3';'y=13cos(t)-5cos(2t)-2cos(3t)-cos(4t)'},'fontsize',12,'HorizontalAlignment','center','color',[1,1,1])
text(0,-20,'You','fontsize',fs,'HorizontalAlignment','center','color','b')
text(20,-24,'By Thomas E. Woolley','fontsize',fs/7,'HorizontalAlignment','right','color','k')

%% Add in the arrow
annotation('arrow',[.7.85],[.65 .75],'linewidth',5,'color','k','headstyle','vback3','headlength',30,'HeadWidth',30)
annotation('line',[.3 .4],[.4 .4-0.6667*(.3-.4)],'linewidth',5,'color','k')

%% Tidy up the plot
axis equal
axis([-20 20 -25 20])
set(gcf,'PaperPositionMode','auto')

%% Save
print(gcf, '-r300',['./1D.png'], '-dpng');
________________________________________________________________
CODE 2
%% Clear variables
clear
close
clc

%% Set up figure size
screen_size = get(0,'screensize');
figure_position =[0 0 500 screen_size(4)/1.2];
h=figure('outerposition',figure_position);

%% Variables
fs=30; %Fontsize
[x,y] = meshgrid(-3:.01:3);
f = (x.^2+y.^2-1).^3-x.^2.*y.^3;

%% Plot
contourf(x,y,f,[0 0],'r','linewidth',3)

%% Add in the text
text(0,0.25,{'I am';'implicitly';'yours'},'fontsize',fs,'HorizontalAlignment','center','color','b')
text(0,1.5,'(x^2+y^2-1)^3-x^2y^3=0','fontsize',fs/2,'HorizontalAlignment','center','color','b')
text(1,-1,'By Thomas E. Woolley','fontsize',fs/5,'HorizontalAlignment','right','color','k')

%% Tidy up the plot
axis equal
axis([-2 2 -2 2])
set(gcf,'PaperPositionMode','auto')

%% Save
print(gcf, '-r300',['./Implicit_heart.png'], '-dpng');
________________________________________________________________
CODE 3
%% Clear variables
clear
close
clc

%% Set up figure size
screen_size = get(0,'screensize');
figure_position =[0 0 500 screen_size(4)/1.2];
h=figure('outerposition',figure_position);

%% Variables
fs=20; %Fontsize

%% Variables
f = '(2*x^2+y^2+z^2-1)^3-x^2*z^3/10-y^2*z^3';

%% Plot
ezimplot3(f,[-3 3],200)

%% Add in the text
text(1,-.5,.6,{'You fill all the';' dimensions';'of my life'},'fontsize',fs,'HorizontalAlignment','center','color','y')
text(.7,0,-.8,{'(2x^2+y^2+z^2-1)^3-x^2z^3/10-y^2z^3=0'},'fontsize',fs/2,'HorizontalAlignment','center','color','k', 'rotation', 2)
text(0.5,-.9,-.9,'By Thomas E. Woolley','fontsize',fs/3,'HorizontalAlignment','right','color','k', 'rotation', -75)

%% Tidy up the plot
grid off
axis equal
view([85 20])
set(gcf,'PaperPositionMode','auto')

%% Save
print(gcf, '-r300',['./3D.png'], '-dpng');
________________________________________________________________
________________________________________
This post is dedicated to my wife and best friend. Happy Valentine's day.


Monday, 26 August 2013

Art Benjmain on continued fractions.


This week brings my Art Benjamin related posts to an end. Not only did we discuss Fibonacci sequences, but he also provided me with a lovely interpretation of how continued fractions work and what they represent numerically. His exposition is recounted below.
________________________________________________________________
________________________________________
Here is a typical continued fraction and its simplified form
$$3+\frac{1}{7+\frac{1}{15}}=\frac{333}{106}.$$
Believe it, or not, the numerator and denominator have a combinatorial interpretation. Imagine a strip of squares with one of the numbers in each square (Figure 1).
Figure 1. A strip of three squares containing numbers from the continued fraction. The glass square and the opaque domino.
As with the Fibonacci numbers we want to consider tilings of this strip. This time the square will be made of glass, meaning we can see through it, whereas the domino will be opaque (Figure 1).

As we saw previously there are three ways to tile the board [in Figure 1]. You can tile it with all squares, a domino and a square, or a square and a domino (Figure 2). We’ll say that the weight of the tiling is the product of the numbers that you can see through the glass squares.

Figure 2. All possible weighted tilings of the strip of three numbers using the glass tile and opaque domino.
When you add up all of these tilings you get
$$315+3+15=333,$$
which is the numerator of the fraction.

Now, what about the denominator? Well, clearly the denominator is not influenced by the first number as that is “on top” of the fraction. So, if we ignore the first space and then count the weighted tilings again, we can either have a square and a square, or a single domino (Figure 3). Note that the empty product is counted as one. Adding these together we get 105+1=106, which is the denominator of the fraction.

Figure 3. Weighted tilings after the first number has been eliminated.
So that is a combinatorial way of representing the continued fraction. The top and the bottom are simply counting the weighted tilings. This technique is full generalisable to any length of continued fraction and any numbers you like.
Now suppose I wrote the numbers in reverse so the strip was 15, 7, 3. Notice I haven’t changed the original tilings on this grid so the weighted product will, once again, be 333. This tells you that this continued fraction:
$$3+\frac{1}{7+\frac{1}{15}}$$
will have same numerator as
$$15+\frac{1}{7+\frac{1}{3}},$$
which isn’t obvious from the numbers, but from this visualisation we can immediately spot this.

As above we can finish this calculation by removing the 15 and considering the tiling of a 7, 3 board. The sum of which will be 21+1=22. Thus,
$$15+\frac{1}{7+\frac{1}{3}}=\frac{333}{22},$$
Now isn’t that a fun little way of seeing the fraction?
________________________________________________________________
________________________________________
Over the past few weeks I hope I’ve shown you that Art Benjamin is much more than just a human calculator. His mental arithmetic skills are impressive, but his enthusiasm for mathematics is boundless. I seriously urge you to go see his shows if you get the chance. You will not be disappointed.

Monday, 12 August 2013

Art Benjamin on Fibonacci patterns part 2.


Last time we had a closer look at the Fibonacci numbers. Although Fibonacci justified them through rabbit breeding we saw that they could also arise from a tiling problem. This week Art expands on the original problem he stated:
how do we show
\begin{equation}
f_{n-1}^2+ f_n^2= f_{2n}?\label{Square_addition}
\end{equation}
________________________________________________________________
________________________________________
Let’s look at the square addition identity (1). What does this say? Suppose we have a strip of length $2n$. How many tilings are there? Firstly, by definition, $f_{2n}$. Secondly, a tiling of length $2n$ can be created by breaking the original strip into two halves. How many ways can I tile this broken strip? Well there are $f_n$ ways to tile each half and, so, the number of ways would be $f_n^2$ (Figure 1(a)).

Now, this is not all the tilings of the $2n$ strip though, because it could happen that we can’t split the strip like this because a domino is placed in the middle. Subtracting this domino means that we now have two strips of $n-1$ squares to tile, giving $f_{n-1}^2$ tilings (Figure 1(b)).


Figure 1. Dissecting a strip of length $2n$ into (a) two length $n$ strips, or (b) two length $n-1$ strips and a central domino.
So, of all the tilings of a $2n$ strip $f_n^2$ do not have a domino crossing the middle section and $f_{n-1}^2$ do have a domino crossing the middle section therefore the total is
\begin{equation}f_{n-1}^2+ f_n^2= f_{2n}.\end{equation}
We’ve taken a question and we’ve answered it in two different ways therefore those answers must be the same.

Inductively, the sum of consecutive Fibonacci squares is difficult to prove without proving a much stronger result by induction, from which the formula (1) will be a specific case. To see the more general result consider the following: originally, I broke the strip in half, but there is nothing special about the centre. Suppose I broke a given strip into two pieces. One of length $n$ and one of length $m$, so the length of the whole strip is $n+m$. By definition, the number of ways of tiling this strip is $f_{n+m}$.

Figure 2. Dissecting a strip of length $n+m$ into (a) a strip of length $n$ and a strip of length $m$, or (b) a length $n-1$ strip and length $m-1$, plus a connecting domino.
How many ways can I tile each of these sections? As before there are $f_n\times f_m$ ways (Figure 2(a)). However, this does not consider the possibility that there is a domino crossing the $n$ and $m$ length sections. As before we can remove this domino leaving strips of length $n-1$ and $m-1$ meaning that there are $f_{n-1}\times f_{m-1}$ ways of tiling these two parts (Figure 2(b)). Putting these both together we generate the stronger result,
\begin{equation}f_{n-1}f_{m-1}+ f_n f_m= f_{m+n},\end{equation}
which is the easier result to prove by induction. If $n$ is 1 the result is trivial and then if you induct on $n$ it will be ok, but who needs induction? These pictures tell you what is happening in general.
________________________________________________________________
________________________________________
Next time Art changes topic and gives us an explanation of what continued fractions actually mean. Interestingly, it is still based on this idea of tiling a strip.