46207 擴充神算的簡單機率模型

### 二、簡單機率模型與符號設定

$$X_i = \left \{ \begin{array}{ll} 1, \mbox{ 黑球}, \quad \mbox{ 機率 }p, \\ 0, \mbox{ 白球}, \quad \mbox{ 機率 }1-p. \end{array} \right.$$

$$X_{ij} = \left \{ \begin{array}{ll} 1, \mbox{ 黑球}, \quad \mbox{ 機率 }p, \\ 0, \mbox{ 白球}, \quad \mbox{ 機率 }1-p. \end{array} \right.$$

$$W=\min \{i \in \mathbb{N}:Y_{i+1}=1 \}, \quad S=\min \{i \in \mathbb{N}:Z_{i+1}=1 \}.$$

$$E(W)=\sum_{n=1}^{\infty} n P(W=n), \quad E(S)=\sum_{n=1}^{\infty} n P(S=n).$$

### 三、研究問題

(1) 對任意 $n \in \mathbb{N}$, 探討 $P(Y_n=1)$ 與 $P(Z_n=1)$ 之值。

(2) 探討 $E(W)$ 與 $E(S)$ 之值。

### 四、二維結果

$$P(Y_n=1)=\frac{1}{2}- \frac{1}{2} (1-2p)^{\Psi_n} ,$$

\begin{align} Y_n \equiv X_1+C_{1}^{n-1} X_2+C_{2}^{n-1} X_3+ \cdots+ C_{n-2}^{n-1} X_{n-1}+ X_n \ (\mbox{mod} \ 2). \label{eq:y} \tag{4.1} \end{align}

$$P(Y_n=1)=P \left( X_{i_1}+X_{i_2}+\cdots+X_{i_{\gamma}} \equiv 1 \ (\mbox{mod} \ 2) \right),$$

$$i_k = \min \{m \gt i_{k-1}: C_{m}^{n-1} \mbox{ 之值是奇數} \}, \quad k \gt 1.$$

$$a_{n}=P \left( X_1+X_2+\cdots+X_{n-1}+X_{n} \equiv 1 \ (\mbox{mod} \ 2) \right).$$

$$P(Y_n=1)=a_{\gamma}=a_{\Psi_n}.$$

\begin{align*} a_{n} &=P \bigg(X_{n}=1, \sum_{i=1}^{n-1} X_i \equiv 0 \ (\mbox{mod} \ 2) \bigg)+ P \bigg(X_{n}=0, \sum_{i=1}^{n-1} X_i \equiv 1 \ (\mbox{mod} \ 2) \bigg) \\ &= P(X_{n}=1) P \bigg(\sum_{i=1}^{n-1} X_i \equiv 0 \ (\mbox{mod} \ 2) \bigg)+ P(X_{n}=0) P \bigg(\sum_{i=1}^{n-1} X_i \equiv 1 \ (\mbox{mod} \ 2) \bigg) \\ &= p \left (1-a_{n-1} \right )+ (1-p) a_{n-1}=p+(1-2p) a_{n-1}. \end{align*}

$$a_n-\frac{1}{2}=(1-2p) \left ( a_{n-1}-\frac{1}{2} \right ), \ \forall n \ge 2,$$

$$a_n=\frac{1}{2} -\frac{1}{2} (1-2p)^n.$$

$$P(Y_n=1)=a_{\Psi_n}=\frac{1}{2}- \frac{1}{2} (1-2p)^{\Psi_n}.$$

$\Box$

$$E(W)=\frac{p}{1-p}+ \frac{1-p}{p}.$$

\begin{align*} \{W=2 \} &= \{Y_2 = 0, Y_{3}= 1 \} \\ &= \{X_1 +X_{2} \equiv 0, X_2 +X_{3} \equiv 1 \ (\mbox{mod} \ 2) \} , \\[5pt] \{W=3 \} &= \{Y_2 = 0, Y_{3}= 0, Y_4=1 \} \\ &= \{X_1 +X_{2} \equiv 0, X_2 +X_{3} \equiv 0, X_3 +X_{4} \equiv 1, \ (\mbox{mod} \ 2) \} . \end{align*}

\begin{align*} \{W=n \} &= \{Y_i = 0, 2 \le i \le n,Y_{n+1}= 1 \} \\ &= \bigg( \bigcap_{i=1}^{n-1} \{X_i +X_{i+1} \equiv 0 \ (\mbox{mod} \ 2) \} \bigg) \cap \{X_n +X_{n+1} \equiv 1 \ (\mbox{mod} \ 2) \} \\ &= \{X_i=0, 1 \le i \le n,X_{n+1}=1 \} \cup \{X_i=1, 1 \le i \le n,X_{n+1}=0 \}, \end{align*}

$$P(W=n) =p (1-p)^n+(1-p) p^n.$$

\begin{align*} \sum_{n=1}^{\infty} n p^n&=\frac{p}{(1-p)^2}, \quad \sum_{n=1}^{\infty} n (1-p)^n=\frac{1-p}{p^2},\\ \hbox{因此 } E(W) &= \sum_{n=1}^{\infty} n P(W=n) \\ &=(1-p) \sum_{n=1}^{\infty} n p^n+ p \sum_{n=1}^{\infty} n (1-p)^n \\ &= \frac{p(1-p)}{(1-p)^2}+\frac{p(1-p)}{p^2}=\frac{p}{1-p}+ \frac{1-p}{p}. \end{align*}

### 五、三維結果

$$P(Z_n=1)=\frac{1}{2}- \frac{1}{2} (1-2p)^{\lambda_n} ,$$

$$\lambda_n= \left (C_{0}^{n-1} \ (\mbox{mod} \ 2) \right ) \Psi_n+ \left (C_{1}^{n-1} \ (\mbox{mod} \ 2) \right ) \Psi_{n-1}+ \cdots + \left (C_{n-1}^{n-1} \ (\mbox{mod} \ 2) \right ) \Psi_1,$$

$$Z_2 \equiv X_{11}+X_{21}+X_{22}, \quad Z_3 \equiv X_{11}+X_{31}+X_{33} \ (\mbox{mod} \ 2).$$ $$Z_4 \equiv X_{11}+X_{21}+X_{22}+X_{31}+X_{33}+X_{41}+X_{42}+X_{43}+X_{44} \ (\mbox{mod} \ 2).$$ $$Z_5 \equiv X_{11}+X_{51}+X_{55} \ (\mbox{mod} \ 2).$$ $$Z_6 \equiv X_{11}+X_{21}+X_{22}+X_{51}+X_{55}+X_{61}+X_{62}+X_{65}+X_{66} \ (\mbox{mod} \ 2).$$ $$Z_7 \equiv X_{11}+X_{31}+X_{33}+X_{51}+X_{55}+X_{71}+X_{73}+X_{75}+X_{77} \ (\mbox{mod} \ 2).$$

$X_{11}$, $X_{21}$, $X_{22}$, $X_{31}$, $X_{32}$, $X_{33}$, $\cdots$, $X_{i1}$, $X_{i2}$, $\cdots$, $X_{ii}$, $\cdots$, $X_{n1}$, $X_{n2}$, $\cdots$, $X_{nn}$,

$$\begin{array}{ccccccc} C_{n-1}^{n-1} C_{0}^{0}, & &&&&& \\[4pt] C_{n-2}^{n-1} C_{0}^{1}, & C_{n-2}^{n-1} C_{1}^{1}, & &&&& \\[4pt] C_{n-3}^{n-1} C_{0}^{2}, & C_{n-3}^{n-1} C_{1}^{2}, & C_{n-3}^{n-1} C_{2}^{2}, & &&& \\[4pt] & & & \cdots \cdots, & & & \\[4pt] C_{2}^{n-1} C_{0}^{n-3}, & C_{2}^{n-1} C_{1}^{n-3}, & C_{2}^{n-1} C_{2}^{n-3}, & \cdots, & C_{2}^{n-1} C_{n-3}^{n-3}, & & \\[4pt] C_{1}^{n-1} C_{0}^{n-2}, & C_{1}^{n-1} C_{1}^{n-2}, & C_{1}^{n-1} C_{2}^{n-2}, & \cdots, & \cdots, & C_{1}^{n-1} C_{n-2}^{n-2}, & \\[4pt] C_{0}^{n-1} C_{0}^{n-1}, & C_{0}^{n-1} C_{1}^{n-1}, & C_{0}^{n-1} C_{2}^{n-1}, & \cdots, & \cdots, & \cdots, & C_{0}^{n-1} C_{n-1}^{n-1}, \end{array}$$

\begin{align} Z_n \equiv \sum_{i=1}^{n} \sum_{j=1}^{i} \left( C_{n-i}^{n-1} C_{j-1}^{i-1} \ (\mbox{mod} \ 2) \right) X_{ij} \quad (\mbox{mod} \ 2). \label{eq:z} \tag{5.1} \end{align}

$$P(Z_n=1)=\frac{1}{2}- \frac{1}{2} (1-2p)^{\lambda_n}.$$

$\Box$

$$E(S)=\sum_{n=1}^{\infty} n P(S=n),$$

\begin{align*} P(S=n) &=p \left \{\frac{1}{2} + \frac{1}{2} (1-2p)^{\Psi_{n+1}} \right \} \prod_{i=2}^{n} \left \{\frac{1}{2}- \frac{1}{2} (1-2p)^{\Psi_i} \right \} \\ & \mbox{ } \quad + q \left \{\frac{1}{2}- \frac{1}{2} (1-2p)^{\Psi_{n+1}} \right \} \prod_{i=2}^{n} \left \{\frac{1}{2} + \frac{1}{2} (1-2p)^{\Psi_i} \right \}, \end{align*}

\begin{align*} \{S=2 \} &= \{Z_2 = 0, Z_{3}= 1 \} \\ &= \{X_{11} +X_{21}+X_{22} \equiv 0, X_{21}+X_{22}+X_{31} +X_{33} \equiv 1 \ (\mbox{mod} \ 2) \} , \\ \{S=3 \} &= \{Z_2 = 0, Z_{3}= 0, Z_4=1 \} \\ &= \{X_{11} +X_{21}+X_{22} \equiv 0, X_{21}+X_{22}+X_{31} +X_{33} \equiv 0, \\ & \mbox{ } \qquad X_{31}+X_{33}+X_{41} +X_{42}+X_{43}+X_{44} \equiv 1 \ (\mbox{mod} \ 2) \} , \\ \{S=4 \} &= \{Z_2 = 0, Z_{3}= 0, Z_4=0, Z_5=1 \} \\ &= \{X_{11} +X_{21}+X_{22} \equiv 0, X_{21}+X_{22}+X_{31} +X_{33} \equiv 0, \\ & \mbox{ } \qquad X_{31}+X_{33}+X_{41} +X_{42}+X_{43}+X_{44} \equiv 0, \\ & \mbox{ } \qquad X_{41} +X_{42}+X_{43}+X_{44} +X_{51}+X_{55} \equiv 1 \ (\mbox{mod} \ 2) \} , \\ \hbox{歸納可得 } \{S=n \} &= \{Z_i = 0, 2 \le i \le n, Z_{n+1}=1 \} \\ &= \{X_{11} +X_{21}+X_{22} \equiv 0, X_{21}+X_{22}+X_{31} +X_{33} \equiv 0, \\ & \mbox{ } ~\quad X_{31}+X_{33}+X_{41} +X_{42}+X_{43}+X_{44} \equiv 0, \\ & \mbox{ } ~\quad X_{41} +X_{42}+X_{43}+X_{44} +X_{51}+X_{55} \equiv 0, \\ & \mbox{ } ~\quad \cdots \cdots \\ & \mbox{ } ~\quad X_{n \alpha_1} \!+\!X_{n \alpha_2}\!+\!\cdots\!+\!X_{n \alpha_{\Psi_n}}\!+\! X_{(n+1) \beta_1}\!+\!\cdots \!+\!X_{(n+1) \beta_{\Psi_{n+1}}} \!\equiv\! 1 \, (\mbox{mod} \ 2) \} , \end{align*}

$$\alpha_i = \min \{i \gt \alpha_{i-1}: C_{i}^{n-1} \mbox{ 之值是奇數} \}, \quad \beta_i = \min \{i \gt \beta_{i-1}: C_{i}^{n} \mbox{ 之值是奇數} \}.$$

$$\{X_{21}+X_{22} \}, \ \{X_{31} +X_{33} \}, \ \{X_{41} +X_{42}+X_{43}+X_{44} \}, \ \{ X_{51}+X_{55} \}, \ \cdots,$$

\begin{align*} P(S=n) &=p \left \{\frac{1}{2} + \frac{1}{2} (1-2p)^{\Psi_{n+1}} \right \} \prod_{i=2}^{n} \left \{\frac{1}{2}- \frac{1}{2} (1-2p)^{\Psi_i} \right \} \\ & \mbox{ } \quad + q \left \{\frac{1}{2}- \frac{1}{2} (1-2p)^{\Psi_{n+1}} \right \} \prod_{i=2}^{n} \left \{\frac{1}{2} + \frac{1}{2} (1-2p)^{\Psi_i} \right \}, \end{align*}

$\Box$