Provide a Turing machine description in a specific format and simulate it on an arbitrary word.
<state> <letter> <next_state> <letter_to_write> <Direction>
to do…