Standard cosmology has a number of fine-tuning problems. Some of these problems can be ameliorated by inflation, but even with inflation the universe we observe seems very unlikely. One might hope that string theory helps; at least it provides a theory of quantum gravity. But unfortunately it also raises new questions, for example why do we observe a four-dimensional universe? In this lecture I'll present one possible answer to this question, based on the extended nature of the degrees of freedom present in string and M-theory.