# Stochastic Processes

## Stochastic Processes

Music can be composed of sounds that change in predictable ways but spontaneity is important in music. In mathematics, sequences of random objects are referred to as a stochastic processes. These are important in a host of applications, and music provides a platform for experimenting with models that have been shown to useful elsewhere, and provides a framework for developing musical innovations.

At the most elementary level, we can build models for sequences of notes, and one of the simplest of these models is obtained by successively drawing each at random from the collection of possible notes with all notes equally likely, and with the draws done independently, so that when a new note is drawn, what was drawn previously does not in any way influence the probability for what is drawn in the next draw. In other words, we can imagine writing each possible note on a cards, shuffling the deck of cards and drawing one at random, then replacing the card, shuffling the deck and drawing again, and so on.

The result sounds something like this

On the other hand, there are processes in which, while the next note in a sequence is random, but this value depends on the current note (and only on the current note). Imagine that there is a different deck of cards to draw from depending on the current note. This property for a process is called the Markov property. An example of such a process is a random walk where, given the current note, the value of the next note is a half-step higher or a half-step lower depending on the flip of a fair coin. The result sounds like this

Here we voice by alternating between two independent random walks to produce an interesting sound

And in the following we interweave three independent random waks

The study of random walks in mathematics has a long and glorious history, with many fascinating questions and answers. For example, what is the chance that a random walk starting from some position returns to that position at some future time? (An important question for someone out for a stroll becomes disoriented!) For the simple random walk in which one moves up or down the keyboard by a half-step, flipping a fair coin, the answer is that we always return. How long does it typically take to return? What happens if the coin is slightly unfair?

Applications of random walks abound. The random walk is intimately connected to Brownian motion, which was developed Robert Brown to explain the erratic and unpredictable behavior of microscopic particles in a liquid as they are bombarded by smaller particles moving about randomly. But Brownian motion is now used to model many phenomena, not only in the physical world but in economics. For example, it used to describe the evolution of market prices Here’s a plot of a typical realization of Brownian motion: When we use a Brownian/random walk to determine the frequency and duration of a note, the result is something that sounds like this: