Mtech Cs and Crs PCB 2021
Mtech Cs and Crs PCB 2021
C1. Consider a standard balance with two pans where weights can only be
placed on the left pan, and the object to be weighed on the right pan.
Find the minimum number of weights required to weigh any object
whose weight in grams could be any integer ranging from 1 to 127.
Give precise argument in favor of your answer.
[10]
C2. Let P be a set of n real numbers. For any two real numbers a and b
(a < b), define
R(a, b) = |{x 2 P | a x b}|.
1
C4. Let A be a matrix of size row ⇥ col. A has to be filled in a spiral clock-
wise fashion with successive integers from 1, 2, . . . , row ⇥ col starting
from the top left corner. For example, a 3 ⇥ 4 matrix should be filled
in as follows:
1 2 3 4
10 11 12 5
9 8 7 6
Fill in all the blanks in the following code snippet to do the above job.
In the answer script, write only the while loop with the blanks filled-in.
#include <stdio.h>
#include<stdlib.h>
#define RIGHT 0
#define DOWN 1
#define LEFT 2
#define UP 3
2
}
}
}
int main () {
int **A, row, col, i, j;
printf("\n Row and column size::>");
scanf("%d %d",&row,&col);
[10]
C6. A ternary variable can assume the values 0, 1 or 2, and can be coded with
two binary bits as 00, 01 and 10 respectively. A ternary full-adder has three
ternary digits X, Y and a carry-in Cin as inputs, and produces the ternary
sum S (base 3) and the ternary carry-out Co . For example, if X = (2)3 ,
Y = (2)3 and Cin = (1)3 , then S = (2)3 and Co = (1)3 . Design a circuit
for this ternary full adder using binary gates as well as binary half and full
adders.
[10]
3
C7. (a) Consider the single precision (i.e., 32-bit) floating point representation of
numbers in the normalized form where 8 bits are used for the exponent
with the bias of 127.
(i) What is the binary representation of -10.4 in the above form? The
steps followed to arrive at the representation must be shown.
(b) Consider a 4-way set associative cache mapping, in which the cache
blocks are grouped into sets and each set has 4 blocks. There are 16
cache blocks in total. The following memory block requests arrive in
order when the cache memory is empty:
If a set is full, the Least Recently Used (LRU) policy is used to replace
a block in that set to make room for the present request.
C8. Consider the following language L over the alphabet ⌃ = {a, b, c}.
4
C9. In relational algebra, for any pair of relations R1 and R2 , the standard
division operation is denoted by ÷ and defined as follows:
Here, A⇤ denotes the attributes that are in R1 but not in R2 . The following
is an example of a standard division operation.
R1 R2 R1 ÷ R 2
A B C
1 Red Leaf
2 Green Leaf
C
2 Blue Leaf A B
Leaf
3 Red Leaf 3 Red
Stem
3 Red Stem
4 Pink Leaf
5 Black Stem
(R1 ÷ R2 ) ⇥ R2 = R1 .
(ii) Recall that the notations ./, ./ and ./ denote natural join, left
outer join, and right outer join operations, respectively. For any
arbitrary pair of relations R1 and R2 , prove that if (R1 ÷R2 )⇥R2 = R1
holds, then the following will also hold.
[4+6]
5
C10. Consider sending a message of 10, 000 bits from the source node S to the
destination node D passing through the two routers R1 and R2 as shown in
the figure. Each of the three links on the path has a propagation delay of
20 ms. Node S has a transmission rate of 100 bits/sec, and each of R1 and
R2 has a transmission rate of 1000 bits/sec. Assume that: (i) each router
uses store-and-forward packet switching; (ii) the size of the header is negli-
gible compared to the packet size; (iii) except transmission and propagation
delays, all other delay components are negligible.
(i) Find the end-to-end latency of the message when it is sent as a whole.
(ii) Find the end-to-end latency of the message when it is broken into 10
packets each of size 1000 bits, and then transmitted to the destination.
[4+6]
6
Non-CS Group (Mathematics)
NC1. Consider a standard balance with two pans where weights can only
be placed on the left pan, and the object to be weighed on the right
pan. Find the minimum number of weights required to weigh any
object whose weight in grams could be any integer ranging from 1 to
127. Give precise argument in favor of your answer.
[10]
NC3. Consider a two-player game between Alice and Bob, in which the
players take turns to roll a fair six-faced die. Alice rolls the die first.
Then Bob rolls the die and he wins if he gets the same outcome as
Alice. Otherwise, Alice rolls the die again and she wins if she gets
the same outcome as Bob. The game continues in this way, and it
terminates as soon as one player gets the same outcome as obtained
by the opponent in the previous roll of the die. The player who
succeeds in doing so first is the winner.
(i) Find the probability that the game does not terminate after the
first three rolls (two by Alice and one by Bob) of the die.
(ii) What is the probability that Alice will win the game?
[3+7]
7
NC4. In the figure below, there are three circles touching each other exter-
nally and also touching the line below. Let r1 , r2 and r3 be the radii
of the three circles as shown in the figure. If r1 = 25 and r3 = 9, then
find r2 .
[10]
NC7. Let G be a cubic graph, that is, every vertex has degree exactly 3.
8
NC8. (i) Calculate the number of di↵erent ways you can divide 2n ele-
ments of the set S = {1, 2, . . . , 2n} to form n disjoint subsets,
each containing a pair of elements.
(ii) Calculate the number of di↵erent ways in which the above di-
vision can be done if each subset is required to contain an even
number and an odd number.
[6+4]