Tech Interview

A site for technical interview questions, brain teasers, puzzles, quizzles (whatever the heck those are) and other things that make you think!

    • 14 Apr 2010

      Ants on a Triangle

      Posted at 12:27 pm by Admin, on April 14, 2010

      There are three ants on a triangle, one at each corner. at a given moment in time, they all set off for a different corner at random. what is the probability that they don’t collide?

      Solution

      Consider the triangle ABC. We assume that the ants move towards different corners along the edges of the triangle.

      Total no. of movements: 8 A->B, B->C, C->A A->B, B->A, C->A A->B, B->A, C->B A->B, B->C, C->B A->C, B->C, C->A A->C, B->A, C->A A->C, B->A, C->B A->C, B->C, C->B

      Non-colliding movements: 2 A->B, B->C, C->A A->C, B->A, C->B

      (i.e. the all ants move either in the clockwise or anti-clockwise direction at the same time)

      P(not colliding) = 2/8 = 0.25

      0 Comments
      Posted in regular

Proudly powered by WordPress.

Theme: Minipress by Obox Themes.