SQL Server Performance

Non SQL Quiz

Discussion in 'The Lighter Side of Being a DBA' started by Luis Martin, May 23, 2008.

  1. Luis Martin Moderator

    You have 2 barrels. Each with 10 liters full of milk.
    Also you have 2 empty buckets. One with 5 Liters capacity and the other with 4 Liters.
    Now, I want tho have 2 liters of milk in each bucket.
  2. FrankKalis Moderator

    Interesting, but what exactly is the question? [:$]
  3. Luis Martin Moderator

    That is my lack of English.
    I'll try my best.[:$]
    In that problem, I don't have any other element to achieve the objective. And this is: move milk from full barrels to empty buckets severals time, to finally have 2 liters in each bucket. There is no limit in those moves. Is a real problem and, of course, severals solutions. (min steps win).

  4. Luis Martin Moderator

    Some help to know what is the objective:
    B(10L) B(10L) Bu(5L) Bu(4L)
    10F 10F 0F 0F
    ..............
    Any valid move from and between B and Bu. All moves you want.

    ..............
    ?F ?F 2F 2F
    Final: 2L in Bu(5L) and 2L in Bu(4L)
    Any question?.
  5. Madhivanan Moderator

    [quote user="Luis Martin"]
    Some help to know what is the objective:
    B(10L) B(10L) Bu(5L) Bu(4L)
    10F 10F 0F 0F
    ..............
    Any valid move from and between B and Bu. All moves you want.

    ..............
    ?F ?F 2F 2F
    Final: 2L in Bu(5L) and 2L in Bu(4L)
    Any question?.
    [/quote]
    Fill Bu(4L) from B(10L)
    Now
    B(10L) B(10L) Bu(5L) Bu(4L)
    6F 10F 0F 4F
    Take half of Bu(4L) and fill it in Bu(5L)
    Now
    B(10L) B(10L) Bu(5L) Bu(4L)
    6F 10F 2F 2F
  6. Adriaan New Member

    Madhivanan,
    Nice try, but "Take half of Bu(4L) and fill it in Bu(5L)" - assuming there are no markings on the buckets and barrels, you can't measure half of a bucket ...
  7. Adriaan New Member

    14 steps - if emptying buckets is allowed!
    (1) Fill Bu(4L) from B1
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    6F 10F 0F 4F
    (2) Fill Bu(5L) from Bu(4L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    6F 10F 4F 0F
    (3) Fill Bu(5L) from B2(10L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    6F 9F 5F 0F
    (4) Fill Bu(4L) from B1
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    2F 9F 5F 4F

    (5) Empty Bu(4L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    2F 9F 5F 0F

    (6) Fill Bu(4L) from B2
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    2F 5F 5F 4F

    (7)Empty Bu(4L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    2F 5F 5F 0F
    (8) Fill Bu(4L) from B2
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    2F 1F 5F 4F

    (9) Empty Bu(4L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    2F 1F 5F 0F

    (10) Fill Bu(4L) from Bu(5L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    2F 1F 1F 4F

    (11) Empty Bu(4L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    2F 1F 1F 0F

    (12) Fill Bu(4L) from Bu(5L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    2F 1F 0F 1F

    (13) Fill Bu(4L) from B2
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    2F 0F 0F 2F

    (14) Fill Bu(5L) from B1
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    0 0F 2F 2F
  8. mothilal New Member

    No need to go 14 steps.......With in 10 steps.....

    (1) Fill Bu(4L) from B1
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    6F 10F 0F 4F

    (2)Empty Bu(4L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    6F 10F 0F 0F

    (3) Fill Bu(4L) from B1
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    2F 10F 0F 4F

    (4)Empty Bu(4L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    2F 10F 0F 0F

    (5) Fill Bu(5L) from B1
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    0F 10F 2F 0F

    (6) Fill Bu(4L) from B2
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    0F 6F 2F 4F

    (7)Empty Bu(4L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    0F 6F 2F 0F

    (8) Fill Bu(4L) from B2
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    0F 2F 2F 4F

    (9)Empty Bu(4L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    0F 2F 2F 0F

    (10) Fill Bu(4L) from B2
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    0F 10F 2F 2F
    Any other way is there let me know......... :)
  9. Luis Martin Moderator

    No. You don't have any way to measure half, or any other measure from B or Bu.
    I forgot to mention that. Sorry.
  10. Adriaan New Member

    Luis - my method has a few steps where you throw away the contents of a bucket - is that allowed?
  11. Luis Martin Moderator

    Adriann, my answer where written at the same time you were written. Was for Madhi.
    Anyway you can't throw any milk outside. Always you have to have 20 Liters in any step.
  12. Adriaan New Member

    Okay then - back to the drawing board! [:p]
  13. mothilal New Member

    Finally i got the answer. Let check it is satisfied or not.........
    (1) B(10L) B(10L) Bu(5L) Bu(4L)
    10F 10F 0F 0F
    (2) Fill Bu(5L) from B1
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    5F 10F 5F 0F
    (3) Fill Bu(4L) from Bu(5L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    5F 10F 1F 4F
    (4) Fill B1 from Bu(4L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    9F 10F 1F 0F
    (5) Fill Bu(4L) from Bu(5L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    9F 10F 0F 1F
    (6) Fill Bu(5L) from B1
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    4F 10F 5F 1F
    (7) Fill Bu(4L) from Bu(5L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    4F 10F 2F 4F
    (8) Fill B1 From Bu(4L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    8F 10F 2F 0F
    (9) Fill Bu(4L) from B2
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    8F 6F 2F 4F
    (10) Fill B1 From Bu(4L)
    B1(10L) B2(10L) Bu(5L) Bu(4L)
    10F 6F 2F 2F
  14. Adriaan New Member

    Congratulations! [^][<:eek:)]
  15. Luis Martin Moderator

    Congrats Monthi!!!![:)]
    And that is the minimun steps, as far I know.
    I'll be back next friday with a new one.[:D]
  16. Madhivanan Moderator

    <P mce_keep="true">[quote user="Luis Martin"] <P>Congrats Monthi!!!!<IMG alt=Smile src="http://sql-server-performance.com/Community/emoticons/emotion-1.gif"></P><P>And that is the minimun steps, as far I know.</P><P mce_keep="true">&nbsp;</P><P>I'll be back next friday with a new one.<IMG alt="Big Smile" src="http://sql-server-performance.com/Community/emoticons/emotion-2.gif"></P><P>[/quote]</P><P>Many more interesting Quizes here</P><P><A href="http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47264">http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47264</A></P>
  17. Luis Martin Moderator

    "Many more interesting[:mad:] Quizes here"
    I like more logic problems than math problems.[:)]

  18. satya Moderator

    AGree with Luis, keep them coming in terms of mathematical based quizes.
  19. Madhivanan Moderator

    Yes Most of the questions are related to Mathematics [:)]

Share This Page