二項分配
Author: 藍邦偉　老師

二項分配

p = 0.5 (slider from 0 to 1, step 0.1)
q: 1.0 - p
n = 10 (slider from 4 to 20, step 1)
a = BarChart(-0.5, n + 0.5, Sequence[Binomial[n, k] * p^(k) * q^(n - k), k, 0.0, n, 0.5])
u = Vector((x(Corner[1.0]), 0.0), (x(Corner[3.0]), 0.0))
v = Vector((0.0, y(Corner[1.0])), (0.0, y(Corner[3.0])))
μ: n * p
σ: sqrt(n * p * (1.0 - p))
f(x) = 1.0 / ((2.0 * 3.141592653589793)^(1.0 / 2.0) * σ) * exp(-(x - μ)^(2.0) / 2.0 * σ^(2.0))