function Bernoulli() {
	var p;
	if ( !(this instanceof Bernoulli) ) {
		if ( arguments.length === 0 ) {
			return new Bernoulli();
		}
		return new Bernoulli( arguments[ 0 ] );
	}
	if ( arguments.length ) {
		p = arguments[ 0 ];
		if ( !isProbability( p ) ) {
			throw new TypeError( format( 'invalid argument. Mean parameter must be a probability. Value: `%s`.', p ) );
		}
	} else {
		p = 0.5;
	}
	defineProperty( this, 'p', {
		'configurable': false,
		'enumerable': true,
		'get': function get() {
			return p;
		},
		'set': function set( value ) {
			if ( !isProbability( value ) ) {
				throw new TypeError( format( 'invalid assignment. Must be a probability. Value: `%s`.', value ) );
			}
			p = value;
		}
	});
	return this;
}
Bernoulli distribution constructor.

@constructor
@param {Probability} [p=0.5] - success probability
@throws {TypeError} `p` must be a probability
@returns {Bernoulli} distribution instance

@example
var bernoulli = new Bernoulli();

var y = bernoulli.cdf( 1.8 );
// returns 1.0

var v = bernoulli.median;
// returns 0.0