**Source:**Shared by Alok Mittal (Cannan Partners)

**Problem:**

Quant, Math & Computer Science Puzzles for Interview Preparation & Brain Teasing

A collection of ~225 Puzzles with Solutions (classified by difficulty and topic)

A mad robot sets off towards the North East on a journey from the point (0,0) in a coordinate system. It travels in stages by moving forward and then rotating on the spot. It follows these pseudo-code instructions:

SUB JOURNEY

DISTANCE = 1000

WHILE (DISTANCE > 0.001)

MOVE DISTANCE

STOP

ROTATE(90, DEGREES, CLOCKWISE)

DISTANCE = DISTANCE / 2

END WHILE

EXPLODE

END SUB

Where does the robot explode?

The friendship paradox is the phenomenon first observed by the sociologist Scott L. Feld in 1991 that most people have fewer friends than their friends have, on average. Prove it mathematically.

Update (18th June 2014):

Solution posted by me (Pratik Poddar) in comments

Solution posted by me (Pratik Poddar) in comments

A square has a quarter in each corner. You are blindfolded and must get all quarters to be heads up or all to be tails up. You will be told when you have done this. You may flip however many you want, then ask if you are done (this constitutes a turn). The square is then rotated/spun an undisclosed number of times. You then get another turn and so on…

Is there a strategy that is guaranteed to work in a finite number of moves, and if so, what is that smallest number of moves you need to be 100% you’ll be able to have all heads up or all tails up?

The same problem is there on the blog - in a different form - asked more than 50 months back :-) - Blind Flipping - CSE Blog

Subscribe to:
Posts (Atom)