The below problem has been taken from Mathematics for Computer Science (MIT Opencourseware https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-spring-2015/readings/MIT6_042JS15_textbook.pdf Problem 5.35)
Suppose that you have a regular deck of cards arranged as follows, from top to bottom: 0000000000000111111111111111111111111110000000000000 Note I have represented only whether card is black or not. 0 representing white, 1 otherwise. Only two operations on the deck are allowed: inshuffling and outshuffling. In both, you begin by cutting the deck exactly in half, taking the top half into your right hand and the bottom into your left. Then you shuffle the two halves together so that the cards are perfectly interlaced; that is, the shuffled deck consists of one card from the left, one from the right, one from the left, one from the right, etc. The top card in the shuffled deck comes from the right hand in an outshuffle and from the left hand in an inshuffle
I have tried observing the invariant condition here and writing a few state transitions however I haven't been able to identify any useful property. Could you all suggest something ?