Discourse is the study of how the meaning of a document is built out the meanings of its sentences. As such it is the inter-sentential analogue of semantics. In this talk we consider the following abstract problem. Given a news article, randomly permute the order of its sentences and then attempt to distinguish the original from the permuted version. We present a sequence of generative models that can do this with increasing accuracy. Each (individual) model accounts for some aspect of the document, and assigns a probability to the documents contents. In the standard generative way subsequent models simply multiply the probabilities of the individual models to get their results. We also discuss the linkage of this abstract tasks to more realistic ones such as essay grading, document summarization and document generation.