What is the expected number of rings obtained in the following ring formation process? Refluxing, say, one mole of 1,5-dibromo-pentane with excess ammonia in ethanol can result in the formation of rings. (e.g. $1\lambda^2$-piperidine)

However, it is also possible for the 1,5-dibromo-pentane molecules to be connected together, forming longer chains without forming rings. The longer chains can be reacted again to form larger rings. So in theory, we can have rings that are arbitrarily large.
This is about the rings' size distribution
Question: What is the expected number of rings (large and small) after the reaction finishes? How many of the rings are $1\lambda^2$-piperidine? Generally, is there a mathematical distribution that describes the expected number of rings of any given size?
There is no simple answer here because the outcome will be heavily dependent on the concentration and on the rate of addition.

The most salient point in your question to me is: "excess ammonia."

You can ask what the competing reactions are.


1,5-dibromopentane reacts with ammonia to form 1-amino-5-bromopentane
1-amino-5-bromopentane reacts with itself to form piperidine
1-amino-5-bromopentane reacts with ammonia to form 1,5-diaminopentane
1-amino-5-bromopentane reacts with another straight chain alkyl amine to elongate the chain
1,5-dibromopentane reacts with piperidine to form N-(5-bromopentyl)piperidine
and others...


The main problem I see is that in excess ammonia, unless you perform a slow addition of ammonia, the concentration may be such that the ammonia will over add via (3). Then you're going to get any product. The intermediates are also reactive, so the reactant concentration has to be relatively low as well, otherwise, you may see (4) or (5) or other side reactions. You may also need to run the reaction at lower temperature to disfavor reaction of the product with any alkyl bromide intermediate or reactant.

These issues need to resolved before you even begin to think about distribution of ring sizes because you might not even form any rings.