GATE 2015 (Session 3)
65 questions
MCQ 45 · NAT 201-mark 30 · 2-mark 35
Questions 61–65 of 65
Suppose for i =1,2,3 are independent and identically distributed random variables whose probability mass functions are for i=1,2,3. Define another random variable denotes XOR. Then
_______________.
_______________.
Answer: 0.75
Given , we get . So Y = 0 unless both X1 and X2 are 1.
Probability: P = 1 1/4 = 0.75
Answer: 0.75
Probability: P = 1 1/4 = 0.75
Answer: 0.75
The total number of prime implicants of the function f(w,x,y,z)=(0,2,4,5,6,10) is _______.
Answer: 3
The function has minterms 0, 2, 4, 5, 6, 10. Grouping them on the K-map gives these prime implicants:
- covers minterms (0, 2, 4, 6)
- covers minterms (4, 5)
- covers minterms (2, 10)
Answer: 3
- covers minterms (0, 2, 4, 6)
- covers minterms (4, 5)
- covers minterms (2, 10)
Answer: 3
Suppose c=(c[0],...,c[k-1]) is an array of length k, where all the entries are from the set {0,1}. For any positive integers a and n, consider the following pseudocode.
If k=4, c=(1,0,1,1), a=2 and n=8, then the output of DOSOMETHING(c,a,n) is _____.
DOSOMETHING(c, a, n)
z ← 1
for i ← 0 to k − 1
do z ← z² mod n
if c[i] = 1
then z ← (z × a) mod n
return z If k=4, c=(1,0,1,1), a=2 and n=8, then the output of DOSOMETHING(c,a,n) is _____.
Answer: 0
Start with z = 1, a = 2, n = 8 and c = (1, 0, 1, 1):
- i = 0: z = 1, c = 1 z = 2
- i = 1: z = 4, c = 0
- i = 2: z = 16 mod 8 = 0, c = 1 z = 0
- i = 3: z = 0
(The code finds: .)
Answer: 0
- i = 0: z = 1, c = 1 z = 2
- i = 1: z = 4, c = 0
- i = 2: z = 16 mod 8 = 0, c = 1 z = 0
- i = 3: z = 0
(The code finds: .)
Answer: 0
Let and where n is a positive integer. Which of the following statements is/are correct?
I.
II.
I.
II.
Answer: (D)
For integer , the values come arbitrarily close to every number in (because is irrational, the angles radians keep landing in new places around the circle). So there are infinitely many with and infinitely many with .
For the first kind, , so . Then fails for every constant , so II () is false.
For the second kind, , so . Then fails for every constant , so I () is false.
Answer: (D)
For the first kind, , so . Then fails for every constant , so II () is false.
For the second kind, , so . Then fails for every constant , so I () is false.
Answer: (D)
Consider the following grammar
S F|H
F p|c
H d|c
where S,F, and H are non-terminal symbols, p,d, and c are terminal symbols. Which of the following statement(s) is/are correct?
S1. LL(1) can parse all strings that are generated using grammar G
S2. LR(1) can parse all strings that are generated using grammar G
S F|H
F p|c
H d|c
where S,F, and H are non-terminal symbols, p,d, and c are terminal symbols. Which of the following statement(s) is/are correct?
S1. LL(1) can parse all strings that are generated using grammar G
S2. LR(1) can parse all strings that are generated using grammar G
Answer: (D)
The string "c" can be derived in two ways: and . This means the grammar is ambiguous.
An ambiguous grammar can never be LL(1) or LR(1).
Answer: Neither S1 nor S2
An ambiguous grammar can never be LL(1) or LR(1).
Answer: Neither S1 nor S2