Affiliation:
1. School 1353
2. Federal Research Centre "Computer Science and Control" of the Russian Academy of Sciences
Abstract
The article provides a way to optimize an enumeration process in the Python programming language while solving crypto-arithmetic (enumerative) tasks where two multi-digit numbers add to each other in a column. It is noted that there are two directions in fulfilling enumeration problems which suggest being optimized by combinatorial (algebraic) and programming methods. Moreover, it has been found out that it is impractical to express algebraic optimization methods directly in program codes, since programming languages have their own possibilities for optimizing search procedures.Therefore, the process of learning how to optimize search while fulfilling enumerative tasks should be carried out in two stages. Combinatorial methods are the best means of forming students’ logical mindsets and algorithmic skills. That is the reason why these methods should necessarily be included in the informatics course at the level of general secondary education. Then, at the advanced stage of training, or at the level of secondary general education, it is useful for students to move to the programming direction mastering high-level programming languages.The optimizing strategy of solving crypto-arithmetic problems described in the article, and its implementation in the Python language involves omitting conventional cyclic structures, as well as widely known methods of processing character data. When compiling a computer program "слова.py", the authors applied the join method and the permutations function of the itertools module from the Python standard library. This choice has greatly simplified the recording of the program codes and reduced the time it took to search for the solution.
Publisher
Publishing House Education and Informatics