Pages

Showing posts with label NAH-CET. Show all posts
Showing posts with label NAH-CET. Show all posts

September 14, 2011

Reasoning on Instruction Sets

There are three bottles of water A, B, C whose capacities are 5 liters, 3 liters and 2 liters respectively. For transferring water from one bottle to another and to drain out the bottle, there exists a piping system. The flow thorough these pipes is computer controlled. The computer that controls the flow through these pipes can be fed with three types of instructions, as explained below

Instruction type

Explanation of the instruction

FILL (X, Y)

Fill bottles labeled X from the water in bottle labeled Y, where the remaining capacity of X is less than or equal to amount of water in Y.

EMPTY (X,Y)

Empty out the water in bottle labeled X into bottle labeled Y, where the amount of water in X is less than or equal to remaining capacity of Y.

DRAIN (X)

Drain out all the water contained in bottle labeled X.

Initially A is full with water and B and C are empty.

Q1. After executing a sequence of three instruction bottle A contains one liter of water. The first and the third of these instructions is given below

First instruction FILL (C, A)

Third instruction FILL (C,A)

Which of the following statesman about the instruction is true?

i) The second instruction is FILL (B,A)

ii) The second instruction is Empty (C,B)

iii) The second instruction transfer water from B to C

iv) The second instruction involves using the water in bottle A.

Q2. Consider the same sequence of three instructions and the same initial state mentioned above. Three more instructions are added at the end of the above sequence to have A contain 4 liters of water. In this total sequence of six instructions, the fourth one is DRAIN (A). this is the only DRAIN instruction in the entire sequence. At the end of the execution of the above sequence, how much water is contained in C?

i) 1

ii) 2

iii) 0

iv) None of these

September 8, 2011

Seven Friends in a row

Seven friends A, B, C, D, E, F and G are standing in a row such that

i) A is immediate right to G

ii) G is fourth to the right of C

iii) D was between B and F

iv) C which was third to the left of B, is at one of the end

Which is the right position of E?

A . Left of A

B. Left of F

C. Between F and G

D. None of these