二項分配
Author: 官長壽老師, 藍邦偉  老師

請拉動c重新規劃路線

自動更新路徑

P點落下到Q點的路徑問題:

顯示:說明

b = 1 (slider from 1 to 10, step 1)
a = 1 (slider from 1 to 10, step 1)
k = 9 (slider from 0 to n, step 1)
n = 16 (slider from 1 to 16, step 1)
c = 5 (slider from 1 to 5, step 0.1)
list0 = Sequence(Random[1, a + b], i, 1, n + c * 0)
list1 = Sequence(If[Element[list0, i] ≤ a, 0, 1], i, 1, n)
f = false
P: (n / 2, n / 2)
v = (0.5, -0.5)
u = (-0.5, -0.5)
list6 = Sequence(Sequence[Segment[(i / 2 + j, i / 2), ((i + 1) / 2 + j, (i + 1) / 2)], i, 0, n - 1 - j], j, 0, n - 1)
list7 = Sequence(Sequence[Segment[((i + j) / 2, (-i + j) / 2), ((i + j + 1) / 2, (-i + j - 1) / 2)], i, 0, j - 1], j, 1, n)
list8 = Sequence(Text[i, (i - 0.1, -0.3)], i, 0, n)
list2 = Sequence(If[i - Sum[list1, i] > k, 1, If[Sum[list1, i] > n - k, 0, Element[list1, i]]], i, 1, n)
Q: (k, 0)
list3 = Sequence(Sum[Take[list2, 1, i]], i, 1, n)
list4 = Join({{P}, Sequence[P + Element[list3, i] * u + (i - Element[list3, i]) * v, i, 1, n]})
list5 = Sequence(Vector[Element[list4, i], Element[list4, i + 1]], i, 1, n)
poly2, p_1, g, h, i = Polygon(P, P + (n - k) * u, P + (n - k) * u + k * v, P + k * v)
j = true
p: a / (a + b)
q: b / (a + b)
文字4: "$往右機率p= \frac{ a }{a+b }= \frac{" + (LaTeX[a]) + " }{" + (LaTeX[a + b]) + "}$
$往左機率q= \frac{ b }{a+b }= \frac{" + (LaTeX[b]) + "}{ " + (LaTeX[a + b]) + "}$"
文字2: "P到Q點的機率:C^{n}_{k} p^k q^{n-k}=C^{" + (LaTeX[n]) + "}_{" + (LaTeX[k]) + "}(" + (LaTeX[FractionText[p]]) + ")^" + (LaTeX[k]) + "(" + (LaTeX[FractionText[q]]) + ")^" + (LaTeX[n - k]) + "=" + (LaTeX[FractionText[Binomial[n, k] * p^(k) * q^(n - k)]]) + ""