設萬維讀者為首頁 廣告服務 聯繫我們 關於萬維
簡體 繁體 手機版
分類廣告
版主:
萬維讀者網 > 靈機一動 > 帖子
Money again Answer
送交者: nanweishui 2005年07月19日08:48:49 於 [靈機一動] 發送悄悄話
You are given 1000 one dollar bills and 10 envelopes. Put the bills into the envelopes in such a way that someone can ask you for any amount of money from $1 to $1000 (examples - $532, $619, $88, etc.) and you can give it to them through a combination of the envelopes.

Using binary expressions:
1, 2, 4, 8, 16, 32, 64, 128, 256, 489 (which is 1000 – (1+2+…+256)).
For each integer between 1 to 511 (=2^9-1), its binary expression maps it to a unique combination of 1, 2, …, 256 (=2^8). With an envelop of 489 dollars, we can get every integer from 1 to 1000.

0%(0)
0%(0)
標 題 (必選項):
內 容 (選填項):
實用資訊
回國機票$360起 | 商務艙省$200 | 全球最佳航空公司出爐:海航獲五星
海外華人福利!在線看陳建斌《三叉戟》熱血歸回 豪情築夢 高清免費看 無地區限制
一周點擊熱帖 更多>>
一周回復熱帖