The application is designed to provide certain functionality related to the branch of mathematics separated as Discrete Mathematics. The application includes some algorithms, parts of number theory and encryption, induction and recursion, implementation of selected advanced calculation methods. The topics of Discrete Mathematics and Its Applications (McGraw-Hill Education - Kenneth H. Rosen) are impossible to cover in one application, and this application does not set itself such a task.
The algorithms in the application include( Algorithms Activity): algorithm for linear and binary search, sorting by the bubble method and by the inverting method, determining connected pairs and non-overlapping pairs (for example, events with a beginning and an end like lectures).
The bubble sort is one of the simplest sorting algorithms, but not one of the most efficient. It puts a list into increasing order by successively comparing adjacent elements, interchanging them if they are in the wrong order. To carry out the bubble sort, performs the basic operation, that is, interchanging a larger element with a smaller one following it, starting at the beginning of the list, for a full pass. Iterates this procedure until the sort is complete.
The insertion sort compares the second element with the first element and inserts it before the first element if it does not exceed the first element and after the first element if it exceeds the first element. At this point, the first two elements are in the correct order. The third element is then compared with the first element, and if it is larger than the first element, it is compared with the second element; it is inserted into the correct position among the first three elements. The procedure continues in the same way with the following elements to the end of the list.
Algorithms that make what seems to be the “best” choice at each step are called greedy algorithms – these are the two algorithms for connected pairs and non-overlapping pairs.
Non-overlapping pairs can be used finding a route between two sites.
The Number Conversion and Cryptography Activity includes: - converting numbers from one number system to another; and other.
The application can be used in practice when converting numbers from one number system to another( Number Conversion Activity), in arithmetic operations( Arithmetic operations) with integers in different number systems (they are included in base 2,3,4,5,6,7,8,9,16). Arithmetic operations and conversion to different number systems are performed over integers without a limit by the length of the operands, the so-called BigInteger.
Factorization(Factorization Activity) involves determining the prime factors of a number, determining the greatest common divisor of two numbers, and other.
Generation of pseudo random numbers of type BigInteger( Pseudo Random Numbers), determined by the length in bits.
Encryption of text(Cryptography Activity) from Latin alphabet(26), encryption of texts with Cyrillic alphabet (30 letters) and encryption using the RSA method and AES method. With all encryption methods, it is possible to store the encrypted files in the Download directory of the device, in the names of which there is text AppDiscret.
In cryptography it is important to be able to find remainder of b in power n divided by m efficiently without using an excessive amount of memory. The app also has a function for fast modular exponentiation( Fast Modular Exponentiation Activity) .
Mathematical induction in application includes(Mathematical Induction Activity): summation of the first N integers, and other
Advanced calculation functions( Counting Activity) include: - calculating the number of bacteria multiplied after a certain time; - Fibonacci numbers; - The number of disc moves in the game Towers of Hanoi; and other.
In almost all activities, there is help that reveals the calculated characteristics.