Ask Your Question
0

How to plot the Binomial Distribution

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

geroyx gravatar image

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

Hey there, is there a macro for
image description
?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

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

Sébastien gravatar image

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

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

Comments

Nice... ;)

geroyx gravatar imagegeroyx ( 2020-04-06 12:39:04 +0100 )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

Stats

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

Seen: 1,308 times

Last updated: Apr 06 '20