Abstract
Extending previous work on non-binary Fibonacci codes, a new ternary variant is proposed sharing the main features like robustness against errors and ease of encoding and decoding, while improving the compression efficiency relative to other ternary codes. The improvement is based on an increased density of the codes and also shown empirically on large textual examples. A motivation for d-ary codes, with \(d>2\), may be the emergence of future technologies that enable the representation of more than just two values in an atomic storage unit.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
References
Anisimov, A.V., Zavadskyi, I.O.: Variable-length prefix codes with multiple delimiters. IEEE Trans. Inf. Theory 63(5), 2885–2895 (2017)
Elias, P.: Universal codeword sets and representations of the integers. IEEE Trans. Information Theory 21(2), 194–203 (1975)
Even, S., Rodeh, M.: Economical encoding of commas between strings. Commun. ACM 21(4), 315–317 (1978)
Fagan, S., Gençay, R.: An introduction to textual econometrics. Handbook of Empirical Economics and Finance CRC Press, pp. 133–153 (2010)
Fraenkel, A.S.: Systems of numeration. In: 6th IEEE Symposium on Computer Arithmetic, ARITH 1983, Aarhus, Denmark, 20–22 June 1983, pp. 37–42 (1983)
Fraenkel, A.S., Klein, S.T.: Robust universal complete codes for transmission and compression. Discrete Appl. Math. 64(1), 31–55 (1996)
Huffman, D.A.: A method for the construction of minimum-redundancy codes. Proc. IRE 40(9), 1098–1101 (1952)
Klein, S.T.: Combinatorial representation of generalized Fibonacci numbers. Fibonacci Quart. 29(2), 124–131 (1991)
Klein, S.T., Kopel Ben-Nissan, M.: On the usefulness of Fibonacci compression codes. Comput. J. 53, 701–716 (2010)
Klein, S.T., Serebro, T.C., Shapira, D.: Generalization of Fibonacci codes to the non-binary case. IEEE Access 10, 112043–112052 (2022)
Moffat, A.: Word-based text compression. Softw. Pract. Exp. 19(2), 185–198 (1989)
Moffat, A., Turpin, A.: Compression and coding algorithms, the international series in engineering and computer science, vol. 669. Kluwer (2002)
Trogemann, G., Nitussov, A.Y., Ernst, W.: Computing in Russia: the history of computer devices and information technology revealed. Vieweg Braunschweig (2001)
Witten, I.H., Neal, R.M., Cleary, J.G.: Arithmetic coding for data compression. Commun. ACM 30(6), 520–540 (1987)
Zeckendorf, E.: Représentation des nombres naturels par une somme de nombres de Fibonacci ou de nombres de Lucas. Bull. Soc. R. Sci. Liège 41, 179–182 (1972)
Zipf, G.K.: Human behavior and the principle of least effort. Ravenio Books (1949)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Appendix: Encoding and decoding
Appendix: Encoding and decoding
For the encoding, Algorithm 1 assumes that a sequence of integers is given, and an array B is used to temporarily store the trits representing the current integer. The first step is to calculate the length of the representation, including the terminating delimiter 12 or 22, of a given integer x. According to Eq. (2), this will be the smallest \(\ell \) for which \(x\ge F_{2\ell -3}-1\), so that
where \(\phi =\frac{1+\sqrt{5}}{2}=1.618\) is the golden ratio, and we have used the fact that Fibonacci numbers are given by \(F_n=\frac{1}{\sqrt{5}}\phi ^n\), rounded to the nearest integer.
Once the length j is known, the relative index within the block of legal strings of length \(j-2\) is iteratively evaluated. Finally, the last two trits are set to 22 or 12 accordingly. Specifically, if \(B[r..j-2]=21^{j-2-r}\) with \(r\ge 1\) and \(j-2-r\ge 0\), then the suffix is 12, otherwise, it is 22.
The decoding procedure of Algorithm 2 works on an array A of trits assumed to contain the concatenated ternary representations of a sequence of integers. It accumulates the value of the current integer in a variable val. A variable status maintains the number of 2-trits, encountered while scanning the current ternary string, that could possibly belong to the suffix of the form \(21^s2\), with \(s\ge 0\), serving as delimiter. Once the end of the current string has been detected, we know the length of the encoding and val can be updated to account for the shorter strings, according to Eq. (2). Finally, val has to be adjusted because the last two trits, 12 or 22, do not belong to the representation.
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Klein, S.T., Shapira, D. (2023). Enhanced Ternary Fibonacci Codes. In: Nagy, B. (eds) Implementation and Application of Automata. CIAA 2023. Lecture Notes in Computer Science, vol 14151. Springer, Cham. https://doi.org/10.1007/978-3-031-40247-0_13
Download citation
DOI: https://doi.org/10.1007/978-3-031-40247-0_13
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-40246-3
Online ISBN: 978-3-031-40247-0
eBook Packages: Computer ScienceComputer Science (R0)