
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1163 Articles for Computers

15K+ Views
The Instantaneous description is called as an informal notation, and explains how a Push down automata (PDA) computes the given input string and makes a decision that the given string is accepted or rejected.The PDA involves both state and content of the stack.Stack is often one of the important parts of PDA at any time.So, we make a convenient notation for describing the successive configurations of PDA for string processing.The factors of PDA notation by triple (q, w, γ) wereq is the current state.w is the remaining input alphabet.γ is the current contents of the PDA stack.Generally, the leftmost symbol ... Read More

69K+ Views
DFA is the short form for the deterministic finite automata and NFA is for the Non-deterministic finite automata. Now, let us understand in detail about these two finite automata.DFAA Deterministic Finite automata is a five-tuple automata. Following is the definition of DFA −M=(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.NFANFA also has five states same as DFA, but with different transition function, as shown follows −δ: Q X Σ ... Read More

6K+ Views
A grammar can be unambiguous, if the grammar does not contain ambiguity. This means if it does not contain more than one left most derivation (LMD) or more than one right most derivation (RMD) or more than one parse tree for the given input string, it is an unambiguous grammar.RulesTo convert the ambiguous grammar to the unambiguous grammar, we apply the following rules −Rule 1 − If the left associative operators (+, -, *, /) are used in the production rule, then apply left recursion in the production rule. Left recursion is nothing but left most symbol on the right side ... Read More

958 Views
For each of the following languages, draw the finite automata (FA) accepting it.{a, b}*{a}The language states that the automata accept the strings containing any number of a's and b's and finally ending in a.The finite state automaton for the language is as follows −{a, b}*{b, aa}{a, b*}The language states that the automata accept the strings starting and ending with any number of a's and b's and containing any of the substrings b and aa.The finite state automaton for the language is a follows −{bbb, baa}*{a}The language states that the automata accept the strings containing any number of bbb's and baa's ... Read More

39K+ Views
Pumping lemma for context free language (CFL) is used to prove that a language is not a Context free languageAssume L is context free languageThen there is a pumping length n such that any string w εL of length>=n can be written as follows −|w|>=nWe can break w into 5 strings, w=uvxyz, such as the ones given below|vxy| >=n|vy| # εFor all k>=0, the string uvkxyyz∈LThe steps to prove that the language is not a context free by using pumping lemma are explained below −Assume that L is context free.The pumping length is n.All strings longer than n can be ... Read More

258 Views
ProblemConsider the following context-free grammars (CFG) and find the pairs of languages which can be generated by Gl and G2 respectively.SolutionConsider the following CFG −G1 : S->aS|B , B->b l bBG2: S->aA | bB , A->aA| B | ε , B->bB | εNow, we can generate the language as follows. First consider G1 as shown belowConsider G1: S->aS|B B->b|bB Using S->B ->b b can be generated Using S->B ->bB ->bb bb can be generated Using S->aS ->aB ... Read More

2K+ Views
In order to understand the relationship between the grammar and language in the theory of computation (TOC), let us understand what is language generated by grammar in TOC.Language generated by grammarThe grammar is S-> aSb| E.In this grammar, by using S-> E, we can generate E.Therefore, E is part of L(G).Similarly, by using S=>aSb=>ab, ab is generated.Similarly, aabb can also be generated.Therefore, the result is as follows −L(G) = {anbn, n>0}In language L(G) which is discussed above, the condition n =0 is taken to accept the epsilon.Consider the grammar given belowS -> aSa | bSb | a |bNow, let us ... Read More

4K+ Views
The language for the given regular expression (RE) is as follows −L={ ε,aa,ab,ba,aaaa,………}ExampleLet the regular expression be ((a+b)(a+b))*(a+b).Construct the Finite automata for the given regular expression.First, generate the language for the given Regular Expression −L={a,d,aaa,bbb,abb,bab,bba,………..}This is the language of odd length stringsThe Finite Automata is as follows −

6K+ Views
To convert the regular expression to Finite Automata (FA) we can use the Subset method.Subset method is used to obtain FA from the given regular expression (RE).Step 1 − Construct a Transition diagram for a given RE using Non-deterministic finite automata (NFA) with ε moves.Step 2 − Convert NFA with ε to NFA without ε.Step 3 − Convert the NFA to equivalent DFA.We will divide the given expression into three parts as follows −“1” ,”(0+1)*, and “0”NFA with Epsilon transition is as follows −Now, we will remove the epsilon transition.After removing, the transition diagram is given below −

10K+ Views
The regular expression R= a+ba* divided into r1 and r2r1= a and r2= ba*Let us draw Non-deterministic finite automata (NFA) for r1 as given below −Now, we will go for r2 = ba *Divide r2 into r3 and r4, where, r3=b and r4=a*The NFA for r3 is as follows −The NFA for r4 is as follows −q5 on epsilon movies goes to q6 and q8, q6 on ‘a’ goes to q7 whereas, q7 on epsilon moves goes to q6 as well as q7.r2= r3.r4Now, concatenate r3 and r4 as shown below −q3 on input ‘b’ goes to q4, q4 on ... Read More