精華區beta Oversea_Job 關於我們 聯絡資訊
I remembered this hard question :) The 12 Ball Problem There are twelve balls, identical in appearance, but one is either heavier or lighter than all the others. Using only a balance scale (ie two balanced pans and no weights) and using it only three times, isolate the odd ball and be able to say in which way it differs. Is it heavier or lighter than the rest ? -- ※ 發信站: 批踢踢參(ptt3.cc) ◆ From: 216.15.33.137 > -------------------------------------------------------------------------- < 作者: jphant (春日步步春生) 看板: Job 標題: Re: [討論] 12 balls brain teaser 時間: Thu Feb 2 12:04:45 2006 ※ 引述《Ptt (杜奕瑾)》之銘言: : There are twelve balls, identical in appearance, but one is either : heavier or lighter than all the others. Using only a balance scale (ie two : balanced pans and no weights) and using it only three times, isolate the : odd ball and be able to say in which way it differs. Is it heavier or : lighter than the rest ? 這個太老了一點...:D 之前的google interview還比較有挑戰性. Google之前招募打廣告 用了一個叫GLAT的東西. 裡面有一些我覺得真的不錯的題目, 其中一題好像是, 如果給3個顏色給你著色在一個正20面體上, 總共可以有多少種組合? 我到現在還沒想 出來要怎麼解. 另外看到的一些無聊的interview問題, 聽說是從M$出來的, 之前有一本書就為這個 大作文章"How would you move Mt. Fuji". 1. 美國有多少個加油站? 我查一個網站說2004年的統計大概是168,000個. 而且數量還在減少當中. 至於這個要怎麼去解那就問倒我了. 2. 怎麼不用秤而知道一台飛機的重量. 用天平XD 3. 怎麼移動富士山? 莫名其妙的問題, 我的答案是用很多很多錢. 如果覺得有更好笑的答案歡迎補完. -- ※ 發信站: 批踢踢參(ptt3.cc) ◆ From: 12.75.136.225 > -------------------------------------------------------------------------- < 作者: Skuld (Sherry) 看板: Job 標題: Re: [討論] 12 balls brain teaser 時間: Fri Feb 3 00:23:44 2006 I had fun solving this problem. :) 1) divide the 12 balls into 4, 4, 4 balls 2) put 4 and 4 balls on each side of the scale 2.1) if the scale is balanced, the odd ball is in the unscaled 4 balls 3) we now have 8 regular and 4 unknown balls 4) put 3 regular and 3 unknown balls on scale 4.1) if the scale is balanced, the odd ball is the last unknown ball 5) put 1 regular and the odd ball on scale and check heavier/lighter 4.2) if the scale is unbalanced, remember the odd ball heavier/lighter among the 3 unknown balls 5) put 1 and 1 unknown balls on scale 5.1) if the scale is balanced, the odd ball is the last unknown ball and we already know whether it's heavier/lighter 5.2) if the scale is unbalanced, the odd ball is the heavier/lighter ball on scale 2.2) if the scale is unbalanced, the odd ball is among the 4 possibly heavier or 4 possibly lighter balls on scale 3) we now have 4 regular, 4 possibley heavier, and 4 possibley lighter balls 4) put 3 regular balls + 1 heavier ball on one side and 3 heavier + 1 lighter balls on the other side of the scale 4.1) if the scale is balanced, the odd ball is in the 3 unscaled lighter balls 5) put 1 and 1 unknown lighter balls on scale 5.1) if the scale is balanced, the odd ball is the last unknown ball and it's lighter 5.2) if the scale is unbalanced, the odd ball is the lighter ball on scale 4.2) if the scale is unbalanced 4.21) if 3 regular + 1 heavier ball side is heavier, the odd ball is either in the 1 heavier ball on this side or the 1 lighter ball on the other side 5) put 1 regular and 1 heavier ball on scale 5.1) if the scale is balanced, the odd ball is the unscaled lighter ball 5.2) if the scale is unbalanced, the odd ball is the heavier ball on scale 4.22) if 3 heavier + 1 lighter balls side is heavier, the odd ball is in the 3 heavier balls 5) put 1 and 1 unknown heavier balls on scale 5.1) if the scale is balanced, the odd ball is the last unknown ball and it's heavier 5.2) if the scale is unbalanced, the odd ball is the heavier ball on scale ※ 引述《Ptt (杜奕瑾)》之銘言: : I remembered this hard question :) : The 12 Ball Problem : There are twelve balls, identical in appearance, but one is either : heavier or lighter than all the others. Using only a balance scale (ie two : balanced pans and no weights) and using it only three times, isolate the : odd ball and be able to say in which way it differs. Is it heavier or : lighter than the rest ? -- ※ 發信站: 批踢踢參(ptt3.cc) ◆ From: 69.138.162.221
losfer:13 ball is still possible :) 02/03 13:48
Ptt:well done 02/06 11:00
> -------------------------------------------------------------------------- < 作者: Ptt (杜奕瑾) 看板: Job 標題: Re: [討論] 12 balls brain teaser 時間: Sat Feb 4 11:35:01 2006 : 這個太老了一點...:D 之前的google interview還比較有挑戰性. Google之前招募打廣告 : 用了一個叫GLAT的東西. 裡面有一些我覺得真的不錯的題目, 其中一題好像是, : 如果給3個顏色給你著色在一個正20面體上, 總共可以有多少種組合? 我到現在還沒想 : 出來要怎麼解. 這是 Graph coloring problem 以前有看過 http://en.wikipedia.org/wiki/Graph_coloring : 另外看到的一些無聊的interview問題, 聽說是從M$出來的, 之前有一本書就為這個 這本書也看過了 問題都不是很難 有些不一定是決對答案 只是要看你怎麼思考 不過其實MS不考這種問題了.. Skuld跟我說過一個問題答案 為什麼旅館熱水一開就是熱的 不是在書上寫的 -- ※ 發信站: 批踢踢參(ptt3.cc) ◆ From: 12.104.90.162 > -------------------------------------------------------------------------- < 作者: jphant (春日步步春生) 看板: Job 標題: Re: [討論] 12 balls brain teaser 時間: Sat Feb 4 14:10:35 2006 ※ 引述《Ptt (杜奕瑾)》之銘言: : : 如果給3個顏色給你著色在一個正20面體上, 總共可以有多少種組合? 我到現在還沒想 : : 出來要怎麼解. : 這是 Graph coloring problem 以前有看過 : http://en.wikipedia.org/wiki/Graph_coloring 我剛剛去看了上面的wiki, 發現還是有對您的解釋不太懂的地方. 古典的graph coloring problem要的是找出需要有最少種顏色來塗一個東西, 讓不同的但是靠在一起的單位能夠分開分辨. 這個題目要怎麼應用在上面這個 20面體的例子上? 我是有什麼東西沒想到? : Skuld跟我說過一個問題答案 : .為什麼旅館熱水一開就是熱的 因為他的熱水系統是分散式的? 想了很多答案但是好像要實現都很貴... 他的隔溫要做特別好? 還是他的水是用高壓高溫送到單位以後再用冷水混成的熱水? -- ※ 發信站: 批踢踢參(ptt3.cc) ◆ From: 24.193.21.182 > -------------------------------------------------------------------------- < 作者: acyang (復倫 夜夜充電) 看板: Job 標題: Re: [討論] 12 balls brain teaser 時間: Mon Feb 6 10:14:23 2006 ※ 引述《Ptt (杜奕瑾)》之銘言: : Skuld跟我說過一個問題答案 : .為什麼旅館熱水一開就是熱的 : 不是在書上寫的 我的想法,因為旅館的各個房間大家都經常在開熱水龍頭,每個房間 的洗手間相距也不像住家熱水器到浴室平均距離那麼遠,所以旅館牆 壁內整個熱水管線系統幾乎都經常保有溫度夠高的熱水。 住在很多公寓也是如此,絕大多數時間熱水一開就是熱的,少數例外 是住在離公用大鍋爐較遠又在清晨三點去開熱水時有可能先摸到一些 不夠熱的水。 熱水管線沿途的絕緣包覆,也會影響水龍頭開出熱水的時效,旅館的 熱水管線應該比較肯花錢包覆較好的絕緣材質。 -- ※ 發信站: 批踢踢參(ptt3.cc) ◆ From: 69.226.242.200 > -------------------------------------------------------------------------- < 作者: Ptt (杜奕瑾) 看板: Job 標題: Re: [討論] 12 balls brain teaser 時間: Mon Feb 6 14:09:46 2006 : : 不是在書上寫的 : 我的想法,因為旅館的各個房間大家都經常在開熱水龍頭,每個房間 : 的洗手間相距也不像住家熱水器到浴室平均距離那麼遠,所以旅館牆 : 壁內整個熱水管線系統幾乎都經常保有溫度夠高的熱水。 而且旅館常常有人在使用熱水 也比較不需要再花費額外的時間把途中"管線"加熱 : 住在很多公寓也是如此,絕大多數時間熱水一開就是熱的,少數例外 : 是住在離公用大鍋爐較遠又在清晨三點去開熱水時有可能先摸到一些 : 不夠熱的水。 : 熱水管線沿途的絕緣包覆,也會影響水龍頭開出熱水的時效,旅館的 : 熱水管線應該比較肯花錢包覆較好的絕緣材質。 不過這都是一般會想到 以及書上寫的 Skuld 家裡曾是包大型冷熱空調工程的 既然是他教我的 他來回答更專業的部分吧.. -- ※ 發信站: 批踢踢參(ptt3.cc) ◆ From: 165.112.191.116
jphant:我只是好奇當早上9點大家都開始洗澡的時候旅館要怎麼 02/06 21:36
jphant:產生出那麼多的熱水. 而當凌晨3點沒人洗澡的時候呢? 02/06 21:37
acyang:旅館與公寓的鍋爐容量都很大,邊出水還繼續燒爐子, 02/07 06:32
acyang:況且早晨幾乎都是淋浴的,淋浴用水比泡澡用水少. 02/07 06:34
Skuld:the hot water circulates nonstop in the pipe in hotel 02/07 21:52
Skuld:luxury home may choose to have such feature as well 02/07 21:56
Skuld:through adequate pumping 02/07 21:59
jphant:感謝skuld. 果然了不起. 02/08 12:15
Skuld:31 ice cream helps 02/08 16:47