# Exploiting Outage and Error Probability
## 3 System Performance Analysis and Our Proposed Cooperative Routing Protocols
### Error Probability  
In this section, closed-form expressions for error probability of incremental relaying with cooperative retransmissions has been derived for AF relaying. The average un-conditional error probability, \(P(e)\) is given as [15]:  
\[P(e)=Pr(\gamma_{SD}\leq\gamma_{0})\times P_{dig}(e)+(1-Pr(\gamma_{SD}\leq \gamma_{0}))\times P_{direct}(e) \tag{20}\]  
Figure 3: \(P_{out}\) of incremental relaying with cooperative retransmissions. The first term, \(Pr(\gamma_{SD}\leq\gamma_{0})\times P_{div}(e)\), in the above equation represents that the error occurs in the direct transmission and assistance from relays is needed. The fading is Rayleigh distributed, therefore, \(\gamma_{SD}\) follows exponential distribution. Hence \(Pr(\gamma_{SD})\) is written as:  
\[Pr(\gamma_{SD}\leq\gamma_{0})=1-exp(-\frac{\gamma_{0}}{\gamma_{SD}}) \tag{21}\]  
Here \(\gamma_{SD}\) is the SNR between S and D. \(P_{div}(e)\) in Equation (20) represents the average probability that an error occurs in the combined diversity transmission from S and R to the D. \(P_{direct}(e)\) represents the probability of error at D given that direct transmission is successful and relay's assistance is not required. The conditional error probability takes the form of \(a\times erfc(\sqrt{b\gamma_{SD}})\), with \(erfc(x)\) is the error function defines as \(erfc(x)=(2/\pi)\int_{0}^{\infty}exp(-x^{2})\ dx)\) and (a,b) are constants. For BPSK: a = 0.5 and b = 1. Hence, \(P_{direct}(e)\) can be written as  
\[P_{direct}(e)=\int_{0}^{\infty}a\times erfc(\sqrt{b\gamma})f_{\gamma_{SD}}( \gamma|\gamma_{SD}>\gamma_{0})\ d\gamma \tag{22}\]  
where, \(f_{\gamma_{SD}}(\gamma|\gamma_{SD}>\gamma_{0})\) is the conditional PDF of \(\gamma_{SD}\) given that \(\gamma_{SD}\) is greater than the threshold \(\gamma_{0}\). The conditional PDF, \(f_{\gamma_{SD}}(\gamma|\gamma_{SD}>\gamma_{0})\), for \(\gamma>\gamma_{0}\) is found as:  
\[f_{\gamma_{SD}}(\gamma|\gamma_{SD}>\gamma_{0})=\frac{exp(\gamma_{0}/\tilde{ \gamma}_{SD})}{\tilde{\gamma}_{SD}}exp(\frac{-\tilde{\gamma}}{\tilde{\gamma}_ {SD}}) \tag{23}\]  
The closed-form expression for \(P_{direct}(e)\), after substituting Equation (23) into Equation (22), solving the integration and doing some required manipulations, is written as:  
\[P_{direct}(e)=a\ erfc(\sqrt{b\gamma_{0}})-a\ exp(\frac{\gamma_{0}}{\tilde{ \gamma}_{SD}})\times\sqrt{\frac{b\tilde{\gamma}_{SD}}{1+b\tilde{\gamma}_{SD} }}\ erfc(\sqrt{\gamma_{0}(b+1/\tilde{\gamma}_{SD})}) \tag{24}\]  
If the destination needs assistance from relays, the signals are combined at D using MRC. To calculate \(P_{div}(e)\), we need to know the output SNR at D. The output SNR at D will be sum of direct signal, \(\gamma_{SD}\) and relayed signals. For incremental relaying cooperative retransmissions, \(P_{div}(e)\) will have three cases. **Case 1**: \((\gamma_{SD}\leq\gamma_{0})\)  
In this case, the relay, \(R_{1}\), performs re-transmission given that direct transmission is not successful. In this case, \(\gamma_{d}=\gamma_{SD}+\gamma_{R_{1}}\), where \(\gamma_{d}\) represents output SNR at D and \(\gamma_{R_{i}}\) is defined in Equation (B2). \(P_{div}(e)\) can be written as  
\[P_{div}(e)=\int_{0}^{\infty}a\times erfc(\sqrt{bz})f_{\gamma_{d}}(z|\gamma_{SD }\leq\gamma_{0})\ dz \tag{25}\]  
\(\gamma_{d}\) is a random variable whose PDF is the convolution of the PDFs of \(\gamma_{SD}\) and \(\gamma_{R_{1}}=f_{\gamma_{1}}\). \(f_{\gamma_{1}}\) is derived in Appendix B in Equation (B3). The conditional PDF of output SNR at D, \(f_{\gamma_{d}}(z|\gamma_{SD}\ \leq\ \gamma_{0})\) is derived as:  
\[f_{\gamma_{d}}(z|\gamma_{SD}\leq\gamma_{0}) = \frac{f_{\gamma_{SD}}(z)*f_{\gamma_{R_{1}}}(z)}{Pr[\gamma_{SD} \leq\gamma_{0}]} \tag{26}\] \[= \frac{exp(-z/\tilde{\gamma}_{R_{1}})-exp(-z/\tilde{\gamma}_{SD}) }{(\tilde{\gamma}_{R_{1}}-\tilde{\gamma}_{SD})(1-exp(-\gamma_{0}/\tilde{ \gamma}_{SD}))},\hskip 36.135 ptif\ \ z\leq\gamma_{0}\]where, \(Pr[\gamma_{SD}\leq\gamma_{0}]\) is defined in Equation (21).