# Spectrum Slicing for Multiple Access Channels with Heterogeneous Services
## 5 Non-Orthogonal Multiple Access
### Latency-Oriented System  
We now derive the distributions of the KPIs in the NOMA latency-oriented case. As for OMA, intermittent users maintain a queue of up to \(Q\) packets, and we can define the transition matrix \(\mathbf{P}^{(Q)}\) of the Markov chain representing the queue state of an intermittent user right after two successive transmission opportunities:  
\[P_{ij}^{(Q)}= \begin{cases}0&\text{if $j<i-1$;}\\ \text{Bin}(j-i+1;G,\alpha)&\text{if $i-1\leq j<Q-1$;}\\ \sum_{k=Q-i+1}^{G}\text{Bin}(k;G,\alpha)&\text{if $j=Q-1$.}\end{cases}  \tag{60}\]  
Using the same procedure as in (23), we can derive the steady-state distribution \(\mathbf{\pi}^{(0)}\), and then the value of \(\mathbf{\pi}^{(n)}\) in intermediate slots. We can then define the success probability and throughput for the broadband user  
\[p_{s,B} =\sum_{r=K}^{N}\text{Bin}(r;N,(1-\varepsilon_{B})(\pi_{0}^{(G-1)} )^{\frac{u_{l}}{\omega}}) \tag{61}\] \[S_{B} =\frac{Kp_{s,B}}{N}. \tag{62}\]  
We now analyze the latency for an intermittent user. As in the PAoI case, we consider an offset \(o\), with a set of possible transmissions \(\mathcal{T}_{o}(N)\) given by (39). Latency is composed of two parts, the waiting time \(W\) and the decoding time \(Y\). The waiting time is the time from the generation of the packet until it is transmitted, and the decoding time depends on when the frame from the broadband user is decoded. As it was done for the OMA case, we define the generation set \(\mathcal{G}_{\ell}^{(n)}\), which contains the possible numbers of arrivals in each transmission window after the generation of the considered one:  
\[\mathcal{G}_{\ell}^{(n)}=\{0,\ldots,G-n\}\times\{0,\ldots,G\}^{\ell-1}. \tag{63}\]  
The probability of each element in the set is given by:  
\[p_{\text{gen}}(\mathbf{g};\ell,n)=\text{Bin}(g_{1};G-n,\alpha)\prod_{i=2}^{ \ell}\text{Bin}(g_{i};G,\alpha). \tag{64}\]  
As we did for OMA, we define the set \(\mathcal{H}_{\ell}^{(n,\theta)}\), which contains the elements \(\mathbf{g}\in\mathcal{G}_{\ell}^{(n)}\) for which the considered packet is transmitted at the \(\ell\)-th opportunity, following the definitions we gave in (26) and (27). We compute the dropping probability for a packet generated in slot \(n\) with \(q\) packets ahead of it as such:  
\[p_{D}(n,q)=1-\sum_{\ell=1}^{q+1}\sum_{\mathbf{g}\in\mathcal{H}_{\ell}^{(n, \phi)}}p_{\text{gen}}(\mathbf{g};\ell,n). \tag{65}\]  
We can now compute \(p_{W}(w;n,q)\)  
\[p_{W}(w;n,q)=\frac{\sum_{\mathbf{g}\in\mathcal{H}_{\ell}^{(n,\phi)}}p_{\text{ gen}}\big{(}\mathbf{g};\big{\lfloor}\frac{w}{G}\big{\rfloor},n\big{)}}{1-p_{D}(n,q)} \delta\Big{(}w-G\Big{(}\Big{\lfloor}\frac{w}{G}\Big{\rfloor}+1\Big{)})+n\Big{)}. \tag{66}\]  
In order to compute \(Y\), we need to consider the fact that transmission opportunities before or after the one in which the packet is sent are used by the same user. We consider a packet generated in slot \(i\) in a frame with offset \(o\), which finds \(q\) packets ahead of it and waits for \(w\) slots before being transmitted. If the transmission is in the same frame as the packet generation, there might be \(C\) transmission opportunities unused by the user before the packet generation, whereas if the transmission is in a subsequent frame, the user is active in all transmission opportunities in the frame before the one in which the packet is transmitted, because it still has packets in the queue. We know that the offset of the frame in which the packet is transmitted is \(\omega_{\left\lfloor\frac{i+w}{N}\right\rfloor}(o)\), as given by (52). In the following, we will simply refer to this value as \(\omega\) to simplify the notation. We then have that \(C=0\) if \(i+w>N\), and in the other case we need to consider the possible events that happened before the generation of the considered packet. We now compute the pmf of \(C\). There are \(|\mathcal{T}_{o}(i-1)|\) transmission opportunities before the generation of the packet.