# Theory of Computation: Question Set – 11

#### What is a deterministic pushdown automaton (DPDA), and how is it used to recognize context-free languages?

A deterministic pushdown automaton (DPDA) is a type of pushdown automaton where each transition is uniquely determined by the current state, input symbol, and top symbol of the stack. DPDA can be used to recognize context-free languages by pushing and popping symbols on a stack, which allows it to keep track of nested structures in the input string.

#### Can you explain the difference between a deterministic finite automaton (DFA) and a nondeterministic finite automaton (NFA)?

A deterministic finite automaton (DFA) is a type of finite automaton where each transition is uniquely determined by the current state and input symbol. In contrast, a nondeterministic finite automaton (NFA) may have multiple transitions from a state on the same input symbol or may have ε-transitions that allow it to transition without reading an input symbol. NFAs are more expressive than DFAs but are also harder to design and analyze.

#### What is the difference between a complete DFA and an incomplete DFA?

A complete DFA is a type of DFA where every state has a transition on every input symbol in the alphabet. An incomplete DFA is a DFA where some states do not have a transition on one or more input symbols. Complete DFAs are easier to work with and can be converted to incomplete DFAs by adding a sink state to handle missing transitions.

#### What is a state minimization algorithm, and how is it used to simplify a DFA?

A state minimization algorithm is an algorithm that takes a DFA as input and produces an equivalent DFA with the minimum number of states. State minimization algorithms work by merging equivalent states, where two states are considered equivalent if they have the same set of outgoing transitions on all input symbols. The resulting DFA is simpler and easier to work with.

#### Can you explain the difference between a language and a regular expression?

A language is a set of strings over an alphabet, while a regular expression is a concise notation for describing a language as a pattern of symbols and operators. A regular expression can be used to generate the language it describes, and a language can be described by one or more regular expressions.

#### What is the difference between an ε-transition and a normal transition in an NFA?

An ε-transition is a transition in an NFA that does not read an input symbol but allows the automaton to transition to another state. A normal transition, in contrast, is a transition that reads an input symbol and transitions to a new state based on the input symbol.

#### Can you explain the difference between a state machine and a finite automaton?

A state machine is a mathematical model that consists of a set of states, a set of inputs, and a set of transitions that define how the machine changes state based on the input. A finite automaton is a type of state machine that is used to recognize regular languages. While all finite automata are state machines, not all state machines are finite automata.

A prefix of a string is any substring that appears at the beginning of the string, while a suffix is any substring that appears at the end of the string. Finite automata can be used to recognize prefixes and suffixes of a language by modifying the accept states to indicate when a prefix or suffix has been recognized. For example, a DFA can be constructed to recognize all strings that have a given prefix but may have additional characters after the prefix.