CHARACTERISTICS OF AN ALGORITHM -GUFFO.IN

Example : Method which is effective (to be explained later) but not definite. The following is a program fragment for the example method: x ← 1

Toss a coin,

If the result is Head then x ←3 else x ← 4

{in the above, the symbol ‘←’ denotes that the value on its R.H.S is assigned to the variable on its L.H.S. Detailed discussion under (i) of Section 1.6.1}

All the steps, like tossing the coin etc., can be (effectively) carried out. However, the method is not definite, as two different executions may yield different outputs.

  1. Inputs: An algorithm has zero or more, but only finite, number of inputs. Examples of algorithms requiring zero inputs:

(i) Print the largest integer, say MAX, representable in the computer system being used.

(ii) Print the ASCII code of each of the letter in the alphabet of the computer system being used.

(iii) Find the sum S of the form 1+2+3+…, where S is the largest integer less than or equal to MAX defined in Example (i) above.

  1. Output: An algorithm has one or more outputs. The requirement of at least one output is obviously essential, because, otherwise we can not know the answer/solution provided by the algorithm.

The outputs have specific relation to the inputs, where the relation is defined by the algorithm.

  1. Effectiveness: An algorithm should be effective. This means that each of the operation to be performed in an algorithm must be sufficiently basic that it can, in principle, be done exactly and in a finite length of time, by a person using pencil and paper. It may be noted that the ‘FINITENESS’ condition is a special case of ‘EFFECTIVENESS’. If a sequence of steps is not finite, then it can not be effective also.

A method may be designed which is a definite sequence of actions but is not finite (and hence not effective)

Example : If the following instruction is a part of an algorithm: Find exact value of e using the following formula e = 1+ 1/(1!) + 1/(2!) + 1/(3!) +…..
and add it to x.
Then, the algorithm is not effective, because as per instruction, computation of e
requires computation of infinitely many terms of the form 1/n! for n = 1, 2, 3, …..,
which is not possible/effective.
However, the instruction is definite as it is easily seen that computation of each of the term 1/n! is definite (at least for a given machine).

Ex. 2) For each of the following, give one example of a method, which is not an
algorithm, because

(i) the method is not finite
(ii) the method is not definite
(iii) the method is not effective but finite

Beautiful love Massage for Your Love One
Richard Cory EA Robinson
La violencia sexual en el vecindario daña la salud mental en las mujeres

 

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!