Ask Your Question

How to plot the Binomial Distribution

asked 2020-04-05 19:47:23 +0200

geroyx gravatar image

updated 2020-04-06 10:44:29 +0200

Hey there, is there a macro for
image description

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-04-05 21:17:44 +0200

Sébastien gravatar image

updated 2020-04-06 12:18:57 +0200

The formula can be written in SageMath using binomial, but you may also use binom from the scipy library:

sage: import scipy.stats
sage: binom_dist = scipy.stats.binom(20,.20)
sage: bar_chart([binom_dist.pmf(k) for k in range(20)])

image description

See the Sage quick start for statistics page. As explained in the doc of

sage: scipy.stats.binom?

pmf stands for Probability mass function.

edit flag offensive delete link more


Nice... ;)

geroyx gravatar imagegeroyx ( 2020-04-06 12:39:04 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-04-05 19:47:23 +0200

Seen: 226 times

Last updated: Apr 06 '20