## 4 Known Number of Processes Multichannel Naming with Beeps
Because the leader processes of each group run the TN algorithm simultaneously, the time complexity for the algorithm is \(\mathcal{O}(n\log n)\) rounds. Two cases need to be examined to calculate the time complexity. If the number of processes \(n\) is the same for all groups, then the time complexity is \(\mathcal{O}(n\log n)\) rounds. Otherwise, the time complexity is \(\mathcal{O}(n_{i}\log n_{i})\) rounds, where \(i\) is the group with the highest number of processes. **Theorem 3**. : _The Multichannel Beep Naming algorithm terminates with a time complexity of \(\mathcal{O}(n\log n)\) rounds, and when it terminates, all processes are assigned unique names from the range \((1,N)\)._  
Proof. : Initially, from Theorems 1 and 2 it is known that all processes in each group are assigned unique names from the range \((1,n_{j})\) where \(1\leq j\leq k\), and that the leader process of each group knowsabout the termination of the SGBN algorithm for all other groups. Therefore, all processes in Group 1 are assigned unique names in the range \((1,n_{1})\), where \(n_{1}\) is the number of processes in Group 1. Next, it is demonstrated that when the number of processes is sent by the leader process of group \(x\) to the next group in the sequence, the combined names of the processes in the two groups form a unique set of names in the range \((1,n_{y})\), where \(n_{y}\) is the total number of processes for all groups from 1 to \(n_{x+1}\). In the multichannel naming algorithm, each group apart from Group 1 waits until the total number of processes is received. The leader of Group 1 immediately begins the transmission of the total number of processes \(n_{1}\) to the next group in sequence, which is Group 2. The leader process transforms \(n_{1}\) into its binary form and sends it using the previously described binary deep encoding. When the processes of Group 2 receive the number of processes, each process updates its name by adding the total number of processes \(n_{1}\) received from Group 1 to its name. Now, all processes in Groups 1 and 2 are assigned unique names in the range \((1,(n_{1}+n_{2}))\). Next, it is illustrated that, when the leader process of group \(x\) sends the total number of processes to group \(x+1\), the combined names of all processes in all groups from 1 to \(x+1\) are unique. When the processes of group \(x+1\) receive the total number of processes of all groups from 1 to \(x\), each process that is a part of group \(x+1\) updates its name by adding the total number of processes. This results in the assignment of new unique names for the processes in group \(x+1\). All processes in all groups are assigned unique names in the range \((1,n_{z})\), where \(n_{z}\) is the total number of processes for all groups from 1 to \(x+1\). Finally, it is demonstrated that all processes in all groups from 1 to \(k\) are assigned unique names in the range \((1,N)\), where \(N=\sum_{i=1}^{k}n_{i}\). It was proved that when the leader process of group \(x\) sends the total number of processes to group \(x+1\), the combined names of all processes are assigned unique names. Therefore, when the leader process of group \(k-1\) sends the total number of processes to group \(k\), the processes in group \(k\) update their names, which results in unique names that are different from the existing names in the groups \((1,(k-1))\). Thus, all processes in all groups are assigned unique names from the range \((1,N)\), which completes the uniqueness part of the proof. Next, the expected number of rounds needed to finish assigning unique names to all process in all groups \((1,k)\) is computed. The time complexity for the MGR algorithm is computed as the total sum of rounds needed to transmit the number of processes from each group. The binary representation of each number is transmitted using \(\log n+1\) rounds. The number of rounds required to finish forming a consecutive set of unique names is \((k-1)(\log n+1)\) rounds. Thus, the time complexity of the second part of the naming algorithm is \(\mathcal{O}(n\log n)\) rounds.