1
GATE CSE 2018
MCQ (Single Correct Answer)
+2
-0.6
Consider the following C code. Assume that unsigned long int type length is 64 bits.
unsigned long int fun(unsigned long int n){
     unsigned long int i, j = 0, sum = 0;
     for (i = n; i > 1; i = i/2) j++;
     for ( ; j > 1; j = j/2) sum++;
     return(sum);
}
The value returned when we call fun with the input $${2^{40}}$$ is
A
4
B
5
C
6
D
40
2
GATE CSE 2018
MCQ (Single Correct Answer)
+2
-0.6
The set of all recursively enumerable languages is
A
closed under complementation.
B
closed under intersection.
C
a subset of the set of all recursive languages
D
an uncountable set.
3
GATE CSE 2018
MCQ (Single Correct Answer)
+2
-0.6
Let $$N$$ be an $$NFA$$ with $$n$$ states. Let $$k$$ be the number of states of a minimal $$DFA$$ which is equivalent to $$N.$$ Which one of the following is necessarily true?
A
$$k \ge {2^n}$$
B
$$k \ge n$$
C
$$k \le {n^2}$$
D
$$k \le {2^n}$$
4
GATE CSE 2018
MCQ (Single Correct Answer)
+2
-0.6
Consider the following languages:

$$\,\,\,\,\,\,\,\,{\rm I}.\,\,\,\,\,\,\,$$ $$\left\{ {{a^m}{b^n}{c^p}{d^q}} \right.|m + p = n + q,$$ where $$\left. {m,n,p,q \ge 0} \right\}$$
$$\,\,\,\,\,\,{\rm II}.\,\,\,\,\,\,\,$$ $$\left\{ {{a^m}{b^n}{c^p}{d^q}} \right.|m = n$$ and $$p=q,$$ where $$\left. {m,n,p,q \ge 0} \right\}$$
$$\,\,\,\,{\rm III}.\,\,\,\,\,\,\,$$ $$\left\{ {{a^m}{b^n}{c^p}{d^q}} \right.|m = n = p$$ and $$p \ne q,$$ where $$\left. {m,n,p,q \ge 0} \right\}$$
$$\,\,\,\,{\rm IV}.\,\,\,\,\,\,\,$$ $$\left\{ {{a^m}{b^n}{c^p}{d^q}} \right.|mn = p + q,$$ where $$\left. {m,n,p,q \ge 0} \right\}$$

Which of the languages above are context-free?

A
$${\rm I}$$ and $${\rm IV}$$ only
B
$${\rm I}$$ and $${\rm II}$$ only
C
$${\rm II}$$ and $${\rm III}$$ only
D
$${\rm II}$$ and $${\rm IV}$$ only
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12