## 4 Interactive Compression
### Interactive compression of books.
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{3}{*}{**Book Title**} & \multirow{3}{*}{**Original**} & \multicolumn{3}{c}{**Interactive Protocol**} & \multirow{3}{*}{**Zip**} & \multicolumn{2}{c}{**Gzip**} \\ \cline{3-3}  & & \multicolumn{2}{c}{**(12 bits hash)**} & & & \\ \cline{3-3}  & & \multicolumn{1}{c}{**Dimensions**} & \multicolumn{1}{c}{**Compressed**} & \multicolumn{1}{c}{**Compression**} & \multicolumn{1}{c}{**Compressed**} & \multicolumn{1}{c}{**Compression**} & \multicolumn{1}{c}{**Compressed**} & \multicolumn{1}{c}{**Compression**} \\  & & \multicolumn{1}{c}{**size**} & \multicolumn{1}{c}{**ratio**} & \multicolumn{1}{c}{**size**} & \multicolumn{1}{c}{**ratio**} & \multicolumn{1}{c}{**size**} & \multicolumn{1}{c}{**ratio**} \\ \hline
**Angeli e demoni** & 948.3 KB & 334.7 KB & 2.83 & 353.3 KB & 2.68 & 339.1 KB & 2.78 \\ \hline
**Decamerone** & 1,638.2 KB & 544.6 KB & 3.00 & 577.2 KB & 2.83 & 551.7 KB & 2.96 \\ \hline
**Gomorra** & 663.0 KB & 240.2 KB & 2.76 & 251.4 KB & 2.63 & 241.3 KB & 2.74 \\ \hline
**Promessi Sposi** & 1,394.9 KB & 490.1 KB & 2.84 & 520.2 KB & 2.68 & 498.5 KB & 2.79 \\ \hline
**Uomini che** & & & & & & \\
**odiano le donne** & 1,093.5 KB & 373.9 KB & 2.92 & 405.6 KB & 2.69 & 388.1 KB & 2.81 \\ \hline
**20,000 Leagues** & & & & & & \\
**Under The Sea** & 875,5 KB & 306.2 KB & 2.85 & 336.1 KB & 2.60 & 323.4 KB & 2.70 \\ \hline
**The Wealth Of** & 2,273.1 KB & 602.9 KB & 3.77 & 688.1 KB & 3.30 & 652.8 KB & 3.48 \\ \hline
**Catcher in the** & 384.3 KB & 122.4 KB & 3.13 & 131.5 KB & 2.92 & 125.6 KB & 3.05 \\
**Rye** & 937.4 KB & 288.2 KB & 3.25 & 326.3 KB & 2.87 & 310.1 KB & 3.02 \\
**Bell Tolls** & 935.3 KB & 310.8 KB & 3.00 & 342.3 KB & 2.73 & 324.8 KB & 2.87 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Compression results. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Angeli e**} & \multirow{2}{*}{**Deca- demoni**} & \multirow{2}{*}{**Demora**} & \multirow{2}{*}{**Sposi**} & \multirow{2}{*}{**Uomini**} & \multirow{2}{*}{**20000**} & **The Wealth** & **Catcher** & **For Whom** & **The Grapes** \\  & & & & **che odiano** & & **Leques** & **Of Nations** & **in the** & **The Bell** & **Of Wrath** \\ \hline
**Decamerone** & 1,638.2 KB & 544.6 KB & 3.00 & 577.2 KB & 2.83 & 551.7 KB & 2.96 \\ \hline
**Gomorra** & 663.0 KB & 240.2 KB & 2.76 & 251.4 KB & 2.63 & 241.3 KB & 2.74 \\ \hline
**Promessi Sposi** & 1,394.9 KB & 490.1 KB & 2.84 & 520.2 KB & 2.68 & 498.5 KB & 2.79 \\ \hline
**Uomini che** & & & & & & & \\
**odiano le donne** & 1,093.5 KB & 373.9 KB & 2.92 & 405.6 KB & 2.69 & 388.1 KB & 2.81 \\ \hline
**20,000 Leagues** & & & & & & & \\
**Under The Sea** & 875,5 KB & 306.2 KB & 2.85 & 336.1 KB & 2.60 & 323.4 KB & 2.70 \\ \hline
**The Wealth Of** & 2,273.1 KB & 602.9 KB & 3.77 & 688.1 KB & 3.30 & 652.8 KB & 3.48 \\ \hline
**Catcher in the** & 384.3 KB & 122.4 KB & 3.13 & 131.5 KB & 2.92 & 125.6 KB & 3.05 \\
**Rye** & 937.4 KB & 288.2 KB & 3.25 & 326.3 KB & 2.87 & 310.1 KB & 3.02 \\
**Bell Tolls** & 935.3 KB & 310.8 KB & 3.00 & 342.3 KB & 2.73 & 324.8 KB & 2.87 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Compression errors. In our experiments the running time of the program that simulates the interaction (if we do not visualize on the computer monitor the messages describing the interaction) is fast enough to be of the same order of the gzip running time on the same input. These results are very encouraging: with this approach we have implicitly set a strong limit on the length of any matched string that is copied into the output stream (the maximum length of a match will be the length of the longest word in the static Receiver's dictionary) but nevertheless the results are competitive with respect to the standard zip and gzip compressors. Possible improvements are therefore foreseen if we allow the matches to have longer lengths. The price we pay is the possibility of communication errors.