Proof that CFLs are not closed under intersection
AnswerLet L₁={aⁱbⁱcʲ:i,j≥0} and L₂={aⁱbʲcʲ:i,j≥0}. Both are context-free: L₁ has grammar S→AC, A→aAb|ε, C→cC|ε; L₂ has S→AB, A→aA|ε, B→bBc|ε. Their intersection is {aⁿbⁿcⁿ:n≥0}.…
Read more →AnswerLet L₁={aⁱbⁱcʲ:i,j≥0} and L₂={aⁱbʲcʲ:i,j≥0}. Both are context-free: L₁ has grammar S→AC, A→aAb|ε, C→cC|ε; L₂ has S→AB, A→aA|ε, B→bBc|ε. Their intersection is {aⁿbⁿcⁿ:n≥0}.…
Read more →AnswerThe incoming outputs are 0 for q0, 1 for q1 and 2 for q2, so no state splitting is needed. Define Moore…
Read more →AnswerP is the class of decision languages decidable by a deterministic Turing machine in time O(nᵏ) for some fixed constant k. The…
Read more →AnswerA trap or sink state is a state that transitions to itself on every input symbol. A rejecting sink cannot lead to…
Read more →AnswerA DFA is a five-tuple (Q,Σ,δ,q₀,F), where Q is finite, Σ is the input alphabet, δ is a total deterministic transition function,…
Read more →AnswerA PDA is (Q,Σ,Γ,δ,q₀,Z₀,F), with stack alphabet Γ and initial stack symbol Z₀. Its ID is (q,w,γ): current state, unread input and…
Read more →AnswerA grammar is ambiguous if some word has two distinct leftmost derivations. Choose abab. First derivation: S ⇒ aSbS ⇒ abS ⇒…
Read more →AnswerFirst convert the expression to an ε-NFA using Thompson construction. Remove ε-transitions or convert to a DFA by subset construction. For each…
Read more →AnswerUse S → 011S | 1S | T and T → 01T | ε. The first variable generates any finite sequence of…
Read more →AnswerA multitape TM has k tapes with separate read/write heads. Its transition function maps a state and k scanned symbols to a…
Read more →Ask a study question in English or Hindi. I will find relevant passages from our notes.