## 3 The Lossless Adaptive Data Compression Method Based on the Binomial Number System (BNS)
### Methods for Converting Binary Sequences to Binomial Code and Vice Versa  
The binomial numbers of the binary sequences required in step 1 of the method (see Figure 1) are obtained after their preliminary conversion to equilibrium combinations. In a compressible binary sequence of code length \(n\), the number \(k=0\), \(1\), \(2\),..., \(n\) units are calculated. Thus, the binary sequence is transformed into a \(k\)-equilibrium code combination with code length \(n\) and \(k\) units. Then, by removing the units from the LSB to the first zero or zeros to the first unit, it is converted into a binomial length of \(m<n\) (see Figure 3). As a result of this conversion to a binomial number, the binary sequence is compressed by the \(n-m\). For an example of the implementation of step 1, the binary sequence 00111 of code length \(n=6\) is shown. After determining the number of units \(k=4\), it is converted into a combination of 0011110 of equilibrium code, as shown in Table 2.  
Deletion in 4 LSB of the code combinations containing units converts it to binomial code 00 with code length \(m=n-k=6-4=2\). Compression result \(n-m=4\). For an arbitrary binary sequence with code length \(n=1024\) and number of units \(k=224\), the number of zeros \(n-k=1024-224=800\). If it is 64 ones at its end, then after discarding them, the code length of the binomial code decreases to \(m=1024-64=960\) bits, which includes 800 zeros and 160 ones. The result of compression is 64 bits. The examples show that the result of the compression of the binary sequence in the first step largely depends on the number of zeros or ones in their continuous sequence located at LSB. Therefore, such compression is effective only in exceptional cases, such as binary television TV lines [23]. \begin{table}
\begin{tabular}{l l l l l l} \hline \hline \(\mathbf{N}\) & **Binomial Code** & **Binomial Numeric Function** & \(\mathbf{N}\) & **Binomial Code** & **Binomial Numeric Function** \\ \hline
0 & 00 & 0C\({}_{5}^{4}+0C_{6}^{4}\) & 8 & 10111 & 1C\({}_{5}^{4}+0C_{6}^{3}+1C_{6}^{3}+1C_{6}^{2}+1C_{6}^{1}\) \\
1 & 010 & 0C\({}_{5}^{4}+1C_{6}^{4}+0C_{6}^{3}\) & 9 & 1100 & 1C\({}_{5}^{4}+1C_{6}^{3}+0C_{6}^{2}+0C_{6}^{2}\) \\
2 & 0110 & 0C\({}_{5}^{4}+1C_{6}^{4}+1C_{6}^{3}+0C_{6}^{2}\) & 10 & 11010 & 1C\({}_{5}^{4}+0C_{6}^{3}+0C_{6}^{2}+1C_{6}^{2}+0C_{6}^{1}\) \\
3 & 01110 & 0C\({}_{5}^{4}+1C_{6}^{4}+1C_{6}^{3}+1C_{6}^{2}+0C_{6}^{1}\) & 11 & 11011 & 1C\({}_{5}^{4}+1C_{6}^{3}+0C_{6}^{2}+1C_{6}^{2}+1C_{6}^{1}\) \\
4 & 01111 & 0C\({}_{5}^{4}+1C_{6}^{4}+1C_{6}^{3}+1C_{6}^{2}+1C_{6}^{1}\) & 12 & 11100 & 1C\({}_{5}^{4}+1C_{6}^{3}+1C_{6}^{3}+0C_{6}^{1}+0C_{6}^{1}\) \\
5 & 100 & 1C\({}_{5}^{4}+0C_{6}^{3}+0C_{6}^{3}\) & 13 & 11101 & 1C\({}_{5}^{4}+1C_{6}^{3}+1C_{6}^{3}+0C_{6}^{2}+1C_{6}^{1}\) \\
6 & 1010 & 1C\({}_{5}^{4}+0C_{6}^{3}+1C_{6}^{3}+0C_{6}^{2}\) & 14 & 1111 & 1C\({}_{5}^{4}+1C_{6}^{3}+1C_{6}^{2}+1C_{6}^{2}\) \\
7 & 10110 & 1C\({}_{5}^{4}+0C_{6}^{4}+1C_{6}^{3}+1C_{6}^{2}+0C_{6}^{1}\) & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Binomial code with \(n=6\), \(k=4\). Figure 3: Obtaining binomial numbers. In most other cases, another compression step is needed, carried out by the numbering function of the BNS, which converts the binomial c of code length \(m\) into the corresponding binary number of the code length \(l\). However, the need to store or transmit the number of units \(k\) for its restoration increases the code length \(l\) of the compressed sequence per \(q=\log_{2}n\) bit, thereby reducing the compression effect to \(n-(l+q)=n-l-q\). In this case, \((l+q)\) may be greater than \(n\), and there will be no compression. However, for long binary sequences and small values of \(k\) and \(n>(l+q)\), which determines the compression effect. In Table 3, the binomial number 00 with code length \(m=2\) is replaced by the binary number 0000 of length \(l=4\). In this case, it is evident that \(l>m\).