分頁: (2) 1 [2]  ( 前往第一篇未讀文章 ) Reply to this topicStart new topicStart Poll

> S/O 面試 - 推理遊戲 brain teasers (答案posted)
Caesar
發表於: Aug 23 2015, 11:45  
Quote Post


Loop
************

發表數: 7,495
所屬群組: 軍團長
註冊日期: 12-18-2004

活躍:29
聲望:2214


QUOTE (XxEDxX @ Aug 23 2015, 18:59 )
QUOTE (XxEDxX @ Aug 23 2015, 18:48)
QUOTE (Caesar @ Aug 23 2015, 16:48)
I didn't read ED's solution

If mine is redundant , just tell me n ignore this
So here we go.

Mark 1-12 in sequence

1st :
1234 vs 5678
Two possible result ,
same weight (go to A)or difference ( go to B ),

2nd-A :
9,10 vs 11,12 and follow with 3rd : 9,11 vs 10,12

2nd-B:
1256vs 3478 and follow with 3rd : 1357 vs 2468

That's it.

I have thought around your solution.

If according to your solution we have three times (left:heavier), can you tell me which marble is different? And, is it lighter or heavier than others?

I think your answer looks simpler, but it seems unable to cover all possibilities.

For simpler argument,

After your first step, if it is unequal, then you have 8 marbles to be considered.

2-step bisection method is not enough to pick the different one and determine whether it is lighter or heavier.

You need one more step, so you totally need 4 steps for your solution.

As a side note , I guess we are not sharing the same idea with my solution.
Actually the unequal in first trial hints too.


But since I've checked with the model answer , and I'm wrong anyway, so I guess no point in explaining my original solution.


--------------------
Above the starry canopy. God judges as we judged.
Get busy living, or get busy dying.

.

PM
Top
Caesar
發表於: Aug 23 2015, 11:48  
Quote Post


Loop
************

發表數: 7,495
所屬群組: 軍團長
註冊日期: 12-18-2004

活躍:29
聲望:2214


QUOTE (XxEDxX @ Aug 23 2015, 19:32 )
QUOTE (Caesar @ Aug 23 2015, 19:30)
Hey I'm dumb. ( yea sry)

For my case (ii) ,
I can't point it out really.

1st : 1234 vs 5678 , result : not equal
2nd : 349 vs 125 , result : equal

Now ,we all know 678 is the defective group now .

Please advise a detailed solution on how to figure out which one with a final trial.
This is my question 2 hours ago, and I still can't point it out.

Oh please , I know I'm dumb. tongue.gif

what is your unequal in the first step?

It can give you some idea for the third step bro smile.gif

Woot !! 
I get it finally !!


--------------------
Above the starry canopy. God judges as we judged.
Get busy living, or get busy dying.

.

PM
Top
XxEDxX
發表於: Aug 23 2015, 11:54  
Quote Post


三品官
**********

發表數: 1,467
所屬群組: 太守
註冊日期: 8-30-2011

活躍:11
聲望:507


QUOTE (Caesar @ Aug 23 2015, 19:45 )
QUOTE (XxEDxX @ Aug 23 2015, 18:59)
QUOTE (XxEDxX @ Aug 23 2015, 18:48)
QUOTE (Caesar @ Aug 23 2015, 16:48)
I didn't read ED's solution

If mine is redundant , just tell me n ignore this
So here we go.

Mark 1-12 in sequence

1st :
1234 vs 5678
Two possible result ,
same weight (go to A)or difference ( go to B ),

2nd-A :
9,10 vs 11,12 and follow with 3rd : 9,11 vs 10,12

2nd-B:
1256vs 3478 and follow with 3rd : 1357 vs 2468

That's it.

I have thought around your solution.

If according to your solution we have three times (left:heavier), can you tell me which marble is different? And, is it lighter or heavier than others?

I think your answer looks simpler, but it seems unable to cover all possibilities.

For simpler argument,

After your first step, if it is unequal, then you have 8 marbles to be considered.

2-step bisection method is not enough to pick the different one and determine whether it is lighter or heavier.

You need one more step, so you totally need 4 steps for your solution.

As a side note , I guess we are not sharing the same idea with my solution.
Actually the unequal in first trial hints too.


But since I've checked with the model answer , and I'm wrong anyway, so I guess no point in explaining my original solution.

"Actually the unequal in first trial hints too."

