DEV Community

Meu57
Meu57

Posted on

Alice: How we can understand TOC?

Image description

Alice: “How can we understand TOC in our real life? Can you break down how we see Theory of Computation (TOC) in our everyday lives?”

Bob: “Absolutely! Take our recent trip to the supermarket. Have you noticed how there were two doors for exiting and a separate one for entering?

Alice: “Yes!!”

Bob: That’s a practical example of TOC at play. We encounter it all the time, especially in electromechanical devices.”

Alice: “Like what exactly?”

Bob: “Think about those automatic doors at the supermarket entrance. They swing open when you approach, right? That’s controlled by a device at the heart of the mechanism.” *

Alice: “And how does that device work?”

Bob: “Well, it’s pretty clever. There’s a sensor pad in front that detects someone coming. Then, there’s another pad at the back to make sure the door stays open long enough for you to pass through safely.”

Alice: “So, this device has two states, either ‘OPEN’ or ‘CLOSED,’ depending on what?”

Bob: “Exactly! And it responds to four possible inputs: ‘FRONT’, ‘REAR’, ‘BOTH’, or ‘NEITHER’. Based on these inputs, it switches between its states.”

Alice: “Could you give me an example?”

Bob: “Sure thing. Let’s say A person walks up to the door from the front (‘FRONT’ signal). The door opens (‘OPEN’).

The person is now behind the door (‘REAR’ signal). The door stays open (‘OPEN’).
The person walks away, and no one is at the door (‘NEITHER’ signal). The door closes (‘CLOSED’).
Another person walks up to the door from the front (‘FRONT’ signal). The door opens again (‘OPEN’).
Now, there are people at both sides of the door (‘BOTH’ signal). The door stays open (‘OPEN’).
Everyone walks away from the door (‘NEITHER’ signal). The door closes (‘CLOSED’).
A person walks up to the door from the back (‘REAR’ signal). The door stays closed (‘CLOSED’).
The person walks away, and no one is at the door again (‘NEITHER’ signal). The door stays closed (‘CLOSED’).
So, the door’s state changes based on whether someone is near it or not. This is a simple example of how a finite automaton, a concept in Theory of Computation, works in real life.”

Alice: “So, viewing the automatic door controller as a finite automaton helps us understand its behavior better?”

Bob: “Exactly! It’s like looking at a simple computer with just a single bit of memory, capable of remembering whether it’s ‘OPEN’ or ‘CLOSED’. More complex devices like elevator controllers might need more memory bits to track their states. This approach helps us grasp the design of various devices, from household appliances to digital watches, using the concepts of finite automata.”

*Reference Introduction to the theory of Computation by Michael Sipser

NextPage

Back

Top comments (0)