Questions tagged [automata]

In theoretical computer science, automata theory is the study of abstract 'mathematical' machines or systems and the computational problems that can be solved using these machines. These abstract machines are called automata. ("Automata", Wikipedia)

From Wikipedia,

Automata, or automata theory, is the study of mathematical objects called abstract machines or automata and the computational problems that can be solved using them. Automata comes from the Greek word αὐτόματα meaning "self-acting".

692 questions
-1
votes
1 answer

How to select a sublist after another sublist in prolog

With a list containing only 0 and 1, it is required to find out whether each occurance of [0, 1] is followed (not necessarily immediately) by an occurance of [1, 0, 0]. How to do that?
hola
  • 930
  • 1
  • 17
  • 35
-1
votes
1 answer

Python parser for Calculator

I am trying to write a parser which takes expressions as a input from file. expressions can be A=B=10 or B=(C-A)-4 etc. What i have tried so far is . I am reading a file IP.txt import re opert = '+-/*()_=' fileName = "input.txt" f =…
Vaibhav Jain
  • 5,287
  • 10
  • 54
  • 114
-1
votes
2 answers

read Grammar from file and store in an array in C#

Still new to C# so be nice :) S -> NP VP S -> Aux NP VP NP -> Proper-Noun NP -> Nominal Nominal -> Noun Nominal -> Nominal Noun Nominal -> Nominal PP VP -> Verb NP VP -> Verb NP PP PP -> Preposition NP how to store these productions in an array or…
user1989
  • 1
  • 1
-1
votes
1 answer

Is there an openly available implementation of the Hopcroft's DFA minimization algorithm?

Ditto. Java or C# would be best, but any imperative language will do.
Jakub Lédl
  • 1,805
  • 3
  • 17
  • 26
-1
votes
1 answer

Union in context-free languages

Is the union of a collection of context-free languages always context-free ? Justify your answer ..... I know that the answer is yes, but how can I prove it ?
-2
votes
1 answer

Check whether it accepts a finite determinant automaton at least one word of length k, if so - print it, else - print "No"

I wrote data structure and some functions for automata, but I stuck with find_way function that will accept automata object and k. type FSM q = ([q], Alphabet, [Transition q], q, [q]) type Alphabet = [Char] type Transition q = (q, Char, q) states…
Hedgehog
  • 3
  • 3
-2
votes
1 answer

Is there a two state TG that accepts all the input strings from {a, b}* that are not in EVEN-EVEN?

I am new to the topic of finite automata and transition graphs. I had a quiz that asked that if there is a two-state TG that accepts all strings from {a,b}* that are not in EVEN-EVEN (language that have an even number of a's and even number of b's).…
-2
votes
2 answers

Find a regular expression that describes those words that don't contain two consecutive a's over the alphabet {a,b}

I've tried to write a grammar for the language. Here is my grammar: S -> aS | bS | λ I also wanted to generate the word "bbababb" which does not have two consecutive a's. I started with, bS => bbS => bbaS => bbabS => bbabaS => bbababS => bbababbS =>…
OHO33
  • 7
-2
votes
1 answer

PDA and CF grammar for L={w| w={a,b}* such that 2* (number of "a"-s in w) != 3* (number of "b"-s in w) +2 }

I found the following problem in a past exam: Construct a PDA with void stack acceptance and a CF grammar for the language: L={w| w={a,b}* such that 2* (number of "a"-s in w) != 3* (number of "b"-s in w) +2 } Assume that w = {a, b}* with that…
-2
votes
1 answer

Find a s-grammar (simple grammar)

find a simple grammar (a.k.a s-grammar) for the following language: L={(ab)2mb :m>=0} [i did this but it is wrong] S-> aASBB|b A-> a B->b
Fulla
  • 79
  • 7
-2
votes
4 answers

Best alternative to using if statement?

I am trying to break out of a bad habit of using if/else too frequently. I am new to how functions work and the proper way to call them but I am constantly researching the correct way to implement them with my code. The code that I am making is…
-2
votes
1 answer

Find the center letter in 2 pdf (2 stack) in automata

Draw a 2PDA that accepts MIDDLE A of all words that have A as the middle letter. Also, Explain the Logic of it.
Sohaib Aslam
  • 1,245
  • 17
  • 27
-2
votes
1 answer

Number of Turing Machines?

Do you have any idea about this question? I do not know what it asks. -What is the number of Turing machines with with the state set of (Q-start, Q2, Q3, Q4, Q5, Q6, Q-accept, Q-reject),input alphabet(0,1)and tape alphabet (0,1,x,U) where U is the…
MadMax
  • 306
  • 1
  • 5
  • 17
-2
votes
5 answers

Parsing quotes within a string literal

Why do strings in almost all languages require that you escape the quotations? for instance if you have a string such as "hello world"" why do languages want you to write it as "hello world\"" Do you not only require that the string starts and…
Har
  • 3,727
  • 10
  • 41
  • 75
-2
votes
1 answer

In Regular Expression, how to make an alternative to "?" matching by only using union (+) and closure(*) quantifiers?

I would like ask if is it possible to represent "?" quantifier using only union (+) and closure(*) quantifiers. For example, "a+" can also represented as "a(a*)". How can you represent "a?" with only "*"s and "+"s?