The Control Room Riddle

Find the minimum number of nodes n n on a graph, that satisfies the following properties:

  • There is exactly one node that is connected to only one other node.
  • And each of the remaining n 1 n-1 nodes is connected to m m other nodes.

Now, prove that a solution exists only for odd values of m m . Let n ( m ) n(m) denote n n as a function of m m . Hence, n ( 3 ) = 6 n(3) = 6 .

Find the value of n ( 7 ) + n ( 21 ) n(7) + n(21) .

Note : Consider this to be a graph theory question and hence no practical notions of a room apply. Each room is nothing but a node on a graph and can be connected to any other room, and not just "adjacent" ones, as would be the case with real rooms. The graph can even be fully connected.


Inspiration : A Ted-Ed video . In the video, they consider each room to be connected to 3 other rooms. What if each room were connected to m m rooms instead? Let the number of rooms be n n in this case, in the video, m = 3 m=3 yields n = 6 n=6 .


The answer is 34.

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.

3 solutions

Ivan Koswara
Jul 6, 2016

We claim that:

n ( m ) = { 2 if $m = 1$ m + 3 if $m$ is odd, $m > 1$ undefined if $m$ is even n(m) = \begin{cases} 2 & \text{if \$m = 1\$} \\ m+3 & \text{if \$m\$ is odd, \$m > 1\$} \\ \text{undefined} & \text{if \$m\$ is even} \end{cases}

For the special case m = 1 m = 1 , it's enough to have 2 vertices; just connect them. Clearly it's impossible with only 1 vertex, since this sole vertex must be adjacent to something else.

For odd m > 1 m > 1 , note that the sum of degrees of all vertices must be even (degree sum formula or double counting; each edge contributes two to the sum). But this sum is equal to 1 + ( n 1 ) m 1 + (n-1)m ; 1 for the odd vertex, and m m for each of the remaining n 1 n-1 vertices. Since m m is odd, we must have n 1 n-1 odd, so n n even. Additionally, we also need n > m n > m ; in a simple graph, the degree of a vertex must be strictly less than the number of vertices (there are only n 1 n-1 other vertices, so the degree must be no greater than n 1 n-1 ). Thus the candidates are m + 1 , m + 3 , m+1, m+3, \ldots .

n = m + 1 n = m+1 vertices aren't enough. n 1 = m n-1 = m of the vertices must be adjacent to m m other vertices; since there are only m m other vertices, these m m vertices are adjacent to all other vertices. But this means the odd vertex is adjacent to all these m m vertices, impossible.

n = m + 3 n = m+3 is easy to make. Label the vertices v 0 , v 1 , v 2 , , v m + 2 v_0, v_1, v_2, \ldots, v_{m+2} . Let v 0 v_0 be adjacent to v m v_m . v m v_m is adjacent to everything other than v m + 1 v_{m+1} and v m + 2 v_{m+2} . For 0 < 2 i 1 < m 0 < 2i-1 < m , v 2 i 1 v_{2i-1} is adjacent to everything other than v 0 v_0 and v 2 i v_{2i} , and for 0 < 2 i < m 0 < 2i < m , v 2 i v_{2i} is adjacent to everything other than v 0 v_0 and v 2 i 1 v_{2i-1} . v m + 1 , v m + 2 v_{m+1}, v_{m+2} are both adjacent to everything other than v 0 v_0 and v m v_m . It can be verified that this works.

For even m m , we can again apply the degree sum formula. The sum of degrees is 1 + ( n 1 ) m 1 + (n-1)m , which must be even. But m m is even, so this sum is always odd, contradiction. Thus n ( m ) n(m) is not defined for even m m .

Finally, we just plug in: n ( 7 ) + n ( 21 ) = ( 7 + 3 ) + ( 21 + 3 ) = 34 n(7) + n(21) = (7+3) + (21+3) = \boxed{34} .

Moderator note:

Great analysis of the problem + generalizing to all values :)

Abhishek Sinha
Jun 23, 2016

