Questions tagged [dfa]

A DFA is a deterministic finite automaton, a simple model of computation. It is one way to model regular languages. Each DFA consists of a finite set of states and a transition function between those states describing how the state of the machine changes in response to new input. DFAs are closely related to regular expressions in the sense that they can be converted into each other. Thus, DFAs are often used to implement regular expression matchers.

569 questions
-1
votes
1 answer

Construct a DFA given the following conditions

Construct a DFA over {0,1}* where the string when converted to binary must be divisible by 2 or 3. Also, the number of 1s in the string must not be divisible by
-1
votes
1 answer

No. of DFA's that can be constructed

How many DFA's can be constructed given 5 states over the alphabet {0,1}. Given that the initial state is not fixed.
-1
votes
1 answer

How to solve shift/reduce conflict using operator precedence?

So I have this grammar I'm trying to build an LR(1) table for E' -> E E -> E + E E -> E * E E -> ( E ) E -> a So far, this my table I'm trying to solve the conflicts here. I thought about changing the grammar to…
Ruba Sbeih
  • 27
  • 1
  • 6
-1
votes
1 answer

Designing a DFA

I want to design a DFA for the following language after fixing ambiguity. I thought and tried a lot but couldn't get a proper answer. S->aA|aB|lambda A->aA|aS B->bB|aB|b
Davood
  • 72
  • 8
-1
votes
1 answer

DFA for (0001)*, is it correct

PLease check whether this dfa is correct or not? Thankyou
-1
votes
1 answer

How to convert nfa to dfa

Question in note my solution I find a question in my note and when I try to convert the nfa to a dfa, i get a similar result but not exactly the same. what am i doing wrong? or is my answer also acceptable?
Kent Wong
  • 143
  • 8
-1
votes
1 answer

DFA diagram to recognize arithmetic expressions

I need to draw a DFA diagram that can recognize arithmetic expressions, varialbes or brackets are not allowed. It can only contain numbers and four arithmetic operators. And it has to accepts any number string with or without sign - e.g. 5, -7 ,…
Zamura
  • 1
  • 1
-1
votes
1 answer

Trying to draw a Non- Deterministic Finite Automata

I'm completely new to finite automata and kind of struggling to understand the topic. I'm able to draw simple ones but I have a practice question that asks to: Design a Non- Deterministic Finite Automata that accepts ∑={0,1}. The Non-Deterministic…
John Diggle
  • 21
  • 1
  • 7
-1
votes
2 answers

How to determine which language is simpler

The following language is the complement of a simpler language. Construct a DFA for the simpler language and then use it to give the state diagram of a DFA for the given language where Σ = {a,b}. L={ w : w does not contain the substring baba}. I…
nmorsi
  • 23
  • 3
-1
votes
4 answers

An FA that accepts all binary strings with an even number of 0's and the number of 1's is a multiple of 3

This question is directly from Chapter 1 exercises of Introducing the Theory of Computation by Wayne Goddard (Question 1.17). Initially I thought of creating two separate DFAs one for ensuring the number of 0's in the input is even and another for…
-1
votes
1 answer

DFA for expected coin tosses

I am trying to construct this problem: A fair coin is tossed until two heads appear in a row. What is the expected number of coin tosses? Design a DFA for the language L+ {w|w has 11 as a substring} Use this DFA as a Markov chain to calculate the…
Zach
  • 119
  • 3
  • 17
-1
votes
1 answer

number of dfa's that can be designed

Can we calculate the total number (i.e maximum no.) of dfa's that can be designed when the following constraints are put: |Q|=2{No. of states is 2},|Ɛ|=2{No. of alphabets} and |F|=1{No. of Final States} ?
-1
votes
1 answer

How to draw a DFA for given language?

Give a finite state diagram for a DFA that accepts any word in the language L = {w | w ∈ {a, b}∗ and w alternates a’s and b’s and has an even number of b’s}. My attempt: I am having problem on how to deal with the even part of b.
max
  • 167
  • 2
  • 9
-1
votes
1 answer

Understanding epsilon closure algorithm pseudocode

The following pseudocode is from Introduction to Compiler Construction in a Java World book. This algorithm is supposed to output the epsilon closure of a set of a states of a nondeterministic finite machine (to convert it to a deterministic one…
Algo
  • 841
  • 1
  • 14
  • 26
-1
votes
2 answers

What is the number of states in the minimal DFA with input symbols {0,1,2} where 2nd last symbol is 1?

four options:- A. 8 B. 9 C. 6 D. None can somebody please explain the answer diagrammatically..