Imagine you have a critical component that you know will fail in 1
in N "uses" (for some suitable definition of "use").
You may want to schedule routine replacement of the component so that
its chance of failure between routine replacements is less than P%.
If the failures follow a binomial distribution (each time the component
is "used" it either fails or does not) then the static member
function binomial_distibution<>::find_maximum_number_of_trials
can be used to estimate the maximum number of "uses" of that
component for some acceptable risk level alpha.

The example program binomial_sample_sizes.cpp
demonstrates its usage. It centres on a routine that prints out a table
of maximum sample sizes for various probability thresholds:

The routine then declares a table of probability thresholds: these
are the maximum acceptable probability that successes
or fewer events will be observed. In our example, successes
will be always zero, since we want no component failures, but in other
situations non-zero values may well make sense.

doublealpha[]={0.5,0.25,0.1,0.05,0.01,0.001,0.0001,0.00001};

Much of the rest of the program is pretty-printing, the important part
is in the calculation of maximum number of permitted trials for each
value of alpha:

Note that since we're calculating the maximum number of trials permitted,
we'll err on the safe side and take the floor of the result. Had we
been calculating the minimum number of trials
required to observe a certain number of successes
using find_minimum_number_of_trials
we would have taken the ceiling instead.

We'll finish off by looking at some sample output, firstly for a 1
in 1000 chance of component failure with each use: