edited by
1,278 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

1.9k
views
1 answers
14 votes
go_editor asked May 23, 2016
1,920 views
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$ ... $val(b_0b_1 \dots b_{n−1}) = 2 · val(a_0a_1 \dots a_{n−1})$.
1.3k
views
1 answers
7 votes
go_editor asked May 27, 2016
1,282 views
Given an undirected weighted graph $G = (V, E)$ with non-negative edge weights, we can compute a minimum cost spanning tree $T = (V, E')$. We ... the statement is false.All the shortest paths from $s$ to the other vertices are unchanged.
1.6k
views
4 answers
12 votes
go_editor asked May 27, 2016
1,562 views
Let $A$ be an array of $n$ integers, sorted so that $A[1] \leq A[2] \leq \dots A[n]$. Suppose you are given a number $x$ and you wish to find out if there exist ... $l$ such that $A[k]+A[l] = x$.Design an $O(n)$ algorithm for this problem.
1.1k
views
1 answers
8 votes
go_editor asked May 23, 2016
1,142 views
We use the notation $[x1,x2,...,xn]$ to denote a list of integers. $[]$ denotes the empty list, and $[n]$ is the list consisting of one integer $n$. For ... false)When does $f(l)$ return the value true for an input $l$? Explain your answer.