CS: Computer Science and Information Technology
CS: Computer Science and Information Technology
CS: Computer Science and Information Technology
A
CS : COMPUTER SCIENCE AND INFORMATION TECHNOLOGY
Duration: Three Hours Maximum Marks: 100
Name
Registration Number CS
CS-A 1/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
Q.2 Suppose p is the number of cars per minute passing through a certain road junction between 5 PM
and 6 PM, and p has a Poisson distribution with mean 3. What is the probability of observing fewer
than 3 cars during any given minute in this interval? Nptel Reference 1
(A) 8/(2e3) (B) 9/(2e3) (C) 17/(2e3) (D) 26/(2e3)
Nptel Reference 2
2
1 x x
Q.3
Which one of the following does NOT equal 1 y y 2 ?
1 z z2
1 x ( x + 1) x + 1 1 x +1 x2 + 1
(A) 1 y ( y + 1) y +1 (B) 1 y +1 y2 +1
1 z ( z + 1) z +1 1 z +1 z2 +1
0 x y x2 y2 2 x+ y x2 + y2 Nptel Reference
(C) 0 yz y z2 2
(D) 2 y+z y +z
2 2
2
1 z z 1 z z2
Q.4 The smallest integer that can be represented by an 8-bit number in 2s complement form is
(A) -256 (B) -128 (C) -127 (D) 0 Nptel Reference- Lec-11
Q.5 In the following truth table, V = 1 if and only if the input is valid.
Inputs Outputs
D0 D1 D2 D3 X0 X1 V
0 0 0 0 x x 0
1 0 0 0 0 0 1
x 1 0 0 0 1 1
x x 1 0 1 0 1
Nptel Reference- Lec-30
x x x 1 1 1 1
What function does the truth table represent?
(A) Priority encoder (B) Decoder
(C) Multiplexer (D) Demultiplexer
Q.6 Which one of the following is the tightest upper bound that represents the number of swaps
required to sort n numbers using selection sort?
(A) O(log n) (B) O(n) (C) O(n log n) (D) O(n2) Nptel Reference
Q.7 Which one of the following is the tightest upper bound that represents the time complexity of
inserting an object into a binary search tree of n nodes?
(A) O(1) (B) O(log n) (C) O(n) (D) O(n log n) Nptel Reference-Lec-8
CS-A 2/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
Nptel Reference 1
Q.8 Consider the languages L1 = and L2 = { a } . Which one of the following represents L1 L2 U L1 ?
Nptel Reference 2
(A) {} (B) (C) a* (D) {, a}
Nptel Reference 3
Q.9 What is the maximum number of reduce moves that can be taken by a bottom-up parser for a
grammar with no epsilon- and unit-production (i.e., of type A and A a) to parse a string
with n tokens?
(A) n/2 (B) n-1 (C) 2n-1 (D) 2n Nptel Reference
Q.10 A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process
starts with priority zero (the lowest priority). The scheduler re-evaluates the process priorities every
T time units and decides the next process to schedule. Which one of the following is TRUE if the
processes have no I/O operations and all arrive at time zero?
(A) This algorithm is equivalent to the first-come-first-serve algorithm.
(B) This algorithm is equivalent to the round-robin algorithm. Nptel Reference
(C) This algorithm is equivalent to the shortest-job-first algorithm.
(D) This algorithm is equivalent to the shortest-remaining-time-first algorithm.
Q.11 Match the problem domains in GROUP I with the solution technologies in GROUP II.
GROUP I GROUP II
Q.12 The transport layer protocols used for real time multimedia, file transfer, DNS and email,
respectively are
(A) TCP, UDP, UDP and TCP Nptel Reference-Lec-35
(B) UDP, TCP, TCP and UDP
(C) UDP, TCP, UDP and TCP
(D) TCP, UDP, TCP and UDP
Q.13 Using public key cryptography, X adds a digital signature to message M, encrypts <M, >, and
sends it to Y, where it is decrypted. Which one of the following sequences of keys is used for the
operations?
Nptel Reference
(A) Encryption: Xs private key followed by Ys private key; Decryption: Xs public key followed
by Ys public key
(B) Encryption: Xs private key followed by Ys public key; Decryption: Xs public key followed
by Ys private key
(C) Encryption: Xs public key followed by Ys private key; Decryption: Ys public key followed
by Xs private key
(D) Encryption: Xs private key followed by Ys public key; Decryption: Ys private key followed
by Xs public key
CS-A 3/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
Q.14 Assume that source S and destination D are connected through two intermediate routers labeled R.
Determine how many times each packet has to visit the network layer and the data link layer during
a transmission from S to D.
Nptel Reference-Lec-2
Nptel Reference
Q.16 Three concurrent processes X, Y, and Z execute three different code segments that access and
update certain shared variables. Process X executes the P operation (i.e., wait) on semaphores
a, b and c; process Y executes the P operation on semaphores b, c and d; process Z executes the
P operation on semaphores c, d, and a before entering the respective code segments. After
completing the execution of its code segment, each process invokes the V operation (i.e., signal) on
its three semaphores. All semaphores are binary semaphores initialized to one. Which one of the
following represents a deadlock-free order of invoking the P operations by the processes?
(A) X: P(a)P(b)P(c) Y: P(b)P(c)P(d) Z: P(c)P(d)P(a) Nptel Reference 1
(B) X: P(b)P(a)P(c) Y: P(b)P(c)P(d) Z: P(a)P(c)P(d)
(C) X: P(b)P(a)P(c) Y: P(c)P(b)P(d) Z: P(a)P(c)P(d)
(D) X: P(a)P(b)P(c) Y: P(c)P(b)P(d) Z: P(c)P(d)P(a)
Nptel Reference 2
CS-A 4/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
Q.19 What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete
graph of n vertices? Nptel Reference-Lec-36
2 2 3 3
(A) (n ) (B) (n log n) (C) (n ) (D) (n log n)
Q.20 In a k-way set associative cache, the cache is divided into v sets, each of which consists of k lines.
The lines of a set are placed in sequence one after another. The lines in set s are sequenced before
the lines in set (s+1). The main memory blocks are numbered 0 onwards. The main memory block
numbered j must be mapped to any one of the cache lines from Nptel Reference-Lec-29
(A) (j mod v) * k to (j mod v) * k + (k-1) (B) (j mod v) to (j mod v) + (k-1)
(C) (j mod k) to (j mod k) + (v-1) (D) (j mod k) * v to (j mod k) * v + (v-1)
Q.21 Which one of the following expressions does NOT represent exclusive NOR of x and y?
(A) xy + x y (B) x y (C) x y (D) x y Nptel Reference-Lec-5-7
f (x ) dx
3
The value of computed using the trapezoidal rule is
0
Q.24 Consider an undirected random graph of eight vertices. The probability that there is an edge
between a pair of vertices is 1/2. What is the expected number of unordered cycles of length three?
(A) 1/8 (B) 1 (C) 7 (D) 8 Nptel Reference
Q.25 Which of the following statements is/are TRUE for undirected graphs?
P: Number of odd degree vertices is even.
Q: Sum of degrees of all vertices is even. Nptel Reference
(A) P only (B) Q only (C) Both P and Q (D) Neither P nor Q
CS-A 5/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
Q.26 The line graph L(G) of a simple graph G is defined as follows: Nptel Reference
(A) x (F ( x ) P ( x )) (B) x ( F (x ) P (x ))
(C) x ( F (x ) P ( x )) (D) x (F ( x ) P ( x ))
Q.29 Consider a hard disk with 16 recording surfaces (0-15) having 16384 cylinders (0-16383) and each
cylinder contains 64 sectors (0-63). Data storage capacity in each sector is 512 bytes. Data are
organized cylinder-wise and the addressing format is <cylinder no., surface no., sector no.>. A file
of size 42797 KB is stored in the disk and the starting disk location of the file is <1200, 9, 40>.
What is the cylinder number of the last sector of the file, if it is stored in a contiguous manner?
(A) 1281 (B) 1282 (C) 1283 (D) 1284 Nptel Reference-Lec-24-26
Q.30 The number of elements that can be sorted in (log n) time using heap sort is
(B) ( log n )
log n
(A) (1) (C) (D) (log n) Nptel Reference
log log n
CS-A 6/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
{ }
L1 = 0 p 1q 0 r | p, q, r 0
L2 = {0 1 0 | p, q, r 0, p r }
p q r Nptel Reference
Nptel Reference 1
Nptel Reference 2
Nptel Reference 3
Nptel Reference
Q.39 A certain computation generates two arrays a and b such that a[i]=f(i)for 0 i < n and
b[i] = g (a[i] )for 0 i < n. Suppose this computation is decomposed into two concurrent processes
X and Y such that X computes the array a and Y computes the array b. The processes employ two
binary semaphores R and S, both initialized to zero. The array a is shared by the two processes. The
structures of the processes are shown below.
Nptel Reference 1
Process X: Process Y:
private i; private i; Nptel Reference 2
for (i=0; i<n; i++) { for (i=0; i<n; i++) {
a[i] = f(i); EntryY(R, S);
ExitX(R, S); b[i] = g(a[i]);
} }
Which one of the following represents the CORRECT implementations of ExitX and EntryY?
(A) ExitX(R, S) { (B) ExitX(R, S) {
P(R); V(R);
V(S); V(S);
} }
EntryY(R, S) { EntryY(R, S) {
P(S); P(R);
V(R); P(S);
} }
(C) ExitX(R, S) { (D) ExitX(R, S) {
P(S); V(R);
V(R); P(S);
} }
EntryY(R, S) { EntryY(R, S) {
V(S); V(S);
P(R); P(R);
} }
Q.40 Consider the following two sets of LR(1) items of an LR(1) grammar.
Q.42 What is the return value of f(p,p), if the value of p is initialized to 5 before the call? Note that
the first parameter is passed by reference, whereas the second parameter is passed by value.
Q.43 The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. Which
one of the following is the postorder traversal sequence of the same tree?
(A) 10, 20, 15, 23, 25, 35, 42, 39, 30 (B) 15, 10, 25, 23, 20, 42, 35, 39, 30
Nptel Reference-Lec-7
(C) 15, 20, 10, 23, 25, 42, 35, 39, 30 (D) 15, 10, 23, 25, 20, 35, 42, 39, 30
Q.44 Consider the following operation along with Enqueue and Dequeue operations on queues, where
k is a global parameter.
MultiDequeue(Q){ Nptel Reference 1-Lec-1
m = k
while (Q is not empty) and (m > 0) { Nptel Reference 2
Dequeue(Q)
m = m 1
}
}
What is the worst case time complexity of a sequence of n queue operations on an initially empty
queue?
(A) (n) (B) (n + k) (C) (nk) (D) (n2)
Q.45 Consider an instruction pipeline with five stages without any branch prediction: Fetch Instruction
(FI), Decode Instruction (DI), Fetch Operand (FO), Execute Instruction (EI) and Write Operand
(WO). The stage delays for FI, DI, FO, EI and WO are 5 ns, 7 ns, 10 ns, 8 ns and 6 ns, respectively.
There are intermediate storage buffers after each stage and the delay of each buffer is 1 ns. A
program consisting of 12 instructions I1, I2, I3, , I12 is executed in this pipelined processor.
Instruction I4 is the only branch instruction and its branch target is I9. If the branch is taken during
the execution of this program, the time (in ns) needed to complete the program is
Nptel Reference -Lec-24-25
(A) 132 (B) 165 (C) 176 (D) 328
Q.46 A RAM chip has a capacity of 1024 words of 8 bits each (1K 8). The number of 2 4 decoders
with enable line needed to construct a 16K 16 RAM from 1K 8 RAM is
Nptel Reference -Lec-30
(A) 4 (B) 5 (C) 6 (D) 7
CS-A 10/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
Q.48 Suppose the instruction set architecture of the processor has only two registers. The only allowed
compiler optimization is code motion, which moves statements from one place to another while
preserving correctness. What is the minimum number of spills to memory in the compiled code? Nptel Reference 1
(A) 0 (B) 1 (C) 2 (D) 3 Nptel Reference 2
Q.49 What is the minimum number of registers needed in the instruction set architecture of the processor
to compile this code segment without any spill to memory? Do not apply any optimization other
than optimizing register allocation. Nptel Reference 1
(A) 3 (B) 4 (C) 5 (D) 6
Nptel Reference 2
Common Data for Questions 50 and 51:
The procedure given below is required to find and replace certain characters inside an input character string
supplied in array A. The characters to be replaced are supplied in array oldc, while their respective
replacement characters are supplied in array newc. Array A has a fixed length of five characters, while
arrays oldc and newc contain three characters each. However, the procedure is flawed.
void find_and_replace (char *A, char *oldc, char *newc) {
for (int i=0; i<5; i++)
for (int j=0; j<3; j++)
if (A[i] == oldc[j]) A[i] = newc[j];
}
The procedure is tested with the following four test cases.
(1) oldc = abc, newc = dab (2) oldc = cde, newc = bcd
(3) oldc = bca, newc = cda (4) oldc = abc, newc = bac
Q.50 The tester now tests the program on all input strings of length five consisting of characters a,
b, c, d and e with duplicates allowed. If the tester carries out this testing with the four
test cases given above, how many test cases will be able to capture the flaw? Nptel Reference- Lec-13
(A) Only one (B) Only two (C) Only three (D) All four
Q.51 If array A is made to hold the string abcde, which of the above four test cases will be successful
in exposing the flaw in this procedure?
(A) None (B) 2 only Nptel Reference- Lec-13
(C) 3 and 4 only (D) 4 only
CS-A 11/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
A computer uses 46-bit virtual address, 32-bit physical address, and a three-level paged page table
organization. The page table base register stores the base address of the first-level table (T1), which
occupies exactly one page. Each entry of T1 stores the base address of a page of the second-level table (T2).
Each entry of T2 stores the base address of a page of the third-level table (T3). Each entry of T3 stores a page
table entry (PTE). The PTE is 32 bits in size. The processor used in the computer has a 1 MB 16-way set
associative virtually indexed physically tagged cache. The cache block size is 64 bytes.
Nptel Reference 1
Q.52 What is the size of a page in KB in this computer?
Nptel Reference 2-Lec-29
(A) 2 (B) 4 (C) 8 (D) 16
Q.53 What is the minimum number of page colours needed to guarantee that no two synonyms map to
different sets in the processor cache of this computer? Nptel Reference 1
(A) 2 (B) 4 (C) 8 (D) 16
Nptel Reference 2-Lec-29
Statement for Linked Answer Questions 54 and 55:
Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values.
F={CHG, ABC, BCFH, EA, FEG} is a set of functional dependencies (FDs) so that F+ is
exactly the set of FDs that hold for R.
Q.54 How many candidate keys does the relation R have? Nptel Reference
CS-A 12/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
Nadir
(A) Highest (B) Lowest (C) Medium (D) Integration
Q.58 What will be the maximum sum of 44, 42, 40, ...... ?
(A) 502 (B) 504 (C) 506 (D) 500
Q.62 Out of all the 2-digit integers between 1 and 100, a 2-digit number has to be selected at random.
What is the probability that the selected number is not divisible by 7?
(A) 13/90 (B) 12/90 (C) 78/90 (D) 77/90
CS-A 13/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
Q.63 After several defeats in wars, Robert Bruce went in exile and wanted to commit suicide. Just before
committing suicide, he came across a spider attempting tirelessly to have its net. Time and again,
the spider failed but that did not deter it to refrain from making attempts. Such attempts by the
spider made Bruce curious. Thus, Bruce started observing the near-impossible goal of the spider to
have the net. Ultimately, the spider succeeded in having its net despite several failures. Such act of
the spider encouraged Bruce not to commit suicide. And then, Bruce went back again and won
many a battle, and the rest is history.
Which one of the following assertions is best supported by the above information?
(A) Failure is the pillar of success.
(B) Honesty is the best policy.
(C) Life begins and ends with adventures.
(D) No adversity justifies giving up hope.
Q.64 A tourist covers half of his journey by train at 60 km/h, half of the remainder by bus at 30 km/h and
the rest by cycle at 10 km/h. The average speed of the tourist in km/h during his entire journey is
(A) 36 (B) 30 (C) 24 (D) 18
Q.65 The current erection cost of a structure is Rs. 13,200. If the labour wages per day increase by 1/5 of
the current wages and the working hours decrease by 1/24 of the current period, then the new cost
of erection in Rs. is
(A) 16,500 (B) 15,180 (C) 11,000 (D) 10,120
CS-A 14/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
CS-A 15/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
CS-A 16/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
CS-A 17/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
CS-A 18/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
CS-A 19/20
2013 COMPUTER SCIENCE & INFORMATION TECH. - CS
CS-A 20/20