Relevant wiki: Graph Theory

Consider the last n 1 n-1 nodes, each with degree m m to conclude ( n 2 ) m + m 1 = ( a ) 2 E ( b ) 2 ( n 1 2 ) = ( n 1 ) ( n 2 ) , (n-2)m+ m-1 \stackrel{(a)}{=} 2 |E| \stackrel{(b)}{\leq} 2\binom{n-1}{2}= (n-1)(n-2), where the equality (a) follows from the Handshaking lemma and (b) follows from the maximum number of edges in a graph with n 1 n-1 nodes. From the equality (a) it follows that m m must be odd and n n must be even. Plugging in m = 7 , 21 m=7,21 we get the minimum values of n n , which is not difficult to see to be feasible.

Shashwat Shukla
Jun 22, 2016

Relevant wiki: Graph Theory

The general formula for n n is:

n ( m ) = m + 3 n(m) = m + 3 ; \forall odd m 3 m \geq 3

Let the number of edges on a graph be k k .
An important observation is to note that

k = ( n 1 ) m + 1 2 k = \frac{(n-1)*m + 1}{2} .

This immediately allows us to eliminate all even m m . Because if m m is even, then k k won't be an integer. Hence no solution exists for even m m .

It is also a trivial observation that a valid graph will have atleast m + 1 m+1 nodes.
Our proposed answer is m + 3 m+3 . So, first we prove that m + 2 m+2 can never be a solution:

That is very easy. Again just substitute n = m + 2 n = m + 2 into the equation for k k . Using the fact that m m is odd, prove that k k will not be an integer. Hence m + 2 m+2 can never be a solution.

Next we consider our proposed solution of n = m + 3 n = m + 3 . In this case, we can always construct a valid solution as follows:

Let the rooms be labelled as x 1 , x 2 , . . . x m + 3 x_{1}, x_{2}, ... x_{m+3} .

  • x 1 x_{1} is the control room.
  • x 2 x_{2} is the room connected to the control room.
  • Consider rooms x 3 x_{3} through x m + 1 x_{m+1} . Connect each of these rooms to x 2 x_{2} . Now, the connectivity of x 1 x_{1} and x 2 x_{2} has been satisfied.
  • Now connect rooms x 3 x_{3} through x m + 1 x_{m+1} to each other. For example, x 5 x_{5} is now connected to each of x 3 , x 4 , x 6 , . . . x m + 1 x_{3}, x_{4}, x_{6}, ... x_{m+1} .
  • This leaves us with two nodes to consider: x m + 2 x_{m+2} and x m + 3 x_{m+3} . Connect both of these to each other. Then connect both of these to each of x 3 , x 4 , x 5 , . . . x m + 1 x_{3}, x_{4}, x_{5}, ... x_{m+1} . Note that the connectivity of x m + 2 x_{m+2} and x m + 3 x_{m+3} is now satisfied.
  • But now one can note that each of x 3 x_{3} through x m + 1 x_{m+1} is connected to m + 1 m+1 nodes instead of m m . To rectify this, pair up the nodes x 3 x_{3} through x m + 1 x_{m+1} . And delete the edge connecting these paired up nodes. For example, pair up x 3 x_{3} with x 4 x_{4} and x 5 x_{5} with x 6 x_{6} ... and delete the edge connecting x 3 x_{3} with x 4 x_{4} and delete the edge connecting x 5 x_{5} with x 6 x_{6} ...

We have created a valid graph!

Having proven our result,
n ( 7 ) + n ( 21 ) = ( 7 + 3 ) + ( 21 + 3 ) = 34 n(7)+ n(21) = (7 + 3) + (21 + 3) = \mathbf{34}

Nice problem, @Shashwat Shukla ! (+1)

Geoff Pilling - 4 years, 11 months ago

Glad you liked it :)

Shashwat Shukla - 4 years, 11 months ago

Avoid double duty on your notation. IE n ( ) n(\cdot) is a function and n n is the number of nodes.

Calvin Lin Staff - 4 years, 11 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...