In the discrete case:

let j be the number of samples, and N(j) the population of objects found in each sample, there is the trivial case where the population of objects per sample is just 1 so N(j) = for all j that have objects and N(j) = j for all j without objects. The formalism is a little difficult like all formalisms will usually be.

The total number of objects for all samples:

For the non trivial case

But it gets a little unwieldy in the continuous case. So I'll work through it a bit.

Suppose we have a clock that goes form 0 to 5 seconds. What is the expected value of all possible measurement of time in that time frame? Well, a discrete approximation is just taking the the time readings from start to finish at 1 second intervals:

j = 0, 1, 2, 3, 4, 5 and N(j) = 1 for all j

Using the above formula (0+1+2+3+4+5) * (1/6) = 15/6 = 2.5

Before going into the formalism let's just try to do this in the continuous case where we run the clock from 0 to 5 seconds. What is the average time (which ONLY in the special case the average is also the expectation value). I will use Psi notation to drive the point home a bit. I begin with the Born constraint (which is really true of all probability conceptions):

Now, by inspection and assumption, the probability density P(t) is independent of t, so we can, thankfully, solve this integral:

Which implies

for all t.

So now we can state the definition of expectation in the continuous case and then solve and example:

So what is the expected value of t as we run the clock from 0 to 5 seconds?

So bear in mind, even for trivial problems the formal rigor can feel like rigor mortis!