A basic approach to compose a song is to repeat a sequence of tones again and again.
Musical repetitions are very similar to geometric transformations.
A geometric figure like a triangle can be relocated while preserving its size and shape. You can hear a sample of Mozart's music here . Mozart's idea was that from the stock of bars, the player will be able to generate a variety of melodies himself, by selecting randomly from the offered choices per bar. Besides the musical experience, the piece provides challenges in probability theory, ranging from practical routine computations to fundamental and philosophical ones. Both the musical and mathematical aspects can be used well for educational purposes.