## 5 Performance Analysis
### Proof of Cluster Heads Expectation  
**Theorem 1**.: _The expected number of CHs per round in PEAFC-CL is \(k_{r}\), \(k_{r}=c\%N_{active}\)._  
**Proof:** Based on the CH selection strategy, the expected number of CHs formed in each round is:  
\[E(N_{CH})=\sum_{i=0}^{n}p_{i}G_{i}(t) \tag{20}\]  
Figure 6: Analysis of message complexity.  
where \(p_{i}\) is the probability of node \(i\) being selected as the CH in the current round. It can be known from the window size of the node-generating random number (_i.e._, \(W_{r}\)) and its own contrast threshold \(T_{i}(t)\), that: \[\begin{array}{l}p_{i}=\frac{T_{i}(t)-0}{W_{r}-0}\\ =\frac{T^{*}_{n}(t)\left[\beta\frac{T_{i}}{r_{\max}}\times(1-\beta)\frac{M_{i} \times r_{\max}}{R_{r}\max}\right]-0}{\beta\frac{T_{i}}{R_{r}\max}+(1-\beta) \frac{M_{r}\times r_{\max}}{R_{r}\max}-0}\\ =T^{\prime}_{n}(t)\frac{\beta E_{i}\times r_{\max}M_{r}\max+(1-\beta)M_{i} \times r_{\max}}{\beta E_{r}\times r_{\max}M_{r}\max+(1-\beta)M_{r}\times r_{ \max}}\end{array}\] (21) Set: \[H_{i}=\frac{\beta E_{i}\times curr}{\beta E_{r}\times M_{r}\max+(1-\beta)M_{i} \times curr}{\beta E_{r}\times overM_{r}\max+(1-\beta)M_{r}\times neverE_{r} \times\max}\] (22) we have: \[E(N_{CH})=\sum_{i=0}^{n}p_{i}G_{i}(t)=\frac{k_{r}\sum_{i=0}^{n}\left(H_{i}G_{ i}(t)\right)}{N_{active}-k_{r}(r\text{mod}\left[N_{active}/k_{r}\right]}\] (23)  
1. When \(r\text{mod}\left[N_{active}/k_{r}\right]=0\), there are \(\forall i\in(1,2,\cdots n)\) and \(G_{i}(t)=1\). At the current time of the network, the sum of the residual energy of all nodes is equal to \(N_{active}\) times the average energy, that is: \[\sum_{i=0}^{n}E_{i}\times curr}=N_{active}E_{r}\times\] (24) and \(\sum_{i=0}^{n}M_{i}\times curr}=N_{active}M_{r}\times\); thus, when \(r=0\) for the first round of a cycle, the expected number of CHs in the network is \(k_{r}\): \[E(N_{CH})=\frac{k_{r}\sum_{i=0}^{n}\left(H_{i}G_{i}(t)\right)}{N_{active}-k_{r }(r\text{mod}\left[N_{active}/k_{r}\right]}=\frac{k_{r}N_{active}}{N_{active} }=k_{r}\] (25)
2. When \(r\text{mod}\left[N_{active}/k_{r}\right]=1\), that is, \(k_{r}\) nodes are selected as CHs after one round, there is \(\sum_{i=0}^{n}\left(H_{i}G_{i}(t)\right)=N_{active}-k_{r}\): \[E(N_{CH})=\frac{k_{r}(N_{active}-k_{r})}{N_{active}-k_{r}}=k_{r}\] (26)
3. When \(r\text{mod}\left[N_{active}/k_{r}\right]=m\) and \(m>1\), that is, \(m\cdot k_{r}\) nodes are selected as the CH after \(m\) rounds, there is: \[\sum_{i=0}^{n}\left(H_{i}G_{i}(t)\right)=N_{active}-mk_{r}\] (27) therefore: \[E(N_{CH})=\frac{k_{r}(N_{active}-mk_{r})}{N_{active}-mk_{r}}=k_{r}\] (28) Therefore, in this paper, the expected number of CHs formed in each round is \(k_{r}\). A statistical overview of the number of CHs with different numbers of active nodes is given in Figure 7; the statistical analysis is given in Table 1. Considering the variance, the number of CHs for 60 nodes is relatively close to the theoretical value and also relatively stable.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Analytical CHs Expectation** & **Simulated CHs Expectation** & **Variance** \\ \hline \(N=100\) & 5 & 5.011 & 0.64 \\ \(N=80\) & 4 & 4.010 & 0.53 \\ \(N=60\) & 3 & 2.992 & 0.45 \\ \hline \hline \end{tabular}
\end{table}
Table 1: The analysis of cluster heads expectation.