一直以為自己很笨哦,特別是同老公相比。老公的智商是超高的,在高中時可是風雲人物啊。他老是嘲笑我笨,我也乖乖地承認。他現在找工作,正準備微軟的面試,從網上找了一個題目,向我顯示其難度。題目如下: There are n number of people in a room. Some of them are celebrities. The question is to find out who is celebrity. You are allowed to ask a any one of them whether he knows another people. The one being asked can only answer "Yes" or "No". Two rules: Celebrity doesn't know anybody else. All other people know celebrity. 開始覺得很難,後來花了一下,大概10分鐘的出答案 1. you pick two ppl A & B 2. you ask A whether he knows B 3. If yes, A is not Celebrity, while B is possible. if No, B is not Celebrity while A is possibly the celebrity. 4. give up the one whom you are sure not the celebrity and continue with this process and you will find. so you need to ask (n-1) times to get the answer 然後老公問我:how about there are several celebrities. 哇,糟糕,我把問題想簡單了,不過靈光一閃 umm, that is hard if more than 1 celebrity, than does celebrity knows celebrity? this conflicts with the rule? if everyone knows celebrith, then celebrity should also know celebrity [8:45:34 AM] if celebrity does not know anyone, then celebrith should not know celebrity [8:45:42 AM] so there should be only one celebrity [8:46:20 AM] ok, but in the question, it uses "Some of them are celebrities. " [8:46:33 AM] this is not the issue [8:46:44 AM] this is grammar [8:46:57 AM] : ok [8:47:13 AM] grammatically, you could say, more than one people is in the room [8:47:32 AM] because of using "is", you mean there are only one ppl? [8:47:59 AM] no...my English grammar is perfect, even better than American :) [8:48:13 AM] Here it focus on Logic [8:48:38 AM] ok [8:49:20 AM] last time I chat with an American, he said my grammar is better than most American ppl [8:50:02 AM]: ok [8:51:28 AM so it seems the most important thing is to UNDERSTAND the question... 重要的是正確理解題目 [8:51:59 AM] you are misleading yourself by thinking there are more than one celebrith because of the "ARE" in the question.... [8:52:57 AM] : ok, if there is only one, things will become simple. [8:53:48 AM] the important thing is you need to conclude there is only one celebrity thru LOGIC [8:54:08 AM] if there is more than one celebrity, then from the two rules we will deduce conflicting results. [8:55:08 AM] : ok [8:55:50 AM] : I am being lucky because I assume there is only one celebrity, and my assumption happens to be correct [8:56:18 AM] I think next time when you have a seemingly complex question, you might make some assumption to make it easier [8:56:26 AM] ok [8:56:32 AM] and of course check the assumption [8:57:14 AM] this might be an efficient way of resolving issues 複雜問題簡單化 this might be the quality what Microsoft is looking for [9:04:48 AM]Simplifying the Complex 後來想了一下,如果不限制單個人的詢問次數,那麼最有效的方法是 1+(n+1)/2, if n is odd number 1+n/2, if n is even number |