Comprehensive Study Notes: Theory of Computer Science - Automata, Languages and Computation
Propositions and Predicates
Definition of Proposition: A proposition (or statement) is a declarative sentence that can be assigned exactly one of two truth values: true () or false ().
Logical Connectives:
Negation (NOT): Denoted by . If is true, is false.
Conjunction (AND): Denoted by . It is true only if both and are true.
Disjunction (OR): Denoted by . This is the inclusive OR, meaning it is true if is true, is true, or both are true.
Implication (IF… THEN): Denoted by . It is false only when is true and is false. If is false, the implication is true regardless of the value of .
If and Only If (Biconditional): Denoted by . It is true when both and have the same truth value.
Well-formed Formulas (wff): A recursive definition where:
A propositional variable is a wff.
If is a wff, then is a wff.
If and are wffs, then , , , and are wffs.
Tautology and Contradiction:
A tautology is a formula that is true for all possible assignments of truth values to its variables (e.g., ).
A contradiction is a formula that is false for all possible assignments (e.g., ).
Normal Forms:
Disjunctive Normal Form (DNF): A sum (disjunction) of elementary products (conjunctions of literals).
Principal Disjunctive Normal Form (PDNF): A unique representation as a sum of minterms. A minterm is a product where every variable in the formula appears exactly once (either as or ).
Conjunctive Normal Form (CNF): A product of elementary sums.
Rules of Inference: These are tautologies in the form of implications used for valid arguments:
Modus Ponens: From and , infer .
Modus Tollens: From and , infer .
Hypothetical Syllogism: From and , infer .
Disjunctive Syllogism: From and , infer .
Predicate Calculus: Extends propositional logic to include predicates and quantifiers.
Universal Quantifier (): Means "for all."
Existential Quantifier (): Means "there exists."
Bound and Free Variables: A variable is bound if it is within the scope of a quantifier; otherwise, it is free.
Mathematical Preliminaries
Set Theory: A set is a well-defined collection of objects. Operations include:
Union (): Elements in or .
Intersection (): Elements in both and .
Complement (): Elements in that are not in .
Power Set (): The set of all subsets of .
Algebraic Systems:
Semigroup: A set with a binary operation that is closed and associative.
Monoid: A semigroup with an identity element ().
Group: A monoid where every element has an inverse.
Relations: A subset of . Properties include:
Reflexive: for all .
Symmetric: .
Transitive: .
Equivalence Relation: A relation that is reflexive, symmetric, and transitive, partitioning the set into disjoint equivalence classes.
Functions: A map :
One-to-one (Injective): Distinct inputs have distinct outputs.
Onto (Surjective): Every output has at least one corresponding input.
Bijection: Both one-to-one and onto.
Pigeonhole Principle: If objects are placed in places and , then at least one place must contain two or more objects.
Graphs and Trees:
Graph: Vertices and edges connecting them.
Tree: A connected graph with no circuits.
Binary Tree: A tree where the root has degree 2 and other internal vertices have degree 3. The number of leaves in a binary tree with vertices is , and is always odd.
Strings: Finite sequences of symbols from an alphabet .
Levi's Theorem: If , then there exists a unique string such that either and , or and .
The Theory of Automata
Discrete Automaton Model: Consists of input (), output (), states (), a state relation (transition function), and an output relation.
Moore Machine: Output depends only on the current state ().
Mealy Machine: Output depends on both the current state and the input ().
Finite Automata (FA): Represented by a 5-tuple .
DFA: Deterministic Finite Automaton (one unique next state per input).
NDFA (or NFA): Nondeterministic Finite Automaton (set of possible next states).
Equivalence of DFA and NFA: For every NFA, there exists an equivalent DFA that accepts the same language. If the NFA has states, the equivalent DFA may have up to states.
Minimization of FA: An algorithm that identifies equivalent states (-equivalence) to construct an automaton with the minimum possible number of states.
Formal Languages
Grammar: Defined as , where is the set of variables, is the terminal alphabet, is the set of productions, and is the start symbol.
Chomsky Classification:
Type 0 (Unrestricted): No restrictions on productions (Recursive Enumerable).
Type 1 (Context-Sensitive): Productions are of the form with (Context-Sensitive Language).
Type 2 (Context-Free): Left-hand side is a single variable () (Context-Free Language).
Type 3 (Regular): Productions are or (Regular Language).
Language Hierarchy: .
Regular Sets and Regular Grammars
Regular Expressions: Represent regular sets. Basic operations are union (), concatenation (product), and iteration (Kleene closure ).
Arden's Theorem: Given the equation , if does not contain the empty string , then the unique solution is .
Pumping Lemma for Regular Sets: A string in a regular set of length can be split into three parts (, ) such that is in the language for all . This is used to prove a set is not regular.
Closure Properties: Regular sets are closed under union, concatenation, closure, transpose, complementation, and intersection.
Context-Free Languages (CFL)
Derivation Trees (Parse Trees): Graphical representation of string generation. The yield of the tree is the terminal string derived.
Ambiguity: A grammar is ambiguous if a string has more than one derivation tree or more than one leftmost derivation.
Simplification:
Eliminate variables that do not derive any terminal string.
Eliminate symbols that do not appear in any sentential form.
Eliminate null productions ().
Eliminate unit productions ().
Chomsky Normal Form (CNF): Every production is of the form or .
Greibach Normal Form (GNF): Every production is of the form , where is a terminal and is a string of variables.
Pumping Lemma for CFLs: For a CFL, there exists a constant such that a string () can be split into (, ) such that is in the language for all .
Pushdown Automata (PDA)
Definition: An extension of finite automata with a pushdown store (stack). Represented by .
Acceptance: PDA can accept by reaching a final state or by having an empty stack (null store).
Relations: A language is a CFL if and only if it is accepted by a PDA. Deterministic PDAs accept a proper subclass of CFLs called deterministic languages.
Turing Machines (TM) and Linear Bounded Automata (LBA)
Standard Turing Machine: A finite control with a read/write head moving on an infinite tape. Moves are specified as , where .
Instantaneous Description (ID): Represents the tape contents, state, and head position (e.g., ).
Construction Techniques: Use of storage in state, multiple tracks, and subroutines.
Multitape TM: Equivalent in power to a single-tape TM. To simulate moves of a multitape TM, a single-tape TM requires time.
Nondeterministic TM (NTM): Equivalent to a deterministic TM.
LBA: A nondeterministic TM where the tape is restricted to a linear function of the input length. LBAs accept Context-Sensitive Languages.
Decidability and Computability
Recursive Language: A language accepted by a TM that halts on all inputs.
Recursively Enumerable (RE) Language: A language accepted by a TM; it may not halt if the input is not in the language.
Uncountability: The set of all languages over an alphabet is uncountable, but the set of TMs is countable, proving languages exist that are not RE.
Halting Problem: The decision problem of whether a given TM halts on a specific input is undecidable.
Post Correspondence Problem (PCP): Determining if two lists of strings can form matching sequences. PCP is undecidable for alphabets with size .
Primitive Recursive Functions: Built from initial functions (Zero, Successor, Projection) using composition and recursion.
Ackermann's Function: A recursive function that is not primitive recursive.
Complexity Theory
Growth Rate: Measured using Big-Oh notation (). Polynomial growth is generally considered efficient, while exponential growth is inefficient.
Class P: Languages decidable by a deterministic TM in polynomial time.
Class NP: Languages decidable by a nondeterministic TM in polynomial time.
NP-Complete: A language is NP-complete if it is in NP and every language in NP can be reduced to in polynomial time.
Cook's Theorem: The Satisfiability Problem (SAT) is NP-complete.
Quantum Computation: Uses quantum bits (qubits) like . Quantum computers can potentially solve certain problems (like factoring) more efficiently than classical computers using principles like superposition and entanglement.