猜數字要幾次才猜的到? - 拼圖
![David avatar](/img/cat4.jpg)
By David
at 2011-01-09T17:57
at 2011-01-09T17:57
Table of Contents
Let n be a positive integer, and x an unknown non-negative integer less than
n.
Suppose you may ask questions of the form "Is x less than t?",
where t is an arbitrary integer,
but the answer to each question will be told only after
you ask another question (i. e., the answers are delayed by one question;
note that the last question will not be answered at all). How large may n be
so that you can still guarantee to determine x with only 30 questions?
令N為一正整數, x是一比n小的非負整數.
假設你可以提問如" x是否比t小?" 這種類型的問題 , t是多少由你自己決定.
但是對方的回答會在你問下一問題之後回答----也就是回答會"延遲"一題才答出
(也就是說 你問的最後一個問題根本就不會被回答XD)
那麼假如你問30個問題就保證可以知道x是多少,n的最大值是多少?
--
n.
Suppose you may ask questions of the form "Is x less than t?",
where t is an arbitrary integer,
but the answer to each question will be told only after
you ask another question (i. e., the answers are delayed by one question;
note that the last question will not be answered at all). How large may n be
so that you can still guarantee to determine x with only 30 questions?
令N為一正整數, x是一比n小的非負整數.
假設你可以提問如" x是否比t小?" 這種類型的問題 , t是多少由你自己決定.
但是對方的回答會在你問下一問題之後回答----也就是回答會"延遲"一題才答出
(也就是說 你問的最後一個問題根本就不會被回答XD)
那麼假如你問30個問題就保證可以知道x是多少,n的最大值是多少?
--
Tags:
拼圖
All Comments
Related Posts
八卦板的「超怪面試問題」
![Aaliyah avatar](/img/girl.jpg)
By Aaliyah
at 2011-01-07T22:47
at 2011-01-07T22:47
八卦板的「超怪面試問題」
![David avatar](/img/boy2.jpg)
By David
at 2011-01-07T21:50
at 2011-01-07T21:50
你相信你自己的眼睛嗎?
![Gary avatar](/img/cat2.jpg)
By Gary
at 2011-01-07T00:03
at 2011-01-07T00:03
八卦板的「超怪面試問題」
![Kumar avatar](/img/girl1.jpg)
By Kumar
at 2011-01-06T22:24
at 2011-01-06T22:24
完美洗牌
![Anthony avatar](/img/elephant.jpg)
By Anthony
at 2011-01-06T19:49
at 2011-01-06T19:49