Directions for question
Under the reign of the Roman emperor Commodus in 600 C.E., ‘munera’s, or gladiator fights, held in the Colosseum Arena in Rome were a very common occurrence.
The entrance to the Colosseum Arena by the gladiators took place through five underground corridors opening out to five gates with doors arranged in a row. On one day of the gladiator fight, five infamous gladiators – Spartacus, Crixus, Maximus, Flamma and Tetraites – were to enter the arena through the gates, from left to right respectively, in that order. He whose door was opened had to step out on the arena and fight. Who of the gladiators would fight who depended entirely on the fancy of Emperor Commodus, who controlled the opening or closing of doors using a system of codes. More than two gladiators could fight each other in the arena.
If the door to a gate was to be opened, the code was A (A for Aperio in Latin or open), and if the door to a gate was to be closed, the code was C (C for Clausula in Latin or close). Thus if Emperor Commodus finally stopped at the code ACACC, it meant that he wanted the doors of the first and third gate from the left to the right to be opened, that is Spartacus and Maximus should fight.
On that particular day Emperor Commodus started when the code was initially set at CACAC. He could change the code, but only by using some number of steps, wherein in each step the state of only two consecutive doors could be changed. However he had to reach his desired code using the minimum number of steps. At least one change was mandatory.
Question
What could have been the maximum number of steps Emperor Commodus needed to implement to generate any final code, taking the minimum number of steps possible to do so, for the doors of the five gates of the Colosseum Arena on that particular day ?
4
-
-
-
On that particular day Emperor Commodus started when the code was already set at CACAC
Now suppose Emperor Commodus wanted to make the final code to AACAA.
It is to be noted that only the first and fifth code (from left to right) has been changed.
To enable that, the minimum number of steps Emperor Commodus needed to take were :
Initial : CACAC
Step 1 : ACCAC
Step 2 : AAAAC
Step 3 : AAACA
Step 4 : AACAA
Hence, the maximum number of steps Emperor Commodus needed to implement to generate any final code, taking the minimum number of steps possible to do so, for the doors of the five gates of the Colosseum Arena was when he would want to change only the code of the first and fifth door (from left to right) from what was initially, and the number of steps to do that was 4