Computer Science Articles - Page 51 of 62

Convert RE 1(0+1)*0 into equivalent DFA.

Bhanu Priya
Updated on 12-Jun-2021 11:01:35

7K+ 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 −

Construct NFA with Epsilon moves for regular expression a+ba*.

Bhanu Priya
Updated on 12-Jun-2021 10:40:32

11K+ 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

What is Inductive Hypothesis in TOC?

Bhanu Priya
Updated on 12-Jun-2021 10:24:52

2K+ Views

Induction is a powerful tool in mathematics. It is a way of proving propositions that hold for all natural numbers.Hypothesis − The formal proof can be using deductive proof and inductive proof. The deductive proof consists of sequence of statements given with logical reasoning in order to prove the first or initial statement. The initial statement is called Hypothesis.Suppose there exists a k > 0 such that for any regular expression r where 0 < OP(r) < k, there exists an NFA- s such that L(M) = L(r). Furthermore, suppose that M has exactly one final state.Inductive StepLet r be ... Read More

How to convert Regular expression to Finite Automata?

Bhanu Priya
Updated on 12-Jun-2021 10:22:41

20K+ Views

To convert the regular expression (RE) to Finite Automata (FA), we can use the Subset method.Subset method is used to obtain FA from the given RE.Step 1 − Construct a Transition diagram for a given RE by using Non-deterministic finite automata (NFA) with ε moves.Step 2 − Convert NFA with ε to NFA without ε.Step 3 − Convert the NFA to the equivalent Deterministic Finite Automata (DFA).Some basic RE are as follows −Case 1 − For a regular expression ‘a’, we can construct FA as shown below −Case 2 − For a regular expression ‘ab’ we can construct FA, as ... Read More

Explain the relationship between Finite Automata and Regular Expression.

Bhanu Priya
Updated on 12-Jun-2021 10:20:36

15K+ 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

Explain the meanings of some of the regular expressions.

Bhanu Priya
Updated on 12-Jun-2021 10:16:52

879 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

Construct the Regular expression for the given languages by the user.

Bhanu Priya
Updated on 12-Jun-2021 10:13:11

2K+ 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

Construct the Regular expression for the given languages.

Bhanu Priya
Updated on 12-Jun-2021 10:11:43

10K+ 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

Construct the minimum DFA for any given finite automata.

Bhanu Priya
Updated on 12-Jun-2021 09:57:38

8K+ Views

ProblemConstruct a minimum state DFA for the following automata −SolutionWe first construct a transition table for the given finite automata −States\inputs01q0q1q5q1q6q2*q2q0q2q3q2q6q4q7q5q5q2q6q6q6q4q7q6q2Q={q0, q1, q2, q3, q4, q5, q6, q7}Q01={q2} and Q02={q0, q1, q2, q3, q4, q5, q6, q7}S0={{q2} {q0, q1, q2, q3, q4, q5, q6, q7}}Consider the set {q0, q1, q2, q3, q4, q5, q6, q7}{q2} {q0, q1, q3, q5, q6, q7}{q2} {q0, q4, q6} {q1, q3, q5, q7}{q2} {q0, q4} {q6} {q1, q3, q5, q7}{q2}{q0, q4}{q6}{q1, q7}{q3, q5}The minimized state is as follows −M1=(Q1, Σ, δ1, q01, F1)Q1= {[q2], [q0, q4], [q6], [q1, q7], [q3, q5]}qo1= {[q0, q4]}F1= {[q2]}Transition TableNow ... Read More

Explain the method for constructing Minimum Finite State Automata.

Bhanu Priya
Updated on 12-Jun-2021 09:54:00

3K+ Views

A finite state machine (FSM) which has a set of states and two functions called the next-state and output function.The set of states correspond to all the possible combinations of the internal storage.If there are n bits of storage, there are 2n possible states.The next state function is a combinational logic function that given the inputs and the current state, determines the next state of the systemA Finite State Machine consists of the following −K states: S = {s1, s2, ... ,sk}, s1 is initial stateN inputs: I = {h, i2, ... ,in}M outputs: O = {o1, o2, . ,om}Next-state ... Read More

Advertisements