You are on page 1of 3

Question 1:

Sanjeev loves to hike. He found a lovely hill in the vicinity of his college, and planned to hike to the top of it
during the weekend. On Saturday, Sanjeev started the hike at 6 AM, and reached the top of the hill at 4 PM.
He camped on the top of the hill that night, and at 6 AM on Sunday, started walking down following the exact
same trail. It took him less time walking down, and he reached the foothills at 2 PM. Sanjeev could have hiked
up or down with non-uniform speed, and could have taken arbitrary breaks in between -- we do not know
anything about that.

Prove that there exists at least one point in the trail where Sanjeev was present at exactly the same time (as
per his watch) on both Saturday and Sunday, that is, once while hiking up, and then again while walking down.

Solution:
This problem can be solved by superimposing the two events simultaneously.

If we consider Sanjeev on Sunday, and his ghost from the previous day, who will enact every step what he did
on Saturday, then, at 6 AM on Sunday, Sanjeev starts descending the hill, as well as, his ghost starts ascending
the hill. Sanjeev reaches the bottom at 2 PM, while his ghost reaches the top at 4 PM.

Since both of them start at the same time, both of them has to meet together at some point on the hill at
some time, irrespective of whether anyone takes any rest or moves with variable speed.

Thus, this is the point where Sanjeev was present exactly at the same time on both Saturday and Sunday.

Then, it is proved that there exists at least one point in the trail where Sanjeev
was present at exactly the same time on both Saturday and Sunday.

Question 2:
Mumtaz got an amazing gift on her eleventh birthday -- a collection of 20 miniature robots. The robots can
walk in a straight line if the path is clear, and if they meet any obstruction, they do a backflip, and start walking
in the opposite direction. Mumtaz placed the robots individually on a thin straight wooden plank of length 10
feet, and observed that each robot crosses the length of the plank in exactly 1 minute, if they are allowed to
walk from one end of the plank to the other. Just for fun, Mumtaz decided to place all the 20 robots at
random spots on the wooden plank, facing either left or right, in a random order. Once the robots are
switched on, they started walking along the plank, doing backflips whenever obstructed by another robot.
Assume that the plank can accommodate only one robot sidewise (it is a thin plank), and hence the robots can
not overtake one another, or cross one another. Thus, if two robots meet head-on, both of them have to do
back-flips, and walk in opposite directions.

How many robots will remain on the plank after 2 minutes of switching them on? Justify your answer.

Solution:
This problem can be solved by considering that two robots switch identities while colliding.

Let’s consider a collision between two robots. Both of them do a backflip and start going in the reverse
directions. Thus, the left going robot will go right and vice versa.

But previously, two robots were going in opposite directions, and after collision the case remains same.
If we consider that they have switched identities after collision, then the robots continue their motion as
before.

So, collisions do not affect the motion of robots, overall.

Since a robot takes 1 minute to cross the entire plank, all robots will go outside the plank within one minute
only (considering that no time is wasted in backflips).

Then, it is proved that no robots will remain on the plank after 2 minutes of switching them on.

ANS: 0 (Zero)

Question 3:
Suppose that Google maintains two back-up data centers -- one in India and one in the USA -- and the data
centers hold mirrored copy of the same data. To ensure exact mirroring, the data centers communicate every
day, and run a synchronization routine, as follows. Suppose the data centre in India has a d-bit data D1 stored
in it, and the data centre in the USA has a d-bit data D2 stored in it. The two data centers communicate "D1
mod p" and "D2 mod p" for k randomly chosen primes p, each of size x bits. If the communicated numbers "D1
mod p" and "D2 mod p" mismatch for even a single prime p, the data centers conclude that the mirroring has
failed.

What is the probability that the mirroring has failed, that is, D1 and D2 are not identical, even if the
communicated numbers "D1 mod p" and "D2 mod p" are identical for all k randomly chosen x-bit primes p?

Solution:
This problem can be solved by considering failed mirroring as a collection of hash collisions.

Considering mod p as the hash function, we have to find the probability for the case when hashing by all p’s
collide.

Probability of having a hash collision for a single hashing function is given by the well-established formula :

{ −𝑒∗(𝑒−1)}
1– 𝑒
{ }
{2𝑒}
where j is the number of items to be hashed, and
n is the number of hash buckets.

For this case, n = maximum prime number possible in x bits


≈ (2𝑒 ) – 1 (there is no formula for finding the max prime number for x bits)
And, j = maximum number possible in d bits
= (2𝑒 ) – 1

Therefore, for failed mirroring of one p of size x bits


Probability:

{ −((2𝑒 )– 1)∗( (2𝑒 )– 2)}


{ }
𝑒+1
1– 𝑒 { (2 )– 2}

Therefore, for k such p’s:


Probability (ANS) :
𝑒
−((2𝑒 )– 1)∗( (2𝑒 )– 2)}
{
{ }
𝑒+1
(1– 𝑒 { (2 ) – 2}
)

You might also like