A framework for the study of parallelism (A), convergence (B), and contingency (C). Shading of squares indicates different environments, and X, Y, and Z are three different states of a trait in ancestors and their descendants. Arrows indicate transitions between states. In panel (C), the presence of trait Y in the ancestor results in further divergence when the ancestor re-enters the original environment, rather than convergence.