edited by
1,191 views
4 votes
4 votes

For a binary string $x = a_0a_1 \dots a_{n−1}$ define $val(x)$ to be $\Sigma_{0 \leq i < n} 2^{n-1-i}.a_i$
Let $\Sigma = \{(0, 0),(0, 1),(1, 0),(1, 1)\}$.

  1. Construct a finite automaton that accepts exactly those strings $(a_0, b_0)(a_1, b_1) \dots (a_{n−1}, b_{n−1}) \in  \Sigma^*$ such that $val(b_0b_1 \dots b_{n−1}) = 4 · val(a_0a_1 \dots a_{n−1})$.
edited by

1 Answer

Best answer
3 votes
3 votes

Before analysing this problem , please have a look at my answer for the problem : https://gateoverflow.in/46562/cmi2012-b-02a .

This problem is a slight modification to the problem that I mentioned above. But the idea of construction of FA completely differs for this problem.

Analysing the input string:

Consider the input: $01011010$

$(a0 a1 a2 a3)$ $=$ $0011$

$(b0 b1 b2 b3)$ $=$ $1100$

val$(b0 b1 b2 b3)$ $=$ $4$ . val$(a0 a1 a2 a3)$

So this input is one of the strings belonging to the language.

For any string belonging to this language, the least significant $2$ bits of $($$b0$ $b1$ $b2$ $b3$....$bn$$-$$1$$)$  should be zeros because val$($$b0$ $b1$ $b2$ $b3$$)$ $=$ $4$ . val($a0$ $a1$ $a2$ $a3$$)$. [Any bit sequence which is a multiple of 4 will end with 00]

The $2$ most significant bit positions of  $($$a$0 $a1$ $a2$ $a3$.......$an-1$$)$ should be zeros so only there exists a possibility for $($$b0$ $b1$ $b2$ ....$bn-1$$)$ to be $4$ times the value of  $($$a0$ $a1$ $a2$ $a3$.......$an$$-$$1$$)$.

These are the $2$ basic requirements for the input to be a part of the language.

Idea of construction of Finite Automaton :

Consider the input  01011010

$(a0 a1 a2 a3)$ $=$ $0011$

$(b0 b1 b2 b3)$ $=$ $1100$

We can clearly see from the above example that  

$a0=a1=0$

$b0=a2$

$b1=a3.$

$b2=b3=0$

For any input in the language,

$a0=a1=0$

$b0=a2$

$b1=a3$

$b2=a4$

......

$bn-3 =an-1$

$bn-2=bn-1=0$

So, this input pattern should have to recognized by the Finite automaton.

The corresponding Finite automaton is:

 

Regular Expression :  $00 +  (000+010(11)^*01).(00+10(11)^*01)^*.0$

edited by

Related questions

12 votes
12 votes
4 answers
3
go_editor asked May 27, 2016
1,498 views
Let $A$ be an array of $n$ integers, sorted so that $A \leq A \leq \dots A[n]$. Suppose you are given a number $x$ and you wish to find out if there exist indices $k$ a...