# CeRA-eSP: Code-Expanded Random Access to Enhance Success Probability of Massive MTC
## 4 Proposed Scheme
### Preamble Codeword Set Selection Algorithm
#### 4.1.3 PUSCH Timeout RATE Analysis Model  
To prevent redundant preamble codeword recording by the BS, the PUSCH waiting time is set as follows:  
\[W=\frac{M}{N_{max,fp}}, \tag{12}\]  
where \(N_{max,fp}\) denotes the maximum number of preamble sequences transmitted in the first RA slot. This prevents the transmission of the same preamble codewords, even when \(N_{max,fp}\) is fully utilized for every RAO.  
Let \(N_{de}(t)\) be the number of deduced preamble sets at time slot \(t\), \(N_{w}(t)\) be the cumulative number of waiting devices at time slot \(t\), and \(G(t)\) be the number of extra preamble codewords that cannot be served owing to the PUSCH limitations at time slot \(t\). In the initial time slot 1, the number of waiting devices at time 1 can be calculated as \(N_{w}(1)=max(0,N_{de}(1)-N_{ST})\), where \(N_{ST}\) is the allocable PUSCH resource, which has a fixed value of 144 [30]. If \(N_{w}(1)\) is not zero, it means that some of the preamble codewords cannot receive the RAR message at time \(t=1\) and need to receive PUSCH resources within the PUSCH waiting window \(W\). In addition, the PUSCH gain at time 1 can be calculated as \(G(1)=max(0,N_{de}(1)-N_{ST})\); at time slot 2, \(N_{w}(2)\) includes \(G(1)\) when extra preamble codewords exist at time slot \(t=11\); therefore, the number of waiting devices at time 1 can be calculated as \(N_{w}(2)=max(w,N_{de}(2)+G(1)-N_{ST})\). Furthermore, the PUSCH gain at time 2 can be calculated as \(G(2)=max(0,N_{de}(t)+G(1)-N_{ST})\). Therefore, the general formula for \(G(t)\) can be formulated as follows:  
\[G(t)=max(0,N_{de}(t)+G(t-1)-N_{ST}). \tag{13}\]  
At time slot \(t=W\) where the PUSCH waiting time has expired, \(N_{w}(t)\) includes the number of timeout preamble codewords \(N_{to}(t)\) as follows:  
\[N_{to}(t)=max(0,G(t-1)+N_{de}(t)-N_{ST}\cdot W), \tag{14}\]  
where \(G(t-1)+N_{de}\) is the device that waits to receive the RAR message at time slot \(t-1\), and \(N_{ST}\cdot W\) is the total allocable PUSCH resources between times \(t-W\) and \(t\).  
The number of waiting devices consists of three main components: the number of deduced preamble codewords, number of previous extra preamble codewords, and number of timeout preamble codewords. As the three aforementioned components are already defined in (10), (13), and (14), \(N_{w}(t)\) can be calculated as follows:  
\[N_{w}(t)=max(0,N_{de}(t)+G(t-1)-N_{ST}-N_{to}(t-W)). \tag{15}\]The reason that the number of timeout devices at time \(t-W\) is reflected in the waiting preamble codewords at time \(t\), is that the removal of the corresponding timeout preamble codewords from the waiting preamble codeword occurs after the PUSCH timeout window \(W\).  
Because the PUSCH timeout rate is the ratio of the number of timeout preamble codewords to the deduced preamble codewords, the PUSCH timeout rate in all time slots \(t\) can be calculated using (14) and (15) as follows:  
\[\mathcal{T}=\frac{N_{to}(t)}{N_{de}(t)}=\frac{max(0,max(0,N_{de}(t+W)+G(t+W)-N _{ST}-N_{to}(t))+N_{de}(t)-N_{ST}\cdot W)}{M\cdot N_{fp}\Big{(}1-\Big{(}1-\frac {1}{M}\Big{)}^{v}\Big{)}\Big{(}1-\Big{(}1-\frac{1}{N_{fp}}\Big{)}^{v}\Big{)}}. \tag{16}\]