October 2017
Beginner to intermediate
270 pages
7h
English
Let's begin with a simple distribution: one that has a binary outcome, and is very much like tossing a (fair) coin.
This distribution represents a single event that takes the value 1 (let's call this heads) with a probability of p, and 0 (lets call this tails), with probability 1-p.
In order to visualize this, let's generate a large number of events of a Bernoulli distribution using np and graph the tendency of this distribution, with the following only two possible outcomes:
plt.figure() distro = np.random.binomial(1, .6, 10000)/0.5 plt.hist(distro, 2 , normed=1)
The following graph shows the binomial distribution, through an histogram, showing the complementary nature of the outcomes' probabilities:
Read now
Unlock full access