Document Open Access Logo

Making Change in 2048

Author David Eppstein



PDF
Thumbnail PDF

File

LIPIcs.FUN.2018.21.pdf
  • Filesize: 498 kB
  • 13 pages

Document Identifiers

Author Details

David Eppstein
  • Computer Science Department, University of California, Irvine

Cite AsGet BibTex

David Eppstein. Making Change in 2048. In 9th International Conference on Fun with Algorithms (FUN 2018). Leibniz International Proceedings in Informatics (LIPIcs), Volume 100, pp. 21:1-21:13, Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2018)
https://doi.org/10.4230/LIPIcs.FUN.2018.21

Abstract

The 2048 game involves tiles labeled with powers of two that can be merged to form bigger powers of two; variants of the same puzzle involve similar merges of other tile values. We analyze the maximum score achievable in these games by proving a min-max theorem equating this maximum score (in an abstract generalized variation of 2048 that allows all the moves of the original game) with the minimum value that causes a greedy change-making algorithm to use a given number of coins. A widely-followed strategy in 2048 maintains tiles that represent the move number in binary notation, and a similar strategy in the Fibonacci number variant of the game (987) maintains the Zeckendorf representation of the move number as a sum of the fewest possible Fibonacci numbers; our analysis shows that the ability to follow these strategies is intimately connected with the fact that greedy change-making is optimal for binary and Fibonacci coinage. For variants of 2048 using tile values for which greedy change-making is suboptimal, it is the greedy strategy, not the optimal representation as sums of tile values, that controls the length of the game. In particular, the game will always terminate whenever the sequence of allowable tile values has arbitrarily large gaps between consecutive values.

Subject Classification

ACM Subject Classification
  • Theory of computation → Discrete optimization
