## 3 Proposed Channel-Quality Aware Query Tree Algorithm
### The CAQT Algorithm
If the efficiency of retransmission is higher than that of splitting, as shown in Line 13-19, the reader will ask the tag to retransmit immediately. Otherwise, as shown in Line 20-29, the reader will adopt the query tree algorithm to split the tag for collision resolution. Regarding the efficiency of retransmission, \(\text{E}_{rtx}\big{(}\widetilde{m},\widetilde{PER}\big{)}\) is calculated by:  
\[\text{E}_{rtx}\Big{(}\widetilde{PER},\widetilde{m}\big{)}=\sum_{r=1}^{ \widetilde{m}}\left(1/(\sum_{k=1}^{\infty}k\times(1-\text{P}_{rtx})\times( \text{P}_{rtx})^{k-1})\right) \tag{6}\]  
where \(\text{P}_{rtx}\) is the probability of successful retransmission in current slot and \(k\) is the slots used in the \(k\)-th retransmission. Therefore, \(k\times(1-\text{P}_{rtx})\times(\text{P}_{rtx})^{k-1}\) is the expected used slot given that the tag is successfully identified in \(k\)-th retransmission, and \(\sum\limits_{k=1}^{\infty}k\times(1-\text{P}_{rtx})\times(\text{P}_{rtx})^{k-1}\) is the expected number of slots to successfully retransmit a tag. Furthermore, \(P_{rtx}\) is the probability that has \(r\) tags successfully transmit in current slot and remaining (\(r-1\)) tags suffer channel error, which is deduced by:  
\[\text{P}_{rtx}=\left( \begin{array}{c}r\\ 1\end{array} \right)\times\left(1-\widetilde{PER}\right)\times\widetilde{PER}^ {r-1} \tag{7}\]  
It should be noted that, if the reader still detects the unreadable slot after asking the tag to transmit, the reader will regard the unreadable slot is more likely due to collision rather than channel error. Then the reader will split the tag follows the procedure of the query tree-based algorithm to resolve the collision, as shown in Line 16-19. The efficiency of splitting the tags by query tree-based algorithm, \(\mathrm{E}_{spl}\left(\widetilde{m},\widetilde{PER}\right)\), is the expected slots to resolve the \(\widetilde{m}\) collided tags and is calculated by:  
\[\mathrm{E}_{spl}\left(\widetilde{PER},\widetilde{m}\right)=\frac{\widetilde{m }}{\mathrm{S}\left(\widetilde{PER},\widetilde{m}\right)}, \tag{8}\]  
where \(\mathrm{S}\left(\widetilde{PER},\widetilde{m}\right)\) is the total number of slots which use to recognize \(\widetilde{m}\) tags and can be recursively estimated by:  
\[\mathrm{S}\left(\widetilde{PER},\widetilde{m}\right)=\left\{ \begin{array}{ll} 1&,\widetilde{m}=1\\ \sum\limits_{i=1}^{\widetilde{m}}\sum\limits_{j=0}^{\widetilde{m}}\left(1+ \mathrm{S}(\widetilde{PER},j)\right)\times\left(\begin{array}{c}\widetilde{ m}\\ j\end{array}\right)\times\left(\begin{array}{c}\widetilde{m}\\ j\end{array}\right)^{j}\times\left(1-\frac{1}{\widetilde{m}}\right)^{ \widetilde{m}-j},\widetilde{m}>1\end{array} \right. \tag{9}\]  
where \(\left( \begin{array}{c}\widetilde{m}\\ j\end{array} \right)\times\left( \begin{array}{c}\frac{1}{m}\end{array}  \right)^{j}\times\left(1-\frac{1}{\widetilde{m}}\right)^{\widetilde{m}-j}\) the probability of j tags transmits in \(i\)-th slot. It should be noted that the number of slots applied to split the tags should be equal to the number of estimated collided tags ideally [33; 34]. Therefore, there are \(\widetilde{m}\) slots applied in current tag-splitting procedure. In addition, as shown in Line 23-24 of Figure 8, when only one slot is readable and remaining slots are idle, this means the previous unreadable slot is due to channel error rather than collision. Therefore, the \(\widetilde{PER}\) should be updated by the procedure described in Section 3.1. However, it should be noted that the time complexity of CAQT in the worst case scenario is \(n\times(k+2-\ln n)\)[35] if all unreadable slots are due to collision.