“Mangers and Engineers”

Q:The FBI has surrounded the headquarters of the Norne corporation. There are n people in the building. Each person is either an engineer or a manager. All computer files have been deleted, and all documents have been shredded by the managers. The problem confronting the FBI interrogation team is to separate the people into these two classes, so that all the managers can be locked up and all the engineers can be freed. Each of the n people knows the status of all the others. The interrogation consists entirely of asking person i if person j is an engineer or a manager. The engineers always tell the truth. What makes it hard is that the managers may not tell the truth. In fact, the managers are evil geniuses who are conspiring to confuse the interrogators.
  1. Under the assumption that more than half of the people are engineers, can you find a strategy for the FBI to find one engineer with at mostn-1 questions?
  2. Is this possible in any number of questions if half the people are managers?
  3. Once an engineer is found, he/she can classify everybody else. Is there a way to classify everybody in fewer questions?





A:

1.如果manager人数少于engineer人数:

    initialize:将所有人放进UNSEEN集合中,从UNSEEN集合中随机选一人,放在STACK堆栈的top;

    step1:从UNSEEN集合中随机选一个人x,向当前STACK堆栈的top元素y询问x的身份。如果y说x是manager,同时丢掉x和y,如果是engineer,将x放到STACK的top;

    step2:repeat  step1,直到UNSEEN集合为空,此时STACK的top元素的身份必然为engineer;

    step3:向该engineer询问所有人的身份(因为他不撒谎),Ends。

    n-1步就可以完成(特定情况下可以优化成n-2,n-3,不详述,参照Ref.)

    but,如何proof???

2.如果manager人数多于或等于engineer人数,问题无解。

3. don't konw.


(Ref:The Puzzle Toad - 1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值