ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Einstein's riddle - Who owns the goldfish? : How I solved (아인슈타인의 "금붕어를 키우는 사람은 누구인가" 문제)
    카테고리 없음 2023. 2. 11. 01:30
    728x90
    반응형

    불금을 맞이하여 알고리즘이 아닌 문제를 한번 풀어보았다. 답은 생각보다 빨리 찾았는데 문제랑 상관없는 다른 질문이 생겼고, 같은 질문을 하는 글들이 있어 기록을 해본다. (아.. 한국어로 같이 적다가 너무 힘들어서 포기함)

    손으로 푼 기록

     

    * Following question and conditions are translated back in English from Korean so some words or nuance can be different from the original text. I recommend to look for the original English version.

    (아래의 문제는 영어 원문을 한국어로 전달받은 것을 다시 영어로 번역한 것이므로 원문의 뉘앙스와 다른 것이 있을 수 있으니, 원문을 찾아보시는 것을 추천드립니다.)

     

    Question

     Five nationals of five different countries live in five differently colored houses, keep five different pets, drink five different drinks and smoke five different brands of cigarettes. Find the one who owns goldfishes.

     서로 다른 5채의 집에 국적이 다른 사람이 살고 있다. 각 집주인은 5가지 다른 종류의 음료수를 마시고, 상표가 다른 담배를 피우며, 애완동물을 한마리씩 기른다. 아래에 주어진 정보를 토대로 금붕어를 기르고 있는 사람은 어떤 국적을 가지고, 무슨 색 집에 살며, 어떤 브랜드의 담배를 피고, 무슨 음료를 마시는지 밝혀라.

     

    Conditions

    * I dk how to spell the brands of cigarettes so replaced those with uppercase initials...:)

    1. The British lives in the red house / 영국 사람은 빨간색 집에 산다
    2. The Swedish has a dog / 스웨덴 사람은 강아지를 키운다
    3. The Dane drinks tea / 덴마크 사람은 차를 마신다
    4. The green house is on the left of the white house/ 초록색 집은 하얀색 집의 바로 왼쪽에 있다
    5. The one who lives in the green house drinks coffee / 초록색 집에 사는 사람은 커피를 마신다
    6. The one who somkes PM has birds / 팔몰을 피는 사람은 새를 키운다
    7. The one who somkes DH is the owner of the yellow house / 던힐을 피우는 사람은 노란색 집의 주인이다
    8. The one who lives in the house in the middle drinks milk / 가운데 집에 사는 사람은 우유를 마신다
    9. The Norwegian lives in the first house / 노르웨이 사람은 첫번째 집에 산다
    10. The one who smokes B is a neighbor of the person who has a cat / 블렌드를 피우는 사람은 고양이를 키우는 사람의 이웃이다
    11. The one who has a horse lives next to the one who smokes DH / 말을 키우는 사람의 옆집은 던힐을 피운다
    12. The one who somkes BM drinks beer / 블루 마스터를 피우는 사람은 맥주를 마신다
    13. The German smokes P / 독일 사람은 프린스를 피운다
    14. The Norwegian is a neighbor of the one who lives in a blue house / 노르웨이 사람은 파란색 집의 이웃이다
    15. The one who somkes B has a neighbor who drinks water / 블렌드를 피우는 사람은 물을 마시는 사람을 이웃으로 한다.

    My questions are:

    Q: Are the houses in a circle or in a row?

    A: In a row because there are the first and the center following the con#8 and the con#9.

     

    Q: What is the definition of "neighbor" in this question? Are "neighbor" and "next" share same meaning in the cons?

    A: I decided to try to solve this riddle assuming "neighbor == next" and come up with a different definition if I couldn't find an answer. Fortunately, I got the answer and it seems an error happened when the riddle was translated from EN to KR.

     

    Q: There are five colors of houses, five brands of cigarettes, five nationalities but only four animals in the condition - No hint for the person who has the goldfish. Then how can I find the person who has the goldfish?

    A: ???

     

    How to solve?

     The main concept is:

       1/ Make a table with the above hints. Sentences are in order, which can make reverse thinking difficult.

    (e.g. The person who somkes DH lives next to the person who has horses == The person who has horses lives next to the person who smokes DH)

       2/ Review the constraints in order of information weight of categories.

     

    From the first question, there is one information we know about all the houses - the orders. So I made the below table first.

      House1 House2 House3 House4 House5
    Nationality          
    Drink          
    Cigarette          
    Pet          
    Color          

     

    Among all the conditions, firstly we should pick what we can get another information from the absolute position. Those're con#8(Middle) and con#9(First).

    • Con#8: Middle house - Milk
    • Con#9: First house - Norwagian

     

      House1 House2 House3 House4 House5
    Nationality Norwagian        
    Drink     Milk
       
    Cigarette          
    Pet          
    Color          

     

    Then we can fill out the blanks based on the conditions related with the Norwegian.

    • Con#14: Norwagian - Blue's Neighbor

     

      House1 House2 House3 House4 House5
    Nationality Norwagian        
    Drink     Milk    
    Cigarette          
    Pet          
    Color   Blue      

     

    Now, we have 1 infomation per nationality, drink and color and 5 information abt absolute position. We can infer relative positions from absolute positions, let's look the condition with relative positions.

     

    There're 4 conditions tell us about it.

    • Con#4: Relative position color - color
    • Con#10: Relative position cigarette - pet
    • Con#11: Relative position cigarette - pet
    • Con#15: Relative position drink - cigarette

    We still don't have any information on cigarettes, pets and drinks, so let's review con#4 first.

    • Con#4: Green - On the left of white

    Below is the possible options of Green: White.

        (House3: House4)

        (House4: House5)

     

    Well, seems there's nothing what we can do. Let's move on the next conditions. Below is weight of information.

    • Color: 1.5
    • Drink: 1
    • Nationality: 1

    So let's look what the condition tells about colors.

    • Con#1: English - Red
    • Con#5: Green - Coffee
    • Con#7: Yellow - DH

    Following con#5, drink of house3 s/b coffee, not milk. T/f, (House4:House5) is the answer for Green:White.

    Now the empty houses are House1 and 3. The Norwagian lives in House 1, so House3 is red (con#1) and the remained house is yellow.

     

     Following con#7, yellow - DH and DH - horse's neighbor following con#11. So the table can be updated as below.

     

      House1 House2 House3 House4 House5
    Nationality Norwagian   British    
    Drink     Milk Coffee  
    Cigarette DH        
    Pet   Horse      
    Color Yellow Blue Red Green White

     

    The inforamtion weight is updated as below.

    • Color: 5 (Finished)
    • Drink: 2
    • Nationality: 2
    • Cigarette: 1
    • Pet : 1

     

    So let's see what we have on drink - nationality, drink - cigarette, nationality - cigarette.

    • Con#5: Dane - Tea
    • Con#12: Beer - BM
    • Con#13: German - P
    • Con#15: B - water's neighbor

     

    • The possible options for Dane - Tea is House 2 or House 5
    • The possible options for Beer - BM is House 2 or House 5
    • The possible options for German - P is House2, 4 or 5 but because of above two constraints, House4 is the final position(Dane can't drink tea and bear together)
    • The possible option for B - Water is (B, Water) == (House2, House1), (House3, House2), (House4, House5) but because of below reasons, (House 2, House 1) is the final position.
      • Because of con#13, (House4, House5) is rejected
      • One of con#5 and Con#12 is House 2 or 5 and both constraints include drink. So water can't be House 2 - (House3, House2) is rejected

    Following con#15's position, con#12's position is House 5 because House2's owner can't smoke B and BM together. It decides Dane and Tea's position to House2.

     

      House1 House2 House3 House4 House5
    Nationality Norwagian Dane British German  
    Drink Water Tea Milk Coffee Beer
    Cigarette DH B   P BM
    Pet   Horse      
    Color Yellow Blue Red Green White

     

    Now information weight is as below.

    • Color: 5 (Finished)
    • Drink: 5 (Finished)
    • Nationality: 4
    • Cigarette: 4
    • Pet : 1

     

    We can fill out blanks the last one option of each categories for Nationality and Cigarette and based on the constraints.

    • Con#2: Swedish - Dog
    • Con#6: PM - Bird
    • Con#10: B - Cat's neighbor
      House1 House2 House3 House4 House5
    Nationality Norwagian Dane British German Swedish
    Drink Water Tea Milk Coffee Beer
    Cigarette DH B PM P BM
    Pet Cat Horse Bird   Dog
    Color Yellow Blue Red Green White

     

    Yay! We got one last blank in Pet category.

    The owner is German who drinks coffee, smokes P and lives in the green colored house.

     

    But can we say he has the goldfish? I would say NO because no one, nowhere said the last one animal is a goldfish. We don't know which animal he has.

    728x90
    반응형

    댓글