二項分配與常態分配
Author: 藍邦偉　老師

二項分配與常態分配

p = 0.5 (slider from 0 to 1, step 0.1)
q: 1 - p
n = 10 (slider from 4 to 20, step 1)
u = Vector((x(Corner[1]), 0), (x(Corner[3]), 0))
v = Vector((0, y(Corner[1])), (0, y(Corner[3])))
μ: n * p
σ: sqrt(n * p * (1 - p))
a = BarChart(0, n + 0.5, Sequence[Binomial[n, k] * p^(k) * q^(n - k), k, 0, n, 0.5])
f = Function(1 / ((2 * π)^(1 / 2) * σ) * ℯ^((-(x - μ)^(2)) / 2 * σ^(2)), 0, 50)