Respuesta :
Answer:
For the given problem, the algorithm is as follows:
The value of dominoes pip is between 0 to n
So, the total count of pips is n + 1
Compute the total count of tiles (t) = {(n + 1) * (n + 2)}/2
Each tile consists of two pips, therefore total number of occurrence of pip = t*2
Therefore, the occurrence of each of the pip = Total count of occurrence of pips/total number of pips = (t * 2) / (n + 1)
If the occurrence of individual pip is even in number, then ring is arranged otherwise not.
Example for odd number of n.
Let the value of n = 3
The value of pip is 0, 1, 2, 3
Therefore, the total number of pips = n + 1 = 4
The total number of tiles (t) = {(n + 1) * (n + 2)}/2
= {5 * 4}/2
= 10
Therefore, the tiles would be (0, 0), (0, 1), (0, 2), (0, 3), (1, 1), (1, 2), (1, 3), (2, 2), (2, 3), (3, 3)
Total occurrence of pips = 10 * 2
= 20
Therefore, the count of each pip = (t * 2)/ (n + 1)
= 20/4
= 5
Since, the number of individual pip are odd in number; therefore, ring can’t be formed.
Explanation:
Since, for changing the adjacent tile, the pip value must be same.
Therefore, the occurrence of pip must be in pairs.
Example for even number of n.
Let the value of n = 2
The value of pip is 0, 1, 2
Therefore, the total number of pips = n + 1 = 3
Total number of tiles (t) = {(n + 1) * (n + 2)}/2
= {4 * 3}/2
= 6
Therefore, the tiles would be (0, 0), (0, 1), (0, 2), (1, 1), (1, 2), (2, 2).
Total occurrence of pips = 6 * 2
= 12
Therefore, the count of each pip = (t * 2)/ (n + 1)
= 12/3
= 4
Since, the total number of individual pip are even in number; therefore, ring can be formed.
Explanation: