Re: [理工] [離散] 98台大電機

看板Grad-ProbAsk作者 (numin)時間13年前 (2012/09/05 23:54), 編輯推噓3(306)
留言9則, 3人參與, 最新討論串5/5 (看更多)
※ 引述《Byzantin (拜占庭)》之銘言: : 假設1為改變status,0為不改變 : locker 1 2 3 4 5 6 7 ‧‧‧ : student1 1 1 1 1 1 1 1 ‧‧‧ : student2 0 1 0 1 0 1 0 ‧‧‧ : student3 0 0 1 0 0 1 0 ‧‧‧ : student4 0 0 0 1 0 0 0 ‧‧‧ : ‧ : ‧ : ‧ : locker還是open的條件是該行為1的bit數有奇數個, : 每個locker在遇到編號的因數時該列bit會是1 : 所以最後是open的locker它的編號的因數為奇數個 : 即完全平方數,所以是1,4,9,16,25,36,49,64,81,100 問題: 想請問上面黃色部份的意思,有點看不懂。(原題目在下面) 另外在黃子嘉老師課本1-72範例二提到的是正因數個數,不曉得和這個有什麼關係。 感謝各位耐心看完題目及問題,謝謝。 : ※ 引述《ceo890710 (Drinking)》之銘言: : : --------------------------------------------------------------------- : : One hundred students enter a locker room that contains 100 lockers. : : The first student open all the lockers.The second student changes the : : status(from open to closed, and vice versa) of every other locker, : : starting with the second locker.The third student then changes the : : status of every third locker,starting with the third locker.In general, : : for 1<=K<=100,the kth student changes the status of every kth locker, : : starting with the kth locker.After the 100th student has gone through : : the lockers,which lockers are left open? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.193.221.223

09/06 00:02, , 1F
因為第n列 bit為1的行數要是n之倍數
09/06 00:02, 1F

09/06 00:08, , 2F
應該是每個LOCKER在遇到編號跟自己相同的因數時bit=1
09/06 00:08, 2F

09/06 00:36, , 3F
感謝d大,B大的回答。
09/06 00:36, 3F

09/06 00:42, , 4F
想了一下子終於想通了,但想請問d大一下,你說的第n列bit為1
09/06 00:42, 4F

09/06 00:43, , 5F
的行數要是n之倍數,這是觀察出來的嗎?
09/06 00:43, 5F

09/06 01:04, , 6F
the kth student changes the status of every kth locker
09/06 01:04, 6F

09/06 09:40, , 7F
謝謝d大,原來之前還不算是想通,不過現在終於知道了,在列
09/06 09:40, 7F

09/06 09:41, , 8F
和行數之間仔細想了一下,並且思考the kth那段話,才完全明
09/06 09:41, 8F

09/06 09:41, , 9F
白,謝謝。
09/06 09:41, 9F
文章代碼(AID): #1GHtMQ4P (Grad-ProbAsk)
討論串 (同標題文章)
文章代碼(AID): #1GHtMQ4P (Grad-ProbAsk)