In music, or other fields, the term "**stochastic**", from the Greek "stochos" or "goal", refers to randomly generated elements created by strict mathematical processes. In probability theory stochastic processes are studied, in which a system such as a queue evolves over time subject to random factors.

Stochastic processes can be used in music either to compose a fixed piece, or produced in performance. Stochastic music was pioneered by Iannis Xenakis, who used probability, game theory, group theory, set theory, and Boolean algebra, and frequently used computers to produced his scores. Earlier, John Cage and others had composed *aleatoric music*, which is created by chance processes but does not have the strict mathematical basis (Cage's *Music of Changes*, for example, uses a system of charts based on the I-Ching).

In artificial intelligence the term "**stochastic**" specifically refers to an environment that is non-deterministic in that the next state of the environment is not fully determined by either the previous state of the environment *or* the actions of the agent. A deterministic environment is much simpler for an agent to deal with.

*Formalized Music: Thought and Mathematics in Composition*by Iannis Xenakis, ISBN 1576470792