Mathematical Experiment 4

Construct a program that simulates the game of ``network tracing''.


Construct a subprogram that reverses any segment of a given sequence.

Construct a subprogram that generates a random permutation of 1,2,...,n.

Combine the previous two subprograms to form a game in which the player
is limited to perform certain permutations of an arbitrary permutation
of 1,2,...,n. For example, he is allowed to reverse the tail of
a sequence, or he is allowed to ``reflect'' the sequence with respect to
a ``gap''. The goal of the game is to restore a randomly generated permutation
back to the ascending order.

Generalize the construction to a twodimensional game.

Every binary operation on the set S = {1,2,...,n} is uniquely
determined by its multiplication table, which is just an n×n
matrix with entries in S. With respect to any binary operation of S
one can define the corresponding Fibonacci sequence a_{1}
= 1, a_{2} = 1, a_{n}_{+2} = a_{n}_{+1}·a_{n}(n³
1). Discover mathematical properties of such sequences from observations
of various binary operations. This experiment can be done with Symphony.

Draw a torus.