三階馬可夫鍊
Author: 藍邦偉　老師

$ Markov \;Chain $

a_{11}=

a_{12}=

$ a_{13}= $

a_{21}=

$ a_{22}= $

a_{23}=

$ b_{11}= $

$ b_{21}= $

a11=

a21=

a12=

a22=

a13=

a23=

b11=

b21=

$ 第一次轉移 $

$ 第二次轉移 $

$ 第三次轉移 $

$第$%v$步$

$ 穩定情形P^{(n)}=AP^{(n-1)}=P^{(n-1)}⇒AX=X $
$設X=\left [  \begin{array}{cc} x \ y \ z \end{array} \right ],0≤x,y,z≤1,\;x+y+z=1 $

f = 0.1 (slider from 0 to 1, step 1)
e = 0.2 (slider from 0 to 1, step 1)
d = 0.3 (slider from 0 to 1, step 1)
c = 0.4 (slider from 0 to 1, step 1)
cf: c * f
U: -100 * cf + 10 * e * (10 * d - 10)
b = 0.3 (slider from 0 to 1, step 1)
bc: b * c
eb: e * b
a = 0.4 (slider from 0 to 1, step 0.1)
W: 100 * ((1 - a) * (d - 1) + bc)
V: (-eb - f * (1 - a)) * 100
list: {abs(U), abs(V), abs(W)}
g = 0.2 (slider from 0 to 1, step 1)
h = 0.2 (slider from 0 to 1, step 1)
IB_{a11} = Textfield(a)
IB_{a21} = Textfield(b)
IB_{a12} = Textfield(c)
IB_{a22} = Textfield(d)
IB_{a13} = Textfield(e)
IB_{a23} = Textfield(f)
IB_{b11} = Textfield(g)
IB_{b21} = Textfield(h)
text02: "$ P^{(1)}=AP^{(0)}=\left [\begin{array}{cc} " + (LaTeX[FractionText[a]]) + " & " + (LaTeX[FractionText[c]]) + " & " + (LaTeX[FractionText[e]]) + " \\ " + (LaTeX[FractionText[b]]) + " & " + (LaTeX[FractionText[d]]) + " & " + (LaTeX[FractionText[f]]) + "\\ " + (LaTeX[FractionText[1 - a - b]]) + " & " + (LaTeX[FractionText[1 - d - c]]) + " & " + (LaTeX[FractionText[1 - e - f]]) + " \\ \end{array}  \right ] \left [\begin{array}{cc} " + (LaTeX[FractionText[g]]) + " \\ " + (LaTeX[FractionText[h]]) + " \\ " + (LaTeX[FractionText[1 - g - h]]) + " \end{array}   \right ]=\left [ \begin{array}{cc} " + (LaTeX[FractionText[a * g + c * h + e * (1 - g - h)]]) + "  \\ " + (LaTeX[FractionText[b * g + d * h + f * (1 - g - h)]]) + "  \\ " + (LaTeX[FractionText[g * (1 - a - b) + h * (1 - c - d) + (1 - g - h) * (1 - e - f)]]) + "  \\ \end{array} \right ]   $"
ag: a * g
ch: c * h
a_{111}: ag + ch + e * (1 - g - h)
bg: b * g
dh: d * h
a_{121}: bg + dh + f * (1 - g - h)
a_{131}: (1 - a - b) * g + (1 - c - d) * h + (1 - e - f) * (1 - g - h)
text04: "$ P^{(2)}=AP^{(1)}=\left [\begin{array}{cc} " + (LaTeX[FractionText[a]]) + " & " + (LaTeX[FractionText[c]]) + " & " + (LaTeX[FractionText[e]]) + " \\ " + (LaTeX[FractionText[b]]) + " & " + (LaTeX[FractionText[d]]) + " &" + (LaTeX[FractionText[f]]) + " \\ " + (LaTeX[FractionText[1 - a - b]]) + "& " + (LaTeX[FractionText[1 - d - c]]) + " & " + (LaTeX[FractionText[1 - e - f]]) + " \\ \end{array}  \right ]\left [ \begin{array}{cc} " + (LaTeX[FractionText[a_{111}]]) + " \\ " + (LaTeX[FractionText[a_{121}]]) + " \\ " + (LaTeX[FractionText[a_{131}]]) + " \end{array}  \right ]  =\left [ \begin{array}{cc} " + (LaTeX[FractionText[a * a_{111} + c * a_{121} + e * a_{131}]]) + " \\ " + (LaTeX[FractionText[b * a_{111} + d * a_{121} + f * a_{131}]]) + " \\ " + (LaTeX[FractionText[(1 - a - b) * a_{111} + (1 - c - d) * a_{121} + (1 - e - f) * a_{131}]]) + " \end{array}  \right ]  $"
q1: a * a_{111} + c * a_{121} + e * a_{131}
q2: b * a_{111} + d * a_{121} + f * a_{131}
q3: (1 - a - b) * a_{111} + (1 - c - d) * a_{121} + (1 - e - f) * a_{131}
q4: a * q1 + c * q2 + e * q3
q5: b * q1 + d * q2 + f * q3
q6: (1 - b - a) * q1 + (1 - c - d) * q2 + (1 - e - f) * q3
text06: "$ P^{(3)}=AP^{(2)} =\left [\begin{array}{cc} " + (LaTeX[FractionText[a]]) + " & " + (LaTeX[FractionText[c]]) + " & " + (LaTeX[FractionText[e]]) + " \\ " + (LaTeX[FractionText[b]]) + " & " + (LaTeX[FractionText[d]]) + " &" + (LaTeX[FractionText[f]]) + " \\ " + (LaTeX[FractionText[1 - b - a]]) + " & " + (LaTeX[FractionText[1 - c - d]]) + " & " + (LaTeX[FractionText[1 - e - f]]) + " \\ \end{array}  \right ] \left [\begin{array}{cc} " + (LaTeX[FractionText[q1]]) + " \\ " + (LaTeX[FractionText[q2]]) + " \\ " + (LaTeX[FractionText[q3]]) + " \end{array}   \right ] =\left [ \begin{array}{cc} " + (LaTeX[FractionText[q4]]) + " \\ " + (LaTeX[FractionText[q5]]) + " \\ " + (LaTeX[FractionText[q6]]) + " \end{array}  \right ] $"
n = 0 (slider from 0 to 15, step 1)
text08: "$ AX=\left [\begin{array}{cc} " + (LaTeX[a]) + " &" + (LaTeX[c]) + "  & " + (LaTeX[e]) + " \\ " + (LaTeX[b]) + " & " + (LaTeX[d]) + " & " + (LaTeX[f]) + " \\ " + (LaTeX[1 - b - a]) + " & " + (LaTeX[1 - d - c]) + " & " + (LaTeX[1 - f - e]) + " \\ \end{array}  \right ] \left [ \begin{array}{cc} x \\ y \\ z \end{array}  \right ] =\left [\begin{array}{cc} x \\ y \\ z \end{array}   \right ]  $"
text09: "$⇒ \left [  \begin{array}{cc} " + (LaTeX[a]) + "x+" + (LaTeX[c]) + "y+" + (LaTeX[e]) + "z \\ " + (LaTeX[b]) + "x+" + (LaTeX[d]) + "y+" + (LaTeX[f]) + "z \\" + (LaTeX[1 - b - a]) + " x+" + (LaTeX[1 - c - d]) + "y+" + (LaTeX[1 - f - e]) + "z \end{array} \right ]  =\left [\begin{array}{cc} x \\ y \\ z \end{array}   \right ] $"
text10: "$ ⇒\left\lbrace\begin{array}{cc} " + (LaTeX[1 - a]) + "x-" + (LaTeX[c]) + "y-" + (LaTeX[e]) + "z=0 \\ " + (LaTeX[b]) + "x-" + (LaTeX[1 - d]) + "y+" + (LaTeX[f]) + "z=0 \\ " + (LaTeX[1 - b - a]) + "x+" + (LaTeX[1 - d - c]) + "y-" + (LaTeX[e + f]) + "z=0 \end{array}   \right.\ ⇒\left\lbrace \begin{array}{cc} " + (LaTeX[10 - 10 * a]) + "x-" + (LaTeX[10 * c]) + "y-" + (LaTeX[10 * e]) + "z=0 \\ " + (LaTeX[10 * b]) + "x-" + (LaTeX[10 - 10 * d]) + "y+" + (LaTeX[10 * f]) + "z=0 \\ " + (LaTeX[10 - 10 * a - 10 * b]) + "x+" + (LaTeX[10 - 10 * c - 10 * d]) + "y-" + (LaTeX[10 * e + 10 * f]) + "z =0\end{array}  \right.\ $"
i = GCD(a, b)
q = GCD(U, V)
q_0 = GCD(q, W)
t: 1 / (U + V + W)
gcd = GCD(list)
text11: "$ 由前兩式知：$
$\;x:y:z=\left\vert  \begin{array}{cc} " + (LaTeX[-10 * c]) + " & " + (LaTeX[-10 * e]) + " \\ " + (LaTeX[10 * d - 10]) + " & " + (LaTeX[10 * f]) + " \\ \end{array} \right\vert:\left\vert \begin{array}{cc} " + (LaTeX[-10 * e]) + "& " + (LaTeX[10 - 10 * a]) + " \\ " + (LaTeX[10 * f]) + " & " + (LaTeX[10 * b]) + " \\ \end{array}  \right\vert:\left\vert \begin{array}{cc} " + (LaTeX[10 - 10 * a]) + " & " + (LaTeX[-10 * c]) + " \\ " + (LaTeX[10 * b]) + " & " + (LaTeX[10 * d - 10]) + " \\ \end{array}  \right\vert    $
                  $=" + (LaTeX[abs(U)]) + "\;:" + (LaTeX[abs(V)]) + "\;:\;" + (LaTeX[abs(W)]) + "\;=" + (LaTeX[abs(U / gcd)]) + "\;:" + (LaTeX[abs(V / gcd)]) + "\;:" + (LaTeX[abs(W / gcd)]) + "$"
j: a + d ≤ 1
k: b + e ≤ 1
l: c + f ≤ 1
m: g + h ≤ 1
text12: "$設x=" + (LaTeX[abs(U / gcd)]) + "t,\;y=" + (LaTeX[abs(V / gcd)]) + "t,\'z=" + (LaTeX[abs(W / gcd)]) + "t,\;t∈\mathbb{R}$
$ 帶入第三式中：\;" + (LaTeX[10 - 10 * a - 10 * b]) + "(" + (LaTeX[abs(U / gcd)]) + ")+" + (LaTeX[10 - 10 * c - 10 * d]) + "(" + (LaTeX[abs(V / gcd)]) + ")-" + (LaTeX[10 * e + 10 * f]) + "(" + (LaTeX[abs(W / gcd)]) + ")=0\;滿足 $"
text13: "$ 又x+y+z=1⇒ " + (LaTeX[abs(U / gcd)]) + "\;t+" + (LaTeX[abs(V / gcd)]) + "\;t+" + (LaTeX[abs(W / gcd)]) + "\;t=1$
$⇒" + (LaTeX[abs(U / gcd + V / gcd + W / gcd)]) + "\;t=1⇒t=\frac{1}{" + (LaTeX[abs(U / gcd + V / gcd + W / gcd)]) + "}$"
text15: "$ 即：\;X=\left [ \begin{array}{cc} " + (LaTeX[FractionText[U * t]]) + " \\ " + (LaTeX[FractionText[V * t]]) + " \\ " + (LaTeX[FractionText[W * t]]) + " \end{array}  \right ]  $"
text14: "$ ⇒x=" + (LaTeX[FractionText[U * t]]) + "\;,\;y=" + (LaTeX[FractionText[V * t]]) + "\;,\;z=" + (LaTeX[FractionText[W * t]]) + " $"
MatrixA: "$ A=" + (LaTeX[If[n ≟ 0, "\left [ \begin{array}{cc} a_{11}& a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} &a_{33} \\ \end{array} \right ] ="]]) + "\left [\begin{array}{cc} " + (LaTeX[FractionText[a]]) + " & " + (LaTeX[FractionText[c]]) + " & " + (LaTeX[FractionText[e]]) + " \\ " + (LaTeX[FractionText[b]]) + " & " + (LaTeX[FractionText[d]]) + " &" + (LaTeX[FractionText[f]]) + " \\ " + (LaTeX[FractionText[1 - a - b]]) + " & " + (LaTeX[FractionText[1 - d - c]]) + " &" + (LaTeX[FractionText[1 - f - e]]) + " \\ \end{array}  \right ]   $"
MatrixP0: "$ P^{(0)}=" + (LaTeX[If[n ≟ 0, "\left [\begin{array}{cc} b_{11} \\ b_{21} \\ b_{31} \end{array}   \right ]="]]) + "\left [\begin{array}{cc} " + (LaTeX[FractionText[g]]) + " \\ " + (LaTeX[FractionText[h]]) + " \\ " + (LaTeX[FractionText[1 - h - g]]) + " \end{array}   \right ]   $"