Adaptive decisions concerning the scheduling of reproduction in an animal's lifetime, including age at maturity and clutch or litter size, should depend on an animal's body condition or state. In this state-dependent case, we are concerned with the optimization of sequences of actions and so dynamic optimization techniques are appropriate. Here we show how stochastic dynamic programming can be used to study the reproductive strategies and population dynamics of natural populations, assuming optimal decisions. As examples we describe models based upon field data from an island population of Soay sheep on St. Kilda. This population shows persistent instability, with cycles culminating in high mortality every three or four years. We explore different assumptions about the extent to which Soay ewes use information about the population cycle in making adaptive decisions. We compare the observed distributions of strategies and population dynamics with model predictions; the results indicate that Soay ewes make optimal reproductive decisions given that they have no information about the population cycle. This study represents the first use of a dynamic optimization life history model of realistic complexity in the study of a field population. The techniques we use are potentially applicable to many other populations, and we discuss their extension to other species and other life history questions.