Comprehension

Directions (Qs. 16-18): Read the following information carefully and answer the questions given below.

The figure below shows the roadmap plan of 5 towns A, B, C, D and E. The computerised car has the software of this roadmap plan in its computer. To follow the route, the driver has to feed instructions, not necessarily all at one time, into the computer. One instruction can be used more than once in a single set of instructions. The three types of instructions are as follows:

Instruction TypeExplanation of instruction
GOTO (X, Y)The car is instructed to move from X to Y through the shortest route.
ROUTE (X, Y, Z)The car is instructed to move from X to Z via the town Y; Y is situated on the shortest route from X to Z.
BACK (X, Y)The car is instructed to go from X to Y and back to X through the shortest route.

The distances (in km) between directly connected towns are: A-D = 12, D-E = 18, A-B = 10, B-E = 15, D-B = 8, A-C = 8, C-E = 21.

Question: 1

A person lives in town A. He has to reach E. He wants to visit all the other three towns. What set of instructions should he feed into the computer so that he travels the minimum distance?

Show Hint

Before adding distances, check whether the town named in each ROUTE instruction is really on the shortest path between its two endpoints; an instruction that fails this test cannot be used at all.
Updated On: Jul 13, 2026
  • GOTO (A, D), GOTO (D, B), GOTO (B, A), ROUTE (A, C, E)
  • BACK (A, C), ROUTE (A, D, B), GOTO (B, E)
  • BACK (A, C), GOTO (A, D), GOTO (D, B), GOTO (B, E)
  • None of these
Show Solution

The Correct Option is C

Solution and Explanation

Another way to attack this question is to work out exactly what each option asks the car to do, in terms of both distance and whether the instruction is even allowed, using the map: A-D = 12 km, D-E = 18 km, A-B = 10 km, B-E = 15 km, D-B = 8 km, A-C = 8 km, C-E = 21 km.

  1. Option (1): GOTO (A, D), GOTO (D, B), GOTO (B, A), ROUTE (A, C, E): The GOTO steps are fine and cost 12 + 8 + 10 = 30 km, but the last instruction asks for the shortest route from A to E via C. Checking the real shortest path from A to E gives 25 km through B (10 + 15), while going through C costs 29 km (8 + 21). Since C does not sit on the genuine shortest route, this ROUTE instruction is meaningless and the whole set fails.
  2. Option (2): BACK (A, C), ROUTE (A, D, B), GOTO (B, E): BACK (A, C) is fine at 16 km. But ROUTE (A, D, B) asks for the shortest route from A to B via D. The direct A-B road is only 10 km, shorter than the 20 km path through D (12 + 8), so D is not on the shortest route from A to B either. This option also fails on the same ground.
  3. Option (3): BACK (A, C), GOTO (A, D), GOTO (D, B), GOTO (B, E): Every instruction here is a plain GOTO or BACK, so there is nothing to fail. The distance is 8 + 8 (BACK A to C and back) + 12 (A to D) + 8 (D to B) + 15 (B to E) = 51 km, touching C, A, D, B and E.
  4. Option (4): None of these: Not needed, since option (3) already works.

Once options (1) and (2) are thrown out for using a ROUTE instruction that does not match the actual shortest path, option (3) is left standing as the only workable, minimum-distance plan, at 51 km.

Let's summarize:

  • A ROUTE (X, Y, Z) instruction is only legal when Y truly lies on the shortest path from X to Z.
  • Checking that condition first eliminates two of the four options immediately, without even comparing total distances.

So the correct set of instructions is option (3), covering all towns in 51 km.

Was this answer helpful?
0
Question: 2

Mr. Goswami lives in town B. He has to go to town C. He wants to visit all the other three towns. He plans his route such that he can travel the minimum distance. Find the minimum number of instructions to be fed into the computer.

Show Hint

