toto
Author: jp

n = 21 (slider from 0 to 40, step 1)
p = 0.4 (slider from 0 to 1, step 0.01)
L = Sequence(n! / (k! * (n - k)!) * p^(k) * (1.0 - p)^(n - k), k, 0.0, n, 1.0)
a = Element(L, 1.0)
L' = Sequence(Segment[(k - 1.5, Element[L, k]), (k - 0.5, Element[L, k])], k, 1.0, n + 1.0, 1.0)
L'' = Sequence(Segment[(k - 0.5, 0.0), (k - 0.5, Element[L, k])], k, 1.0, n + 1.0, 1.0)
L_3 = Sequence(Segment[(k - 1.5, 0.0), (k - 1.5, Element[L, k])], k, 1.0, n + 1.0, 1.0)
k = 4 (slider from 0 to 20, step 1)
A_1: (k - 0.5, 0.0)
A_2: (x(A_1), Element[L, k + 1.0])
A_3: (x(A_1) + 1.0, y(A_2))
A_4: (x(A_3), 0.0)
poly1, a_1, a_2, a_3, a_4 = Polygon(A_1, A_2, A_3, A_4)
T1: "P(X=" + k + ")=" + poly1
m = 11.5 (slider from -10 to 15, step 0.1)
σ = 2.4 (slider from 0 to 5, step 0.1)
f = Function(1.0 / (σ * (2.0 * 3.141592653589793)^(0.5)) * exp(-(0.5) * ((x - m) / σ)^(2.0)), -10.0, 30.0)
b1: n * p
b2: sqrt(n * p * (1.0 - p))
texte1: "n p = " + b1
texte2: " \sqrt{ n p (1-p } = " + b2