Found 700 Articles for Computer Science

What is Minimization of DFA?

Bhanu Priya
Updated on 12-Jun-2021 10:05:01

357 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

Explain the equivalence between two Finite State Machines.

Bhanu Priya
Updated on 12-Jun-2021 10:01:38

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

Give an example problem of converting NFA to DFA.

Bhanu Priya
Updated on 12-Jun-2021 09:59:23

7K+ Views

ProblemConsider a Non-deterministic finite automata (NFA) and convert that NFA into equivalent Deterministic Finite Automata (DFA).SolutionLet’s construct NFA transition table for the given diagram −States\inputsab->q0{q0, q1}q0q1q2q1q2q3q3q3-q2DFA cannot have multiple states. So, consider {q0, q1} as a single state while constructing DFA.Let’s convert the above table into equivalent DFAStates\inputsab->q1[q0, q1]q0[q0, q1][q0q1q2][q0q1]*[q0q1q2][q0q1q2q3][q0q1q3]*[q0q1q2q3][q0q1q2q3][q0q1q2q3]*[q0q1q3][q0q1q2][q0q1q2]In DFA the final states are q2 and q3, wherever q2 and q3 are present that state becomes a final state.Now the transition diagram for DFA is as follows −Read More

Construct the minimum DFA for any given finite automata.

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

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

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

How to convert NFA with epsilon to DFA in TOC?

Bhanu Priya
Updated on 13-Sep-2023 16:13:10

33K+ Views

In this method, we first convert Non-deterministic finite automata (NFA) with ε to NFA without ε.Then, NFA without ε- can be converted to its equivalent Deterministic Finite Automata (DFA).Method for conversionThe method for converting the NFA with ε to DFA is explained below −Step 1 − Consider M={Q, Σ, δ, q0, F) is NFA with ε. We have to convert this NFA with ε to equivalent DFA denoted byM0=(Q0, Σ, δ0, q0, F0)Then obtain, ε-closure(q0) ={p1, p2, p3, ……pn}then [p1, p2, p2, ….pn] becomes a start state of DFAnow[p1, p2, p3, ….pn] ∈ Q0Step 2 − We will obtain δ ... Read More

How to convert NFA with epsilon to without epsilon?

Bhanu Priya
Updated on 12-Jun-2021 09:49:28

24K+ Views

In this method, we try to remove all the ε-transitions from the given Non-deterministic finite automata (NFA) −The method is mentioned below stepwise −Step 1 − Find out all the ε-transitions from each state from Q. That will be called as ε-closure(qi) where, qi ∈Q.Step 2 − Then, 𝛿1 transitions can be obtained. The 𝛿1 transitions means an ε-closure on 𝛿 moves.Step 3 − Step 2 is repeated for each input symbol and for each state of given NFA.Step 4 − By using the resultant status, the transition table for equivalent NFA without ε can be built.NFA with ε to ... Read More

What is an epsilon closure in TOC?

Bhanu Priya
Updated on 12-Jun-2021 09:44:40

13K+ Views

The ε closure(P) is a set of states which are reachable from state P on ε-transitions.The epsilon closure is as mentioned below −ε-closure (P) = P, where P ∈ QIf there exists ε-closure (P) = {q} and 𝛿(q, ε) =r then, ε-closure (P) = {q, r}ExampleFind ε-closure for the following Non-deterministic finite automata (NFA) with epsilon.Solutionε-closure (q0)= {q0, q1, q2}self state+ ε-reachable states.ε-closure (q1)= { q1, q2}q1 is self-state and q2 is a state obtained from q1 with epsilon input.ε-closure (q2)= {q2}Lets us consider an example to understand more clear about epsilon closure −Problem − find the number of epsilon ... Read More

What is an acceptance of language by NFA with Epsilon?

Bhanu Priya
Updated on 12-Jun-2021 09:41:39

5K+ Views

The language L accepted by Non-deterministic finite automata (NFA) with ε, denoted by M= (Q, Σ, 𝛿, q0, F) and can be defined as follows −Let M= (Q, Σ, 𝛿, q0, F) be a NFA with εWhere, Q is a set of statesΣ is input setδ is a transition function from Q x { Σ U ε } to 2Qq0 is start stateF is a final stateThe string w in L accepted by NFA can be represented as follows −L(M)={w| w ∈ Σ* and 𝛿 transition for w from q0 reaches to F}ExampleConstruct NFA with epsilon which accepts a language ... Read More

How to convert the finite automata into regular expressions?

Bhanu Priya
Updated on 12-Jun-2021 09:33:56

8K+ Views

ProblemConvert the given finite automata (FA) into regular expression (RE).SolutionThere are two popular methods for converting a DFA to its regular expression −Arden’s MethodState elimination methodLet’s consider the state elimination method to convert FA to RE.RulesThe rules for state elimination method are as follows −Rule 1The initial state of DFA must not have any incoming edge.If there is any incoming edge to the initial edge, then create a new initial state having no incoming edge to it.Rule 2There must exist only one final state in DFA.If there exist multiple final states, then convert all the final states into non-final states ... Read More

Advertisements