Question: Draw a state diagram that depicts a simple system that stacks and unstuck a set of Russian "Matryoshka" dolls. Matryoshka dolls are hollow wooden dolls that can be separated in two parts, revealing a smaller doll inside, which can itself be separated, and so on, until the smallest, solid doll is reached. The system has four states: ready (dolls stacked), ready (dolls unstacked), stacking, and unstacking. Suppose the subsequent details of the system operation:
- the system can transition between stacking and unstacking mid-sequence; that is, it can switch to stacking again even before all dolls have been unstacked, and vice versa
- the system will never stack or unstack dolls out of order; dolls are always placed inside the next largest doll.
I am having difficulty with this question because I do not know where to start and how to answer this problem.