设万维读者为首页 广告服务 联系我们 关于万维
简体 繁体 手机版
分类广告
版主:
万维读者网 > 灵机一动 > 帖子
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 | 全球最佳航空公司出炉:海航获五星
海外华人福利!在线看陈建斌《三叉戟》热血归回 豪情筑梦 高清免费看 无地区限制
一周点击热帖 更多>>
一周回复热帖