Keywords
  • 2048
  • change-making problem
  • greedy algorithm
  • integer sequences
  • halting problem

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. Ahmed Abdelkader, Aditya Acharya, and Philip Dasler. On the complexity of slide-and-merge games. Electronic preprint arxiv:1501.03837, 2015. Google Scholar
  2. Ahmed Abdelkader, Aditya Acharya, and Philip Dasler. 2048 without new tiles is still hard. In Erik D. Demaine and Fabrizio Grandoni, editors, 8th International Conference on Fun with Algorithms, FUN 2016, June 8-10, 2016, La Maddalena, Italy, volume 49 of LIPIcs, pages 1:1-1:14. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 2016. URL: http://dx.doi.org/10.4230/LIPIcs.FUN.2016.1.
  3. Anna Adamaszek and Michal Adamaszek. Combinatorics of the change-making problem. Eur. J. Comb., 31(1):47-63, 2010. URL: http://dx.doi.org/10.1016/j.ejc.2009.05.002.
  4. Terry Beyer and D. F. Swinehart. Number of multiply-restricted partitions [A1] (algorithm 448). Commun. ACM, 16(6):379, 1973. URL: http://dx.doi.org/10.1145/362248.362275.
  5. Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms. MIT Press, 2009. Problem 16-1, p. 446. Google Scholar
  6. L. J. Cowen, Robert Cowen, and Arthur Steinberg. Totally greedy coin sets and greedy obstructions. Electronic Journal of Combinatorics, 15(1):RP90, 2008. URL: https://www.combinatorics.org/Volume_15/Abstracts/v15i1r90.html.
  7. Michael T. Goodrich and Roberto Tamassia. Algorithm Design and Applications. Wiley, 2015. Exercise A-12.1, p. 349. Google Scholar
  8. Lou Huang. 2048 Numberwang. Web applet. URL: https://louh.github.io/2048-numberwang/.
  9. Caleb Hugo. 2048 Circle of Fifths. Web applet. URL: https://calebhugo.com/musical-games-interact-with-sound/2048-circle-of-fifths/.
  10. Wojciech Jaśkowski. Mastering 2048 with delayed temporal coherence learning, multi-stage weight promotion, redundant encoding and carousel shaping. IEEE Transactions on Computational Intelligence and AI in Games, 2017. URL: http://dx.doi.org/10.1109/TCIAIG.2017.2651887.
  11. Dexter Kozen and Shmuel Zaks. Optimal bounds for the change-making problem. Theor. Comput. Sci., 123(2):377-388, 1994. URL: http://dx.doi.org/10.1016/0304-3975(94)90134-1.
  12. Stefan Langerman and Yushi Uno. Threes!, fives, 1024!, and 2048 are hard. In Erik D. Demaine and Fabrizio Grandoni, editors, 8th International Conference on Fun with Algorithms, FUN 2016, June 8-10, 2016, La Maddalena, Italy, volume 49 of LIPIcs, pages 22:1-22:14. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 2016. URL: http://dx.doi.org/10.4230/LIPIcs.FUN.2016.22.
  13. Florian Luca and Ravindranathan Thangadurai. On an arithmetic function considered by Pillai. Journal de Théorie des Nombres de Bordeaux, 21(3):693-699, 2009. URL: https://jtnb.cedram.org/item?id=JTNB_2009__21_3_693_0.
  14. M. J. Magazine, G. L. Nemhauser, and L. E. Trotter, Jr. When the greedy solution solves a class of knapsack problems. Operations Research, 23(2):207-217, 1975. URL: https://www.jstor.org/stable/169525.
  15. Kiminori Matsuzaki. Developing a 2048 player with backward temporal coherence learning and restart. In Mark H. M. Winands, H. Jaap van den Herik, and Walter A. Kosters, editors, Advances in Computer Games - 15th International Conferences, ACG 2017, Leiden, The Netherlands, July 3-5, 2017, Revised Selected Papers, volume 10664 of Lecture Notes in Computer Science, pages 176-187. Springer, 2017. URL: http://dx.doi.org/10.1007/978-3-319-71649-7_15.
  16. Rahul Mehta. 2048 is (PSPACE) hard, but sometimes easy. Electronic preprint arxiv:1408.6315, 2014. Google Scholar
  17. Giuseppe Melfi. On two conjectures about practical numbers. J. Number Theory, 56(1):205-210, 1996. URL: http://dx.doi.org/10.1006/jnth.1996.0012.
  18. Todd W. Neller. Pedagogical possibilities for the 2048 puzzle game. Journal of Computing Sciences in Colleges, 30(3):38-46, 2015. URL: https://dl.acm.org/citation.cfm?id=2675327.2675335.
  19. Kazuto Oka and Kiminori Matsuzaki. Systematic selection of n-tuple networks for 2048. In Aske Plaat, Walter A. Kosters, and H. Jaap van den Herik, editors, Computers and Games - 9th International Conference, CG 2016, Leiden, The Netherlands, June 29 - July 1, 2016, Revised Selected Papers, volume 10068 of Lecture Notes in Computer Science, pages 81-92. Springer, 2016. URL: http://dx.doi.org/10.1007/978-3-319-50935-8_8.
  20. David Pearson. A polynomial-time algorithm for the change-making problem. Oper. Res. Lett., 33(3):231-234, 2005. URL: http://dx.doi.org/10.1016/j.orl.2004.06.001.
  21. S. S. Pillai. An arithmetical function concerning primes. Annamalai University Journal, pages 159-167, 1930. As cited by Luca and Thangadurai [13]. Google Scholar
  22. Rebecca S. Portnoff, Linda N. Lee, Serge Egelman, Pratyush Mishra, Derek Leung, and David A. Wagner. Somebody’s watching me?: Assessing the effectiveness of webcam indicator lights. In Bo Begole, Jinwoo Kim, Kori Inkpen, and Woontack Woo, editors, Proceedings of the 33rd Annual ACM Conference on Human Factors in Computing Systems, CHI 2015, Seoul, Republic of Korea, April 18-23, 2015, pages 1649-1658. ACM, 2015. URL: http://dx.doi.org/10.1145/2702123.2702164.
  23. Philip Rodgers and John Levine. An investigation into 2048 AI strategies. In 2014 IEEE Conference on Computational Intelligence and Games, CIG 2014, Dortmund, Germany, August 26-29, 2014, pages 1-2. IEEE, 2014. URL: http://dx.doi.org/10.1109/CIG.2014.6932920.
  24. Jeffrey Shallit. What this country needs is an 18cent piece. The Mathematical Intelligencer, 25(2):20-23, 2003. URL: http://dx.doi.org/10.1007/bf02984830.
  25. Wacław Sierpiński. Sur une propriété des nombres naturels. Annali di Matematica Pura ed Applicata, 39(1):69-74, 1955. URL: http://dx.doi.org/10.1007/BF02410762.
  26. B. M. Stewart. Sums of distinct divisors. American Journal of Mathematics, 76(4):779-785, 1954. URL: http://dx.doi.org/10.2307/2372651.
  27. Marcin Grzegorz Szubert and Wojciech Jaskowski. Temporal difference learning of n-tuple networks for the game 2048. In 2014 IEEE Conference on Computational Intelligence and Games, CIG 2014, Dortmund, Germany, August 26-29, 2014, pages 1-8. IEEE, 2014. URL: http://dx.doi.org/10.1109/CIG.2014.6932907.
  28. H. Jaap van den Herik. Five new games. ICGA Journal, pages 129-130, September 2014. URL: https://icga.leidenuniv.nl/wp-content/uploads/2015/04/September-2014.pdf.
  29. A. Weingartner. Practical numbers and the distribution of divisors. The Quarterly Journal of Mathematics, 66(2):743-758, 2015. URL: http://dx.doi.org/10.1093/qmath/hav006.
  30. Kun-Hao Yeh, I-Chen Wu, Chu-Hsuan Hsueh, Chia-Chuan Chang, Chao-Chin Liang, and Han Chiang. Multistage temporal difference learning for 2048-like games. IEEE Trans. Comput. Intellig. and AI in Games, 9(4):369-380, 2017. URL: http://dx.doi.org/10.1109/TCIAIG.2016.2593710.
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail