-1

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 ensuring the number of 1's in the input is divisible by 3. However combining these two separate DFA's into one language proved to be a more difficult task than what I thought. I would highly appreciate if anyone could point me in the right direction.

I'm having a difficult time constructing logical steps to ensure we retain previously acquired data regarding 0's and 1's after observing a new symbol.

JungleJeem
  • 51
  • 8
  • I don't know about computation theory, but if a dfa can't use assertions, you could use two expressions `(?:1?01?01?)+` and `(?:0?10?10?10?)+` I'm not sure they are combinable, and not sure of the theory, etc... If you can use assertions, it's fairly easy `^(?=(?:1?01?01?)+$)(?:0?10?10?10?)+$` Again, I'm probably way off.. –  Aug 28 '16 at 00:00
  • But it doesn't match `11100` @sln – revo Sep 06 '16 at 08:47
  • @revo - You're right. This is probably better `^(?=(?:1*01*01*)+$)(?:0*10*10*10*)+$` –  Sep 06 '16 at 14:17

4 Answers4

0

Your idea of building two different DFAs and combining them together is a good one. You're starting with two DFAs and essentially want to build a single DFA that runs both of them at the same time. This is a great time to use the product construction, which does just that. The idea is to build a new DFA whose states correspond to pairs of states, one from the first DFA and one from the second. If you're familiar with the powerset construction, you'll find this construction pretty easy to pick up; the intuition is pretty similar.

templatetypedef
  • 362,284
  • 104
  • 897
  • 1,065
0

DFAs only accepts even numbers of 0's and numbers of 1's that are multiples of 3.

Alphabet Σ={0,1}.

Language L={00011,00010001,0101010...}

Here q0 is a start state and final state also. This DFA take 6 six states.

The given input satisfies multiples of 3.

Suppose that we take an input of 0001. Then:

  1. if q0 accepts 0 then it will goes to q1
  2. if q1 accepts 0 then it will goes to q0
  3. Again q0 accepts 0 then it will goes to q1
  4. And next q1 accepts 1 then it will goes to q2 Then the given input string is satisfies.

Here is a helpful transition diagram to better explain this process: Transition diagram

flyingfishcattle
  • 1,817
  • 3
  • 14
  • 25
0

The language accepted by finite automata for even numbers of 0's and numbers of 1's divisible by 3 is

L={€,00,111,0000,00111, 111111, ..... }

The language accepted for even numbers of 0's is

L1={€, 00,0000,.....}

FA1

The language accepted for numbers of 1's divisible by 3 is

L2={€,111, 111111,...}

FA2

The finite automata that accepts the string having even numbers of 0's and numbers of 1's divisible by 3 is shown below:

Transition diagram

flyingfishcattle
  • 1,817
  • 3
  • 14
  • 25
0

In this case the considered language is the union of language accepted by the machine M1 and that accepted by the machine M2. The machines M1 and M2 are given in the solution to Question 1. Using the -transition, we propose the non-deterministic finite automaton M3 given in the diagram as the one that accepts L(M1) ∪ L(M2)

image 1

1

vimuth
  • 5,064
  • 33
  • 79
  • 116