# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .r
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: R
#     language: R
#     name: r
# ---

# Plot of Binomial Distribution

options(repr.plot.width=5, repr.plot.height=5)

x <- seq(0, 12, length=13)
print(x)

p=0.5
hx <- dbinom(x, size=12, prob=p)
hx
title <- sprintf("Binomial Distributions (p=%f)", p)
plot(x, hx, lty=2, xlab="x value", ylab="Density", main=title)

p=0.3
hx <- dbinom(x, size=12, prob=p)
hx
title <- sprintf("Binomial Distributions (p=%f)", p)
plot(x, hx, lty=2, xlab="x value", ylab="Density", main=title)

p=0.8
hx <- dbinom(x, size=12, prob=p)
hx
title <- sprintf("Binomial Distributions (p=%f)", p)
plot(x, hx, lty=2, xlab="x value", ylab="Density", main=title)



StarcoderdataJupyterScriptsDedupFiltered