Saturday 19 April 2014

Input and Output

04:15

Input and Output

Introduction


Some of the competitive examinations give question on a pattern generally known as "Input and Output".In these questions, input data is converted into output through a few systematic steps. in the direction 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 the designed (pre-defined order of elements) output.


From the given example, we have to understand the following.

(1) the method followed in the transformation;and
(2) the desired arrangement of the elements in the final output. The same method is 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 predefined. The following are the most commonly followed arrangements of elements in the output.

(a) If the elements are numbers:

(i) Ascending order.
(ii) Descending order.


(b) If the elements are letters:

(i) Alphabetical order: The elements appear in the same order as in a dictionary, from A to Z
(ii) Reverse Alphabetical order:The elements appear in the reverse order,from Z to A.


(c) If the elements are words:

(i) Alphabetical order: The words in the output are to be in the same order in which they appear in a dictionary,starting from A to Z
(ii) Reverse Alphabetical order: The words in the output are to be in the revers of the  order given in a dictionary, starting from A to Z.


(d) If the elements are combination of letters, numbers and words, several kinds of arrangements 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 follows a specific pattern while rearranged the given elements. There are two most commonly followed methods. Let us name them as (1) Single element movement, and (2) Interchange of two elements.
Students should note that there can be other 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 rearranged in each step. The elements, which are to the left of the place vacated by the rearranged element, shift to their right to fill the vacant place. The position of the other elements remain unchanged.


illustrated 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 is followed in subsequent steps. 


2. Interchange of elements:

In each step, the element to be rearranged interchanges its position with the element in its designated position.In this case, A interchanges its position with B and  the position of the other elements remain unchanged.This is the first step. Each of the subsequent steps follows the same methods till the final output is obtained.


Illustration of this method:

Input : B D C A F E
Step I :A D C B F E
Step II: A B C D F E
Step III:A B C D E F
Step III is the final step.


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 the remaining elements.
Step III:Whenever an element comes into its designated position without consuming any step, then leave such element untouched.

Let us understand the concept discussed above more clearly by using the following example.


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 patter in each step. The following is an illustration of input and the steps involved in the rearrangement.
input: belt an area the state are tea
Step I: an belt area the state are tea
Step II:an are belt area the states tea
Step III:an are area belt the state tea
Step IV:an are area belt state the tea
Step V:an are area belt state tea the
Step VI:is the final output (last step) for the above input.
Example:
Question:
1.Which of the following will be the last step for the following input?
input:from food has made case wage
(1)has made from food case wage
(2)case food from has wage made
(3)case food from has made wage
(4)case from food has made wage
(5)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(3) 

2. 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 illustration 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 output.

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 comments:

Post a Comment

 

© 2013 Aptitude and Reasoning Formulas. All rights resevered. Designed by Templateism

Back To Top