Number of cases in server relaying problem

33 Views Asked by At

There are 4 servers namely X,Y,Z,W. A message after being received by one server is relayed to another server. Find the possible number of cases where a message originating from one server after seven relays reaches the same server.

One possible example of this- W->X->W->Y->Z->X->Y->W

Attempt-> Lets say there are 8 empty places and we need to fill them appropriately. Say, the first place is occupied by W. The last place is also occupied by W. The remaining 6 places can be filled by $3^6$ ways. So total cases- $4*3^6$