Skip to main content

Enhanced Ternary Fibonacci Codes

  • Conference paper
  • First Online:
Implementation and Application of Automata (CIAA 2023)

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 49.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    http://pizzachili.dcc.uchile.cl/.

References

  1. Anisimov, A.V., Zavadskyi, I.O.: Variable-length prefix codes with multiple delimiters. IEEE Trans. Inf. Theory 63(5), 2885–2895 (2017)

    MathSciNet  MATH  Google Scholar 

  2. Elias, P.: Universal codeword sets and representations of the integers. IEEE Trans. Information Theory 21(2), 194–203 (1975)

    Article  MathSciNet  MATH  Google Scholar 

  3. Even, S., Rodeh, M.: Economical encoding of commas between strings. Commun. ACM 21(4), 315–317 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  4. Fagan, S., Gençay, R.: An introduction to textual econometrics. Handbook of Empirical Economics and Finance CRC Press, pp. 133–153 (2010)

    Google Scholar 

  5. 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)

    Google Scholar 

  6. Fraenkel, A.S., Klein, S.T.: Robust universal complete codes for transmission and compression. Discrete Appl. Math. 64(1), 31–55 (1996)

    Article  MATH  Google Scholar 

  7. Huffman, D.A.: A method for the construction of minimum-redundancy codes. Proc. IRE 40(9), 1098–1101 (1952)

    Article  MATH  Google Scholar 

  8. Klein, S.T.: Combinatorial representation of generalized Fibonacci numbers. Fibonacci Quart. 29(2), 124–131 (1991)

    MathSciNet  MATH  Google Scholar 

  9. Klein, S.T., Kopel Ben-Nissan, M.: On the usefulness of Fibonacci compression codes. Comput. J. 53, 701–716 (2010)

    Article  Google Scholar 

  10. Klein, S.T., Serebro, T.C., Shapira, D.: Generalization of Fibonacci codes to the non-binary case. IEEE Access 10, 112043–112052 (2022)

    Article  Google Scholar 

  11. Moffat, A.: Word-based text compression. Softw. Pract. Exp. 19(2), 185–198 (1989)

    Article  Google Scholar 

  12. Moffat, A., Turpin, A.: Compression and coding algorithms, the international series in engineering and computer science, vol. 669. Kluwer (2002)

    Google Scholar 

  13. Trogemann, G., Nitussov, A.Y., Ernst, W.: Computing in Russia: the history of computer devices and information technology revealed. Vieweg Braunschweig (2001)

    Google Scholar 

  14. Witten, I.H., Neal, R.M., Cleary, J.G.: Arithmetic coding for data compression. Commun. ACM 30(6), 520–540 (1987)

    Article  Google Scholar 

  15. 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)

    MathSciNet  MATH  Google Scholar 

  16. Zipf, G.K.: Human behavior and the principle of least effort. Ravenio Books (1949)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dana Shapira .

Editor information

Editors and Affiliations

Appendix: Encoding and decoding

Appendix: Encoding and decoding

figure h

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

$$\ell = \big \lfloor {\textstyle \frac{1}{2}}\log _{\phi }\big (\sqrt{5}(x+1)\big )+3\big \rfloor ,$$

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.

figure i

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics