Let A be a ring whose additive group is free abelian of finite rank. The topic of this talk is the following question: what is the probability that k random elements of A generate it as a ring? After making this question precise I will show that it has an interesting answer which can be interpreted as a local-global principle. (This is joint work with Rostyslav Kravchenko and Marcin Mazur.)