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
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Step 1: Note the distances from the map.
The roads and their lengths (in km) are: A-D = 12, D-E = 18, A-B = 10, B-E = 15, D-B = 8, A-C = 8, and C-E = 21. There is no direct road between any other pair of towns.

Step 2: Recall when a ROUTE instruction is allowed.
ROUTE (X, Y, Z) can only be used when Y actually lies on the shortest path from X to Z. If Y is not on that shortest path, the instruction breaks its own definition and cannot be fed into the computer. So before adding up any distance, check every ROUTE instruction against the real shortest path.

Step 3: Test option (1), which ends with ROUTE (A, C, E).
Find the shortest way from A to E: going A to B to E costs 10 + 15 = 25 km, going A to D to E costs 12 + 18 = 30 km, and going A to C to E costs 8 + 21 = 29 km. The shortest is 25 km, through B, not through C. Since C is not on the true shortest route from A to E, ROUTE (A, C, E) is not a valid instruction, so option (1) is ruled out.

Step 4: Test option (2), which uses ROUTE (A, D, B).
Find the shortest way from A to B: the direct road costs 10 km, while going through D costs 12 + 8 = 20 km. So the shortest route from A to B is the direct 10 km road, and D does not lie on it. ROUTE (A, D, B) is therefore invalid too, so option (2) is also ruled out.

Step 5: Check option (3), which uses only GOTO and BACK.
Option (3) reads: BACK (A, C), GOTO (A, D), GOTO (D, B), GOTO (B, E). None of these instructions is a ROUTE, so there is no validity problem here. Add up the distance: BACK (A, C) sends the car from A to C and back, costing 8 + 8 = 16 km; GOTO (A, D) costs 12 km; GOTO (D, B) costs 8 km; and GOTO (B, E) costs 15 km. The total is 16 + 12 + 8 + 15 = 51 km, and along the way the car visits C, A, D, B, and finally E, so all three other towns are covered.

Final Answer:
Options (1) and (2) both contain a ROUTE instruction that is not actually valid on this map, so they cannot be fed into the computer at all. Option (3) is the only instruction set that is both valid and gives the minimum travel distance of 51 km while visiting every town. \[ \boxed{\text{Option (3)}} \]
Was this answer helpful?
0
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
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Step 1: List the distances again.
A-D = 12, D-E = 18, A-B = 10, B-E = 15, D-B = 8, A-C = 8, C-E = 21 (all in km). Mr. Goswami starts at B, must visit A, D and E, and must end at C.

Step 2: Work out the shortest distance for each order of visiting A, D and E.
Trying every order of the three towns between B and C: B-A-D-E-C costs 10+12+18+21 = 61 km; B-A-E-D-C costs 10+25+18+20 = 73 km; B-D-A-E-C costs 8+12+25+21 = 66 km; B-D-E-A-C costs 8+18+25+8 = 59 km; B-E-A-D-C costs 15+25+12+20 = 72 km; B-E-D-A-C costs 15+18+12+8 = 53 km. (Here A-E is taken as 25 km, its shortest value through B, and D-C as 20 km, its shortest value through A, since there is no direct D-C or A-E road.)

Step 3: Pick the minimum-distance order.
The smallest total is 53 km, for the order B, E, D, A, C, that is: GOTO (B, E) = 15 km, GOTO (E, D) = 18 km, GOTO (D, A) = 12 km, GOTO (A, C) = 8 km. That is 4 instructions so far.

Step 4: Look for a way to combine two of these instructions into one.
Check whether the shortest route from D to C already passes through A on its own: D to C directly through A costs 12 + 8 = 20 km, while going the other way, through E, costs 18 + 21 = 39 km. So the true shortest route from D to C is 20 km, and it runs through A automatically. This means GOTO (D, A) followed by GOTO (A, C) can be replaced by the single instruction GOTO (D, C) (equivalently ROUTE (D, A, C), since A genuinely lies on this shortest path), without changing the distance travelled or skipping town A.

Final Answer:
The full plan becomes GOTO (B, E), GOTO (E, D), GOTO (D, C), just 3 instructions, still covering the minimum distance of 15 + 18 + 20 = 53 km and visiting every town. \[ \boxed{3} \]
Was this answer helpful?
0
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
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Step 1: Recall the distances, and note that the direct A-D road (12 km) is now unusable.
The remaining roads are: D-E = 18, A-B = 10, B-E = 15, D-B = 8, A-C = 8, C-E = 21.

Step 2: Check option (1): ROUTE (A, B, E), GOTO (E, D).
First confirm B genuinely lies on the shortest route from A to E: A-B-E costs 10 + 15 = 25 km, while A-D-E would cost 12 + 18 = 30 km and A-C-E costs 8 + 21 = 29 km, so 25 km through B is indeed shortest, and the ROUTE instruction is valid. Then GOTO (E, D) uses the direct 18 km road, which has nothing to do with A-D. This whole plan (A to B to E to D) never touches the broken road, so it can be used.

Step 3: Check option (2): GOTO (A, B), GOTO (B, D).
GOTO (A, B) uses the direct 10 km road. GOTO (B, D) uses the direct 8 km road between B and D. Neither instruction goes near the destroyed A-D road, so this plan (A to B to D, 18 km total) is also perfectly usable.

Step 4: Check option (3): ROUTE (A, C, E), GOTO (E, D).
Check whether C genuinely lies on the shortest route from A to E. As found already, the shortest route from A to E is 25 km through B, while going through C costs 29 km (8 + 21), so C is NOT on the true shortest path from A to E. This means ROUTE (A, C, E) breaks its own definition and is not a valid instruction to give the computer in the first place, regardless of the flood.

Final Answer:
Options (1) and (2) both find a legal way around the broken A-D road, but option (3) fails already at the ROUTE instruction, since C never was on the shortest A-to-E path. So option (3) is the one that can't be used. \[ \boxed{\text{Option (3)}} \]
Was this answer helpful?
0
0