# Combined Access Barring Scheme for IoT Devices Using Bayesian Estimation
## 3 The Proposed Technique: Combined Access Barring
### Estimation on \(u\)  
As already explained that the eNodeB does not have the information on the number of active devices \(u\), in order to calculate optimal \(p\) and in turn maximize success probability, the eNodeB needs to have estimation on \(u\). The eNodeB can observe the number of successful and idle preambles in each time slot, then the eNodeB needs to calculate \(E[u](i,s)]\) which can be written as:  
\[E[u](i,s)]=\sum_{u=0}^{\infty}uP(u|(i,s)) \tag{9}\]  
where \(P(u|(i,s))\) is the probability of having \(u\) active users if the number of idle and successful preambles are \(i\) and \(s\) respectively. This probability can be written as follows:  
\[P(u|(i,s))=\frac{P(u,i,s)}{P(i,s)} \tag{10}\]  
where \(P(i,s)\) is the probability that \(i\) idle and \(s\) successful preambles are transmitted and can be written as:  
\[P(i,s)=\sum_{u=0}^{\infty}P(u,i,s) \tag{11}\]  
We can write \(P(u,i,s)\) as follows:  
\[P(u,i,s)=P((i,s)|u)P(u)=\sum_{v=0}^{u}P((i,s)|v)P(v|u)P(u) \tag{12}\]  
\(P((i,s)|u)\) in (12) is the aposteriori probability in Bayesian rule while \(P(u)\) is the apriori probability. After taking \(P(u)\) as apriori probability, the information is then used to get the observation on \(i\) and \(s\). To evaluate (12) in each time slot, \(P(u)\) is required for each time slot. With increase in the number of IoT devices, finding \(P(u)\) for each user is quite time consuming and computationally inefficient. So we assume \(P(u)\) to be Poisson distributed and can be written as:  
\[P(u)=\frac{x^{u}}{x!}e^{-x} \tag{13}\]where \(x=E[P(u)]\) is the mean of the Poisson distribution. Now we can rewrite (2) as follows:  
\[P\left(S_{m}\right)=\sum_{u=0}^{\infty}\sum_{v=0}^{u}P\left(S_{m}|v\right)P\left( v|u\right)P(u)=\frac{xp}{R}e^{-\frac{xp}{R}} \tag{14}\]  
Similarly (6) and (8) can be written as follows:  
\[E[S]=xpe^{-\frac{xp}{R}} \tag{15}\]  
\[p=\min\left(1,\frac{R}{x}\right) \tag{16}\]  
We can see from (16) that the estimation on \(P(u)\) comes down to estimating the mean of the backlog distribution or \(x\) which means that in each time slot, instead of finding exact probability distribution, we find the mean of the distribution. Finding the mean of distribution instead of actual distribution \(P(u)\) is termed as pseudo-Bayesian instead of Bayesian [20]. Now we need to find \(P(u,i,s)\) and \(P(i,s)\) in order to evaluate \(P(u|(i,s))\) and \(E[u|(i,s)]\) as in (10) and (9). Let us now find \(P((i,s)|v)\) to evaluate (12) and (11). This probability depends on choosing \(i\) idle and \(s\) success preambles among \(R\). Among \(R\) there are \(\binom{R}{i+s}\) ways to choose idle and success preambles and among \(i+s\) there are \(\binom{i+s}{s}\) ways to select success preambles among \(i+s\). Since for success, there must be one IoT devices for one preamble, then there are \(\binom{s}{s}\) ways to choose successful IoT devices among \(v\) and then these successful devices can be randomly chosen in \(s!\) ways. If \(s\) preambles are successful among \(R\), then the remaining \(R-i-s\) should neither have success nor they can remain idle. Combining all these statements, we can write the expression of \(P((i,s)|v)\) as follows:  
\[P((i,s)|v)=\frac{1}{R^{v}}\left[\binom{R}{i+s}\binom{i+s}{s}\binom{v}{s}s! \left(R-i-s\right)^{v-s}\right]P_{col}(R-i-s,v-s) \tag{17}\]  
where \(R^{v}\) is the number of every possible ways for \(v\) IoT devices to select among \(R\) preambles randomly and \(P_{col}(R-i-s,v-s)\) is the probability of collision in \(R-i-s\) channels when \(v-s\) IoT devices try to transmit.