SHOW ALL WORKINGS Show, by drawing the state transition diagram of…