0% found this document useful (0 votes)
19 views9 pages

Mtech Cs and Crs PCB 2021

Uploaded by

ZPratt Stark
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views9 pages

Mtech Cs and Crs PCB 2021

Uploaded by

ZPratt Stark
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

CS Group (Computer Science)

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}|.

(i) Design a suitable data structure D to store P such that given a, b


(a < b) as inputs, you can find R(a, b) in time O(log n). Analyze
the time required to construct your data structure D.
(ii) Justify that O(log n) time is sufficient for reporting R(a, b) using
your data structure D.
[5+5]

C3. Let G be a simple undirected graph having n vertices with the


property that the average of the degrees of the vertices in G is at least
4. Consider the following procedure:
Repeatedly delete a vertex from G whose degree is at most
2, until there is no such vertex.
Let H be the resulting graph at the end of this procedure. Then,

(i) Show that the graph H is not empty.


(ii) Using part (i) above, prove that there exist four distinct vertices
a, b, c and d in H such that deg(a) = deg(b) and deg(c) =
deg(d), where deg(x) denotes the degree of the vertex x.
[5 + 5]

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

void spiralFill ( int **A, int r , int c ) {


int i, j, top, bottom, left, right, dir, k=1;
i = j = 0; dir = RIGHT;
top = 0; bottom = r-1; left = 0; right = c-1;
while ((top <= _________ ) && (left <= ________)) {
A[i][j] = k; k++;
switch (dir) {
case RIGHT: if(j < ____) ____;
else{dir = _____; top = ____; i = ____;}
break;
case DOWN: if(i < ____) ____;
else{dir = _____; right = ____; j = ____;}
break;
case LEFT: if(j > ____) ____;
else{dir = _____; bottom = ____; i = ____;}
break;
case UP: if(i > ____) ____;
else{dir = _____; left = ____; j = ____;}
break;

2
}
}
}

int main () {
int **A, row, col, i, j;
printf("\n Row and column size::>");
scanf("%d %d",&row,&col);

A = (int **)calloc(row,sizeof(int *));


for(i=0;i<row;i++){
A[i] = (int *)calloc(col,sizeof(int));
}
spiralFill(A,row,col);
}

[10]

C5. Given a set S of n integers and a constant k (positive integer), design an


algorithm for finding a subset of S of maximum possible size such that the
sum of each pair of integers in this subset is not divisible by k. Note that
full credit will be given for a polynomial (in n) time algorithm.
[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.

(ii) How many di↵erent floating point numbers can be represented in


the above form, lying strictly between 2 18 and 2 17 (i.e., exclud-
ing 2 18 and 2 17 )?
[3+2]

(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:

8, 4, 8, 3, 0, 7, 12, 64, 216, 8.

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.

(i) Show the cache configuration (along with intermediate configura-


tions) on meeting the above memory requirements.

(ii) What is the hit ratio?


[4+1]

C8. Consider the following language L over the alphabet ⌃ = {a, b, c}.

L = {ai bj ck | i, j, k 0, and if i = 1 then j = k}

(i) Show that L is not regular.

(ii) Show that L is a context-free language.


[7+3]

4
C9. In relational algebra, for any pair of relations R1 and R2 , the standard
division operation is denoted by ÷ and defined as follows:

R1 ÷ R2 = ⇡A⇤ (R1 ) ⇡A⇤ ((⇡A⇤ (R1 ) ⇥ R2 ) R1 )

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

(i) Cite a working example wherein a pair of relations R1 and R2 satisfies


the following equation:

(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.

(R1 ./ R2 ) – (R1 ./ R2 ) ⌘ (R1 ./ R2 ) – (R1 ./ R2 ).

[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]

NC2. Consider three real numbers a b c > 0. If (ax bx cx )(x 2) > 0


for any rational number x 6= 2, show that

(i) a, b and c can be the lengths of the three sides of a triangle


ABC;

(ii) ABC is a right-angled triangle.


[3+7]

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]

NC5. Let G be a group generated by a and b such that ord(a) = n, ord(b) =


2 and ab = ba 1 , where n is a positive integer, b 2
/ hai and ord(x)
denotes the order of the element x.

(i) Prove that for any positive integer k, abk = ba k .


(ii) Let H be a cyclic subgroup of hai. Show that H is a normal
subgroup of G.
[5+5]

NC6. Let p be an odd prime and let n = (p 1)(p + 1).

(i) Show that p divides n2n + 1.


(ii) Show that there are infinitely many integers m such that p di-
vides m2m + 1.
[6+4]

NC7. Let G be a cubic graph, that is, every vertex has degree exactly 3.

(i) Prove that the number of vertices of G cannot be 101.


(ii) Prove that if G contains 100 vertices, then it contains a bipartite
subgraph that has at least 75 edges.
[3+7]

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]

NC9. Consider a 4 ⇥ 4 positive semi-definite matrix A with all diagonal


elements equal to 1 and all o↵-diagonal elements equal to ⇢.

(i) If ⇢ < 0, show that the largest eigenvalue of A cannot exceed


4/3.
(ii) Give an eigenvector of A other than (1, 1, 1, 1)> .
[7+3]
⇣ ⌘
NC10. Let a > 0 and x1 > 0. Define xn+1 = 1
2
xn + a
xn
for all n 2 N.
Show that
p
(i) xn > a for all n 2;
p
(ii) the sequence {xn : n 1} converges to a.
[3+7]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy