Aganippe76

Answered

2022-07-04

How to derive this simple equality?

Let us define

${L}_{i}\triangleq \mathrm{log}\left({\displaystyle \frac{Prob({x}_{i}=+1)}{Prob({x}_{i}=-1)}}\right)$

$E\{{x}_{i}\}\triangleq Prob({x}_{i}=+1)-Prob({x}_{i}=-1)$

I need to show that

$E\{{x}_{i}\}=\mathrm{tanh}({L}_{i}/2)$

I can write

$\begin{array}{}\text{(1a)}& E\{{x}_{i}\}& ={e}^{log(Prob({x}_{i}=+1)-Prob({x}_{i}=-1))}\text{(1b)}& & ={e}^{{L}_{i}}\end{array}$

if I use the following:

$\mathrm{tanh}(z)={\displaystyle \frac{\mathrm{sinh}(z)}{\mathrm{cosh}(z)}}={\displaystyle \frac{{e}^{z}-{e}^{-z}}{{e}^{z}+{e}^{-z}}}={\displaystyle \frac{{e}^{2z}-1}{{e}^{2z}+1}}$

and put $z={L}_{i}/2$, then

$\begin{array}{}\text{(2)}& \mathrm{tanh}({L}_{i}/2)={\displaystyle \frac{{e}^{{L}_{i}}-1}{{e}^{{l}_{i}}+1}}\end{array}$

how do I arrive at (2) using (1a)

Let us define

${L}_{i}\triangleq \mathrm{log}\left({\displaystyle \frac{Prob({x}_{i}=+1)}{Prob({x}_{i}=-1)}}\right)$

$E\{{x}_{i}\}\triangleq Prob({x}_{i}=+1)-Prob({x}_{i}=-1)$

I need to show that

$E\{{x}_{i}\}=\mathrm{tanh}({L}_{i}/2)$

I can write

$\begin{array}{}\text{(1a)}& E\{{x}_{i}\}& ={e}^{log(Prob({x}_{i}=+1)-Prob({x}_{i}=-1))}\text{(1b)}& & ={e}^{{L}_{i}}\end{array}$

if I use the following:

$\mathrm{tanh}(z)={\displaystyle \frac{\mathrm{sinh}(z)}{\mathrm{cosh}(z)}}={\displaystyle \frac{{e}^{z}-{e}^{-z}}{{e}^{z}+{e}^{-z}}}={\displaystyle \frac{{e}^{2z}-1}{{e}^{2z}+1}}$

and put $z={L}_{i}/2$, then

$\begin{array}{}\text{(2)}& \mathrm{tanh}({L}_{i}/2)={\displaystyle \frac{{e}^{{L}_{i}}-1}{{e}^{{l}_{i}}+1}}\end{array}$

how do I arrive at (2) using (1a)

Answer & Explanation

jugf5

Expert

2022-07-05Added 18 answers

Where you went wrong is here:

$\mathrm{log}(A/B)\ne \mathrm{log}(A-B).$

Observe that

${L}_{i}\triangleq \mathrm{log}\left({\displaystyle \frac{Prob({x}_{i}=+1)}{Prob({x}_{i}=-1)}}\right)$

$E\{{x}_{i}\}\triangleq Prob({x}_{i}=+1)-Prob({x}_{i}=-1)$

$\mathrm{tanh}\left(\frac{{L}_{i}}{2}\right)=\frac{{e}^{{L}_{i}}-1}{{e}^{{L}_{i}}+1}=\frac{{\displaystyle \frac{Prob({x}_{i}=+1)}{Prob({x}_{i}=-1)}}-1}{{\displaystyle \frac{Prob({x}_{i}=+1)}{Prob({x}_{i}=-1)}}+1}=\frac{Prob({x}_{i}=+1)-Prob({x}_{i}=-1)}{Prob({x}_{i}=+1)+Prob({x}_{i}=-1)}.$

Assuming the only two events are ${x}_{i}=+1$ and ${x}_{i}=-1$, we have

$Prob({x}_{i}=+1)+Prob({x}_{i}=-1)=1.$

Therefore,

$\mathrm{tanh}\left(\frac{{L}_{i}}{2}\right)=E\{{x}_{i}\}.$

$\mathrm{log}(A/B)\ne \mathrm{log}(A-B).$

Observe that

${L}_{i}\triangleq \mathrm{log}\left({\displaystyle \frac{Prob({x}_{i}=+1)}{Prob({x}_{i}=-1)}}\right)$

$E\{{x}_{i}\}\triangleq Prob({x}_{i}=+1)-Prob({x}_{i}=-1)$

$\mathrm{tanh}\left(\frac{{L}_{i}}{2}\right)=\frac{{e}^{{L}_{i}}-1}{{e}^{{L}_{i}}+1}=\frac{{\displaystyle \frac{Prob({x}_{i}=+1)}{Prob({x}_{i}=-1)}}-1}{{\displaystyle \frac{Prob({x}_{i}=+1)}{Prob({x}_{i}=-1)}}+1}=\frac{Prob({x}_{i}=+1)-Prob({x}_{i}=-1)}{Prob({x}_{i}=+1)+Prob({x}_{i}=-1)}.$

Assuming the only two events are ${x}_{i}=+1$ and ${x}_{i}=-1$, we have

$Prob({x}_{i}=+1)+Prob({x}_{i}=-1)=1.$

Therefore,

$\mathrm{tanh}\left(\frac{{L}_{i}}{2}\right)=E\{{x}_{i}\}.$

Most Popular Questions