⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chap3.tex

📁 Concrete_Mathematics_2nd_Ed_TeX_Source_Code
💻 TEX
📖 第 1 页 / 共 5 页
字号:
Incidentally, when we're faced with a ``prove or disprove,\qback''we're usually better off trying first to disprove with a counterexample,\g "Skepticism" is healthy only to a limited extent. Being skeptical"!philosophy"about proofs and programs (particularly your own) will probably keepyour grades healthy and your job fairly secure. But applying that muchskepticism will probably also keep you shut away working all the time,instead of letting you get out for exercise and relaxation.\parToo much skepticism is an open invitation to thestate of rigor mortis, where you become so worried about beingcorrect and rigorous that you never get anything finished.\par\hfill\dash---A skeptic\gfor two reasons: A disproof ispotentially easier (we need just one counterexample); andnit-picking arouses our creative juices.Even if the given assertion is true, oursearch for a counterexampleoften leads us to a proof, as soon as we see why a counterexampleis impossible. Besides, it's healthy to be skeptical.If we try to prove that$\bigl\lfloor \mskip-1mu\sqrt{\lfloor x \rfloor} \bigr\rfloor	= \lfloor \sqrt{x} \rfloor$ with the help of calculus, wemight start by decomposing~$x$into its integer and fractional parts $\lfloor x \rfloor + \{x\}=n+\theta$and then expanding the square root using the binomial theorem:$(n + \theta)^{1/2} =	n^{1/2} + n^{-1/2} \theta / 2	- n^{-3/2} \theta^2 \!/ 8 + \cdots\,$.But this approach gets pretty messy.It's much easier to use the tools we've developed.Here's a possible strategy:Somehow strip off the outer floor and square root of$\bigl\lfloor \mskip-1mu \sqrt{\lfloor x \rfloor} \bigr\rfloor$,then remove the inner floor,then add back the outer stuff to get$\lfloor \sqrt{x} \rfloor$.OK\null. We let $m =\smash{\bigl\lfloor \mskip-1mu \sqrt{\lfloor x \rfloor} \bigr\rfloor}$and invoke~\eq(|alt-f-c-def|\rm(a)),giving $m \leq \smash{\sqrt{\lfloor x \rfloor}} < m+1$.That removes the outer floor bracket without losing any information.Squaring, since all three expressions are nonnegative,we have $m^2 \leq \lfloor x \rfloor < (m+1)^2 \bex$.That gets rid of the square root.Next we remove the floor,using~\eq(|f-c-in/out|\rm(d)) for the left inequalityand~\eq(|f-c-in/out|\rm(a)) for the right:$m^2 \leq x < (m+1)^2 \bex$.It's now a simple matter to retrace our steps,taking square roots to get $m \leq \sqrt{x} < m+1$and invoking~\eq(|alt-f-c-def|\rm(a)) to get $m = \lfloor \sqrt{x} \rfloor$.Thus $\bigl\lfloor \mskip-1mu \sqrt{\lfloor x \rfloor} \bigr\rfloor = m= \lfloor \sqrt{x} \rfloor$; the assertion is true. Similarly, we canprove that\begindisplay \bigl\lceil \mskip-1mu\sqrt{\lceil x \rceil}@ \bigr\rceil	= \lceil \sqrt{x}\, \rceil \,, \qquad\hbox{real $x \geq 0$.}\enddisplayThe proof we just founddoesn't rely heavily on the properties of square roots.A closer look shows that we can generalize the ideas and prove much more:Let $f(x)$ be any continuous,monotonically increasing function with the property that\begindisplayf(x)={\rm integer}\qquad\Longrightarrow\qquad x={\rm integer}\,.\enddisplay(The symbol `$\Longrightarrow$' means ``"implies".\qback'')"!$\Longrightarrow$ (alphabetize at the end)"Then we have\begindisplay\lfloor f(x)\rfloor =\lfloor f(\lfloor x\rfloor )\rfloor \qquad\hbox{and}\qquad \lceil f(x)\rceil =\lceil f(\lceil x\rceil )\rceil ,\,\eqno\enddisplaywhenever $f(x)$, $f(\lfloor x\rfloor )$, and $f(\lceil x\rceil )$ are defined.\g\vskip-35pt(This observation was made by R.~J. "McEliece" when he was an undergrad.)\gLet's prove this general property for ceilings, since we did floorsearlier and since the proof for floors is almost the same. If $x=\lceilx\rceil $, there's nothing to prove. Otherwise $x<\lceil x\rceil $, and$f(x)<f(\lceil x\rceil )$ since $f$~is increasing.  Hence $\lceilf(x)\rceil \le\lceil f(\lceil x\rceil )\rceil $,since $\lceil \,\rceil$~is nondecreasing.If $\lceil f(x)\rceil <\lceil f(\lceil x\rceil )\rceil $, there must be a number~$y$ such that $x\le y<\lceil x\rceil $and $f(y)=\lceil f(x)\rceil $, since $f$~is continuous. This~$y$ is an integer, because of $f@$'sspecial property. But there cannot be an integer strictly between$x$ and~$\lceil x\rceil $. This contradiction implies that we must have$\lceil f(x)\rceil =\lceil f(\lceil x\rceil )\rceil $.An important special case of this theorem is worth noting explicitly:\begindisplay\left\lfloor  x+m\over n\right\rfloor =\left\lfloor \lfloor x\rfloor +m\over n\right\rfloor \qquad\hbox{and}\qquad\left\lceil x+m\over n\right\rceil =\left\lceil \lceil x\rceil +m\over n\right\rceil \,,\eqno\eqref|rational-in/out|\enddisplay\looseness=-1if $m$ and $n$ are integers and the denominator $n$ is positive.For example, let $m=0$; we have$\bigl\lfloor \bigl\lfloor \lfloor x/10\rfloor /10\bigr\rfloor /10\bigr\rfloor =\lfloor x/1000\rfloor $.Dividing thrice by~$10$ and throwing off digits is the same asdividing by~$1000$ and tossing the remainder.Let's try now to prove or disprove another statement:\begindisplay \bigl\lceil \mskip-1mu\sqrt{\lfloor x \rfloor}\mskip2mu \bigr\rceil	\buildrel?\over= \lceil \sqrt{x}\, \rceil \,, \qquad\hbox{real $x \geq 0$.}\enddisplayThis works when $x=\pi$ and $x=e$, but it fails when $x=\phi$; so we knowthat it isn't true in general.Before going any further, let's digress a minute to discuss different"levels" of problems that might appear in books about mathematics:"!philosophy" "!problems, levels of" "!exercises, levels of"\def\level#1. {\smallbreak\noindent\hbox{\subsubtitle Level #1. }}\level 1. Given an explicit object $x$ and an explicit property~$P(x)$,{\it prove\/} that $P(x)$ is true. For example, ``Prove that$\lfloor \pi\rfloor =3$.'' Here the problem involves finding a proof of somepurported fact.\level 2. Given an explicit set $X$ and an explicit property~$P(x)$,prove that $P(x)$ is true {\it for all\/} $x\in X$. For example,``Prove that $\lfloor x\rfloor \le x$ for all real $x$.''Again the problem involvesfinding a proof, but the proof this time must be general. We're doingalgebra, not just arithmetic.\level 3. Given an explicit set $X$ and an explicit property~$P(x)$,prove {\it or disprove\/} that $P(x)$ is true for all $x\in X$.\g In my other texts ``prove or disprove''seems to mean the same as ``prove,\qback'' about99.44\% of the time; but not in~this~book.\gFor example, ``Prove or disprove that$\bigl\lceil \mskip-1mu\sqrt{\lfloor x \rfloor}\mskip2mu \bigr\rceil	= \lceil \sqrt{x}\,\rceil$ for all real $x \geq 0$.''Here there's an additional level of uncertainty;the outcome might go either way. This is closer to the real situation amathematician constantly faces: Assertions that get intobooks tend to be true, butnew things have to be looked at with a jaundiced eye. If the statementis false, our job is to find a counterexample. If the statement is true,we must find a proof as in level~2.\level 4. Given an explicit set $X$ and an explicit property~$P(x)$,find a {\it "necessary and sufficient condition"\/} $Q(x)$ that $P(x)$is true. For example, ``Find a necessary and sufficient conditionthat $\lfloor x\rfloor \ge\lceil x\rceil $.''The problem is to find $Q$ such that $P(x)\iff Q(x)$. Of course, there's always a trivial answer;we can take $Q(x)=P(x)$. But the implied requirement is to find a conditionthat's as simple as possible.\g But no simpler.\par\hfill\dash---A. "Einstein"\gCreativity is required to discover a simple condition that will work.(For example, in this case, ``$\lfloor x\rfloor \ge\lceil x\rceil \iff x$ is an integer.'')The extra element of discovery needed to find $Q(x)$ makes this sort ofproblem more difficult, but it's more typical of what mathematicians must doin the ``real world.\qback'' Finally, of course, a proof must be giventhat $P(x)$ is true if and only if $Q(x)$ is true.\level 5. Given an explicit set $X$, find {\it an interesting property\/}$P(x)$ of its elements. Now we're in the scary domain of pure research,where students might think that total chaos reigns. This is realmathematics. Authors of textbooks rarely dare to pose level 5 problems.\smallbreakEnd of digression. But let's convert the last question we looked at from level~3 tolevel~4: What is a necessary and sufficient condition that$\bigl\lceil \mskip-1mu\sqrt{\lfloor x \rfloor}\mskip2mu \bigr\rceil	= \lceil \sqrt{x}\,\rceil$?We have observed that equality holds when $x=3.142$ but not when $x=1.618$;further experimentation shows that it fails also when $x$ is between $9$and~$10$. Oho.\g Home of the Toledo~Mudhens.\g "!baseball" Yes. We see that bad cases occur whenever $m^2<x<m^2+1$,since this gives $m$ on the left and $m+1$ on the right.In all other cases where $\sqrt x$ is defined, namely when $x=0$ or$m^2+1\le x\le(m+1)^2$, we get equality.The following statement is therefore necessary and sufficientfor equality: Either $x$ is an integer or $\sqrt{\lfloor x\rfloor}$~isn't.\smallbreakFor our next problem let's consider a handy new notation, suggested byC.\thinspace A.\thinspace R. "Hoare" andLyle "Ramshaw", for "intervals" of the real line:\tabref|nn:interval|$[\alpha\dts \beta ]$ denotes the set of real numbers~$x$ such that$\alpha \leq x \leq \beta$.This set is called a {\it "closed interval"\/} becauseit contains both endpoints $\alpha$~and~$\beta$.The interval containing neither endpoint, denoted by $(\alpha\dts \beta)$,consists of all~$x$ such that $\alpha < x < \beta$; thisis called an {\it "open interval"}.And the intervals $[\alpha\dts \beta)$ and $(\alpha\dts \beta ]$,which contain just one endpoint, are defined similarly and called{\it "half-open"}. \g(Or, by pessimists, half-closed.)\gHow many integers are contained in such intervals?The half-open intervals are easier, so we start with them.In fact half-open intervals are almost alwaysnicer than open or closed intervals.For example, they're additive\dash---we can combine the half-open intervals$[\alpha\dts\beta)$ and $[\beta\dts\gamma)$ to formthe half-open interval $[\alpha\dts\gamma)$.This wouldn't work with open intervalsbecause the point~$\beta$ would be excluded,and it could cause problems with closed intervalsbecause $\beta$~would be included twice.Back to our problem. The answeris easy if $\alpha$ and~$\beta$ are integers: Then$[\alpha\dts\beta)$ contains the $\beta - \alpha$ integers$\alpha$,~$\alpha+1$, \dots,~$\beta-1$, assuming that $\alpha \leq \beta$.Similarly $(\alpha\dts\beta@]$ contains $\beta - \alpha$ integers in such a case.But our problem is harder, because $\alpha$~and~$\beta$ are arbitraryreals.We can convert it to the easier problem, though,since\begindisplay&\alpha \leq n < \beta\qquad\iff\qquad\lceil \alpha\rceil \leq n < \lceil\beta\rceil \,,\cr&\alpha < n \leq \beta\qquad\iff\qquad	 \lfloor\alpha\rfloor < n \leq \lfloor\beta\rfloor \,,\cr\enddisplaywhen $n$ is an integer, according to~\eq(|f-c-in/out|).The intervals on the right have integer endpoints and contain thesame number of integers as those on the left, which have real endpoints.So the interval $[\alpha\dts\beta)$ contains exactly$\lceil\beta\rceil - \lceil\alpha\rceil$ integers,and $(\alpha\dts\beta@]$ contains$\lfloor\beta\rfloor - \lfloor\alpha\rfloor$.This is a case where we actually want to introduce floor or ceiling brackets,instead of getting rid of them.By the way, there's a mnemonic for rememberingwhich case uses floors and which uses ceilings:Half-open intervals that include the left endpoint but not the right(such as $0 \leq \theta < 1$) are slightly more common than those that includethe right endpoint but not the left;\g Just like we can remember the date of "Columbus"'s departure bysinging, ``In fourteen hundred and ninety-three/ Columbus sailed thedeep blue sea.''\gand floors are slightly more common than ceilings.So by "Murphy's Law", the correct rule isthe opposite of what we'd expect\dash---ceilings for$[\alpha\dts\beta)$ and floors for $(\alpha\dts\beta@]$.Similar analyses show that the closed interval $[\alpha\dts\beta@]$ containsexactly $\lfloor\beta\rfloor - \lceil\alpha\rceil + 1$ integersand that the open interval $(\alpha\dts\beta)$ contains$\lceil\beta\rceil - \lfloor\alpha\rfloor - 1$;but we place the additional restriction $\alpha \neq \beta$on the latter so that the formula won't ever embarrass usby claiming that an empty interval $(\alpha\dts\alpha)$ containsa total of $-1$~integers.To summarize, we've deduced the following facts:\begindisplay\vcenter{\halign{\hfil$#$\hfil\quad&&\quad\hfil$#$\hfil\quad\cr\hidewidth\hbox{interval}\hidewidth & \hbox{integers contained} & \hbox{restrictions} \cr\noalign{\vskip2pt}[\alpha\dts\beta@] & \lfloor\beta\rfloor - \lceil\alpha\rceil + 1 &						\alpha \leq \beta \,, \cr[\alpha\dts\beta) & \lceil\beta\rceil - \lceil\alpha\rceil	&						\alpha \leq \beta \,, \cr(\alpha\dts\beta@] & \lfloor\beta\rfloor - \lfloor\alpha\rfloor	&						\alpha \leq \beta \,, \cr(\alpha\dts\beta) & \lceil\beta\rceil - \lfloor\alpha\rfloor - 1	&						\alpha < \beta \,. \cr}}\eqno\eqref|ints-in-interval|\enddisplayNow here's a problem we can't refuse.The "Concrete Math Club" has a casino (open only to purchasers of this book)"!greed"in which there's a "roulette" "wheel" with one thousand slots, numbered $1$~to~$1000$.If the number~$n$ that comes up on a spinis divisible by the floor of its cube root,that is, if\begindisplay \lfloor \mskip-2mu \root3\of{n} \rfloor \bigm\divides n \,,\enddisplaythen it's a winner and the house pays us \$5;otherwise it's a loser and we must pay~\$1.(The notation $a\divides b$, read ``$a$~divides~$b$,\qback''means that $b$~is an exact multiple of~$a$; Chapter~4 investigatesthis relation carefully.)\g (A poll of the class at this point showed that 28~students thought it was abad idea to play, 13~wanted to gamble, and the rest were too confusedto answer.)\smallskip(So we hit them with the Concrete Math Club.)\gCan we expect to make money if we play this game?We can compute the average winnings\dash---%that is, the amount we'll win (or lose) per play\dash---%

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -