Monday, 1 December 2014

Input and Output

Some of the competitive examination give questions on a pattern generally known as "input and output". In these questions, input is converted into output through a few systematic steps. In the directions for these questions, an example (to show how a given  input is transformed into a designed output) will be given. The input is a string of elements (these elements can be alphabets or numbers or words or any combination of these), which is processed through a few methodical steps and transformed into designed (pre-defined order of elements) output.
From the given example, we have to understand the following: (i) the method followed in the transformation; and
(ii) the Desired arrangement of the elements in the final output.
Same method has to be employed to answer the subsequent questions.
Now, let us analyse the two important phrases used in the above paragraph, viz., desired order of output and methodical transformation.
I. Desired order of output :
The form in which the final output is required, is pre-defined. The following are the most commonly followed arrangements of elements in the output.
(a) if the elements are numbers: The numbers can be arranged in Ascending order or Descending order.
(b) If the elements are letters or words:
(i)Alphabetical order: the elements appear in the same order in which they apear in a dictionary, starting from A to Z.
(ii)Reverse Alphabetical order: the elements appear in the reverse order in which they apear in a dictionary, starting from Z to A.
(iii)if the elements are a combination of letters, numbers and words, several kinds of arrangement are possible. On a case-to-case basis, we have to find out the arrangement in the output.
II. Methodical transformation:
To achieve the pre-defined output, the input string of elements is processed through a few steps. These steps follow a specific pattern while rearranging the given elements. These are most commonly followed methods. Let us name them as single element movement, and interchange of two elements. Students should note that there can be methods of transformation. Now, let us discuss these two methods mentioned above with the help of a simple input " B D C A F E". Let the Desired output be "A B C D E F".
1. Single element movement: In this method, only one element is arranged in each step. The elements, which are to the left of the place vacated by the rearranged, shift to their right to fill vacant space. The position of the other elements remain unchanged.
Illustration of this method:
Input:   B D C A F E
Step I:   A B D C F E
Step II:  A B C D F E
Step III: A B C D E F
Step III is the final output.
In step one, letter 'A' is removed from its position and arranged in the first position. The three letters to the left of the vacant place i.e., B, D and C shift to their right by one place. Similar method followed by subsequent steps.
2. Interchange of elements: In each step, the element to ba arraanged interchanges its position with the element in its designated position. In this case, A interchanges its own position with B and the positions of other elements remain unchanged. This is the first step. Each of the subsequent steps follow the same methods till the final output is obtained.
Method of Answering a Question:
Step I: compare input and output in the example given in the question and observe the final arrangement.
Step II: Observe how each element is being rearranged and also the pattern followed by remaining elements.
Step III: Whenever an element comes into its designated position whithout consuming any step, then leave such element untouched.
Let us understand the concepts discussed above more clearly by using the following examples.
I. Arranging the words given in the input in alphabetical order:
Example: A word arrangement machine, when given an input consisting of words, rearranges them following a particular pattern in each step. The following is an illustration of input and the steps involved in the arrangement.
input : belt an area the state are tea
Step I : an belt area the state are tea
Step II : an are belt area the state tea
Step IV : an are area belt state the tea
Step V : an are area belt state tea the
Step V is the final output (last step) for the above input.
Now, let us solve one question based on the above model.
Example 1 : which of the following is the last step for the following input ?
input : from food has made case wage
(A). has made from food case wage
(B). case food from has wage made
(C). case food from has made wage
(D). case food from made has wage
Solution: On comparing the input with the output, it is clear that the given words are arranged in alphabetical order. Hence, the output is 'case food from has made wage'. Choice - 'C'
II. Arranging the numbers in the given input in increasing order:
Example: A number arrangement machine, when given an input line of numbers, rearranges them following a particular pattern in each step. The following is an example of input and the steps involved in the rearrangement.
input   : 78  92  56  38  144  87
Step I   : 38  92  56  78  144  87
Step II  : 38  56  92 78  144  87
Step III  : 38  56 78  92 144  87
Step IV : 38  56  78  87  144  92
Step V  : 38  56  78  87 92 144
As all the numbers in the given input are arranged in the increasing order, Step V is the final step or output.
Explanation: The numbers are arranged in the ascending order in the output. During rearrangement, only by two numbers I.e., the number to be rearranged and the number in its designated place, interchange positions and the positions of the remaining numbers remain unchanged.

No comments:

Post a Comment