First find which order of visiting A, D and E gives the shortest total trip from B to C, then check if any required town already lies on the shortest path between two other stops, since that can merge two instructions into one.
Updated On: Jul 13, 2026
  • 3
  • 4
  • 5
  • None of these
Show Solution

The Correct Option is A

Solution and Explanation

A cleaner way to handle this question is to first build a table of the shortest distance between every pair of towns, and only then plan Mr. Goswami's trip.

  1. Direct roads: A-D = 12, A-B = 10, A-C = 8, D-B = 8, D-E = 18, B-E = 15, C-E = 21.
  2. Missing direct roads, filled in through the shortest link: A to E has no direct road, so the shortest way is A-B-E = 10 + 15 = 25 km (cheaper than A-D-E at 30 km or A-C-E at 29 km). B to C has no direct road, so the shortest way is B-A-C = 10 + 8 = 18 km. D to C has no direct road, so the shortest way is D-A-C = 12 + 8 = 20 km (cheaper than D-E-C at 39 km).
  3. Plan the trip B to C through A, D and E: With this table in hand, test the order B, E, D, C. Going B to E costs 15 km, E to D costs 18 km, and D to C costs 20 km (which, from the table above, already runs through A). Total: 15 + 18 + 20 = 53 km, touching every town.
  4. Compare with other orders: Any order that leaves out this D-to-C shortcut, for example visiting A and C separately with a detour, only adds extra distance without saving an instruction, so 53 km with 3 instructions is the best available plan.

Since the D-to-C leg already carries the car through A for free, the whole journey needs only three commands: GOTO (B, E), GOTO (E, D), GOTO (D, C).

Let's summarize:

  • Building the full shortest-distance table first shows exactly which direct links are missing and what replaces them.
  • Whenever a required town already sits on the shortest path between two other required stops, one instruction can do the work of two.

So the minimum number of instructions Mr. Goswami needs is 3.

Was this answer helpful?
0
Question: 3

The direct road from A to D is destroyed by floods. A person wants to use the computerised car to go from A to D. Which of the following three sets of instructions can't be used by him?

Show Hint

Check each plan's actual roads against the broken A-D link, but also double-check that any ROUTE instruction's middle town genuinely sits on the true shortest path; option (3) fails on the second test.
Updated On: Jul 13, 2026
  • ROUTE (A, B, E), GOTO (E, D)
  • GOTO (A, B), GOTO (B, D)
  • ROUTE (A, C, E), GOTO (E, D)
  • None of these
Show Solution

The Correct Option is C

Solution and Explanation

A different way to check this question is to work out, for each option, exactly which roads the car would actually use, and see whether any of them secretly needs the broken A-D road, or breaks its own rule.

  1. Option (1): ROUTE (A, B, E), GOTO (E, D): The shortest A to E path is 25 km through B (compare with 29 km through C and 30 km through D), so B truly lies on it and the ROUTE instruction is legal. The car then goes from E to D directly, an 18 km road that never involves A-D. This plan is safe to use.
  2. Option (2): GOTO (A, B), GOTO (B, D): Both legs are direct roads, A to B at 10 km and B to D at 8 km. Again the broken A-D road plays no part, so this plan works too.
  3. Option (3): ROUTE (A, C, E), GOTO (E, D): This time, check if C lies on the shortest A-to-E path. It costs 29 km through C against 25 km through B, so C is not on the real shortest route. The instruction ROUTE (A, C, E) is contradicting its own definition here, so the computer cannot even carry out this command, whether or not the A-D road is broken.
  4. Option (4): None of these: Not applicable, since option (3) is already the one that fails.

So options (1) and (2) both describe genuine, usable detours around the broken road, while option (3) never was a valid instruction to start with.

Let's summarize:

  • A route is safe to use after a road closes as long as it never relies on that closed road.
  • A ROUTE instruction is only meaningful when the named town truly lies on the shortest path between the other two, and that has to be checked before anything else.

Therefore, option (3) is the set of instructions that can't be used.

Was this answer helpful?
0


Questions Asked in XAT exam