Skip to main content

Teaching Efficient Recursive Programming and Recursion Elimination Using Olympiads and Contests Problems

  • Conference paper
  • First Online:
Frontiers in Software Engineering Education (FISEE 2019)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 12271))

Included in the following conference series:

Abstract

Olympiads and contests are popular with bachelor students of Software Engineering, Computer Science and other departments educating professionals to be involved software development. But educational role and potential of these activities are under-evaluated and poorly used in the education. In the present paper we address one particular topic that can be introduced using problems from Olympiads and Contests, namely — efficient recursive programming and recursion elimination. Here we understand efficient recursive programming as problem solving with recursive algorithm design. Recursion elimination studies how to construct (functional) equivalent iterative (imperative) program for a given recursive (functional) preferably with use of fix-size static memory. Great computer scientists have contributed to the recursion elimination studies — John McCarthy, Amir Pnueli, Donald Knuth, etc., many fascinating examples have been examined and resulted in recursion elimination techniques known as tail-recursion and as corecursion. We base our study on examples borrowed from the worlds of Mathematical Olympiads and Programming contests. At the same time we use these examples to stress importance of the recursion elimination studies not only for better education but for better and more efficient program specification, verification, optimization and compiler design.

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 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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.

    i.e. that we know how to compute .

  2. 2.

    NiXNon in any type X, similarly to Non a NumberNaN.

