function sample( rand, n, p ) {
	var sum = 0;
	var i;
	for ( i = 0; i < n; i++ ) {
		if ( rand() <= p ) {
			sum += 1;
		}
	}
	return sum;
}
Generates a binomially distributed pseudorandom number by computing the sum of Bernoulli random variables.

@private
@param {PRNG} rand - PRNG for uniformly distributed numbers
@param {PositiveInteger} n - number of trials
@param {Probability} p - success probability
@returns {NonNegativeInteger} pseudorandom number