Open3

数式を書き留める(通信)

JIGJIG

01 で表現されるバイナリ文字列 \mathbf{b}_{1\times n}i 文字目が 1 である確率を p_i とすると、パリティに関して以下の等式が成立する。

\begin{aligned} {\rm Prob}[b_1 \oplus b_2 \oplus \dotsb \oplus b_n = 0] = \dfrac{1}{2} + \dfrac{1}{2} \displaystyle \prod_{i=1}^{n} (1 - 2 p_i) \\ {\rm Prob}[b_1 \oplus b_2 \oplus \dotsb \oplus b_n = 1] = \dfrac{1}{2} - \dfrac{1}{2} \displaystyle \prod_{i=1}^{n} (1 - 2 p_i) \end{aligned}
簡単な説明

n = 1 の場合、以下の通り成立する。

\begin{aligned} {\rm Prob}[b_1 = 0] &= 1 - p_1 &= \dfrac{1}{2} + \dfrac{1}{2} (1 - 2 p_1) \\ {\rm Prob}[b_1 = 1] &= p_1 &= \dfrac{1}{2} - \dfrac{1}{2} (1 - 2 p_1) \end{aligned}

次に、 n = k の場合、以下が成り立つと仮定する。

\begin{aligned} {\rm Prob}[b_1 \oplus b_2 \oplus \dotsb \oplus b_k = 0] = \dfrac{1}{2} + \dfrac{1}{2} \displaystyle \prod_{i=1}^{k} (1 - 2 p_i) \\ {\rm Prob}[b_1 \oplus b_2 \oplus \dotsb \oplus b_k = 1] = \dfrac{1}{2} - \dfrac{1}{2} \displaystyle \prod_{i=1}^{k} (1 - 2 p_i) \end{aligned}

また、 n=k + 1 のパリティは以下のように計算できる。

\begin{aligned} b_1 \oplus b_2 \oplus \dotsb \oplus b_{k + 1} = 0 \iff \begin{dcases} b_1 \oplus b_2 \oplus \dotsb \oplus b_k = 0 \ \ {\rm and} \ \ b_{k + 1} = 0, & {\rm or} \\ b_1 \oplus b_2 \oplus \dotsb \oplus b_k = 1 \ \ {\rm and} \ \ b_{k + 1} = 1 \end{dcases} \\ b_1 \oplus b_2 \oplus \dotsb \oplus b_{k + 1} = 1 \iff \begin{dcases} b_1 \oplus b_2 \oplus \dotsb \oplus b_k = 0 \ \ {\rm and} \ \ b_{k + 1} = 1, & {\rm or} \\ b_1 \oplus b_2 \oplus \dotsb \oplus b_k = 1 \ \ {\rm and} \ \ b_{k + 1} = 0 \end{dcases} \end{aligned}

よって、それぞれの確率は以下の通り。

\begin{aligned} & \begin{split} {\rm Prob}[b_1 \oplus b_2 \oplus \dotsb \oplus b_{k + 1} = 0] = {} & \biggl\{ \dfrac{1}{2} + \dfrac{1}{2} \displaystyle \prod_{i=1}^{k} (1 - 2 p_i) \biggr\} \cdot (1 - p_{k + 1}) \\ & + \biggl\{ \dfrac{1}{2} - \dfrac{1}{2} \displaystyle \prod_{i=1}^{k} (1 - 2 p_i) \biggr\} \cdot p_{k + 1} \end{split} \\ & \begin{split} {\rm Prob}[b_1 \oplus b_2 \oplus \dotsb \oplus b_{k + 1} = 1] = {} & \biggl\{ \dfrac{1}{2} + \dfrac{1}{2} \displaystyle \prod_{i=1}^{k} (1 - 2 p_i) \biggr\} \cdot p_{k + 1} \\ & + \biggl\{ \dfrac{1}{2} - \dfrac{1}{2} \displaystyle \prod_{i=1}^{k} (1 - 2 p_i) \biggr\} \cdot (1 - p_{k + 1}) \end{split} \end{aligned}

上式を整理すると、 n=k が成り立つとき n=k + 1 でも成立することがわかる。以上のことから、どのような n に対しても成立する。 \blacksquare

JIGJIG

確率 0 \le p_i \le 1\tanh 関数に関する以下の関係式がある。

\begin{aligned} \tanh \biggl(\dfrac{1}{2}\log \dfrac{1 - p_i}{p_i} \biggr) = 1 - 2p_i \end{aligned}
簡単な説明

まず、 x \ge 0 について以下が成立する。

\begin{aligned} \begin{split} \tanh \biggl(\dfrac{1}{2}\log x \biggr) &= \dfrac{e^{\log \sqrt{x}} - e^{-\log \sqrt{x}}}{e^{\log \sqrt{x}} + e^{-\log \sqrt{x}}} \\ &= \dfrac{\sqrt{x} - \dfrac{1}{\sqrt{x}}}{\sqrt{x} + \dfrac{1}{\sqrt{x}}} \\ &= \dfrac{x - 1}{x + 1} \end{split} \end{aligned}

よって、

\begin{aligned} \begin{split} \tanh \biggl(\dfrac{1}{2}\log \dfrac{1 - p_i}{p_i} \biggr) &= \dfrac{\dfrac{1 - p_i}{p_i} - 1}{\dfrac{1 - p_i}{p_i} + 1} \\ &= 1 - 2p_i \end{split} \end{aligned}
JIGJIG

\mathbf{b}_{1\times n} のパリティが奇数である確率 \pi(1) 及びそうではない(この場合、パリティが偶数である)確率の対数比 L^{\rm ex} = \log(\{{1 - \pi(1)}\}/{\pi(1)}) は、対数尤度比 L_i = \log(\{{1 - p_i}\}/{p_i}) を用いて表すことができる。

\begin{aligned} L^{\rm ex} = 2 \tanh^{-1} \displaystyle \prod_{i=1}^{n} \tanh \dfrac{L_i}{2} \end{aligned}
簡単な説明

パリティに関する関係式を再掲すると、

\begin{aligned} \pi(1) = \dfrac{1}{2} - \dfrac{1}{2} \displaystyle \prod_{i=1}^{n} (1 - 2 p_i) \end{aligned}

よって、

\begin{gathered} 1 - 2\pi(1) = \displaystyle \prod_{i=1}^{n} (1 - 2 p_i) \\ \tanh \dfrac{L^{\rm ex}}{2} = \displaystyle \prod_{i=1}^{n} \tanh \dfrac{L_i}{2} \\ L^{\rm ex} = 2 \tanh^{-1} \displaystyle \prod_{i=1}^{n} \tanh \dfrac{L_i}{2} \end{gathered}