- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 1259 Articles for Computers
10K+ Views
In order to understand the relationship between finite automata (FA) and regular expression (RE), we need to understand these terminologies. Let us begin by understanding what is a regular expression.Regular ExpressionRegular expression is the language which is used to describe the language and is accepted by finite automata. Regular expressions are the most effective way to represent any language. Let Σ be an alphabet which denotes the input set.The regular expression over Σ can be defined as follows −Φ is a regular expression which denotes the empty set.ε is a regular expression and denotes the set { ε} and it ... Read More
4K+ Views
Problem 1Prove that (1+00*1)+(1+00*1)(0+10*1)*(0+10*)=0*1(0+10*1)*SolutionHere, we need to prove LHS=RHS (Left hand side = Right hand side)Let us solve first LHS(1+00*1)+(1+00*1)(0+10*1)*(0+10*)Take (1+00*1) as a common factor(1+00*1)( ε+(0+10*1)*(0+10*1)Where,(0+10*1)*(0+10*1). It is in the form of R*R where R=0+10*1As we know, (ε+R*R)=( ε+RR*)=R*Therefore,(1+00*1)((0+10*1)*)Taking 1 as common factor(ε+00*)1(0+10*1)*Apply ε+00*=0*0*1(0+10*1)*=RHSHence, the two regular expressions are equal.Problem 2Show that (0*1*)*=(0+1)*SolutionConsider LHS(0*1*)*= { ε,0,00,1,11,111,01,10,……}= {any combinations of 0’s, any combinations of 1’s, any combinations of 0 and 1, ε}Similarly,RHS=(0+1)*= { ε,0,00,1,11,111,01,10,…..}= { ε, any combinations of 0’s, any combinations of 1’s, any combinations of 0 and 1}Hence, it is proved thatLHS=RHS
565 Views
Regular expression is the language which is used to describe the language and is accepted by finite automata. Regular expressions are the most effective way to represent any language. Let Σ be an alphabet which denotes the input set.The regular expression over Σ can be defined as follows −Φ is a regular expression which denotes the empty set.ε is a regular expression and denotes the set { ε} and it is called a null string.For each ‘a’ in Σ ‘a’ is a regular expression and denotes the set {a}.If r and s regular expressions denoting the language.L1 and l2 respectively ... Read More
806 Views
Arden’s theorem helps in checking the equivalence of two regular expressions.Arden’s TheoremLet, P and Q be two regular expressions over the input set Σ. The regular expression R is given as follows −R=Q+RPThis has a unique solution as R=QP*.ProofLet, P and Q be the two regular expressions over the input string Σ.If P does not contain ε then there exists R such thatR= Q+RP-----------------------equation 1We will replace R by QP* in equation 1Consider Right hand side (R.H.S) of equation 1= Q+QP*P=Q(ε+P*P)=QP* since R*R=R* according to identityThus R=QP* is proved.To prove that R=QP* is a unique solution, we will now replace ... Read More
11K+ Views
The two regular expression’s P and Q are equivalent (denoted as P=Q) if and only if P represents the same set of strings as Q does.For showing the equivalence of two regular expressions we need to show some identities of regular expression’sLet P, Q and R be the regular expressions then the identity rules are as follows −εR=R ε=Rε*= ε ε is null string(Φ)*= ε Φ is empty stringΦR=R Φ= ΦΦ+R=RR+R=RRR*=R*R=R+(R*)*=R*Ε+RR*=R*(P+Q)R=PR+QR(P+Q)*=(P*Q*)*=(P*+Q*)*R*(ε+R)=( ε+R)R*=R*(R+ε)*=R*Ε+R*=R*(PQ)*P=P(QP)*R*R+R=R*RRead More
1K+ Views
Regular expression is the language which is used to describe the language and is accepted by finite automata. Regular expressions are the most effective way to represent any language. Let Σ be an alphabet which denotes the input set.The regular expression over Σ can be defined as follows −Φ is a regular expression which denotes the empty set.ε is a regular expression and denotes the set { ε} and it is called a null string.For each ‘a’ in Σ ‘a’ is a regular expression and denotes the set {a}.If r and s regular expressions denoting the language.L1 and l2 respectively ... Read More
6K+ Views
Problem 1Write the regular expression for the language accepting all the strings containing any number of a's and b's.SolutionThe regular expression will be −r.e. = (a + b)*This will give the set as L = {E, a, aa, b, bb, ab, ba, aba, bab, .....}, any combination of a and b.The (a + b)* shows any combination with a and b even a null string.Problem 2Write the regular expression for the language starting with a but not having consecutive b's.SolutionThe regular expression has to be built for the language: L = {a, aba, aab, aba, aaa, abab, .....}The regular expression ... Read More
621 Views
Moore machine described by 6 tuples(Q, q0, Σ, O, δ, λ) Where,Q: Finite set of statesq0: Initial state of machineΣ: Finite set of input symbolsO: Output alphabetδ: Transition function where Q × Σ → Qλ: Output function where Q → OGiven Σ ={a,b} and Δ ={0,1}Sequence= ‘abb’Partial Moore machine with sequence ‘abb’ is as follows −The Full Moore Machine is as followsThe transition tables for Moore and Mealy Machines are as follows −Transition table for Moor Machine −Stateabo/pABA0BBC0CBD0DBA1Transition table for Mealy Machine −StateabStateO/pStateO/pAB0ADBB0C0CB0D1DB0A0The Mealy Machine transition diagram is as follows −
403 Views
ProblemGiven a Deterministic Finite Automata (DFA), try to reduce the DFA by removing unreachable states and removing similar rows.SolutionStep 1Remove the unreachable states from q0From the initial states, we are not able to reach q2 and q4. So, remove these two states as shown below −After removing unreachable states, the partial minimized DFA is as follows −Step 2The transition table is given below −States01->q0q1q3q1q0q3*q3q5q5*q5q5q5Step 3Divide tables into 2 tables as shown below −Table 1 starts from the non-final states.States01->q0q1q3q1q0q3Table 2 starts from the final states.States01*q3q5q5*q5q5q5Step 4Remove similar rows.Table 1 has no similar rowsTable 2 has similar rows. So, skip q5 ... Read More
10K+ Views
The two finite automata (FA) are said to be equivalent if both the automata accept the same set of strings over an input set Σ.When two FA’s are equivalent then, there is some string x over Σ. On acceptance of that string, if one FA reaches to the final state, the other FA also reaches to the final state.MethodThe method for comparing two FA’s is explained below −Let M and M1 be the two FA’s and Σ be a set of input strings.Step 1 − Construct a transition table that has pairwise entries (q, q1) where q ∈ M and ... Read More