GATE 2018 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2018

65 questions

MCQ 41 · NAT 241-mark 30 · 2-mark 35

Questions 41–45 of 65

Q41Dynamic Programming2 marksMCQ−0.67 if wrong
Assume that multiplying a matrix G1 of dimension pxq with another matrix G2 of dimension qxr requires pqr scalar multiplications. Computing the product of n matrices G1G2G3...Gn can be done by parenthesizing in different ways. Define Gi Gi+1 as an explicitly computed pair for a given paranthesization if they are directly multiplied. For example, in the matrix multiplication chain G1G2G3G4G5G6 using parenthesization (G1(G2G3))(G4(G5G6)), G2G3 and G5G6 are the only explicitly computed pairs. Consider a matrix multiplication chain F1F2F3F4F5, where matrices F1, F2, F3, F4 and F5 are of dimensions 2x25, 25x3, 3x16, 16x1 and 1x1000, respectively. In the parenthesization of F1F2F3F4F5 that minimizes the total number of scalar multiplications, the explicitly computed pairs is/are

Q42Loop2 marksMCQ−0.67 if wrong
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 2402^{40} is

Q43Number System2 marksMCQ−0.67 if wrong
Consider the unsigned 8-bit fixed point binary number representation below,

b7b6b5b4b3.b2b1b0b_7 b_6 b_5 b_4 b_3 . b_2 b_1 b_0

where the position of the binary point is between b3  and  b2b_3 \; and \; b_2. Assume b7b_7 is the most significant bit. Some of the decimal numbers listed below cannot be represented exactly in the above representation:

(i) 31.500 (ii) 0.875 (iii) 12.100 (iv) 3.001

Which one of the following statements is true?

Q44Cache Memory2 marksMCQ−0.67 if wrong
The size of the physical address space of a processor is 2P2^{P} bytes. The word length is 2W2^{W} bytes. The capacity of cache memory is 2N2^{N} Bytes. The size of each cache block is 2M2^{M} words. For a K-way set-associative cache memory, the length (in number of bits) of the tag field is

Q45Context Free Language2 marksMCQ−0.67 if wrong
Consider the following languages:

I. {ambncpdq∣m+p=n+q,  where  m,n,p,q≥0}\{a^{m}b^{n}c^{p}d^{q}|m+p=n+q, \; where \; m,n,p,q \geq 0 \}
II. {ambncpdq∣m=n  and  p=q,  where  m,n,p,q≥0}\{a^{m}b^{n}c^{p}d^{q}|m=n \; and \; p=q, \; where \; m,n,p,q\geq 0 \}
III. {ambncpdq∣m=n=p  and  p≠q,  where  m,n,p,q≥0}\{a^{m}b^{n}c^{p}d^{q}|m=n=p \; and \; p\neq q, \; where \; m,n,p,q\geq 0 \}
IV. {ambncpdq∣mn=p+q,  where  m,n,p,q≥0}\{a^{m}b^{n}c^{p}d^{q}|mn=p+q, \; where\; m,n,p,q\geq 0\}

Which of the languages above are context-free?