# BernoulliGraphDistribution

represents a Bernoulli graph distribution for n-vertex graphs with edge probability p.

# Details and Options • The Bernoulli graph is constructed starting with the complete graph with n vertices and selecting each edge independently through a Bernoulli trial with probability p.
• The following options can be given:
•  DirectedEdges False whether to generate directed edges
• BernoulliGraphDistribution can be used with such functions as RandomGraph and GraphPropertyDistribution.

# Examples

open allclose all

## Basic Examples(2)

Generate a pseudorandom graph:

Distribution of the number of edges:

Probability density function:

## Scope(4)

Generate simple undirected graphs:

Simple directed graphs:

Generate a set of pseudorandom graphs:

Compute probabilities and statistical properties:

## Options(2)

### DirectedEdges(2)

By default, a Bernoulli graph is undirected:

With the setting , directed Bernoulli graphs are generated:

## Applications(3)

After 20 children have spent their first week in kindergarten, the probability that two children have made friends is 0.2:

Find the probability that the social network is connected:

In a snowball fight with 15 participants, and everybody throwing snowballs at everyone else, the probability of being hit by any given participant is 0.4:

Find the size of the largest group where everybody has been hit by everyone else:

Find the largest component fraction when the mean vertex degree is :

Average the result over 100 runs and plot it for different numbers of vertices:

## Properties & Relations(6)

Distribution of the number of vertices:

Distribution of the number of edges:

Probability density function:

The mean of the number of edges:

Distribution of the degree of a vertex:

Probability density function:

The mean of the degree of a vertex:

Connectivity for large n with respect to p:

A Bernoulli graph is almost surely disconnected for :

A Bernoulli graph is almost surely connected for :

Use BernoulliDistribution to simulate a BernoulliGraphDistribution:

Pseudorandom graphs:

Edge probability 1 results in the CompleteGraph:

Edge probability 0 results in the empty graph:

## Neat Examples(1)

Randomly colored vertices: