mscds2018 Solutions
mscds2018 Solutions
Part A - Answers
This is the only place that will be seen for grading part A. So carefully and clearly write the answers to
each question on the designated line below. Write only the final answers, do not show any intermediate work.
Illegible/unclear answers will not be considered.
• f is said to be surjective (or onto) if for every y ∈ B there exists x ∈ A such that f (x) = y;
• f is said to be invertible if there exists a function g from B to A such that f (g(y)) = y for all y ∈ B
and g(f (x)) = x for all x ∈ A.
• For a matrix A, |A| denotes the determinant of A and AT denotes the transpose of A.
Part A - Questions
This section consists of some questions requiring a single answer and some multiple choice questions.
For questions that ask you to calculate a value, you will be assessed based on the answer you provide.
No explanation is required. In multiple choice questions, there may be multiple correct choices.
You have to select all the correct options and no incorrect option to get full marks. There
is no partial credit. Write the correct options / answer in the space provided on page 3.
Only page 3 will be seen for grading part A.
1. If P is an invertible matrix and A = P BP −1 , then which of the following statements are necessarily true?
(a) B = P −1 AP
(b) |A| = |B|
(c) A is invertible if and only if B is invertible
(d) B T = AT .
1 2 3 1 4 7 4 5 6 −1 2 3
2. Let A = 4 5 6 , B = 2 5 8 , C = 1 2 3 and D = 4 −5 6 .
7 8 9 3 6 9 7 8 9 7 8 −9
3. Let x = 3 1 2 . Which of the following statements are true?
(a) xT x is a 3 × 3 matrix
(b) xxT is a 3 × 3 matrix
(c) xxT is a 1 × 1 matrix
(d) xxT = xT x
2
4. A n × n matrix A is said to be symmetric if AT = A. Suppose A is an arbitrary 2 × 2 matrix. Then which
of the following matrices are symmetric (here 0 denotes the 2 × 2 matrix consisting of zeroes):
0 AT
A 0
(b) (d)
A 0 0 AT
Description for the following 3 questions: If Z is a continuous random variable which follows normal
distribution with mean = 0 and standard deviation = 1, then
Z a
exp{−z 2 /2}
P(Z ≤ a) = √ dz = Φ(a),
−∞ 2π
where Φ(a = −2) = 0.02, Φ(a = −1) = 0.16, Φ(a = 0) = 0.50, Φ(a = 1) = 0.84, and Φ(a = 2) = 0.98.
Note that X = µ + σZ follows normal distribution with mean µ and standard deviation σ. The length of
the life of an instrument produced by a machine has a normal distribution with a mean of 24 months and
standard deviation of 2 months.
5. The probability that an instrument produced by this machine will last less than 18 months is
Z 18
exp{−z 2 /2}
(a) √ dz.
−∞ 2π
Z ∞
exp{−z 2 /2}
(b) √ dz.
18 2π
(c) is less than 0.02.
( )
1 x − 24 2
Z 18
1
(d) √ exp − dx.
−∞ 2π.22 2 2
6. The probability that an instrument produced by this machine will die between 18 and 24 months is
7. Out of a large number of instruments produced by this machine, the percentage of instruments that will
last more than 26 months approximately
Description for the following four questions: Given below is the time table for a trans-continental
train cutting across several time zones. All times given below are local time in respective cities. It is given
that the average speed between any two cities is the same for both way journeys.
3
local time local time local time local time
arrival departure City arrival departure
- 06:00 AM ↓ Zut 12:40 PM -
07:45 AM 07:50 AM ↓ Yag ↑ 10:50 AM 10:55 AM
09:40 AM 09:45 AM ↓ Xum ↑ 06:55 AM 07:00 AM
12:10 PM 12:15 PM ↓ Wip ↑ 02:25 AM 02:30 AM
02:45 PM 02:50 PM ↓ Vaq ↑ 11:50 PM 11:55 PM
04:05 PM 04:10 PM ↓ Uap ↑ 08:30 PM 08:35 PM
05:40 PM 05:45 PM ↓ Tix ↑ 04:55 PM 05:00 PM
07:40 PM 07:45 PM ↓ Sab ↑ 12:55 PM 01:00 PM
10:40 PM - Raz ↑ - 08:00 AM
8. Which of the following pairs of cities are in the same time zone?
9. Write down the total time taken in minutes by the train to go from Zut to Raz.
12. In an entrance examination with multiple choice questions, with each question having four options and
a single correct answer, suppose that only 20% candidates think they know the answer to one difficult
question and only half of them know it correctly and the other half get it wrong. The remaining candidates
pick one option out of the four randomly and tick the same. If a candidate has correctly answered the
question, what is the (conditional) probability that she knew the answer?
13. There are n songs segregated into 3 play lists. Assume that each play list has at least one song. The
number of ways of choosing three songs consisting of one song from each play list is:
n3
(A) > for all n
27
n3
(B) ≤ for all n
27
(C) n3 for all n
14. Consider the following functions defined from the interval (0, 1) to real numbers. Which of these functions
attain their maximum value in the interval (0, 1)?
1
(a) f (x) =
x(1 − x)
(b) g(x) = −(x − 0.75)2
πx
(c) u(x) = sin( )
2
4
(d) v(x) = x2 + 2x
15. A farmer owns 50 papaya trees. Each tree produces 600 papayas in a year. For each additional tree
planted in the orchard, the output of each tree (including the pre-existing ones) drops by 5 papayas. How
many trees should be added to the existing orchard in order to maximize the total production of papayas?
16. Let a, b be numbers between 1 and 2 and let c, d be numbers between 3 and 4. Let u = a−1 , v = b−1 , w =
c−1 and x = d−1 . Say which of the following inequalities are true:
17. In the code fragment below, start and end are integer values and square(x) is a function that returns
True if x is a perfect square and False otherwise.
i := 0;
j := 0;
k := 0;
for m in [start,start+1, ...,end]{
if (square(m)=True){
i := i + m*m;
k := k + m*m;
}else{
j := j + m*2;
k := k + m*2;
}
}
At the end of the loop, which of the following are correct statements about the relationship between i, j
and k?
18. Given the following definition of the function foo, what does foo(1037,2) return? Note that a//b denotes
the quotient (integer part) of a ÷ b, for integers a and b. For instance 7//3 is 2.
function foo(n,d){
x := 0;
while (n >= 1) {
x := x+1;
n := n//d;
}
5
return(x);
}
19. A very special island is inhabited only by knights and knaves. Knights always tell the truth, and knaves
always lie. You meet three inhabitants: Ramesh, Bharat and Menaka. Ramesh claims, “Bharat is a
knave.” Bharat says, “Menaka and I are both knights or both knaves.” Menaka claims that Bharat is a
knave.
Which of the following are correct?
20. There are 7 switches on a switchboard, some of which are on and some of which are off. In one move, you
pick any 2 switches and toggle each of them—if the switch you pick is currently off, you turn it on, if it
is on, you turn it off. Your aim is to execute a sequence of moves and turn all 7 switches on. For which
of the following initial configurations is this possible? Each configuration lists the initial positions of the
7 switches in sequence, from switch 1 to switch 7.
(a) (off,on,on,on,on,off,on)
(b) (off,on,on,on,off,on,off)
(c) (off,on,off,off,on,off,on)
(d) (off,on,off,off,off,on,off)
6
Part B
For questions in part (B), you have to write your answer with a short explanation in the space provided below
the question. For numerical answers, the following forms are acceptable: fractions, decimals, symbolic e.g.: nr ,
n P , n! etc.
r
f : N × N 7→ N
2. Suppose A, B and C are m × m matrices. What does the following algorithm compute? (Here A(i, j)
denotes the (i.j)th entry of matrix A.)
for i = 1 to m
for j = 1 to m
for k = 1 to m
C(i, j) = A(i, k) ∗ B(k, j) + C(i, j)
end
end
end
Solution: Overwrites C with AB + C.
1 1 0
3. Find A10 where A is the matrix 0 1 1 . Justify your answer.
0 0 1
1 10 45
Solution: 0 1 10 .
0 0 1
1 n n(n − 1)/2
In general, An = 0 1 n
0 0 1
4. In computing, a floating point operation (flop) is any one of the following operations performed by a
computer: addition, subtraction, multiplication, division. For example, the dot product of two vectors
(u, v, w) · (x, y, z) = ux + vy + wz involves 3 multiplications and 2 additions, a total of 5 flops.
Calculate the exact number of flops required computing C = AB for two 5 × 5 matrices A and B using
X 5
a direct implementation of cij = aik bkj . How does this number change if both the matrices are upper
k=1
triangular?
Solution: Computing each entry of the product matrix requires 5 multiplications and 4 additions, i.e. a
total of 9 flops. Since there are 25 entries to be computed, a total of 25 × 9 = 225 flops is required.
If the matrices are upper triangular, then the product matrix is upper triangular too, so that only 15
entries are computed. Also, the number of flops required per entry is reduced. For example, the number of
computations required for the first row is (5 + 4) + (4 + 3) + (3 + 2) + (2 + 1) + 1 = 9 + 7 + 5 + 3 + 1 = 25,
while for the second row 7 + 5 + 3 + 1 = 16 computations are required. The total number of computations
required is 55.
5. A function f from the set A to itself is said to have a fixed point if f (i) = i for some i in A. Suppose A is
the set {a, b, c, d}. Find the number of bijective functions from the set A to itself having no fixed point.
Solution: # bijections with exactly 4 fixed points equals 1 (the identity);
# bijections with exactly 3 fixed points equals 0, since 3 fixed points would imply the fourth one is also
fixed;
# bijections with exactly 2 fixed points equals 42 = 6 : choose the two points to be fixed, and don’t fix the
other two;
# bijections with exactly 1 fixed point equals 41 × 2 = 8 : choose one point to be fixed, for each such
choice the remaining 3 elements can be permuted in 2 ways without introducing new fixed points.
Thus the required number equals 4! − (1 + 6 + 8) = 24 − 15 = 9.
6. A 4-digit number is represented as abcd i.e. a × 103 + b × 102 + c × 10 + d, where a 6= 0. Suppose the
number dcba, obtained by reversing the digits of abcd, is 9 times abcd. Find the number abcd.
Solution: a must be ≤ 1, for else abcd ≥ 2000, but 2000 × 9 = 18000, while dcba has to be a 4-digit
number; since a 6= 0, thus a must be 1. Then d must be 9; if b ≥ 2, then abcd × 9 = 12c9 × 9 ≥ 10, 000,
so b must be ≤ 1. Consider the 2 cases:
(a) b = 1: in this case, 11c9 × 9 = 9c11 implies 9c + 8 has unit digit 1, so 9c has unit digit 3, so c = 7
and abcd = 1179, but 1179 × 9 6= 9711. So b = 1 does not give a solution;
(b) b = 0: in this case c = 8 and abcd = 1089 works.
P(at least one def ault) = 1 − P(N one of the debtors def ault)
= 1 − P(X = 0)
= 1 −200 C0 p0 (1 − p)200−0 = 1 − (1 − p)200
9. For the situation in the previous problem, what is the expected number defaults?
Solution: X ∼ Binomial(200, p)
1
E(X) = np = 200 × 100 =2
10. Suppose the bank earns 10% of the loan amount for every loan that is repaid. If the person defaults on
his/her credit then the bank loses the entire loan amount. What is the expected revenue of the bank from
a loan of Rs. 100,000?
Solution: If debtor repay the loan then the bank earns Rs 10,000. But the chance that the debtor will
repay the loan
99
10, 000 P(repay loan) = 1 − p = 100
revenue = 1
−100, 000 P(def ault) = p = 100
The expected revenue of the bank from every Rs 100,000 is 10000 ∗ 0.99 + (−100000) ∗ 0.01 = 8900.
Description for the following four questions:
An ice-cream company mainly operates in the five southern states of India. The pie chart shows the
breakdown of revenues (in percentages) for the ice cream company over the last summer. The bar chart
shows the detail of breakdown for strawberry flavor by states in lakhs of rupees.
Lakhs of Rupees
Other
4% 20
12% 15
26%
Mint 10
Chocolate 16%
5
Chocolate Fudge
0
Tamil Nadu Kerala Karnataka Andhra Telengana
14. If you assume that the chocolate flavor and the strawberry flavor are sold in the same proportion across
the five states, then what are the sales of chocolate in Tamil Nadu, in lakhs of rupees? Solution: The
total revenue of chocolate sale is Rs 86.67 Lakh (from previous question). The distribution of the sales
of chocolate flavor by state is same as that of strawberry flavor. That is 20% of the chocolate sales are
coming from Tamil Nadu. That is
x 20
= ,
86.67 100
20×86.67
where x is the sale of chocolate in the state of Tamil Nadu. That is x = 100 = 17.334. The sale of
chocolate in the state of Tamil Nadu is Rs. 17.334 Lakh.
15. A square piece of paper ABCD of side length 1 is folded along the segment that connects the upper right
corner B and the midpoint Q of the left edge AD, as shown. What is the vertical distance between the
base edge (segment DC) and the point P (which was originally point A)?
A B
P
D C
Solution: Let P R be ⊥ to QD and P T be ⊥ to BC. The right-angled triangles QP R and P BT are
similar with BP = 1 and QP = 1/2, so that BT = 2RP and P T = 2QR. Also BT 2 + P T 2 = 1. Now
BT − QR = 1/2, so that 2BT − 2QR = 1, so P T = 2BT − 1. Substituting in BT 2 + P T 2 = 1 gives
BT = 4/5, so the required length is 1/5.
16. A boolean value is a value from the set {True,False}. A 3-ary boolean function is a function that takes
three boolean values as input and produces a boolean value as output. Let f and g be 3-ary boolean
functions. We say that f and g are neighbours if f and g agree on at least one input triple and disagree
on at least one input triple: that is, there exists a triple (x, y, z) such that f (x, y, z) = g(x, y, z) and a
triple (x0 , y 0 , z 0 ) such that f (x0 , y 0 , z 0 ) 6= g(x0 , y 0 , z 0 ).
Suppose we fix a 3-ary boolean function h. How many neighbours does h have?
Solution: 254.
Of the 8 possible input combinations of the three input variables, neighbours agree on 1 to 7 of them.
8 8 8
1 + 2 + · · · + 7 = 254. Or, observe that there are 256 3-ary boolean functions. The only non-
neighbours of h are h itself and the unique function that differs from h on all arguments, so 256 − 2 = 254
are neighbours.
Description for the following four questions:
A golf club has m members with serial numbers 1, 2 . . . , m. If members with serial numbers i and j are
friends, then A(i, j) = A(j, i) = 1, otherwise A(i, j) = A(j, i) = 0. By convention, A(i, i) = 0, i.e. a
person is not considered a friend of himself or herself. Let Ak (i, j) refer to the (i, j)th entry in the k th
power of the matrix A.
Suppose it is given that A9 (i, j) > 0 for all pairs i, j where 1 ≤ i, j ≤ m, A2 (1, 2) > 0 and A4 (1, 3) = 0.
Then which of the following are necessarily true? Give reasons.
19. m ≤ 9.
Solution: False - in the extreme case every one is friend with everyone else and then A9 (i, j) > 0 for all
i, j, 1 ≤ i, j ≤ m irrespective of m - say m can be 100.
20. m ≥ 6.
Solution: True - the smallest chain that links 1 and 3 has length 5 - otherwise A4 (1, 3) > 0- so there are
at least 6 members in the club.