Transporting bananas

864.1K Views

You have 3000 bananas that you want to transport a distance of 1000 km.  The transport will be done by a monkey.  The monkey can carry as many as 1000 bananas at any one time.  With each kilometer traveled (forward or backward), the money consumes 1 banana.  How many bananas can you get across to the other side?

Share
ronret45 Expert Asked on 1st August 2015 in Microsoft Interview Puzzles.
Add Comment

  • 1 Answer(s)

    The answer is 533 bananas.

    Explanation:

    The idea is minimize the monkey movement thereby maximizing bananas. So for that we need to always utilize the maximum carrying capacity of monkey, which we can do that by restricting the backward movement of monkey, thereby saving the banana cost.

    We have to choose some point in the mid way where monkey can transport bananas.

    Bananas remaining 3000.

    So we make monkey moves 1 km only

    a) Move forward with 1000 bananas – Will eat up 1 banana in the way forward
    b) Leave 998 banana after 1 km and return with 1 banana – will eat up 1 banana in the way back
    c) Pick up the next 1000 bananas and move forward – Will eat up 1 banana in the way forward
    d) Leave 998 banana after 1 km and return with 1 banana – will eat up 1 banana in the way back
    e) Will carry the last 1000 bananas from initial and move forward – will eat up 1 banana

    A point which is the crux of problem is that the monkey need not to travel back, so he will not consume banana for that.

    In this way we will be able to transport all the bananas to 1 km forward, now monkey need not to travel back the initial point, hence we are optimizing the km traveled.

    So for travelling 1 Km he consumed 5 bananas.
    For 200 km he will consume 1000 bananas.

    Bananas remaining 2000.

    Now we will apply our above logic here again to calculate the bananas consumed per km.

    a) Move forward with 1000 bananas – Will eat up 1 banana in the way forward
    b) Leave 998 banana after 1 km and return with 1 banana – will eat up 1 banana in the way back
    c) Pick up the next 1000 bananas and move forward – Will eat up 1 banana in the way forward
    So for travelling 1 Km he consumed 3 bananas.
    For 333 km he will consume 1000 bananas.

    Bananas remaining 1000.

    Now since remaining bananas are less than 1000 so monkey needs to travel only in forward direction.Since we already covered 200+333 = 533 km we are left with 467 km.
    So monkey will consume 467 bananas while moving forward.

    Bananas remaining 533.

    Pranav Jain Scholar Answered on 27th April 2016.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.
  • More puzzles to try-