Palindrome in Python

Let’s examine how to determine whether a word or sentence is palindrome or not in python. Words and/or sentences are palindrome when you can read them from beginning to end and vice versa and have the same meaning. In the case of sentences, we don’t consider the spaces and punctuation. Some examples are: Civic Radar

Palindrome in Python Read More »

Construct a deterministic finite-state automaton that recognizes the set of all bit strings that contain exactly three 0s.

We will follow a similar approach to previous exercises to solve this exercise. Let’s define 5 states as follows: S0, the initial state S1 is the state when the automata read exactly one 0 S2 is the state when the automata read exactly two 0s S3 is the state when the automata read exactly three

Construct a deterministic finite-state automaton that recognizes the set of all bit strings that contain exactly three 0s. Read More »