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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
i.e. that we know how to compute .
- 2.
NiX—Non in any type X, similarly to Non a Number — NaN.
References
Berry, G.: Bottom-up computation of recursive programs. RAIRO - Informatique Théorique et Applications (Theoret. Inform. Appl.) 10(3), 47–82 (1976)
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
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
Dijkstra, E.W.: On a cultural gap. Math. Intell. 8(1), 48–52 (1986). https://doi.org/10.1007/BF03023921
Ershov, A.P.: Aesthetics and the human factor in programming. Commun. ACM 15(7), 501–505 (1972)
Ershov, A.P.: Programming as the second literacy (1980). http://ershov.iis.nsk.su/ru/second_literacy/article. Accessed 20 Jan 2020 (in Russian)
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
Gries, D.: The Science of Programming. Monographs in Computer Science. Springer, Heidelberg (1981). https://doi.org/10.1007/978-1-4612-5983-1
Hoare, C.A.R.: An axiomatic basis for computer programming. Commun. ACM 12(10), 576–580 (1969)
Knuth, D.E.: Computer science and its relation to mathematics. Am. Math. Monthly 81(4), 323–343 (1974)
Knuth, D.E.: Textbook Examples of Recursion (1991). https://arxiv.org/pdf/cs/9301113.pdf. Accessed 20 Jan 2020
Knuth, D.E.: The Art of Computer Programming, Volumes 1–3 Boxed Set, 2nd edn. Addison-Wesley, Boston (1998)
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
Liu, Y.A.: Systematic Program Design: From Clarity to Efficiency. Cambridge University Press, Cambridge (2013)
Paterson, M.S., Hewitt C.T.: Comparative schematology. In: Proceedings of the ACM Conference on Concurrent Systems and Parallel Computation, pp. 119–127 (1970)
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)
Shilov, N.V.: Etude on recursion elimination. Model. Anal. Inf. Syst. 25(5), 549–560 (2018)
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)
Shilov, N.V., Yi, K.: Engaging students with theory through ACM collegiate programming contests. Commun. ACM 45(9), 98–101 (2002)
Uspensky, A.V.: Mathematics Apology. Amphora, Sant-Petersburg (2009). (in Russian)
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)
Computing Curricula 2001. Computer Science. https://www.acm.org/binaries/content/assets/education/curricula-recommendations/cc2001.pdf. Accessed 01 July 2020
Computer Science Curricula (2013). https://www.acm.org/binaries/content/assets/education/cs2013_web_final.pdf. Accessed 01 July 2020
International Mathematical Olympiad. https://www.imo-official.org/default.aspx. Accessed 20 Jan 2020
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
ICPC. International Collegiate Programming Contest. https://icpc.baylor.edu/. Accessed 20 Jan 2020
IMO Grand Challenge. https://imo-grand-challenge.github.io/. Accessed 20 Jan 2020
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
Corecursion. From Wikipedia, the free encyclopedia. https://en.wikipedia.org/wiki/Corecursion. Accessed 20 Jan 2020
Tail call. From Wikipedia, the free encyclopedia. https://en.wikipedia.org/wiki/Tail_call. Accessed 20 Jan 2020
Fun With Formal Methods (2013). http://www.iis.nsk.su/fwfm2013. Accessed 20 Jan 2020
Fun With Formal Methods (2019). https://persons.iis.nsk.su/en/FWFM19. Accessed 20 Jan 2020
Codeforces. From Wikipedia, the free encyclopedia. https://en.wikipedia.org/wiki/Codeforces. Accessed 22 June 2020
Code Forces. Sponsored by Telegram. https://codeforces.com/. Accessed 22 June 2020
D. New Year and the Permutation Concatenation. https://codeforces.com/contest/1091/problem/D?locale=en. Accessed 22 June 2020
1091D - New Year and the Permutation Concatenation. https://codeforces.com/blog/entry/64196. Accessed 22 June 2020
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this paper
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)