📄 chap3.tex
字号:
of `lines' and `columns'. We have just decided that the first group should contain$\lceil n/m\rceil$ things; therefore the following sequential distributionscheme ought to work: To distribute $n$ things into $m$ groups, when $m>0$,put $\lceil n/m \rceil$ things into one group, then use the same procedurerecursively to put the remaining $n'=n-\lceil n/m\rceil$ things into $m'=m-1$additional groups.For example, if $n=314$ and $m=6$, the distribution goes like this:\begindisplay \def\preamble{&$\hfil##\hfil$\quad} \openup-2pt\rm remaining\ things&\rm remaining\ groups&\lceil\rm things/groups\rceil\cr\noalign{\vskip3pt}314& 6& 53\cr261& 5& 53\cr208& 4& 52\cr156& 3& 52\cr104& 2& 52\cr\phantom052&1& 52\cr\enddisplayIt works. We get groups of approximately the same size, even though thedivisor keeps changing.Why does it work? In general we can suppose that $n=qm+r$,where $q=\lfloor n/m\rfloor$and $r=n\bmod m$. The process is simple if $r=0$: We put$\lceil n/m\rceil=q$ things intothe first group and replace $n$ by~$n'=n-q$,leaving $n'=qm'$ things to put into the remaining$m'=m-1$ groups. And if $r>0$, we put $\lceil n/m\rceil=q+1$ things into the first group andreplace $n$ by~$n'=n-q-1$, leaving $n'=qm'+r-1$ things for subsequentgroups. The new remainder is $r'=r-1$, but $q$ stays the same.It follows that there will be $r$ groups with $q+1$ things, followedby $m-r$ groups with $q$ things.How many things are in the $k$th group? We'd like a formula that gives$\lceil n/m\rceil$ when $k\le n\bmod m$, and $\lfloor n/m\rfloor$ otherwise.It's not hard to verify that\begindisplay\left\lceil n-k+1\over m\right\rceil\enddisplayhas the desired properties, because this reduces to $q+\lceil(r-k+1)/m\rceil$ if we write $n=qm+r$ as in the preceding paragraph; here$q=\lfloor n/m\rfloor$. We have$\lceil(r-k+1)/m\rceil=\[k\le r]$, if $1\le k\le m$ and $0\le r<m$.Therefore we can write an identity that expresses the partition of$n$ into $m$ as-equal-as-possible parts in nonincreasing order:\begindisplayn=\left\lceil n\mathstrut\over m\right\rceil+\left\lceil n-1\over m\right\rceil+\cdots+\left\lceil n-m+1\over m\right\rceil\,.\eqno\eqref|c-groups|\enddisplayThis identity is valid for all positive integers $m$, and for allintegers~$n$ (whether positive, negative, or zero). We have alreadyencountered the case $m=2$ in \eq(|half-split|),although we wrote it in a slightly different form,$n=\lceil n/2\rceil +\lfloor n/2\rfloor$.If we had wanted the parts to be in nondecreasing order, withthe small groups coming before the larger ones, we couldhave proceeded in the same way but with $\lfloor n/m\rfloor$ thingsin the first group. Then we would have derived the correspondingidentity\begindisplayn=\left\lfloor n\mathstrut\over m\right\rfloor+\left\lfloor n+1\over m\right\rfloor+\cdots+\left\lfloor n+m-1\over m\right\rfloor\,.\eqno\eqref|f-groups|\enddisplayIt's possible to convert between \thiseq\ and \eq(|c-groups|) byusing either \eq(|f-c-reflection|) orthe identity of exercise~|rational-f-to-s|.Now if we replace $n$ in \eq(|f-groups|) by $\lfloor mx\rfloor$,\g Some claim that it's too dangerous to replace anything by an $mx$.\g"!war" "!Armageddon"and apply rule \eq(|rational-in/out|) to remove floors inside of floors,we get an identity that holds for all real~$x$:\begindisplay\lfloor mx \rfloor = \lfloor x \rfloor + \left\lfloor x + {1\over m} \right\rfloor + \cdots + \left\lfloor x + {m-1\over m} \right\rfloor \,.\eqno\eqref|f-replicative|\enddisplayThis is rather amazing, because the floor function is an integerapproximation of a real value, but the single approximation on the leftequals the sum of a bunch of them on the right.If we assume that $\lfloor x\rfloor$ is roughly $x-\half$ on theaverage, the left-hand side is roughly $mx-\half$, while theright-hand side comes to roughly $(x-\half)+(x-\half+{1\over m})+\cdots+(x-\half+{m-1\over m})=mx-\half$; the sum of all these roughapproximations turns out to be exact!\beginsection 3.5 Floor/Ceiling SumsEquation \eq(|f-replicative|) demonstrates that it's possible to geta closed form for at least one kind of sum that involves $\lfloor\,\,\rfloor$.Are there others? Yes. The trick that usually works in such cases is toget rid of the floor or ceiling by introducing a new variable.For example, let's see if it's possible to do the sum\begindisplay\sum_{0\le k<n}\lfloor\sqrt k\rfloor\enddisplayin closed form. One idea is to introduce the variable $m=\lfloor\sqrt k\rfloor$;we can do this ``mechanically'' by proceeding as we did in the rouletteproblem:\begindisplay \openup3pt\sum_{0\le k<n}\lfloor\sqrt k\rfloor&=\sum_{k,m\ge0}m\[k<n]\bigi[m=\lfloor\sqrt k\rfloor\bigr]\cr&=\sum_{k,m\ge0}m\[k<n]\bigi[m\le\sqrt k<m+1\bigr]\cr&=\sum_{k,m\ge0}m\[k<n]\bigi[m^2\le k<(m+1)^{2@}\bigr]\cr&=\sum_{k,m\ge0}m\bigi[m^2\le k<(m+1)^2\le n\bigr]\cr\noalign{\vskip-2pt}&\hskip6em{} +\sum_{k,m\ge0}m\bigi[m^2\le k<n<(m+1)^{2@}\bigr]\,.\cr\enddisplayOnce again the "boundary conditions" are a bit delicate. Let'sassume first that $n=a^2$ is a perfect square. Then the second sumis zero, and the first can be evaluated by our usual routine:\g\vskip2in Falling powers make the sum come tumbling down.\g\begindisplay \openup3pt\hbox to2em{$\displaystyle \sum_{k,m\ge0}m\bigi[m^2\le k<(m+1)^2\le a^{2@}\bigr]$\hss}\cr&=\sum_{m\ge0}m\bigl((m+1)^2-m^{2@}\bigr)\[m+1\le a]\cr&=\sum_{m\ge0}m(2m+1)\[m<a]\cr&=\sum_{m\ge0}\,(2m\_2+3m\_1)\[m<a]\cr&=\sum\nolimits_0^a\,(2m\_2+3m\_1)\,\delta m\cr\noalign{\vskip3pt}&=\textstyle{2\over3}a(a-1)(a-2)+{3\over2}a(a-1) ={1\over6}(4a+1)a(a-1)\,.\cr\enddisplayIn the general case we can let $a=\lfloor\sqrt n\rfloor$; then we merelyneed to add the terms for $a^2\le k<n$, which are all equal to~$a$,so they sum to $(n-a^2)a$. This gives the desired closed form,\begindisplay\sum_{0\le k<n}\lfloor\sqrt k\rfloor=\textstyle na-{1\over3}a^3-\half a^2-{1\over6}a\,, \qquad\hbox{$a=\lfloor\sqrt n\rfloor$}.\eqno\eqref|sum-sqrt|\enddisplayAnother approach to such sums is to replace an expression of theform $\lfloor x\rfloor$ by$\sum_j\[1\le j\le x]$; this is legal whenever $x\ge0$.Here's how that method worksin the sum of $\lfloor$square roots$\rfloor$, if we assume for conveniencethat $n=a^2$:\begindisplay\sum_{0\le k<n}\lfloor\sqrt k\rfloor&=\sum_{j,k}\,\[1\le j\le\sqrt k\,]\[0\le k<a^2]\cr&=\sum_{1\le j< a}\sum_k\,\[j^2\le k<a^2]\cr&=\sum_{1\le j< a}(a^2-j^2)=\textstyle a^3-{1\over3}a(a+\half)(a+1)\,.\enddisplay%This, of course, reduces to the formula we had before.\looseness=-1Now here's another example where a change of variable leads to atransformed sum. A remarkable theorem was discovered independentlyby three mathematicians\dash---"Bohl"~[|bohl|], "Sierpi\'nski"~[|sierpinski|],and "Weyl"~[|weyl|]\dash---%at about the same time in 1909:If $\alpha$ is "irrational" then the "fractional part"s $\{n\alpha\}$are very "uniformly distributed" between $0$ and~$1$, as $n\to\infty$.One way to state this is that\begindisplay\lim_{n\to\infty}{1\over n}\sum_{0\le k<n}f\bigl(\{k\alpha\}\bigr)=\int_0^1 f(x)\,dx\eqno\eqref|unif-frac|\enddisplayfor all irrational $\alpha$ and all functions $f$ that are continuousalmost everywhere. For example, the {\it average\/} valueof $\{n\alpha\}$ can be found by setting $f(x)=x$; we get $\half$.(That's exactly what we might expect; but it's nice to know that it isreally, provably true, no matter how irrational $\alpha$ is.)The theorem of Bohl, Sierpi\'nski, and Weyl is proved byapproximating $f(x)$ above and below by ``"step functions",\qback''\g Warning: This stuff is fairly advanced. Better skim the next two pageson first reading; they aren't crucial.\par\hfill\dash---Friendly TA\par\bigskip\unitlength=1pc\beginpicture(6,2)(0,0)\put(.7,2){\line(1,0)5}\put(1,2){\vector(0,-1)2}\endpicture\vskip-2pc \qquad Start\par\qquad Skimming\gwhich are linear combinations of the simple functions\begindisplayf_v(x)=\[0\le x<v]\enddisplaywhen $0\le v\le1$. Our purpose here is not to prove the theorem; that'sa job for calculus books. But let's try to figure out the basic reasonwhy it holds, by seeing how well it works in the special case $f(x)=f_v(x)$.In other words, let's try to see how close the sum\begindisplay \postdisplaypenalty=10000\sum_{0\le k<n}\bigi[\{k\alpha\}<v\bigr]\enddisplaygets to the ``ideal'' value $nv$, when $n$ is large and $\alpha$ is irrational.\penalty-100For this purpose we define the {\it "discrepancy"\/} $D(\alpha,n)$ to be the"!approximation"maximum absolute value, over all $0\le v\le1$, of the sum\begindisplays(\alpha,n,v)=\sum_{0\le k<n}\Bigl(\bigi[\{k\alpha\}<v\bigr]-v\Bigr)\,.\eqno\enddisplayOur goal is to show that $D(\alpha,n)$ is ``not too large'' whencompared with~$n$,by showing that $\vert s(\alpha,n,v)\vert$ is always reasonably smallwhen $\alpha$ is irrational.First we can rewrite $s(\alpha,n,v)$ in simpler form, then introducea new index variable~$j$:\begindisplay \openup3pt\sum_{0\le k<n}\Bigl(\bigi[\{k\alpha\}<v\bigr]-v\Bigr)&=\sum_{0\le k<n}\bigl(\lfloor k\alpha\rfloor-\lfloor k\alpha-v\rfloor-v\bigr)\cr&=-nv+\sum_{0\le k<n}\sum_j\,\[k\alpha-v<j\le k\alpha]\cr&=-nv+\sum_{0\le j<\lceil n\alpha\rceil}\,\sum_{k<n}\,\bigi[j\alpha^{-1}\le k< (j+v)\alpha^{-1}\bigr]\,.\cr\enddisplayIf we're lucky, we can do the sum on $k$. But we ought to introduce some new variables, so that the formula won't be such a mess.Without loss of generality, we can assume that$0<\alpha<1$; let us write\g Right, name and conquer.\par The change of variable from $k$ to~$j$ is the main point.\par\hfill\dash---Friendly TA\g\begindisplay \openup2pta&=\lfloor \alpha^{-1}\rfloor\,,\qquad}\hfill{\alpha^{-1}&=a+\alpha'\,;\crb&=\lceil v\alpha^{-1}\rceil\,,\qquad}\hfill{v\alpha^{-1}&=b-v'\,.\cr\enddisplayThus $\alpha'=\{\alpha^{-1}\}$ is the fractional part of $\alpha^{-1}$,and $v'$ is the "mumble-fractional part" of $v\alpha^{-1}$.Once again the boundary conditions are our only source of grief. For now,let's forget the restriction `$k<n$' and evaluate the sum on~$k$ without it:\begindisplay\sum_k\Bigi[k\in\bigl[@ j\alpha^{-1}\dts(j+v)\alpha^{-1}\bigr)\Bigr]&=\bigl\lceil(j+v)(a+\alpha')\bigr\rceil-\bigl\lceil j(a+\alpha')\bigr\rceil\cr&=b+\lceil\, j\alpha'{-}v'\,\rceil-\lceil\,j\alpha'\,\rceil\,.\cr\enddisplayOK, that's pretty simple; we plug it in and plug away:\begindisplays(\alpha,n,v)=-nv+\lceil n\alpha\rceil b+\!\sum_{0\le j<\lceil n\alpha\rceil}\bigl(\lceil\,j\alpha'{-}v'\,\rceil- \lceil\,j\alpha'\,\rceil\bigr)-S\,,\eqno\eqref|s-error|\enddisplaywhere $S$ is a correction for the cases with $k\ge n$ that we have failed toexclude. The quantity $j\alpha'$ will never be an integer, since $\alpha$(hence $\alpha'$) is irrational; and $j\alpha'-v'$ will be an integerfor at most one value of~$j$. So we can change the ceiling terms to floors:\begindisplays(\alpha,n,v)=-nv+\lceil n\alpha\rceil b-\!\!\sum_{0\le j<\lceil n\alpha\rceil}\bigl(\lfloor\, j\alpha'\rfloor -\lfloor\,j\alpha'{-}v'\rfloor\bigr)-S+\{\hbox{$@0$ or $1$}\}\,.\enddisplayInteresting. Instead of a closed form, we're getting a sum that looks\g\vskip-3\baselineskip(The formula $\{\hbox{$@0$ or $1$}\}$ stands for something that'seither $0$ or~$1$; we needn't commit ourselves, because the detailsdon't really matter.)\grather like $s(\alpha,n,v)$ but with different parameters:$\alpha'$ instead of~$\alpha$,\ $\lceil n\alpha\rceil$ instead of~$n$,and $v'$ instead of~$v$. So we'llhave a recurrence for $s(\alpha,n,v)$, which (hopefully) will lead to a recurrencefor the discrepancy~$D(\alpha,n)$. This means we want to get\begindisplays(\alpha',\lceil n\alpha\rceil,v')=\sum_{0\le j<\lceil n\alpha\rceil}\bigl(\lfloor\,j\alpha'\rfloor -\lfloor\,j\alpha'-v'\rfloor-v'\bigr)\enddisplayinto the act:\begindisplays(\alpha,n,v)=-nv+\lceil n\alpha\rceil b-\lceil n\alpha\rceil v'-s(\alpha',\lceil n\alpha\rceil,v')-S+\{\hbox{$@0$ or $1$}\}\,.\enddisplayRecalling that $b-v'=v\alpha^{-1}$, we see that everything will simplifybeautifully if we replace $\lceil n\alpha\rceil(b-v')$ by$n\alpha(b-v')=nv$:\begindisplays(\alpha,n,v)=-s(\alpha',\lceil n\alpha\rceil,v') -S+\epsilon+\{\hbox{$@0$ or $1$}\}\,.\enddisplayHere $\epsilon$ is a positive error of at most $v\alpha^{-1}$.Exercise~|k-ge-n-err| proves that $S$ is, simi\-larly, between $0$and~$\lceil v\alpha^{-1@}\rceil$. And we can remove the termfor $j=\lceil n\alpha\rceil-1=\lfloor n\alpha\rfloor$from the sum, since it contributes either $v'$ or~$v'-1$. Hence, if wetake the maximum of absolute values over all~$v$, we get\begindisplayD(\alpha,n)\le D(\alpha',\lfloor \alpha n\rfloor)+\alpha^{-1}+2\,.\eqno\eqref|discrep-rec|\enddisplayThe methods we'll learn in succeeding chapters will allow us to concludefrom this recurrence that $D(\alpha,n)$ is always much smaller than~$n$,when $n$ is sufficiently large. Hence the theorem \eq(|unif-frac
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -