Ask Your Question

How to plot the Binomial Distribution

asked 2020-04-05 12:47:23 -0600

geroyx gravatar image

updated 2020-04-06 03:44:29 -0600

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 14:17:44 -0600

Sébastien gravatar image

updated 2020-04-06 05:18:57 -0600

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 05:39:04 -0600 )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 12:47:23 -0600

Seen: 148 times

Last updated: Apr 06 '20