I need to design an FSM sequence detector that activates when it detects the sequences 01011 and 00101. The problem is that I don't know how, for example, when state s3 receives the value 0 and reaches 010, to make s3 transition to 001 if it receives a 1. This is the design I made:

I need someone to help me not to make the complete diagram but to give me a brief textual summary of how the transitions should be depending on whether they receive 1 or 0."

I need someone to help me not to make the complete diagram but to give me a brief textual summary of how the transitions should be depending on whether they receive 1 or 0."