What is the largest number of towns that can meet the following criteria?
Each pair is directly linked by just one of air, bus or train.
At least one pair is linked by air, at least one pair by bus and at least one pair by train.
No town has an air link, a bus link and a train link.
No three towns, A, B, C are such that the links between AB, AC and BC are all air, all bus or all train.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Let's try to solve this question using an analogy.
Let there be N points. These are to be connected using three different colours of lines Red, Yellow and Blue. We have to find the maximum value of N under these conditions:
C o n d i t i o n 1 : Each pair of points is to be connected by only one colour.
C o n d i t i o n 2 : There has to be atleast one line of each colour. Thus, ( 2 N ) m i n = 1 + 1 + 1 = 3 ⇒ N m i n = 3 .
C o n d i t i o n 3 : There is no point such that lines of all 3 colours pass through it. (Intersections of the lines with themselves other than the given N points are not to be considered for this condition. Consider only the N points that we began with.)
C o n d i t i o n 4 : There is no triangle such that all it's sides are of the same colour.
Total number of lines possible is ( T ) = ( 2 N ) = 2 N ( N − 1 ) .
Consider the N points to be A 1 , A 2 , … A N .
We start with the case where there are ( N ) Red lines:
Let the ( N ) Red lines form the perimeter of an N -sided polygon A 1 A 2 … A N . In this polygon total number of lines connecting the A i ′ s has to be equal to ( T ) so that C o n d i t i o n 1 is satisfied.
We select a point, say A 5 , and draw ( N − 3 ) Yellow lines to the remaining points. Now, every point except A 4 , A 5 , A 6 is connected to a Yellow and Red line so no Blue line is possible there. We connect A 4 and A 6 with the only Blue line possible. Now, no Yellow line is possible too, because if we connect any two points, say A 3 and A 7 with a Yellow line, it will result in a Yellow triangle △ A 3 A 5 A 7 . Thus, no more lines can be drawn.
Hence for C o n d i t i o n 1 to be satisfied:
T = (number of Red lines) + (number of Yellow lines) + (number of Blue lines)
T = ( N ) + ( N − 3 ) + 1
⇒ ( 2 N ) = 2 N − 2
⇒ N 2 − 5 N + 4 = 0
⇒ N = { 1 , 4 }
N = 1 is discarded. Thus, for ( N ) Red lines, N = 4 is the only solution.
Now, we move on to the case where there are ( N − 1 ) Red lines:
C a s e 1 : Select a point, say A 1 , draw N − 1 Red lines to the remaining points. Now select another point, say A 6 , draw ( N − 2 ) Yellow lines to all points other than A 1 (Since the line A 1 A 6 is already drawn in Red.)
Now, we have ( N − 2 ) points which are already connected by Red and Yellow lines. So, no Blue lines can be drawn. Also, drawing any more Yellow lines will result in the formation of Yellow triangles. Thus, no more lines cab be drawn. In this case, C o n d i t i o n 3 is not satisfied here.
So, we replace one Yellow line for a Blue line.
Now, for C o n d i t i o n 1 to be satisfied:
T = ( N − 1 ) + ( N − 3 ) ) + ( 1 )
⇒ T = 2 N − 3
⇒ N 2 − 5 N + 6 = 0
N = { 2 , 3 }
N = 2 is discarded and N = 3 is the solution.
C a s e 2 : Instead of replacing a Yellow line for a Blue line, if we draw only ( N − 4 ) Yellow lines leaving 2 points to be connected by a Blue line, C o n d i t i o n 1 now gives:
T = ( N − 1 ) + ( N − 4 ) + 1
⇒ ( 2 N ) = 2 N − 4
⇒ N 2 − 5 N + 8 = 0
⇒ D i s c r i m i n a n t < 0
Hence, no solution is possible in this case.
C a s e 3 : Draw ( N − 1 ) Red lines such that they form the perimeter of an N - sided polygon such that A 1 , A N are not connected.
Draw Yellow lines from A 3 to all other points except A 1 , A 2 , A 4 , A N . Thus, ( N − 5 ) Yellow lines are drawn.
Draw the Blue lines A 4 A 1 , A 4 A 2 and A N A 1 and A N A 2 , thus forming a Blue hourglass-like structure. Hence, 4 Blue lines are drawn. C o n d i t i o n 2 , 3 , 4 are satisfied.
For C o n d i t i o n 1 to be satisfied:
T = ( N − 1 ) + ( N − 5 ) + 4
⇒ T = 2 N − 2
⇒ N 2 − 5 N + 4 = 0
⇒ N = { 1 , 4 }
N = 1 is discarded and we get N = 4 as the solution.
Interestingly, as we go on decreasing the number of Red lines to ( N − 2 ) , ( N − 3 ) , ( N − 4 ) , … so on, depending on the number, order, method of selection of Red, Yellow and Blue lines we get N = 3 or N = 4 or no solution for N at all. Thus, we conclude that N = 4 and N = 3 are the only solutions satisfying all the conditions.
Now we consider the case when there are ( N + 1 ) Red lines:
Let ( N ) Red lines form the perimeter of an N - sided polygon and draw one Red line such that A 1 , A 4 are connected. For A 1 , A 3 , A N − 1 cannot be chosen as that would result in a Red triangle △ A 1 A 2 A 3 or △ A 1 A N A N − 1 .
Draw Yellow lines from A 1 to all points except A 2 , A N , A 4 . (These points are already connected to A 1 in Red.) Thus, ( N − 4 ) Yellow lines are drawn.
Now, draw the Blue lines A 4 A 2 and A 4 A N . Thus, there are 2 Blue lines. Now, all the points to connected to lines of any 2 of the colours. C o n d i t i o n 2 , 3 , 4 are satisfied.
For C o n d i t i o n 1 to be satisfied:
T = ( N + 1 ) + ( N − 4 ) + ( 2 )
( 2 N ) = 2 N − 1
N 2 − 5 N + 2 = 0
As is seen, there are no positive integral solutions possible for N in this case.
As we go on increasing the number of Red lines to ( N + 2 ) , ( N + 3 ) , … so on, we notice that no positive integral solutions for N are possible.
Thus, we conclude N = 3 and N = 4 are the only possible solutions satisfying the given conditions.
Hence, the largest number of towns meeting all the criteria is 4 .
(I know it's a really long solution and might require additional clarification or there could have been errors at places. Please feel free to point them out or ask any doubts.)