Found 1263 Articles for Computers

Prove that CFL is closed under union and star but not under intersection?

Bhanu Priya
Updated on 16-Jun-2021 14:03:48

2K+ Views

CFL refers to Context Free Language in the theory of computation (TOC). Let us now understand how CFL is closed under Union.CFL is closed under UNIONIf L1 and L2 are CFL’s then L1 U L2 is also CFL.Let L1 and L2 are generated by the Context Free Grammar (CFG).G1=(V1, T1, P1, S1) and G2=(V2, T2, P2, S2) without loss of generality subscript each non terminal of G1 and a1 and each non terminal of G2 with a2 (so that V1∩V2=φ).Subsequent steps are used production entirely from G1 or from G2.Each word generated thus is either a word in L1 or ... Read More

Show that the set of all languages that are not recursively enumerable on {a} is not countable?

Bhanu Priya
Updated on 16-Jun-2021 14:03:14

2K+ Views

A Recursively enumerable language is the language that accepts every string otherwise not. If a language that halt on every string, then we call it as recursive language.ProblemWe need to prove that the set of all languages that are not recursively enumerable on {a} is not countable.First let see what the recursive enumerable language is −Recursive Enumerable LanguageA language L is recursively enumerable if L is the set of strings accepted by some TM.If L is a recursive enumerable language then −if w ∈ L then a TM halts in a final state, if w ∉ L then a TM ... Read More

Prove that the Cartesian product of a finite number of countable sets is countable?

Bhanu Priya
Updated on 16-Jun-2021 14:02:46

2K+ Views

ProblemWe have to prove that the cartesian product of a finite number of countable sets is countable.SolutionLet the X1, X2 ,…….. Xn be the countable sets.Yk= X1 * X2 * …….* Xk when k =1……. N). Thus, Yn := X1 * X2 * · · · * XnProofUsing the induction −In case k = 1 then Y1 = X1 is countable.Assuming that Yk (k ∈ n, 1 ≤ k < n) is countable;Then Yk+1 = ( X1 * X2 * …….* Xk) * Xk+1 = Yk * Xk+1 where the Yk and the Xk+1 can be called countable. Hence the ... Read More

What are the P class and NP class in TOC?

Bhanu Priya
Updated on 16-Jun-2021 14:02:14

16K+ Views

To begin with, let us learn about the P class in the theory of computation (TOC).P-ClassThe class P consists of those problems that are solvable in polynomial time, i.e. these problems can be solved in time O(n k) in the worst-case, where k is constant.These types of problems are called tractable and others are called intractable or super polynomial.Generally, an algorithm is a polynomial time algorithm, if there exists a polynomial p(n) such that the algorithm can solve any instance of size n in a time O(p(n)).Problems requiring Ω(n 50) time to solve are essentially intractable for large n. Most ... Read More

Explain about pumping lemma for context free language?

Bhanu Priya
Updated on 16-Jun-2021 13:41:23

946 Views

ProblemExplain the pumping lemma for context free language by showing that the language of strings in the form xnynzn is not a context free language.SolutionPumping lemma (Context free grammar)We can prove that a particular language is not context free grammar using pumping lemma.Let’s take the concept of proof by contradictionHere we assume that language is CFGConditions of pumping lemmaFirst of all consider a string and split into 5 parts those are pqrst it must satisfy the following conditions −|qs|>=1|qrs|=n (“ n” is pumping length)pqirsit € L for different values of iLet the L be the CF language.Now we can take ... Read More

What are the undecidable problems in TOC?

Bhanu Priya
Updated on 16-Jun-2021 14:01:08

11K+ Views

The problems for which we can’t construct an algorithm that can answer the problem correctly in the infinite time are termed as Undecidable Problems in the theory of computation (TOC).A problem is undecidable if there is no Turing machine that will always halt an infinite amount of time to answer as ‘yes’ or ‘no’.ExamplesThe examples of undecidable problems are explained below. Here, CFG refers to Context Free Grammar.Whether two CFG L and M equal − Since, we cannot determine all the strings of any CFG, we can predict that two CFG are equal or not.Given a context-free language, there is ... Read More

How to convert context free grammar to push down automata?

Bhanu Priya
Updated on 16-Jun-2021 13:41:55

12K+ Views

A context-free grammar (CFG) consisting of a finite set of grammar rules is a quadruple (V, T, P, S) where, V is a variable (non terminals).T is a set of terminals.P is a set of rules, P: V→ (V ∪ T)*, i.e., the left-hand side of the production rules P does have any right context or left context.S is the start symbol.Push down automataA push down automata (PDA) consists of the following −A finite non-empty set of states denoted by Q.A finite non empty set of input symbols denoted by∑.A finite non empty set of push down symbol ┌.A special ... Read More

Give the examples of a context free language that are not regular?

Bhanu Priya
Updated on 16-Jun-2021 13:40:50

2K+ Views

A context-free grammar (CFG) consisting of a finite set of grammar rules is a quadruple (V, T, P, S)Where, V is a variable (non terminals).T is a set of terminals.P is a set of rules, P: V→ (V ∪ T)*, i.e., the left-hand sides of the production rule. P does have any right context or left context.S is the start symbol.By using the rules of any language, we can derive any strings in that language.For language a* CFG is as follows −S -> aSS -> ɛHere, S are the variables.a and ɛ terminals.S is the start symbol.By using these rules, ... Read More

Differentiate between recognizable and decidable in the Turing machine?

Bhanu Priya
Updated on 16-Jun-2021 13:34:12

11K+ Views

When we talk about Turing machines (TM) it could accept the input, reject it or keep computing which is called loop.Now a language is recognizable if and only if a Turing machine accepts the string, when the provided input lies in the language.Also, a language can be recognizable if the TM either terminates and rejects the string or doesn't terminate at all. This means that the TM continues with the computing when the provided input doesn't lie in the language.Whereas, the language is decidable if and only if there is a machine which accepts the string when the provided input ... Read More

Prove the equalities of regular expressions by applying properties?

Bhanu Priya
Updated on 16-Jun-2021 13:33:17

549 Views

ProblemProve each of the following equalities of regular expressions.a. ab*a(a + bb*a)*b = a(b + aa*b)*aa*b.b. b + ab* + aa*b + aa*ab* = a*(b + ab*).SolutionProblem 1Prove that ab*a(a + bb*a)*b = a(b + aa*b)*aa*b.Let’s take LHS ,    = ab*a(a + bb*a)*b Use property of (a+b)* = a*(ba*)*    = ab*a (a* ((bb*a) a* )* a*b    = ab* a (a*bb*a)* a*b {Associative property}    = ab* (a (a*bb*a)*)a*b    = ab*(aa*bb*)*aa*b    = a (b*(aa*bb*)*)aa*b Use property a* (ba*)*= (a+b)*    = a(b+aa*b)*aa*b    = RHS Hence provedProblem 2Prove that b + ab* + aa*b + aa*ab* ... Read More

Advertisements