A Turing machine is a mathematical model of computation that consists of an infinite tape divided into cells, a head that reads and writes symbols on the tape, and a finite set of states. Alan Turing invented the Turing machine in 1936 to formalize the idea of algorithmic computation. A Turing machine operates by reading a symbol from the tape according to its transition function, then writing a symbol, changing its state, and moving the head left or right. If the machine reaches an accepting state, the input is accepted, otherwise it is rejected.