ALGORITMS

 

    An algorithm is a finite set of instructions with characteristics such as: precision, uniqueness, finiteness, input, output, generality. The trace of an algorithm is a simulation of execution of the algorithm.  Pseudocodes are used to specify algorithms. This is an example of pseudocode

that finds the largest of a set of three numbers a, b, c.

1.      procedure max(a, b, c)

2.         x := a

3.         if b > x then    // if b is larger than x, update x

4.           x := b

       5.      if c > x then    // if c is larger than x, update x

6.           x := c

7.         return(x)

8.     end max

      The Euclidean Algorithm is an algorithm used to find greatest common divisor of two integers. The greatest common divisor of two integers x and y (not both zero) is the largest positive integer that divides both x and y. For example, the greatest common divisor of 4 and 6 is 2.

     A recursive procedure is a procedure that invokes itself. A recursive algorithm is an algorithm

That contains a recursive procedure. Let’s see an example of a recursive algorithm that that computes the factorials of an integer. Input n, output n!

1.      procedure factorial(n)

2.       if n = 0 then 

3.             return(1)

4.          return(n * factorial(n – 1))

5.      end factorial

     Analysis of an algorithm refers to the process of deriving estimates for the time and space needed to execute the algorithm.   

    Complexity of an algorithm refers to the amount of time and space required to execute the algorithm. The best-time case is the minimum time needed to execute an algorithm. The worst-time

case is the maximum time needed to execute an algorithm. If the time required is an average, it’s the

average-time case.

     Cryptology is the study of systems, called cryptosystems, for secure communications. In a

Cryptosystem, the sender encrypts the message to be sent. The authorized recipient decrypts the message. Cryptosystems use special encryption and decryption keys to transform messages.    

 

                                                   APPLICATONS

 

   1.   Algorithms can be used in the field of Computational Geometry

URL: www.cs.uu.nl/geobook

 2.  Algorithms can be used in Computational Electromagnetic

URL: www.npac.syr.edu/hplfa/algorithms.html

                                                    

 

                                                      QUESTIONS

 

1. Is a halting problem unsolvable or intractable?

   2. Does it exist an algorithm can decrypt any encrypted message?