This was asked to me on Dec 1 in campus interviews of one of the companies.
We have a cube. An ant is on one of the corners. It moves randomly with equal probability in all the three directions. What is the expected number of steps to reach the opposite corner.
Note that the probability of the ant reaching the opposite corner in 2 steps is 0, in 3 steps is 6/27, in 4 steps is 0 and so on..
(I was able to solve it :D)
Update (11/12/09): Solution posted by Anshum (Jaadu, CSE, IITB) in comments!!
Quant, Math & Computer Science Puzzles for Interview Preparation & Brain Teasing
A collection of ~225 Puzzles with Solutions (classified by difficulty and topic)
Subscribe to:
Post Comments (Atom)
Fraction Brainteaser
Source: Sent to me by Gaurav Sinha Problem: Siddhant writes a Maths test and correctly answers 5 out of 6 Arithmetic questions and 20...

This is not a puzzle. So, for those of you who follow this puzzle blog, please bear with me for just one post. Interesting Math in this art...

Let's say A keep tossing a fair coin, until he get 2 consecutive heads, define X to be the number of tosses for this process; B keep tos...

Source: Sent to me by Gaurav Sinha Problem: Siddhant writes a Maths test and correctly answers 5 out of 6 Arithmetic questions and 20...
Let the expected number of step required to go from (0,0,0) to (1,1,1) be E0.Also let expected number of step required to reach (1,1,1) from (0,0,1)(Or from (0,1,0) or from (1,0,0)) be E1.similarly expected number of step required to reach (1,1,1) from (0,1,1) (Or from (1,0,1) or from (1,1,0)) be E2.Then we can write:
ReplyDeleteE0=1/3(E1+E1+E1)+1
E1= 1/3*E0 + 2/3*E2 + 1
E2 = 2/3*E1 + 1
solving this we find E0 as 10.It is intersting to see that even though we can never reach opposite corner in even number of step,still number of expected step is even.
69/25?
ReplyDeleteyo jaadu... nice :)
ReplyDelete@asad.. Could you explain how did you get 69/25...
ReplyDeleteIn fact a simple sanity check that its wrong...
The best path is of length 3.. The worst might be of infinite length.. You cannot have expected length < 3 :)
This comment has been removed by a blog administrator.
ReplyDelete