Rachel Quach
Rachel Quach

Reputation: 21

Plot histogram showing theoretical distribution of binomial random variable

Plot a histogram showing the theoretical distribution of a binomial random variable X with n = 10 and p = 0.5, labeling your plot. The following command might be helpful after assigning d with dbinom:

gf_line(d ~ 0:10)

I have no idea where to start with this question.

Upvotes: 1

Views: 288

Answers (1)

TarJae
TarJae

Reputation: 78927

Edit: Thank to jay.sf (see comment)

x=0:10
y <- dbinom(x,10,0.5)

plot(x,y, type='h')

enter image description here

Upvotes: 1

Related Questions