## Design DFA accepting binary strings divisible by a number ‘n’

I need to learn how to design a DFA such that given any number ‘n’, it accepts binary strings {0, 1} whose decimal equivalent number is divisible by ‘n’. There will be different DFAs for different ‘n’, but can somebody give a basic approach that I should follow to proceed with any number 0 < … Read more

## Is it possible for a computer to “learn” a regular expression by user-provided examples?

Is it possible for a computer to “learn” a regular expression by user-provided examples? To clarify: I do not want to learn regular expressions. I want to create a program which “learns” a regular expression from examples which are interactively provided by a user, perhaps by selecting parts from a text or selecting begin or … Read more

## Regular vs Context Free Grammars

I’m studying for my computing languages test, and there’s one idea I’m having problems wrapping my head around. I understood that regular grammars are simpler and cannot contain ambiguity, but can’t do a lot of tasks that are required for programming languages. I also understood that context-free grammars allow ambiguity, but allow for some things … Read more

## Determining initial and final states from FA diagram

I am new to automata. And learning to find concatenation of two FAs. But this one has confused me I know how to do concatenation but I am confused that in FA 1, what does x1 means? Is it mean final state or does it mean both initial and final state because it is on … Read more

## is it possible to know if a language is regular if its equivalence classes are finite?

i have a theoretical questions, and was wondering if you could help me with it so i could understand the material better. 1)suppose we have some language L over Σ, can we know if L is regular if all of it equivalence classes of relation RL is finite? 2)and what about L*? is it finite? … Read more

## NPDA transitions to different states by taking same input and popping same top element of a stack

Suppose i have some NPDA and there is some transition functions defined as: $\delta(q_{1},a,A) = (q_{2}, A)$ $\delta(q_{1},a,A) = (q_{3}, Z)$ Is it allowed? I understand, that since the NPDA is nondetermenistic, it’s possible to have transitions to different states with the same input character, but what about same element at the top of stack? … Read more

## Determining whether Turing machine halts on input: primitive recursive?

In Elements of the Theory of Computation by Lewis and Papadimitriou, the authors use a specific function for proving that application of unbounded minimization on a primitive recursive function need not be regular. They choose a peculiar function to prove so, defined as follows. Let M={K,Σ,Δ,s} be a Turing machine. Define G(n,m)=0 if n does … Read more

## Computational power of quantum finite automata

I am preparing some lecture notes on the computational power of quantum finite automata (QFA). I am a bit confused about which models of QFA are stronger and which models are weaker than standard finite automata (FA). There is one-way QFA (1QFA) and two-way QFA (2QFA). For each model, we can either have “measure-once” (MO) … Read more

## MSO (Monadic second-order logic) Logic On Words

Let L be a language over Σ={a,b,c} that contains all words, where the length |w|b (number of all b’s) has remainder 1 if divided by 3. MSO logic over words are definded as follow: I want to express this language using MSO logic. But my problem is how can I count the b’s to calculate … Read more

## What is the word “madness” doing in the first chapter’s title of Automata Theory, Languages and Computation by Hopcroft, Motwani, Ullman?

The chapter’s title is “Automata: The Methods and the Madness“. This title came along in the second edition and remains in the third edition. In the first edition, the the second chapter’s title is “Finite Automata and Regular Expressions”. The word “madness” doesn’t show up anywhere else in the third edition. Why is the chapter … Read more