Found 1261 Articles for Computers

Show that the set of recursive languages is closed under reversal?

Bhanu Priya
Updated on 16-Jun-2021 13:29:59

549 Views

Consider a Language L, over an alphabet T is known as recursive enumerable if there exists a turing machine (TM) which generates a sequence of numbers T* which have precisely the members of L.Whereas L is said to be recursive if there exists a Turing Machine enlisting all members of L and stopping on each member of L as the input.Thus it is clear from the above statements that every recursive language is also recursively enumerable but the converse is not true.The precise connection between families of languages is given below.TheoremStep 1 − A language L is said to be ... Read More

Explain the Closure Under Kleene Star of CFL in TOC?

Bhanu Priya
Updated on 16-Jun-2021 13:29:01

444 Views

If L is a CFL, then L*is a CFL. Here CFL refers to Context Free Language.StepsLet CFG for L has nonterminal S, A, B, C, . . ..Change the nonterminal from S to S1.We create a new CFG for L* as follows −Include all the nonterminal S1, A, B, C, . . . from the CFG for L.Include all productions of the CFG for L.Add new nonterminal S and new productionS → S1S | ∧We can repeat last productionS → S1S → S1S1S → S1S1S1S → S1S1S1S1S → S1S1S1S1∧ → S1S1S1S1Note that any word in L* can be generated by ... Read More

Explain the context free language closure under concatenation?

Bhanu Priya
Updated on 16-Jun-2021 13:28:14

682 Views

Here CFL refers to Context Free Language. Now, let us understand closure under concatenation.Closure under ConcatenationsIf L1 and L2 are CFLs, then L1L2 is a CFL.Follow the steps given below −L1 CFL implies that L1 has CFG1 that generates it.Assume that the nonterminals in CFG1 are S, A, B, C, . . ..Change the nonterminal in CFG1 to S1, A1, B1, C1, . . ..Don’t change the terminals in the CFG1.L2 CFL implies that L2 has CFG2 that generates it.Assume that the nonterminals in CFG2 are S, A, B, C, . . ..Change the nonterminal in CFG2 to S2, A2, ... Read More

Explain the context free language closure under union operation?

Bhanu Priya
Updated on 16-Jun-2021 13:27:48

517 Views

If L1 and L2 are CFLs, then their union L1 + L2 is a CFL.Here CFL refers to Context Free Language.L1 CFL implies that L1 has a CFG, let it is CFG1, that generates it.Assume that the nonterminals in CFG1 are S, A, B, C, . . ..Change the nonterminal in CFG1 to S1, A1, B1, C1, . . ..Don’t change the terminals in the CFG1.L2 CFL implies that L2 has a CFG, Let it is CFG2, that generates it.Assume that the nonterminals in CFG2 are S, A, B, C, . . ..Change the nonterminal in CFG2 to S2, A2, ... Read More

Explain Set relations and operations in TOC?

Bhanu Priya
Updated on 16-Jun-2021 13:26:53

2K+ Views

Let us begin by understanding about the subset in the theory of computation (TOC).SubsetIf A and B are sets, then A ⊂ B (A is a subset of B) if w ∈ A which implies that w ∈ B; that is every element of A is also an element of B.ExamplesLet A = {ab, ba} and B = {ab, ba, aaa}. Then A ⊂ B, but B ⊄ A.Let A = {x, xx, xxx, . . .} and B = {∧, x, xx, xxx, . . .}. Then, A ⊂ B, but B ⊄ A.Let A = {ba, ab} and ... Read More

Explain the concept of strings in TOC?

Bhanu Priya
Updated on 16-Jun-2021 13:26:16

4K+ Views

A string over an alphabet is a finite sequence of letters from the alphabet.Examplestoc, money, c, and adedwxq are strings over the alphabet ∑ = {a, b, c, . . . , z}.84029 is a string over the alphabet ∑ = {0, 1, 2, . . . , 9}.Empty StringThe empty string or null string, denoted by ∧, is the string consisting of no letters, no matter what type of language we are considering.String concatenationGiven two strings w1 and w2, we define the concatenation of w1 and w2 to be the string as w1w2.ExamplesIf w1 = pq and w2 = ... Read More

Explain the concept of set in TOC?

Bhanu Priya
Updated on 16-Jun-2021 13:25:26

2K+ Views

A set is an unordered collection of objects or an unordered collection of elements. Sets are always written with curly braces {}, and the elements in the set are written within the curly braces.ExamplesThe set {a, b, c} has elements a, b, and c.The sets {a, b, c} and {b, c, b, a, a} are the same since order does not matter in a set and since redundancy also does not count.The set {a} has element a. Note that {a} and a are different things; {a} is a set with one element a.The set {xn: n = 1, 2, 3, ... Read More

Generate a Context-free grammar for the language L = {anbm| m≠n}?

Bhanu Priya
Updated on 16-Jun-2021 13:21:38

5K+ Views

A context-free grammar is a quadruple G = (N, T, P, S), Where, N is a finite set of nonterminal symbols, T is a finite set of terminal symbols, N ∩ T = ∅, P is a finite set of productions of the form A → α, Where A ∈ N, α ∈ (N ∪ T)*, S is the start symbol, S ∈ N.Construct a Context free grammar for the language, L = {anbm| m ≠n}Case 1n > m − We generate a string with an equal number of a’s and b’s and add extra a’s on the left −S ... Read More

Give implementation-level descriptions of a Turing machine?

Bhanu Priya
Updated on 16-Jun-2021 13:19:57

2K+ Views

A Turing machine (TM) can be formally described as seven tuples −(Q, X, ∑, δ, q0, B, F)Where, Q is a finite set of states.X is the tape alphabet.∑ is the input alphabet.δ is a transition function:δ𝛿:QxX->QxXx{left shift, right shift}.q0 is the initial state.B is the blank symbol.F is the final state.A Turing machine T recognises a string x (over ∑) if and only when T starts in the initial position and x is written on the tape, T halts in a final state.T is said to recognize a language A, if x is recognised by T and if and ... Read More

State the worst case number of states in DFA and NFA for a language?

Bhanu Priya
Updated on 16-Jun-2021 12:48:43

343 Views

A Deterministic Finite automata (DFA) is a five tuplesM=(Q, ∑, δ, q0, F)Where, Q − Finite set called states.∑ − Finite set called alphabets.δ − Q × ∑ → Q is the transition function.q0 ∈ Q is the start or initial state.F − Final or accept state.Let’s see the worst case number of states in DFA for the language A∩B and A*Let A and B be the two states, |A| = number of states = nA|B| = number of states = nBDFA = |A∩B|   =nA.nB|A ∪ B| =nA.nB|A*|=3/4 2nA|AB| = nA (2nB-2nB-1)NFAThe non-deterministic finite automata (NFA) also have five states ... Read More

Advertisements