# Energy-Efficient Device Discovery Mechanism for Device-to-Device Communications in 5G Networks +
## Appendix A Derivation of Probability \(p_{c}\)  
Let the BS of the considered cell be located at the origin of the Euclidean coordinate plane. Since the analysis of \(p_{c}\) is too complicated for a hexagonal cell, we consider the approximate circle whose radius \(\overline{R}\) is equal to the average of the inradius and exradius of the hexagonal cell, i.e., \(\overline{R}=(R+\frac{\sqrt{3}}{2}R)/2\). Next, since UEs are uniformly distributed over a cell, the joint probability density function (pdf) of the UE's coordinates \((x,y)\) is \(f(x,y)\)=\(1/(\pi\overline{R}^{2})\), where \(x^{2}\)+\(y^{2}\)\(\subset\)\(\overline{R}^{2}\). One can transform the joint pdf \(f(x,y)\) into a polar  
Figure 15: Impact of Wi-Fi AP interference on discovery success rate.  
coordinate system \(g(u,\theta)\)=\(u/(\pi\overline{R}^{2})\), where 0\(\leq\)\(u\)\(<\)\(\overline{R}\) and 0\(\leq\)\(\theta\)\(<\)2\(\pi\). Since the random variable of the angle \(\Theta\) is uniformly distributed over \((0,2\pi)\), the pdf of the angle \(\Theta\) is expressed by \(g_{\Theta}(\theta)\)=\(1/(2\pi)\). Notably, the random variables of the radius \(U\) and angle \(\Theta\) are independent, one has \(g(u,\theta)\)=\(g_{U}(u)g_{\Theta}(\theta)\), yielding the marginal pdf \(g_{U}(u)\)=\(2u/(\overline{R}^{2})\). Since the angle \(\Theta\) is a uniform distribution, the probability \(p_{c}\) is irrelevant to \(\Theta\). Thus, one can derive \(p_{c}\) under the case of \(\theta=\pi/2\), as shown in Figure 11, where the source UE is located at the center of the circle of radius \(d\). The probability \(p_{c}\) that two UEs of a D2D link are located within a circle of radius \(d\) is approximately expressed as follows  
\[p_{c} = \int_{0}^{\overline{R}}g_{U}(u)\Big{[}\frac{r_{1}}{r}\cdot\frac{ A_{i}(u)}{\pi\overline{R}^{2}}+\frac{r_{2}}{r}\cdot\frac{A_{o}(u)}{6\pi \overline{R}^{2}}\Big{]}du, \tag{11}\]  
where \(A_{i}(u)\) and \(A_{o}(u)\) represent the coverage areas of the circle of radius \(d\) inside and outside the considered cell, respectively. Since there are six cells adjacent to the considered cell, \(A_{o}(u)\) is divided by \(6\pi\overline{R}^{2}\) in (11). When \(u\)\(\leq\)\(\overline{R}\)\(-\)\(d\), \(A_{o}(u)\) equals zero. When \(u\)\(>\)\(\overline{R}\)\(-\)\(d\), \(A_{o}(u)\) can be approximated by \(d[(u+d)-\overline{R}]\), the area of the triangle indicated in Figure 11. Subsequently, one can derive \(p_{c}\) as follows  
\[p_{c} = \frac{2}{\overline{R}^{2}}\int_{0}^{\overline{R}-d}u\Big{(} \frac{r_{1}}{r}\Big{)}\Big{(}\frac{d^{2}}{\overline{R}^{2}}\Big{)}du \tag{12}\] \[+\frac{2}{\overline{R}^{2}}\int_{\overline{R}-d}^{\overline{R}}u \Big{(}\frac{r_{1}}{r}\Big{)}\Big{(}\frac{d^{2}}{\overline{R}^{2}}\Big{)} \Big{[}1-\frac{(u+d)-\overline{R}}{\pi d}\Big{]}du\] \[+\frac{2}{\overline{R}^{2}}\int_{\overline{R}-d}^{\overline{R}}u \Big{(}\frac{r_{2}}{r}\Big{)}\Big{(}\frac{d^{2}}{6\overline{R}^{2}}\Big{)} \Big{[}\frac{(u+d)-\overline{R}}{\pi d}\Big{]}du\] \[= \Big{(}\frac{r_{1}}{r}\Big{)}\Big{(}\frac{d^{2}}{\overline{R}^{2 }}\Big{)}\Big{[}1-\frac{1}{\pi}\Big{(}\frac{d}{\overline{R}}\Big{)}+\frac{1}{ 3\pi}\Big{(}\frac{d}{\overline{R}}\Big{)}^{2}\Big{]}\] \[+\Big{(}\frac{r_{2}}{r}\Big{)}\Big{(}\frac{d^{2}}{6\overline{R}^ {2}}\Big{)}\Big{[}\frac{1}{\pi}\Big{(}\frac{d}{\overline{R}}\Big{)}-\frac{1}{ 3\pi}\Big{(}\frac{d}{\overline{R}}\Big{)}^{2}\Big{]}.\]