IBM 十二月

来源: 康MM 2007-12-03 18:45:41 [] [博客] [旧帖] [给我悄悄话] 本文已被阅读: 次 (1992 bytes)
本文内容已被 [ 康MM ] 在 2007-12-11 07:04:09 编辑过。如有问题,请报告版主或论坛管理删除.
Suppose we have a large number, n, of parts and know at least one is defective. If we can test any number of parts at once (learning whether they are all good or at least one is defective) then it is well known that a binary search will identify a defective part after log2(n) tests.

This month's puzzle concerns a variation on this problem in which the defective part only fails intermittently. Assume when the bad part is tested (by itself or with other parts) it fails half the time and passes half the time. The following questions concern how many tests on average it takes various algorithms to identify a single defective part out of a large number n.

You should ignore any lower order terms arising from the fact that you can only test integral numbers of parts at once. Express the answers as C*log2(n) where C is a constant given to 4 decimal places (ie 1.0000 for the original problem).


1. Suppose we use the following algorithm. Select a subgroup of size .5*n at random and test it. If it passes repeat with different random subgroups of size .5*n until you find a subgroup which fails. Then recursively apply the algorithm to smaller groups until you have isolated the bad part. How many tests on average will this take?

2. Use the algorithm in 1) except you test random subgroups of size a*n instead of .5*n. What is the optimal value of a and how many tests on average will be required?

3. Divide the parts at random into 2 equal subgroups and test them alternatively until one fails. Then apply the algorithm recursively. How many tests on average will be required to isolate the bad part.

4. Same as 3) except at each stage the parts are divided into 3 equal subgroups which are tested in turn until one fails. Again how many tests on average will be needed to find the bad part?

5. (Not required for credit) The algorithm in 4 is pretty good but not optimal. How many tests does the optimal algorithm require?

所有跟帖: 

回复:IBM 十二月 -于德利- 给 于德利 发送悄悄话 于德利 的博客首页 (134 bytes) () 12/03/2007 postreply 23:43:11

Is golden ratio better for quesion #2? -endofsuburbia- 给 endofsuburbia 发送悄悄话 endofsuburbia 的博客首页 (0 bytes) () 12/04/2007 postreply 09:34:08

对2xlogx(n)求导数,1/lnx-1/(lnx)^2=0,所以,x=2 -于德利- 给 于德利 发送悄悄话 于德利 的博客首页 (0 bytes) () 12/04/2007 postreply 10:09:48

x=e? -康MM- 给 康MM 发送悄悄话 康MM 的博客首页 (0 bytes) () 12/04/2007 postreply 15:07:03

对,x=e! -于德利- 给 于德利 发送悄悄话 于德利 的博客首页 (0 bytes) () 12/04/2007 postreply 15:39:45

请您先登陆,再发跟帖!

发现Adblock插件

如要继续浏览
请支持本站 请务必在本站关闭/移除任何Adblock

关闭Adblock后 请点击

请参考如何关闭Adblock/Adblock plus

安装Adblock plus用户请点击浏览器图标
选择“Disable on www.wenxuecity.com”

安装Adblock用户请点击图标
选择“don't run on pages on this domain”