A computer science problem by Thaddeus Abiy

Find the 10 × 10 10 \times 10 adjacency matrix A A of the graph above.

Input det ( ( A 2 + A K ) 2 ) \det \left( \frac{( A^2 + A - K )}{2} \right) as your answer.

Details and assumptions

  • K K is the 10 × 10 10 \times 10 matrix which has 1 1 for all entries.


The answer is 1.

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.

2 solutions

Laurent Shorts
Apr 20, 2016

Computer science answer:

A = ( 0 1 0 0 1 1 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 1 1 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 0 0 0 1 0 1 1 0 0 ) A=\begin{pmatrix} 0&1&0&0&1&1&0&0&0&0\\ 1&0&1&0&0&0&1&0&0&0\\ 0&1&0&1&0&0&0&1&0&0\\ 0&0&1&0&1&0&0&0&1&0\\ 1&0&0&1&0&0&0&0&0&1\\ 1&0&0&0&0&0&0&1&1&0\\ 0&1&0&0&0&0&0&0&1&1\\ 0&0&1&0&0&1&0&0&0&1\\ 0&0&0&1&0&1&1&0&0&0\\ 0&0&0&0&1&0&1&1&0&0\\ \end{pmatrix}

A 2 = ( 3 0 1 1 0 0 1 1 1 1 0 3 0 1 1 1 0 1 1 1 1 0 3 0 1 1 1 0 1 1 1 1 0 3 0 1 1 1 0 1 0 1 1 0 3 1 1 1 1 0 0 1 1 1 1 3 1 0 0 1 1 0 1 1 1 1 3 1 0 0 1 1 0 1 1 0 1 3 1 0 1 1 1 0 1 0 0 1 3 1 1 1 1 1 0 1 0 0 1 3 ) A^2=\begin{pmatrix} 3&0&1&1&0&0&1&1&1&1\\ 0&3&0&1&1&1&0&1&1&1\\ 1&0&3&0&1&1&1&0&1&1\\ 1&1&0&3&0&1&1&1&0&1\\ 0&1&1&0&3&1&1&1&1&0\\ 0&1&1&1&1&3&1&0&0&1\\ 1&0&1&1&1&1&3&1&0&0\\ 1&1&0&1&1&0&1&3&1&0\\ 1&1&1&0&1&0&0&1&3&1\\ 1&1&1&1&0&1&0&0&1&3\\ \end{pmatrix}

A 2 + A K 2 = I 10 \frac{A^2+A-K}{2}=I_{10} which has det=1.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
A = [[0, 1, 0, 0, 1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 0, 1, 0, 0, 0], [0, 1, 0, 1, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 1, 0, 0, 0, 1, 0], [1, 0, 0, 1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 1, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0, 0, 1], [0, 0, 0, 1, 0, 1, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 1, 0, 0]]
B = []

for i in xrange(10):
    B += [ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ]
    for j in xrange(10):
        B[i][j] += A[i][j] - 1
        for k in xrange(10):
            B[i][j] += A[i][k] * A[k][j]

print "\n".join([str(line) for line in B])

Output:

[2, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 2, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 2, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 2, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 2, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 2, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 2, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 2, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 2, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 2]

Mathematics answer:

A 2 = ( b i j ) A^2=(b_{ij}) gives the number of path of length 2 from vertex i i to vertex j j , which is 3 if i = j i=j , 0 if vertices are neighbours and 1 if they're not. Then, A + A 2 A+A^2 gives the number of path of length 1 or 2 between vertices, which is 3 if the end vertex is the same as the starting one, and 1 in the other cases.

Ishu Bansal
Sep 14, 2019

If A = ( a i j ) A = (a_{ij}) is an adjacency matrix of an unordered graph, then A 2 = ( b i j ) A^2 = (b_{ij}) , where b i j b_{ij} is the number of adjacent vertices shared by vertex i i and j j . In the above graph, it is clearly visible that

  • each vertex has three adjacent vertices, hence share all 3 3 adjacent vertices with itself => b i i = 3 b_{ii} = 3
  • each vertex share z e r o zero adjacent vertices with each of its adjacent vertices => b i j = 0 b_{ij} = 0 , where a i j = 1 a_{ij} = 1
  • each vertex share 1 1 adjacent vertex with all other vertices => b i j = 1 b_{ij} = 1 , where a i j = 0 a_{ij} = 0 and i j i \neq j

With simple observation, we see that K A K - A will give something similar to A 2 A^2 . What's missing is that all the diagonal elements are 1 instead of 3 as desired. So final step, add 2 I 10 2I_{10} into that. Hence finally A 2 = K A + 2 I A^2 = K - A + 2I or

A 2 + A K 2 = I \frac {A^2 + A - K}{2} = I

Ans : det ( I ) (I) = 1

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...