Computer Science
Computer Science
1.
How many strings of 5 digits have the property that the sum of their digits is 7?
(a) 66
(b) 330
(c) 495
(d) 99
Ans:-B
7 + 5 1C 1
2.
Consider an experiment of tossing two fair dice, one black and one red. What is the probability
that the number on the black die divides the number on red die?
(a) 22/36
11C
(b) 12/36
1110 9 8 = 330
4 3 2
(c) 14/36
(d) 6/36
Ans:-C
Total number of case 36
Red
Black
1.
1.
2.
2.
3.
3.
4.
4.
5.
5.
6.
6.
7.
7.
1.
2.
3.
4.
5.
6.
6 + 3 + 2 + 1 + 1 = 14
Then, Probability =
fa
14
=
Total 36
Ans: C
150
3.
In how many ways can 15 indistinguishable fish be placed into 5 different ponds, so that
each pond contains at least one fish?
(a) 1001 (b) 3876
(c) 775 (d) 200
Ans:-A
Explanation:-
14!
C1 14 C4
10!
= 15 4!
15
15
14 13 12 1110 14 13 12 11
=
=
10 4
4 3 2 1
Required ways
= 77 13 = 1001
15
Ans: A
4.
Consider the following statements: (1) Depth-first search is used to traverse a rooted tree. (2)
Pre-order, Post-order and In order are used to list the vertices of an ordered rooted tree. (3)
Huffmans algorithm is used to find an optimal binary tree with given weights. (4) Topological
sorting provides a labelling such that the parents have larger labels than their children. Which of
the above statement are true?
(a) DES: is an algorithm for traversing or searching tree or graph data structure, one starts at the root
(selecting some arbitrary node as the root in the case of a graph) and explores as far as possible along
each branch before backtracking. (c) Huffmans algorithm: is a method for building extended binary
tree with a weighted path length from a set of given weights initially construct a forest of singleton trees
one associated with each weight. (b) Pre-order, In-order, Post-order, Rule of thumb, Breath first, first
traversal... visit the root node (generally output traverse to left subtree: traverse to right subtree for sorted
binary trees)
5.
Consider a Hamiltonian Graph (G) with no loops and parallel edges. Which of the following is
true with respect to this Graph (G)?
Ans:-C
Ans:- D
For the 8-bit word 00111001, the check bits stored with it would be 0111. Suppose when the
word is read from memory, the check bits are calculated to be 1101. What is the data word that
was read from memory?
(a) 10011001
(b) 00011001
Given, 0 0 1 1 0 1 0 0 1 1 1 1
D12 D11 D10 D9 P8 D7 D6 D5 P4 D3 P2 P
P1
1011
= 1
P2
10110
=1
P3
001
=1
P4
0011
=0
Doing an exclusive-OR of 0111 and 1101 indicating an error in bit 10 of the hamming word. Thus,
the data word read from memory was 00011001.
Correct option is (b)
2. Consider a 32-bit microprocessor, with a 16-bit external data bus, driven by an 8 MHz input
clock. Assume that this microprocessor has a bus cycle whose minimum duration equals four
input clock cycles. What is the maximum data transfer rate for this microprocessor?
(a) 8 106bytes/sec
(c) 16 106bytes/sec
(b) 4 106bytes/sec
(d) 4 109bytes/sec
Minimum bus cycle duration = 4 clock cycle and bus clock = 8 MHz.
Then maximum bus cycle rate = 8/4 = 2 m/s.
Data transferred per bus cycle rate = 16 bit = 2 bytes (1 byte = 8 bits)
Data transfer rate per second -> bus cycle rate *data per bus
Cycle = 2M*2 = M bytes/sec= 4*106byte/sec.
Correct option is (b).
3.
293
4.
(a) FADED
(b) AEOBE
(c) ADOBE
(d) ACABE
5.
The CPU of a system having 1 MIPS execution rate needs 4 machine cycles on an average for
executing an instruction. The fifty percent of the cycles use memory bus. A memory read/write
employs one machine cycle. For execution of the programs, the system utilizes 90 percent of the
CPU time. For block data transfer, an IO device is attached to the system while CPU executes the
background programs continuously. What is the maximum IO data transfer rate if programmed
IO data transfer technique is used?
6.
(a) 8
(b) 9
(c) 27
(d) 11
Sol. For construction a modulo N counter we need log2 number of flip-flops the value rounded to next highest
whole number, so log2272 = 9 i.e. . 2n> = N.
7.
Let E1and E2 be two entities in E-R diagram with simple single valued attributes. R1 and R2 are two
relationships between E1and E2where R1is one - many and R2is many-many. R1and R2 donor have
any attribute of their own. How many minimum number of tables are required to represent this
situation in the Relational Model?
(a) 4
(b) 3
(c) 2
(d) 1
Sol. Storing entities E1and E2 should be converted into table for R1, which is one to many relation there is no
need of a separate table. The many side of relation will include the primary key of one side as foreign key
for R1, which is many to many relation a separate table is required by including the primary key of E1and
E2 as foreign. Hence, we require a minimum of 3 table.