TCS Company

1. Alok and Bhanu play the following game on arithmetic expressions. Given the
expression
N = (Θ + A)/B + (Θ + C + D)/E
where A, B, C, D and E are variables representing digits (0 to 9), Alok would like to
maximize N while Bhanu would like to minimize it. Towards this end, they take turns in
instantiating the variables. Alok starts and, at each move, proposes a value (digit 0-9)
and Bhanu substitutes the value for a variable of her choice. Assuming both play to their
optimal strategies, what is the value of N at the end of the game? Also find a sequence
of moves (digits by Alok and variables by Bhanu) that would yield this value.
Note: Moves that lead to a divide-by-zero condition are disallowed. A non-optimal
sequence of moves is (5 → B, 6 → C , 3 → D, 2 → E, 0 → A) and the expression
evaluates to Θ/5 + (Θ+9)/2.
2. The mean, unique mode, median and range of 21 positive integers is 21. What is the
largest value that can be in this sequence? Also find such a sequence.
Note: Given a sequence of numbers a(1) ≤ a(2) ≤ ... ≤ a(n),
 The median of the sequence is the middlemost value in the sequence if n is
odd and the average of the two middle values if n is even.
 The mode is the most occurring value in the sequence
 The range is the difference between the largest and the smallest values, i.e.
a(n) - a(1).
For example, the sequence 2, 3, 4, 6, 6, 9 has mean = (2 + 3 + 4 + 6 + 6 + 9)/6 = 5,
median = (4+6)/2 =5, mode = 6, and range = 9 – 2 = 7.

Read Solution (Total 2)

TCS Other Question

P(x)= x^2012+x^2011+x^2010+...+x+1)^2 - x^2012 Q(x)=x^2011+x^2010+..+x+1 The remainder when P(x) is divided by Q(x) is ? A spaceship on an inter-galactic tour has to transfer some cargo from a base camp to
a station 100 light sec away through an asteroid belt. The ship can carry a maximum of
100 kgs of cargo and, as a result of colliding against the asteroids, every 2 light sec of
travel causes it to lose 1 kg of cargo. There are 300 kgs of cargo available at the base
camp. Find the maximum amount of cargo (in kg) that the ship can transfer to the
station? Assume that the spaceship can store the cargo at any intermediate point along
the way and that stored cargo is not depleted by the asteroids.