That's why I ask you to think about the case when you get three times (left:heavier). It seems that your method still cannot tell which marble is different and whether it is lighter or heavier than others.

I am afraid that the hint in the first trial is not enough.

***

"But since I've checked with the model answer , and I'm wrong anyway, so I guess no point in explaining my original solution."

I think the model answer may not be unique (that's why I ask), and cannot agree that if your answer is different from the so-called model answer (that you referred to), yours cannot be right.

Whatever, thank you very much for your reply to my answer Caesar. I appreciate them very much.

PM
Top
Caesar
發表於: Aug 23 2015, 11:54  
Quote Post


Loop
************

發表數: 7,495
所屬群組: 軍團長
註冊日期: 12-18-2004

活躍:29
聲望:2214


QUOTE (XxEDxX @ Aug 23 2015, 19:32 )
QUOTE (Caesar @ Aug 23 2015, 19:30)
Hey I'm dumb. ( yea sry)

For my case (ii) ,
I can't point it out really.

1st : 1234 vs 5678 , result : not equal
2nd : 349 vs 125 , result : equal

Now ,we all know 678 is the defective group now .

Please advise a detailed solution on how to figure out which one with a final trial.
This is my question 2 hours ago, and I still can't point it out.

Oh please , I know I'm dumb. tongue.gif

what is your unequal in the first step?

It can give you some idea for the third step bro smile.gif

Woot !! 
I get it finally !!


--------------------
Above the starry canopy. God judges as we judged.
Get busy living, or get busy dying.

.

PM
Top
XxEDxX
發表於: Aug 23 2015, 11:54  
Quote Post


三品官
**********

發表數: 1,467
所屬群組: 太守
註冊日期: 8-30-2011

活躍:11
聲望:507


QUOTE (Caesar @ Aug 23 2015, 19:48 )
QUOTE (XxEDxX @ Aug 23 2015, 19:32)
QUOTE (Caesar @ Aug 23 2015, 19:30)
Hey I'm dumb. ( yea sry)

For my case (ii) ,
I can't point it out really.

1st : 1234 vs 5678 , result : not equal
2nd : 349 vs 125 , result : equal

Now ,we all know 678 is the defective group now .

Please advise a detailed solution on how to figure out which one with a final trial.
This is my question 2 hours ago, and I still can't point it out.

Oh please , I know I'm dumb. tongue.gif

what is your unequal in the first step?

It can give you some idea for the third step bro smile.gif

Woot !! 
I get it finally !!

Good to hear that bro. tongue.gif
PM
Top
Caesar
發表於: Aug 23 2015, 12:14  
Quote Post


Loop
************

發表數: 7,495
所屬群組: 軍團長
註冊日期: 12-18-2004

活躍:29
聲望:2214


Yes , I've said urs could be an alternative solution like 2 hours ago.

And yes , I've said I'm wrong like 2 hours ago.

So yes n yes. grin2.gif


--------------------
Above the starry canopy. God judges as we judged.
Get busy living, or get busy dying.

.

PM
Top
Caesar
發表於: Aug 23 2015, 12:54  
Quote Post


Loop
************

發表數: 7,495
所屬群組: 軍團長
註冊日期: 12-18-2004

活躍:29
聲望:2214


QUOTE

(i)
1st : 1234 vs 5678 , result : equal .
2nd : 39 vs 10,11 , result : 10,11 lighter.

Now either 9 is heavier or 10,11 is lighter.

Altho u just said this isn't ur solution , but I just realised this can actually hit the result .


--------------------
Above the starry canopy. God judges as we judged.
Get busy living, or get busy dying.

.

PM
Top
Pearltea
發表於: Aug 23 2015, 12:56  
Quote Post


四品官
*********

發表數: 1,289
所屬群組: 太守
註冊日期: 9-22-2003

活躍:6
聲望:614


Looks like ED has an alternative solution. 

There are some various solutions in the 2nd and 3rd trials, but for the 1st one it has to be 1234 vs 5678, or ABCD vs EFGH. (Whichever is easier). 

PMEmail Poster
Top
XxEDxX
發表於: Aug 23 2015, 13:04  
Quote Post


三品官
**********

發表數: 1,467
所屬群組: 太守
註冊日期: 8-30-2011

活躍:11
聲望:507


QUOTE (Caesar @ Aug 23 2015, 20:54 )
QUOTE

(i)
1st : 1234 vs 5678 , result : equal .
2nd : 39 vs 10,11 , result : 10,11 lighter.

Now either 9 is heavier or 10,11 is lighter.

Altho u just said this isn't ur solution , but I just realised this can actually hit the result .

Yes, as one lift is enough to pick the one from the 3 marbles. I am just afraid that "pick 3 from the remaining group" makes some confusion.
PM
Top
Pearltea
發表於: Aug 23 2015, 13:08  
Quote Post


四品官
*********

發表數: 1,289
所屬群組: 太守
註冊日期: 9-22-2003

活躍:6
聲望:614


QUOTE (XxEDxX @ Aug 23 2015, 21:04)
QUOTE (Caesar @ Aug 23 2015, 20:54)
QUOTE

(i)
1st : 1234 vs 5678 , result : equal .
2nd : 39 vs 10,11 , result : 10,11 lighter.

Now either 9 is heavier or 10,11 is lighter.

Altho u just said this isn't ur solution , but I just realised this can actually hit the result .

Yes, as one lift is enough to pick the one from the 3 marbles. I am just afraid that "pick 3 from the remaining group" makes some confusion.

My understanding was that you meant picking three of the marbles from the 9, 10, 11 & 12 group, so I wasn't confused. 

本篇文章已被 Pearltea 於 Aug 23 2015, 13:11 編輯過
PMEmail Poster
Top
XxEDxX
發表於: Aug 23 2015, 13:15  
Quote Post


三品官
**********

發表數: 1,467
所屬群組: 太守
註冊日期: 8-30-2011

活躍:11
聲望:507


QUOTE (Pearltea @ Aug 23 2015, 21:08 )
QUOTE (XxEDxX @ Aug 23 2015, 21:04)
QUOTE (Caesar @ Aug 23 2015, 20:54)
QUOTE

(i)
1st : 1234 vs 5678 , result : equal .
2nd : 39 vs 10,11 , result : 10,11 lighter.

Now either 9 is heavier or 10,11 is lighter.

Altho u just said this isn't ur solution , but I just realised this can actually hit the result .

Yes, as one lift is enough to pick the one from the 3 marbles. I am just afraid that "pick 3 from the remaining group" makes some confusion.

My understanding was that you meant picking three of the marbles from the 9, 10, 11 & 12 group, so I wasn't confused. 

Thank you very much for your reply. I hope my answer is clear enough. A good game smile.gif

Can you share the other possible answers?
PM
Top
Pearltea
發表於: Aug 23 2015, 13:34  評價+3
Quote Post


四品官
*********

發表數: 1,289
所屬群組: 太守
註冊日期: 9-22-2003

活躍:6
聲望:614


Here's mine.

Set aside 9, 10, 11 & 12.  

1st weighing: 1,2,3,4 vs 5,6,7,8. (refer 1,2,3,4 as the left side)

If Equal
2nd weighing: 1, 9 vs 10, 11.  (which is the same method as yours)

     If Equal
     3rd weighing: 1 vs 12

     If Unequal
     3rd weighing: 10 vs 11

     [Before I learned that the more popular question requires finding out whether the unusual one is lighter or heavier, 
     my solution were second weighing 9 vs 10, third weighing 10 vs 11.  However that won't solve the problem when 12 is lighter or heavier]

If Unequal

Set aside 7 & 8
Swap 2 & 4 to the right side, and swap 5 to the left side.  
2nd weighing: 1,3,5 vs 2,4,6

     If Equal
     3rd weighing: 7 vs 8 (we know whether these two are heavier or lighter from the 1st weighing)

     If Unequal
     
           If the Balance shifts 
           This means the swapped marbles contain the unusual one.
           3rd weighing: 2 vs 4 (we know whether these two are heavier or lighter from the 1st weighing)

           If the Balance remains the same
           This means the non-swapped marbles contain the unusual one.
           3rd weighing: 1 vs 3 (we know whether these two are heavier or lighter from the 1st weighing)

本篇文章已被 Pearltea 於 Aug 23 2015, 14:00 編輯過
PMEmail Poster
Top
Pearltea
發表於: Aug 23 2015, 13:36  
Quote Post


四品官
*********

發表數: 1,289
所屬群組: 太守
註冊日期: 9-22-2003

活躍:6
聲望:614


Another solution for the 9, 10, 11 & 12 group:

2nd weighing: 1,2,3 vs 9, 10, 11 

3rd weighing: 9 vs 10 (if 2nd weighing is unequal), OR 1 vs 12 (if 2nd weighing is equal)
PMEmail Poster
Top
XxEDxX
發表於: Aug 23 2015, 13:49  
Quote Post


三品官
**********

發表數: 1,467
所屬群組: 太守
註冊日期: 8-30-2011

活躍:11
聲望:507


QUOTE (Pearltea @ Aug 23 2015, 21:34 )
Here's mine.

Set aside 9, 10, 11 & 12.  

1st weighing: 1,2,3,4 vs 5,6,7,8. (refer 1,2,3,4 as the left side)

If Equal
2nd weighing: 1, 9 vs 10, 11.  (which is the same method as yours)

     If Equal
     3rd weighing: 1 vs 12

     If Unequal
     3rd weighing: 10 vs 11

     [Before I learned that the more popular question requires finding out whether the unusual one is lighter or heavier, 
     my solution was second weighing 9 vs 10, third weighing 10 vs 11.  However that won't solve the problem when 12 is light or heavier]

If Unequal

Set aside 7 & 8
Swap 2 & 4 to the right side, and swap 5 to the left side.  
2nd weighing: 1,3,5 vs 2,4,6

     If Equal
     3rd weighing: 7 vs 8 (we know whether these two are heavier or lighter from from the 1st weighing)

     If Unequal
     
           If the Balance shifts 
           This means the swapped marbles contain the unusual one.
           3rd weighing: 2 vs 4 (we know whether these two are heavier or lighter from the 1st weighing)

           If the Balance remains the same
           This means the non-swapped marbles contain the unusual one.
           3rd weighing: 1 vs 3 (we know whether these two are heavier or lighter from the 1st weighing)

Thank you very much for your sharing, Pearltea. And I agree that the first weighting has to be 1234,5678.

Thank you.
PM
Top
Pearltea
發表於: Aug 23 2015, 14:16  評價+1
Quote Post


四品官
*********

發表數: 1,289
所屬群組: 太守
註冊日期: 9-22-2003

活躍:6
聲望:614


You're welcome ED. 

我在網上找不到其他人用我的solution (For 1-8). 問了Mr.程序員但他不肯看, 還譏諷的說: "你不是懂VB的嗎? 你自己寫code去verify不就成了?" 
我試過, so far每個scenario還可以. 

他還說懂寫程式的人不等於懂得玩推理遊戲的人, 方法也可以用程式來找出. 這是甚麼道理 damn.gif . 如沒有這些logic和scenario如何寫出來?
PMEmail Poster
Top
Caesar
發表於: Aug 23 2015, 14:28  
Quote Post


Loop
************

發表數: 7,495
所屬群組: 軍團長
註冊日期: 12-18-2004

活躍:29
聲望:2214


QUOTE (Pearltea @ Aug 23 2015, 22:16 )
問了Mr.程序員但他不肯看

XD.gif 這畫面很有既視感。


--------------------
Above the starry canopy. God judges as we judged.
Get busy living, or get busy dying.

.

PM
Top
Pearltea
發表於: Aug 23 2015, 14:48  
Quote Post


四品官
*********

發表數: 1,289
所屬群組: 太守
註冊日期: 9-22-2003

活躍:6
聲望:614


QUOTE (Caesar @ Aug 23 2015, 22:28 )
QUOTE (Pearltea @ Aug 23 2015, 22:16)
問了Mr.程序員但他不肯看

XD.gif 這畫面很有既視感。

怎麼? Caesar 也這樣跟女友大人對話的嗎? cheerful.png
PMEmail Poster
Top
Pearltea
發表於: Jan 21 2016, 07:31  
Quote Post


四品官
*********

發表數: 1,289
所屬群組: 太守
註冊日期: 9-22-2003

活躍:6
聲望:614


Apologies for resurrecting an old thread - saw an alternative solution to the same problem. The answer was brilliantly thought out:

   1, 2, 7, 10   against   3, 4, 6, 9
   1, 3, 8, 11   against   2, 5, 6, 7
   2, 3, 9, 12   against   1, 4, 5, 8
PMEmail Poster
Top
1 位使用者正在閱讀本主題 (1 位訪客及 0 位匿名使用者)
0 位會員:

Topic Options分頁: (2) 1 [2]  Reply to this topicStart new topicStart Poll

 



[ Script Execution time: 0.0204 ]   [ 12 queries used ]   [ GZIP 啟用 ]