zoukankan      html  css  js  c++  java
  • 翻译

    令 $m>n>1$ 为正整数. 一个集合含有 $m$ 个给定的实数. 我们从中选取任意 $n$ 个数, 记作 $a_1$, $a_2$, $dotsc$, $a_n$, 并提问: 是否 $a_1<a_2<dotsb < a_n$ 正确? 证明: 我们可以最多问 $n!-n^2+2n-2+m(n-1)(1+lfloor log_{n} m floor)-m$ 个问题,将所有的 $m$ 个数排序.

    We can find the order of the first $n$ numbers $n!-1$ questions,
    looking at all possible orderings but one.

    我们可通过查看除$1$以外的所有可能的顺序,找出前$n$个数$n!-1$个问题的顺序.

    Suppose we have found the relative order of the first $k$ numbers
    and let us find the relative order of first $k+1$ numbers.

    假设我们已找到前$k$个数的相对顺序,让我们来找出前$k+1$个数的相对顺序.

    Suppose we have $a_1<a_2<dotsb<a_k$
    and let us find where $a_{k+1}$ fits.

    假设有$a_1<a_2<dotsb<a_k$,让我们找出$a_{k+1}$应该放在哪里.

    We use the following {it binary search}:
    pick $n-1$ numbers among $1,2,dotsc,k$ that divide the interval $[1,k]$
    most equally.

    利用下面的 extbf{二分法搜索(binary search)}:在$1,2,dotsc,k$之间选取$n-1$个数等分区间$[1,k]$.

    (This is achieved by taking the numbers
    $a_{leftlfloor frac{k}{n} ight floor},a_{leftlfloor frac{2k}{n} ight floor},ldots ,
    a_{leftlfloor frac{(n-1)k}{n} ight floor}$).

    (这可通过取数字
    $a_{leftlfloor frac{k}{n} ight floor},a_{leftlfloor frac{2k}{n} ight floor},ldots ,
    a_{leftlfloor frac{(n-1)k}{n} ight floor}$来实现).

    We can find the relative order of $a_{k+1}$ and these numbers by at most $n-1$ questions.

    我们最多可通过$n-1$次提问找出$a_{k+1}$和这些数的相对顺序.


    Indeed, for $1leqslant jleqslant n-1$, let $q_i$ be ``Is it true that
    $a_{leftlfloor frac{k}{n} ight floor}<ldots <aa_{leftlfloor frac{ik}{n} ight floor}
    <a_{k+1}<a_{leftlfloor frac{(i+1)k}{n} ight floor}<ldots <a_{leftlfloor frac{(n-1)k}{n} ight floor}$?''

    实际上, 对于$1leqslant jleqslant n-1$, 令$q_i$为``
    $a_{leftlfloor frac{k}{n} ight floor}<ldots <aa_{leftlfloor frac{ik}{n} ight floor}
    <a_{k+1}<a_{leftlfloor frac{(i+1)k}{n} ight floor}<ldots <a_{leftlfloor frac{(n-1)k}{n} ight floor}$成立么?''

    Then we find an $i$ such that
    $a_{leftlfloor frac{ik}{n} ight floor}<a_{k+1}<a_{leftlfloor frac{(i+1)k}{n} ight floor}$.

    那么我们找到 $i$使得
    $a_{leftlfloor frac{ik}{n} ight floor}<a_{k+1}<a_{leftlfloor frac{(i+1)k}{n} ight floor}$.


    Therefore, by at most $n-1$ questions we reduce the length of the interval of searching
    from $k$ to at most $leftlceil frac{k}{n} ight ceil$, where $lceil x ceil$
    is the least integer number not less than $x$.

    因此,我们最多可通过$n-1$个问题,使搜索的区间长度从$k$减小到最多是$leftlceil frac{k}{n} ight ceil$,其中$lceil x ceil$为不小于$x$的最小整数.

    We repeat this binary search until we find exactly the position of $a_{k+1}$
    (that is, the interval of searching is 1 or 0).

    我们重复这个二分法搜索,直到找出$a_{k+1}$的确切位置.
    (即搜索间隔为$1$或$0$).

    Now if $kleqslant n^j$, then after $i$ steps the interval will be at most $n^{j-i}$,
    so we need at most $j=lceil log _n k ceil$ steps to insert $a_{k+1}$ into the sequence.

    现在,如果$kleqslant n^j$,那么在$i$步之后,间隔最多为$n^{j-i}$,因此我们最多需要$j=lceil log _n k ceil$步来将$a_{k+1}$插入数列中.


    Therefore, the number of questions needed is at most
    $n!-1+(n-1)(lceil log_n(n+1) ceil+ldots +lceil log_n(m-1) ceil)$.

    因此,所需的提问次数最多为
    $n!-1+(n-1)(lceil log_n(n+1) ceil+ldots +lceil log_n(m-1) ceil)$.


    All we need to do is to evaluate this number:
    suppose that
    $n^kleqslant m<n^{k+1}$.
    Then there are $n^2-n$ numbers $r$ for which
    $lceil log_n r ceil=2$, $n^3-n^2$ numbers for which
    $lceil log_n r ceil=3$, and so on until we have $m-1-n^k$ numbers $r$ for which
    $lceil log_n r ceil=k+1$.

    我们需要做的就是计算这个数字:设
    $n^kleqslant m<n^{k+1}$.
    那么有$n^2-n$个数$r$满足$lceil log_n r ceil=2$, 有$n^3-n^2$个数满足$lceil log_n r ceil=3$等等,直到我们有$m-1-n^k$个数$r$满足
    $lceil log_n r ceil=k+1$.


    Therefore the sum is
    egin{align*}
    n!-1+(n-1)(2(n^2-n)+3(n^3-n^2)+dotsb +k(n^k-n^{k-1})+(k+1)(m-1-n^k)) \
    =n!-1+(n-1)((k+1)(m-1)-n^k-n^{k-1}-dotsb -n^2-2n).
    end{align*}
    Because $n^{k+1}>m$,
    [ n^k+n^{k-1}+dotsb +n^2+2n=frac{n^{k+1}-1}{n-1}+n-1
    geqslant frac{m}{n-1}+n-1. ]
    Hence our sum is at most
    egin{align*}
    n!-1+(n-1)left((k+1)(m-1)-frac{m}{n-1}-n+1 ight) \
    = n!-n^2+2n-2+(n-1)(lfloor log_n m floor+1)m-m,
    end{align*}
    as desired.

    因此和为
    egin{align*}
    n!-1+(n-1)(2(n^2-n)+3(n^3-n^2)+dotsb +k(n^k-n^{k-1})+(k+1)(m-1-n^k)) \
    =n!-1+(n-1)((k+1)(m-1)-n^k-n^{k-1}-dotsb -n^2-2n).
    end{align*}
    由于$n^{k+1}>m$,
    [ n^k+n^{k-1}+dotsb +n^2+2n=frac{n^{k+1}-1}{n-1}+n-1
    geqslant frac{m}{n-1}+n-1. ]
    因此我们的和最多为
    egin{align*}
    n!-1+(n-1)left((k+1)(m-1)-frac{m}{n-1}-n+1 ight) \
    = n!-n^2+2n-2+(n-1)(lfloor log_n m floor+1)m-m,
    end{align*}
    得证.

  • 相关阅读:
    Rolling File Appender使用示例
    log4net生成dll文件
    看涨期权(call options)
    log4net file Appender使用示例
    log4net不能记录日志,IsErrorEnabled值为false
    C#委托
    打印事件处理顺序
    Zigbee、WiFi和433MHz无线技术
    log4net Tutorial
    安装服务出现异常
  • 原文地址:https://www.cnblogs.com/Eufisky/p/11247759.html
Copyright © 2011-2022 走看看