References

  1. Berry, G.: Bottom-up computation of recursive programs. RAIRO - Informatique Théorique et Applications (Theoret. Inform. Appl.) 10(3), 47–82 (1976)

    MathSciNet  Google Scholar 

  2. Bird, R.S.: Using circular programs to eliminate multiple traversals of data. Acta Informatica 21(3), 239–250 (1984). https://doi.org/10.1007/BF00264249

    Article  MATH  Google Scholar 

  3. Bird, R.S.: Zippy tabulations of recursive functions. In: Audebaud, P., Paulin-Mohring, C. (eds.) MPC 2008. LNCS, vol. 5133, pp. 92–109. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-70594-9_7

    Chapter  MATH  Google Scholar 

  4. Dijkstra, E.W.: On a cultural gap. Math. Intell. 8(1), 48–52 (1986). https://doi.org/10.1007/BF03023921

    Article  MATH  Google Scholar 

  5. Ershov, A.P.: Aesthetics and the human factor in programming. Commun. ACM 15(7), 501–505 (1972)

    Article  Google Scholar 

  6. Ershov, A.P.: Programming as the second literacy (1980). http://ershov.iis.nsk.su/ru/second_literacy/article. Accessed 20 Jan 2020 (in Russian)

  7. Ershov, A.P., Knuth, D.E. (eds.): Algorithms in Modern Mathematics and Computer Science. LNCS, vol. 122. Springer, Heidelberg (1981). https://doi.org/10.1007/3-540-11157-3

    Book  MATH  Google Scholar 

  8. Gries, D.: The Science of Programming. Monographs in Computer Science. Springer, Heidelberg (1981). https://doi.org/10.1007/978-1-4612-5983-1

    Book  MATH  Google Scholar 

  9. Hoare, C.A.R.: An axiomatic basis for computer programming. Commun. ACM 12(10), 576–580 (1969)

    Article  Google Scholar 

  10. Knuth, D.E.: Computer science and its relation to mathematics. Am. Math. Monthly 81(4), 323–343 (1974)

    Article  MathSciNet  Google Scholar 

  11. Knuth, D.E.: Textbook Examples of Recursion (1991). https://arxiv.org/pdf/cs/9301113.pdf. Accessed 20 Jan 2020

  12. Knuth, D.E.: The Art of Computer Programming, Volumes 1–3 Boxed Set, 2nd edn. Addison-Wesley, Boston (1998)

    Google Scholar 

  13. Lisitsa, A.: Tackling Fibonacci words puzzles by finite countermodels. Contributed talk at the CAV Workshop Fun With Formal Methods, St. Petersburg, Russia, 13 July 2013. http://cgi.csc.liv.ac.uk/~alexei/Fibonacci_Challenge/fun2013.pdf. Accessed 20 Jan 2020

  14. Liu, Y.A.: Systematic Program Design: From Clarity to Efficiency. Cambridge University Press, Cambridge (2013)

    Book  Google Scholar 

  15. Paterson, M.S., Hewitt C.T.: Comparative schematology. In: Proceedings of the ACM Conference on Concurrent Systems and Parallel Computation, pp. 119–127 (1970)

    Google Scholar 

  16. Shilov, N.V.: Study of recursion elimination for a class of semi-interpreted recursive program schemata. In: Abstracts of 31st Nordic Workshop on Programming Theory NWPT 2019, Tallinn, Estonia, 13–15 November 2019, pp. 54–58 (2019)

    Google Scholar 

  17. Shilov, N.V.: Etude on recursion elimination. Model. Anal. Inf. Syst. 25(5), 549–560 (2018)

    Article  MathSciNet  Google Scholar 

  18. Shilov, N.V.: Algorithm design patterns: program theory perspective. In: Proceedings of Fifth International Valentin Turchin Workshop on Metacomputation (META-2016), University of Pereslavl, pp. 170–181 (2016)

    Google Scholar 

  19. Shilov, N.V., Yi, K.: Engaging students with theory through ACM collegiate programming contests. Commun. ACM 45(9), 98–101 (2002)

    Article  Google Scholar 

  20. Uspensky, A.V.: Mathematics Apology. Amphora, Sant-Petersburg (2009). (in Russian)

    Google Scholar 

  21. Shilov, N.V., Shilova, S.O.: On mathematical contents of computer science contests. In: Enhancing University Mathematics: Proceedings of the First KAIST International Symposium on Teaching. CBMS Issues in Mathematics Education, vol. 14, pp. 193–204. American Society (2007)

    Google Scholar 

  22. Computing Curricula 2001. Computer Science. https://www.acm.org/binaries/content/assets/education/curricula-recommendations/cc2001.pdf. Accessed 01 July 2020

  23. Computer Science Curricula (2013). https://www.acm.org/binaries/content/assets/education/cs2013_web_final.pdf. Accessed 01 July 2020

  24. International Mathematical Olympiad. https://www.imo-official.org/default.aspx. Accessed 20 Jan 2020

  25. Problems (with solutions). 60th International Mathematical Olympiad. Bath - UK, 11th–22nd July 2019. https://www.imo2019.uk/wp-content/uploads/2018/07/solutions-r856.pdf. Accessed 20 Jan 2020

  26. ICPC. International Collegiate Programming Contest. https://icpc.baylor.edu/. Accessed 20 Jan 2020

  27. IMO Grand Challenge. https://imo-grand-challenge.github.io/. Accessed 20 Jan 2020

  28. The Egg Dropping Puzzle. From Wikipedia, the free encyclopedia, article on Dynamic Programming. https://en.wikipedia.org/wiki/Dynamic_programming#Egg_dropping_puzzle. Accessed 20 Jan 2020

  29. Corecursion. From Wikipedia, the free encyclopedia. https://en.wikipedia.org/wiki/Corecursion. Accessed 20 Jan 2020

  30. Tail call. From Wikipedia, the free encyclopedia. https://en.wikipedia.org/wiki/Tail_call. Accessed 20 Jan 2020

  31. Fun With Formal Methods (2013). http://www.iis.nsk.su/fwfm2013. Accessed 20 Jan 2020

  32. Fun With Formal Methods (2019). https://persons.iis.nsk.su/en/FWFM19. Accessed 20 Jan 2020

  33. Codeforces. From Wikipedia, the free encyclopedia. https://en.wikipedia.org/wiki/Codeforces. Accessed 22 June 2020

  34. Code Forces. Sponsored by Telegram. https://codeforces.com/. Accessed 22 June 2020

  35. D. New Year and the Permutation Concatenation. https://codeforces.com/contest/1091/problem/D?locale=en. Accessed 22 June 2020

  36. 1091D - New Year and the Permutation Concatenation. https://codeforces.com/blog/entry/64196. Accessed 22 June 2020

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Nikolay V. Shilov .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Shilov, N.V., Danko, D. (2020). Teaching Efficient Recursive Programming and Recursion Elimination Using Olympiads and Contests Problems. In: Bruel, JM., Capozucca, A., Mazzara, M., Meyer, B., Naumchev, A., Sadovykh, A. (eds) Frontiers in Software Engineering Education. FISEE 2019. Lecture Notes in Computer Science(), vol 12271. Springer, Cham. https://doi.org/10.1007/978-3-030-57663-9_16

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-57663-9_16

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-57662-2

  • Online ISBN: 978-3-030-57663-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics