**MATH ****+****
ART&DESIGN ****+**** ? ****=**** LOGO**

*Andrzej Walat
Centre of Informatics Education
Raszynska 8/10, 02-026 Warsaw, Poland
email: *

**Abstract**

This paper describes briefly, how we (me and my colleagues at the Centre of Informatics Education in Warsaw) try to encapsulate various, mainly mathematical and art, activities in Logo programming, to make it more interesting and compelling for ambitious young people between 13 and 15, who are the main users of Logo in Poland how to remove from Logo an odium of being childish, and make it fashionable.

**Keywords**

Logo, programming, competitions, mathematics, art & design.

**1 Introduction**

About ten years ago I was very impressed reading so many
inspiring papers about Logo & learning of Math, particularly:
an interesting article about programming in Logo as an
mathematical activity, by Uri Leron, various papers by Celia
Hoyles, Richard Noss, Trevor Fletcher, particularly his book [2],
and of course the famous book by Harold Abelson and Adrea di
Sessa *The Turtle Graphics* [1]. But now the enthusiasm for
Logo is fading; the voices of its last defenders are getting
weaker and weaker. "Logo is down but not out"–it
is a title of an article I have recently read in MICROMATH [4].

In Poland, Logo is used mainly as a part of informatics instruction during the third key stage of education (age from 13 to 15), which is the last stage of our Polish Basic School. We have a group of Logo fans among teachers and students but the educational potential of Logo is not fully exploited for a number of reasons. One of them is, that plenty of students and also teachers perceive Logo as childish. At the age of 14 it is not fashionable to use Logo. The second one is, that "it has no real applications". Even its educational applications are thougt to be very limited. Plenty of teachers, pupils and parents still believe that Logo was invented mainly to make learning of programming skills much easier and more funny. But, should we teach programming in the secondary school at all? Has Logo really any observable impact on understanding mathematics and on the ability to solve mathematical problems? It seems somewhat questionable.

We –I mean me and my colleagues at the Centre of Informatics Education in Warsaw–are looking for remedies for that. The Warsaw Informatics Competition –WIC (in Polish: WKI–Warszawski Konkurs Informatyczny) seems to be one.

**2 A few words about WIC**

WIC is an informatics competition for young people between 13 and 15–students of the last grades of Warsaw’s basic schools. Students participating in it are expected to solve various problems using Logo. It is a three stages competition. At the first stage each student has to solve 4 problems at home (or maybe at school during his or her free time). At the second stage students solve 3 problems working on their own during a 3 hour session. Usually around 120 students qualify to enter this stage. The last stage is a camp for about 30 students. They work together, discuss problems and compete during the final 3 hour session.

Only a limited number of students participate in WIC, but they are very bright and very enthusiastic. They particularly need challenging problems. We strongly believe that what they do, will become fashionable among other students and should have an impact on informatics teaching in our city and maybe country. We also try to choose such problems for the workshops and competition so that it is evident, that WIC is not only a narrow kind of competition in programming but that it involves other, particularly mathematical and cultural, activities and helps students to develop a much broader high level competence.

**3 One example**

*Problem 1*

**Figure 1**

Figure 1 depicts a design made of a number of identical colourful crosses scattered at random inside a navy blue square. Develop a procedure which produces a similar random design fulfilling the following constraints.

- The number of crosses should be random between 3 and 16.
- The colour of each cross should be chosen by random.
- The side of a square should be 16 times longer than a side of a cross.
- Crosses must not overlap but they can be tangent–see figure 1.

Solving a problem like this is a kind of Art&Design
activity. You have to find a way of generating a random pattern,
obeying a set of constraints. Do you like the pattern? *De
gustibus* *non disputandum* but I must say that I like
it.

But let us examine what kind of mathematical activities occur when a student is trying to solve this problem.

First of all, he or she should discover an **exclusion zone**–for
a given centre (a, b) of one cross–an area in which putting
another cross centre (x, y) is not allowed, because crosses
shouldn’t overlap.

Isn’t it a bigger cross, with a side two times longer? Not exactly.

**Figure 2**

Next, he or she should define a predicate, for example OUT.OF. ZONE :a :b :side :x :y, which means, that the point :x :y is out of the exclusion zone for a given centre :a :b and a given :??side of a cross.

You can use logic to define it, for example, in such a way:

TO OUT.OF.ZONE? :a :b :side :x :y

OUTPUT ~

(OR ((ABS :x – :a) >= 3 * :side) ~

((ABS :y – :b) >= 3 * :side) ~

(AND (ABS :x – :a) >= 2 * :side (ABS :y – :b) >= :side) ~

(AND (ABS :x – :a) >= :side (ABS :y – :b) >= 2 * :side))

END

You can do it in another way:

TO OUT.OF.ZONE? :a :b :side :x :y

OUTPUT NOT IN.ZONE? :a :b :side :x :y

END

TO IN.ZONE? :a :b :side :x :y

OUTPUT ~

(OR ((AND (ABS :x – :a) <= 2 * :side (ABS :y – :b) <= 2 * :side) ~

(AND (ABS :x – :a) <= 3 * :side (ABS :y – :b) <= :side) ~

(AND (ABS :x – :a) <= :side (ABS :y – :b) <= 3 * :side))

END

There are, of course, other ways of using logic to define an exclusion zone. This fact stimulates a vivid discussion among students. Are these numerous definitions equivalent? Why? Which one is the most elegant? And so on.

But must we use logic at all? OUT.OF.ZONE? means that the point (x,y) is in some sense FAR ENOUGH from (a,b), or that the DISTANCE between (x,y) and (a,b) is big enough. But DISTANCE, of course, does not mean an ordinary Euclidean metric. It should be defined in a different way.

TO DISTANCE :a :b :side :x :y

OUTPUT (DIV ABS :x – :a :side) + (DIV ABS :y – :b :side)

END

Having defined our DISTANCE, we can use it to define OUT.OF.ZONE? in a very simple way.

TO OUT.OF.ZONE? :a :b :side :x :y

OUTPUT (DISTANCE :a :b :side :x :y) >= 3

END

Is our DISTANCE a „real distance"? Of course it is not a metric, because it fulfils only one from the three of the following axioms, namely the second one:

M(p

_{1},p_{2}) = 0 <=> p_{1}= p_{2 }M(p_{1},p_{2}) = M(p_{2},p_{1})

M(p_{1},p_{2}) + M(p_{2},p_{3}) >= M(p_{1},p_{3})

So our DISTANCE, which is a good solution of a problem, and is quite useful–works well as a distance, is only a kind of quasimetric. This observation is once more a good starting point for a splendid discussion about various topological issues.

Of course, in order to develop the full solution of Problem 1, a student should also have some informatics competence, and particularly the ability to operate on compound data structures–see an example of a complete solution of the problem below.

*An example of a complete solution of Problem 1*

TO RANDOM.DESIGN

RANDOM.CROSSES 3 + RANDOM 14

ENDTO RANDOM.CROSSES :n

CS LET " side 20 LET " loc []; loc means list of crosses

SQUARE 320 SETFILLCOLOR 1 FILL

REPEAT :n [ADD.CROSS]

ENDTO ADD.CROSS

LET " x -130 + RANDOM 261

LET " y -130 + RANDOM 261

WHILE [OVERLAPPING? :x :y :loc] ~

[LET " x -130 + RANDOM 261 LET " y -130 + RANDOM 261]

PU SETPOS SE :x :y PD

DRAW.CROSS :side

MAKE " loc FPUT SE :x :y :loc

ENDTO OVERLAPPING? :x :y :loc

IF EMPTY? :loc [OUTPUT " false]

IF IN.ZONE? FIRST FIRST :loc LAST FIRST :loc :side :x :y [OP " true]

OP OVERLAPPING? :x :y bf :loc

ENDTO IN.ZONE? :a :b :side :x :y

OUTPUT (DISTANCE :a :b :side :x :y) < 3

ENDTO DISTANCE :a :b :side :x :y

OUTPUT (DIV ABS :x – :a :side) + (DIV ABS :y – :b :side)

ENDTO DRAW.CROSS :side

JUMP 0.5 * :side -0.5 * :side

REPEAT 4 [ARM :side LT 90]

JUMP -0.5 * :side 0.5 * :side

SETFILLCOLOR 2 + RANDOM 14 FILL

END

TO ARM :side

REPEAT 2 [FD :side RT 90]

FD :side

ENDTO SQUARE :side

JUMP -0.5 * :side -0.5 * :side

REPEAT 4 [FD :side RT 90]

JUMP 0.5 * :side 0.5 * :side

ENDTO JUMP :a :b

PU FD :a RT 90

FD :b LT 90 PD

END

Having completed a full solution of a problem we can make further interesting investigation which generates numerous non trivial mathematical–and other–questions. For example:

What will happen when we call the RANDOM.CROSSES 25?

What maximum number of not overlapping crosses can we put in the square?

What is the minimum number of crosses, you can put in the square in such a way, that it is impossible to put another one?

What if we change the size of the square?

**4 Two other examples**

*Problem 2*

Develop a procedure, named CELT, which creates a Celtic pattern shown in Figure 2.

**Figure 2**

*Problem 3*

In Muslim buildings we can see plenty of rectangular mosaics made of white and black (light and dark) small square plates, like the one in Figure 4 or that in Figure 5–which comes from the XIV century Alleppo mosque (see [3]).

**Figure 4**

**Figure 5 **

We can code each of such mosaics in the form of a list of natural numbers.

For example the list:

[469 341 469 85 125]

is a code of the first mosaic–in Figure 4, and the list:

[2130564575 1342525760 1568430071 1431655761 1430259159 22925317 1564542677 1411240448 2113357499 274584193 1598035643 1147138601 1459689147 1952313865 122953403 1971142664 1426137023 2004181029 1146441405 2004871808 1073745583 1566007977 1431658495 1440694272 1350571349 1440601429 1431655749 2113797501]

is the code of the second one–on Figure 5. Do you understand the rule of this coding?

Develop a procedure DECODE :code which, having the code of a mosaic, draws a picture of it on the screen.

**5 Comments**

Figure 3 is a black and white variant of a Celtic pattern
which I have seen on the cover of the British magazine *Mathematics
Teaching* (December 1996). As you can see, we try to exploit
different sources of regular patterns. It gives our workshops
with talented students a multicultural dimension. They can learn
the diversity of different cultures and use it as a source of
inspiration. This is what is behind the question mark in the
title of the paper.

Adding colour to the black and white celtic patterns in attempt to make them look like three dimensional reliefs is another kind of experience.

**Figure 6**

I am always delighted when I see students discover that black doesn’t always look like black and how colours on the screen influence each other. It reminds me of the memoirs of the famous Polish painter Jan Cybis, who was one of my professors at the Academy of Fine in Warsaw. As a young man he was copying a Velasques in the Louwr. He had been working very hard for about a month but he wasn’t pleased with the outcome, because of a small spot of green which refused to look like the one in the original. After trying and trying again without success, he put in despair black colour in that cursed place. To his great surprise it was exactly the green he had been looking for.

There are plenty of clever tricks that can be used to make computer pictures a bit softer and thus more human, like for example this one in Figure 7.

**Figure 7**

In this way programming in Logo becomes a multidimensional activity, which is doing math and art and learning the history of culture at the same time. So:

Math+Art&Design+?=Logo

**References**

- belson H., diSessa A. (1986) Turtle Geometry. The Computer as a Medium for Exploring Mathematics. Boston: MIT Pr..
- letcher T.J., Milner W.W., Watson F.R.
(1990)
*Logo and Mathematics*. Staffordshire: Keele Mathematical Education Publications. - ez A. (1979)
*Die Renaissance des Islams*. Polish edition, Warszawa: PWN. - immons M.(1996)
*Logo, down but not out*. MICROMATH, Vol. 12/3 pp. 22-23.