Comparison of two algorithms in order to find Pythagorean triples using two different programming paradigms

Authors

Keywords:

algorithm, functional programming, imperative programming cyclic process, recursion, Pythagorean triples

Abstract

in this article we analyze the algorithmic characteristics of two solutions for the problem to find Pythagorean triples in a specific range from 1 to n to a defined value of n as an integer. We also make a comparison between the solution implemented with functional paradigm in Scheme language environment Dr. Racket version 6.1 and the solution implemented with imperative paradigm in C++ language environment Dev C++ version 5.8.0. The comparison of these solutions is made from the perspective of two different programming paradigms. We analyze the pure codification, the logic used in the implementation and the performance and efficiency using the computer timer. Both programs present two formats to show the results in the display. These comparisons not only permit to establish possible relations between the programming computer paradigms (functional and imperative) but also let us to think about a hybrid solution from the best of each solution implemented. Each implementation is absolutely original product of the research and the initiative and experience of the author of this article.

Author Biography

  • Omar Iván Trejos Buriticá, Universidad Tecnológica de Pereira

    Ingeniero de Sistemas. Especialista en Instrumentación Física. Magister en Comunicación Educativa. PhD en Ciencias de la Educación, actualmente es docente de tiempo completo de la Universidad Tecnológica de Pereira.

References

Trejos Buriticá, O. I. (2012). Aprendizaje en Ingeniería: un problema de comunicación. Pereira (Colombia): Tesis Doctoral - Universidad Tecnológica de Pereira.

Van Roy, P. (2008). Concepts, Techniques and Models of Computer Programming. Estocolmo: Université catholique de Louvain.

Bruner, J. S. (1969). Hacia un teoría de la instrucción. Ciudad de México: Hispanoamericana.

Ausubel, D. (1986). Sicología Educativa: Un punto de vista cognoscitivo. Ciudad de México. Trillas.

Bruner, J. S. (1991). Actos de significado. Madrid: Alianza Editorial.

Paz Penagos, H. (2014). Aprendizaje autónomo y estilo cognitivo: diseño didáctico, metodología y evaluación. Revista Educación en Ingeniería, 9(17), 53-65.

Paz Penagos, H. (2009). How to develop metacognition through problem solving in higher education? Revista de Ingeniería e Investigación, 31(1), 75-80.

Felleisen, M. et al. (2013). How to design programs (2ª Ed). Boston. MIT Press

Trejos Buriticá, O. I. (2006). Fundamentos de Programación. Pereira: Papiro.

Sparks, J. (2008). The Pythatorean Theorem. Bloomington (Indiana): AuthorHouse.

Downloads

Published

2015-12-15

Issue

Section

Artículos

How to Cite

Comparison of two algorithms in order to find Pythagorean triples using two different programming paradigms. (2015). Entre Ciencia E ingeniería, 9(18), 84-94. https://ojs.ucp.edu.co/index.php/entrecienciaeingenieria/article/view/560