├── .gitignore ├── LICENSE ├── README.md ├── ch01 ├── 1.01.tex ├── 1.02.tex ├── 1.03.tex ├── 1.04.tex ├── 1.05.tex ├── 1.06.tex ├── 1.07.tex ├── 1.08.tex ├── 1.09.tex ├── 1.10.tex ├── 1.11.tex ├── 1.12.tex ├── 1.13.tex ├── 1.14.tex ├── 1.15.tex ├── 1.16.tex ├── 1.17.tex ├── 1.18.tex ├── 1.19.tex ├── 1.20.tex ├── 1.21.tex ├── 1.22.tex ├── 1.23.tex ├── 1.24.tex ├── 1.25.pdf └── 1.25.tex ├── ch02 ├── 2.01.tex ├── 2.02.tex ├── 2.03.tex ├── 2.04.tex └── 2.05.tex ├── ch03 ├── 3.01.tex ├── 3.02.tex ├── 3.03.tex ├── 3.04.tex ├── 3.05.tex ├── 3.06.tex ├── 3.07.tex ├── 3.08.tex ├── 3.09.tex ├── 3.10.tex ├── 3.11.tex ├── 3.12.tex ├── 3.13.tex ├── 3.14.tex ├── 3.15.tex ├── 3.16.tex ├── 3.17.tex ├── 3.18.tex ├── 3.19.tex ├── 3.20.tex ├── 3.21.tex ├── 3.22.tex ├── 3.23.tex ├── 3.24.tex └── 3.25.tex ├── ch04 ├── 4.01.tex ├── 4.02.tex ├── 4.03.tex ├── 4.04.tex ├── 4.05.tex ├── 4.06.tex ├── 4.07.tex ├── 4.08.tex ├── 4.09.tex └── 4.10.tex ├── ch05 ├── 5.01.tex ├── 5.02.tex ├── 5.03.tex ├── 5.04.tex ├── 5.05.tex ├── 5.06.tex ├── 5.07.tex ├── 5.08.tex ├── 5.09.tex ├── 5.10.tex ├── 5.11.tex ├── 5.12.tex ├── 5.13.tex ├── 5.14.tex ├── 5.15.tex ├── 5.16.tex ├── 5.17.tex ├── 5.18.tex ├── 5.19.tex └── 5.20.tex ├── config.tex ├── fonts └── fonts.md ├── solution.pdf └── solution.tex /.gitignore: -------------------------------------------------------------------------------- 1 | ## Core latex/pdflatex auxiliary files: 2 | *.aux 3 | *.lof 4 | *.log 5 | *.lot 6 | *.fls 7 | *.out 8 | *.toc 9 | *.fmt 10 | *.fot 11 | *.cb 12 | *.cb2 13 | .*.lb 14 | 15 | ## Intermediate documents: 16 | *.dvi 17 | *.xdv 18 | *-converted-to.* 19 | # these rules might exclude image files for figures etc. 20 | # *.ps 21 | # *.eps 22 | # *.pdf 23 | 24 | ## Generated if empty string is given at "Please type another file name for output:" 25 | .pdf 26 | 27 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 28 | *.bbl 29 | *.bcf 30 | *.blg 31 | *-blx.aux 32 | *-blx.bib 33 | *.run.xml 34 | 35 | ## Build tool auxiliary files: 36 | *.fdb_latexmk 37 | *.synctex 38 | *.synctex(busy) 39 | *.synctex.gz 40 | *.synctex.gz(busy) 41 | *.pdfsync 42 | 43 | ## Build tool directories for auxiliary files 44 | # latexrun 45 | latex.out/ 46 | 47 | ## Auxiliary and intermediate files from other packages: 48 | # algorithms 49 | *.alg 50 | *.loa 51 | 52 | # achemso 53 | acs-*.bib 54 | 55 | # amsthm 56 | *.thm 57 | 58 | # beamer 59 | *.nav 60 | *.pre 61 | *.snm 62 | *.vrb 63 | 64 | # changes 65 | *.soc 66 | 67 | # comment 68 | *.cut 69 | 70 | # cprotect 71 | *.cpt 72 | 73 | # elsarticle (documentclass of Elsevier journals) 74 | *.spl 75 | 76 | # endnotes 77 | *.ent 78 | 79 | # fixme 80 | *.lox 81 | 82 | # feynmf/feynmp 83 | *.mf 84 | *.mp 85 | *.t[1-9] 86 | *.t[1-9][0-9] 87 | *.tfm 88 | 89 | #(r)(e)ledmac/(r)(e)ledpar 90 | *.end 91 | *.?end 92 | *.[1-9] 93 | *.[1-9][0-9] 94 | *.[1-9][0-9][0-9] 95 | *.[1-9]R 96 | *.[1-9][0-9]R 97 | *.[1-9][0-9][0-9]R 98 | *.eledsec[1-9] 99 | *.eledsec[1-9]R 100 | *.eledsec[1-9][0-9] 101 | *.eledsec[1-9][0-9]R 102 | *.eledsec[1-9][0-9][0-9] 103 | *.eledsec[1-9][0-9][0-9]R 104 | 105 | # glossaries 106 | *.acn 107 | *.acr 108 | *.glg 109 | *.glo 110 | *.gls 111 | *.glsdefs 112 | 113 | # uncomment this for glossaries-extra (will ignore makeindex's style files!) 114 | # *.ist 115 | 116 | # gnuplottex 117 | *-gnuplottex-* 118 | 119 | # gregoriotex 120 | *.gaux 121 | *.gtex 122 | 123 | # htlatex 124 | *.4ct 125 | *.4tc 126 | *.idv 127 | *.lg 128 | *.trc 129 | *.xref 130 | 131 | # hyperref 132 | *.brf 133 | 134 | # knitr 135 | *-concordance.tex 136 | # TODO Comment the next line if you want to keep your tikz graphics files 137 | *.tikz 138 | *-tikzDictionary 139 | 140 | # listings 141 | *.lol 142 | 143 | # luatexja-ruby 144 | *.ltjruby 145 | 146 | # makeidx 147 | *.idx 148 | *.ilg 149 | *.ind 150 | 151 | # minitoc 152 | *.maf 153 | *.mlf 154 | *.mlt 155 | *.mtc[0-9]* 156 | *.slf[0-9]* 157 | *.slt[0-9]* 158 | *.stc[0-9]* 159 | 160 | # minted 161 | _minted* 162 | *.pyg 163 | 164 | # morewrites 165 | *.mw 166 | 167 | # nomencl 168 | *.nlg 169 | *.nlo 170 | *.nls 171 | 172 | # pax 173 | *.pax 174 | 175 | # pdfpcnotes 176 | *.pdfpc 177 | 178 | # sagetex 179 | *.sagetex.sage 180 | *.sagetex.py 181 | *.sagetex.scmd 182 | 183 | # scrwfile 184 | *.wrt 185 | 186 | # sympy 187 | *.sout 188 | *.sympy 189 | sympy-plots-for-*.tex/ 190 | 191 | # pdfcomment 192 | *.upa 193 | *.upb 194 | 195 | # pythontex 196 | *.pytxcode 197 | pythontex-files-*/ 198 | 199 | # tcolorbox 200 | *.listing 201 | 202 | # thmtools 203 | *.loe 204 | 205 | # TikZ & PGF 206 | *.dpth 207 | *.md5 208 | *.auxlock 209 | 210 | # todonotes 211 | *.tdo 212 | 213 | # vhistory 214 | *.hst 215 | *.ver 216 | 217 | # easy-todo 218 | *.lod 219 | 220 | # xcolor 221 | *.xcp 222 | 223 | # xmpincl 224 | *.xmpi 225 | 226 | # xindy 227 | *.xdy 228 | 229 | # xypic precompiled matrices 230 | *.xyc 231 | 232 | # endfloat 233 | *.ttt 234 | *.fff 235 | 236 | # Latexian 237 | TSWLatexianTemp* 238 | 239 | ## Editors: 240 | # WinEdt 241 | *.bak 242 | *.sav 243 | 244 | # Texpad 245 | .texpadtmp 246 | 247 | # LyX 248 | *.lyx~ 249 | 250 | # Kile 251 | *.backup 252 | 253 | # KBibTeX 254 | *~[0-9]* 255 | 256 | # auto folder when using emacs and auctex 257 | ./auto/* 258 | *.el 259 | 260 | # expex forward references with \gathertags 261 | *-tags.tex 262 | 263 | # standalone packages 264 | *.sta 265 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Attribution-NonCommercial-ShareAlike 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International 58 | Public License 59 | 60 | By exercising the Licensed Rights (defined below), You accept and agree 61 | to be bound by the terms and conditions of this Creative Commons 62 | Attribution-NonCommercial-ShareAlike 4.0 International Public License 63 | ("Public License"). To the extent this Public License may be 64 | interpreted as a contract, You are granted the Licensed Rights in 65 | consideration of Your acceptance of these terms and conditions, and the 66 | Licensor grants You such rights in consideration of benefits the 67 | Licensor receives from making the Licensed Material available under 68 | these terms and conditions. 69 | 70 | 71 | Section 1 -- Definitions. 72 | 73 | a. Adapted Material means material subject to Copyright and Similar 74 | Rights that is derived from or based upon the Licensed Material 75 | and in which the Licensed Material is translated, altered, 76 | arranged, transformed, or otherwise modified in a manner requiring 77 | permission under the Copyright and Similar Rights held by the 78 | Licensor. For purposes of this Public License, where the Licensed 79 | Material is a musical work, performance, or sound recording, 80 | Adapted Material is always produced where the Licensed Material is 81 | synched in timed relation with a moving image. 82 | 83 | b. Adapter's License means the license You apply to Your Copyright 84 | and Similar Rights in Your contributions to Adapted Material in 85 | accordance with the terms and conditions of this Public License. 86 | 87 | c. BY-NC-SA Compatible License means a license listed at 88 | creativecommons.org/compatiblelicenses, approved by Creative 89 | Commons as essentially the equivalent of this Public License. 90 | 91 | d. Copyright and Similar Rights means copyright and/or similar rights 92 | closely related to copyright including, without limitation, 93 | performance, broadcast, sound recording, and Sui Generis Database 94 | Rights, without regard to how the rights are labeled or 95 | categorized. For purposes of this Public License, the rights 96 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 97 | Rights. 98 | 99 | e. Effective Technological Measures means those measures that, in the 100 | absence of proper authority, may not be circumvented under laws 101 | fulfilling obligations under Article 11 of the WIPO Copyright 102 | Treaty adopted on December 20, 1996, and/or similar international 103 | agreements. 104 | 105 | f. Exceptions and Limitations means fair use, fair dealing, and/or 106 | any other exception or limitation to Copyright and Similar Rights 107 | that applies to Your use of the Licensed Material. 108 | 109 | g. License Elements means the license attributes listed in the name 110 | of a Creative Commons Public License. The License Elements of this 111 | Public License are Attribution, NonCommercial, and ShareAlike. 112 | 113 | h. Licensed Material means the artistic or literary work, database, 114 | or other material to which the Licensor applied this Public 115 | License. 116 | 117 | i. Licensed Rights means the rights granted to You subject to the 118 | terms and conditions of this Public License, which are limited to 119 | all Copyright and Similar Rights that apply to Your use of the 120 | Licensed Material and that the Licensor has authority to license. 121 | 122 | j. Licensor means the individual(s) or entity(ies) granting rights 123 | under this Public License. 124 | 125 | k. NonCommercial means not primarily intended for or directed towards 126 | commercial advantage or monetary compensation. For purposes of 127 | this Public License, the exchange of the Licensed Material for 128 | other material subject to Copyright and Similar Rights by digital 129 | file-sharing or similar means is NonCommercial provided there is 130 | no payment of monetary compensation in connection with the 131 | exchange. 132 | 133 | l. Share means to provide material to the public by any means or 134 | process that requires permission under the Licensed Rights, such 135 | as reproduction, public display, public performance, distribution, 136 | dissemination, communication, or importation, and to make material 137 | available to the public including in ways that members of the 138 | public may access the material from a place and at a time 139 | individually chosen by them. 140 | 141 | m. Sui Generis Database Rights means rights other than copyright 142 | resulting from Directive 96/9/EC of the European Parliament and of 143 | the Council of 11 March 1996 on the legal protection of databases, 144 | as amended and/or succeeded, as well as other essentially 145 | equivalent rights anywhere in the world. 146 | 147 | n. You means the individual or entity exercising the Licensed Rights 148 | under this Public License. Your has a corresponding meaning. 149 | 150 | 151 | Section 2 -- Scope. 152 | 153 | a. License grant. 154 | 155 | 1. Subject to the terms and conditions of this Public License, 156 | the Licensor hereby grants You a worldwide, royalty-free, 157 | non-sublicensable, non-exclusive, irrevocable license to 158 | exercise the Licensed Rights in the Licensed Material to: 159 | 160 | a. reproduce and Share the Licensed Material, in whole or 161 | in part, for NonCommercial purposes only; and 162 | 163 | b. produce, reproduce, and Share Adapted Material for 164 | NonCommercial purposes only. 165 | 166 | 2. Exceptions and Limitations. For the avoidance of doubt, where 167 | Exceptions and Limitations apply to Your use, this Public 168 | License does not apply, and You do not need to comply with 169 | its terms and conditions. 170 | 171 | 3. Term. The term of this Public License is specified in Section 172 | 6(a). 173 | 174 | 4. Media and formats; technical modifications allowed. The 175 | Licensor authorizes You to exercise the Licensed Rights in 176 | all media and formats whether now known or hereafter created, 177 | and to make technical modifications necessary to do so. The 178 | Licensor waives and/or agrees not to assert any right or 179 | authority to forbid You from making technical modifications 180 | necessary to exercise the Licensed Rights, including 181 | technical modifications necessary to circumvent Effective 182 | Technological Measures. For purposes of this Public License, 183 | simply making modifications authorized by this Section 2(a) 184 | (4) never produces Adapted Material. 185 | 186 | 5. Downstream recipients. 187 | 188 | a. Offer from the Licensor -- Licensed Material. Every 189 | recipient of the Licensed Material automatically 190 | receives an offer from the Licensor to exercise the 191 | Licensed Rights under the terms and conditions of this 192 | Public License. 193 | 194 | b. Additional offer from the Licensor -- Adapted Material. 195 | Every recipient of Adapted Material from You 196 | automatically receives an offer from the Licensor to 197 | exercise the Licensed Rights in the Adapted Material 198 | under the conditions of the Adapter's License You apply. 199 | 200 | c. No downstream restrictions. You may not offer or impose 201 | any additional or different terms or conditions on, or 202 | apply any Effective Technological Measures to, the 203 | Licensed Material if doing so restricts exercise of the 204 | Licensed Rights by any recipient of the Licensed 205 | Material. 206 | 207 | 6. No endorsement. Nothing in this Public License constitutes or 208 | may be construed as permission to assert or imply that You 209 | are, or that Your use of the Licensed Material is, connected 210 | with, or sponsored, endorsed, or granted official status by, 211 | the Licensor or others designated to receive attribution as 212 | provided in Section 3(a)(1)(A)(i). 213 | 214 | b. Other rights. 215 | 216 | 1. Moral rights, such as the right of integrity, are not 217 | licensed under this Public License, nor are publicity, 218 | privacy, and/or other similar personality rights; however, to 219 | the extent possible, the Licensor waives and/or agrees not to 220 | assert any such rights held by the Licensor to the limited 221 | extent necessary to allow You to exercise the Licensed 222 | Rights, but not otherwise. 223 | 224 | 2. Patent and trademark rights are not licensed under this 225 | Public License. 226 | 227 | 3. To the extent possible, the Licensor waives any right to 228 | collect royalties from You for the exercise of the Licensed 229 | Rights, whether directly or through a collecting society 230 | under any voluntary or waivable statutory or compulsory 231 | licensing scheme. In all other cases the Licensor expressly 232 | reserves any right to collect such royalties, including when 233 | the Licensed Material is used other than for NonCommercial 234 | purposes. 235 | 236 | 237 | Section 3 -- License Conditions. 238 | 239 | Your exercise of the Licensed Rights is expressly made subject to the 240 | following conditions. 241 | 242 | a. Attribution. 243 | 244 | 1. If You Share the Licensed Material (including in modified 245 | form), You must: 246 | 247 | a. retain the following if it is supplied by the Licensor 248 | with the Licensed Material: 249 | 250 | i. identification of the creator(s) of the Licensed 251 | Material and any others designated to receive 252 | attribution, in any reasonable manner requested by 253 | the Licensor (including by pseudonym if 254 | designated); 255 | 256 | ii. a copyright notice; 257 | 258 | iii. a notice that refers to this Public License; 259 | 260 | iv. a notice that refers to the disclaimer of 261 | warranties; 262 | 263 | v. a URI or hyperlink to the Licensed Material to the 264 | extent reasonably practicable; 265 | 266 | b. indicate if You modified the Licensed Material and 267 | retain an indication of any previous modifications; and 268 | 269 | c. indicate the Licensed Material is licensed under this 270 | Public License, and include the text of, or the URI or 271 | hyperlink to, this Public License. 272 | 273 | 2. You may satisfy the conditions in Section 3(a)(1) in any 274 | reasonable manner based on the medium, means, and context in 275 | which You Share the Licensed Material. For example, it may be 276 | reasonable to satisfy the conditions by providing a URI or 277 | hyperlink to a resource that includes the required 278 | information. 279 | 3. If requested by the Licensor, You must remove any of the 280 | information required by Section 3(a)(1)(A) to the extent 281 | reasonably practicable. 282 | 283 | b. ShareAlike. 284 | 285 | In addition to the conditions in Section 3(a), if You Share 286 | Adapted Material You produce, the following conditions also apply. 287 | 288 | 1. The Adapter's License You apply must be a Creative Commons 289 | license with the same License Elements, this version or 290 | later, or a BY-NC-SA Compatible License. 291 | 292 | 2. You must include the text of, or the URI or hyperlink to, the 293 | Adapter's License You apply. You may satisfy this condition 294 | in any reasonable manner based on the medium, means, and 295 | context in which You Share Adapted Material. 296 | 297 | 3. You may not offer or impose any additional or different terms 298 | or conditions on, or apply any Effective Technological 299 | Measures to, Adapted Material that restrict exercise of the 300 | rights granted under the Adapter's License You apply. 301 | 302 | 303 | Section 4 -- Sui Generis Database Rights. 304 | 305 | Where the Licensed Rights include Sui Generis Database Rights that 306 | apply to Your use of the Licensed Material: 307 | 308 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 309 | to extract, reuse, reproduce, and Share all or a substantial 310 | portion of the contents of the database for NonCommercial purposes 311 | only; 312 | 313 | b. if You include all or a substantial portion of the database 314 | contents in a database in which You have Sui Generis Database 315 | Rights, then the database in which You have Sui Generis Database 316 | Rights (but not its individual contents) is Adapted Material, 317 | including for purposes of Section 3(b); and 318 | 319 | c. You must comply with the conditions in Section 3(a) if You Share 320 | all or a substantial portion of the contents of the database. 321 | 322 | For the avoidance of doubt, this Section 4 supplements and does not 323 | replace Your obligations under this Public License where the Licensed 324 | Rights include other Copyright and Similar Rights. 325 | 326 | 327 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 328 | 329 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 330 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 331 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 332 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 333 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 334 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 335 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 336 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 337 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 338 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 339 | 340 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 341 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 342 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 343 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 344 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 345 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 346 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 347 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 348 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 349 | 350 | c. The disclaimer of warranties and limitation of liability provided 351 | above shall be interpreted in a manner that, to the extent 352 | possible, most closely approximates an absolute disclaimer and 353 | waiver of all liability. 354 | 355 | 356 | Section 6 -- Term and Termination. 357 | 358 | a. This Public License applies for the term of the Copyright and 359 | Similar Rights licensed here. However, if You fail to comply with 360 | this Public License, then Your rights under this Public License 361 | terminate automatically. 362 | 363 | b. Where Your right to use the Licensed Material has terminated under 364 | Section 6(a), it reinstates: 365 | 366 | 1. automatically as of the date the violation is cured, provided 367 | it is cured within 30 days of Your discovery of the 368 | violation; or 369 | 370 | 2. upon express reinstatement by the Licensor. 371 | 372 | For the avoidance of doubt, this Section 6(b) does not affect any 373 | right the Licensor may have to seek remedies for Your violations 374 | of this Public License. 375 | 376 | c. For the avoidance of doubt, the Licensor may also offer the 377 | Licensed Material under separate terms or conditions or stop 378 | distributing the Licensed Material at any time; however, doing so 379 | will not terminate this Public License. 380 | 381 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 382 | License. 383 | 384 | 385 | Section 7 -- Other Terms and Conditions. 386 | 387 | a. The Licensor shall not be bound by any additional or different 388 | terms or conditions communicated by You unless expressly agreed. 389 | 390 | b. Any arrangements, understandings, or agreements regarding the 391 | Licensed Material not stated herein are separate from and 392 | independent of the terms and conditions of this Public License. 393 | 394 | 395 | Section 8 -- Interpretation. 396 | 397 | a. For the avoidance of doubt, this Public License does not, and 398 | shall not be interpreted to, reduce, limit, restrict, or impose 399 | conditions on any use of the Licensed Material that could lawfully 400 | be made without permission under this Public License. 401 | 402 | b. To the extent possible, if any provision of this Public License is 403 | deemed unenforceable, it shall be automatically reformed to the 404 | minimum extent necessary to make it enforceable. If the provision 405 | cannot be reformed, it shall be severed from this Public License 406 | without affecting the enforceability of the remaining terms and 407 | conditions. 408 | 409 | c. No term or condition of this Public License will be waived and no 410 | failure to comply consented to unless expressly agreed to by the 411 | Licensor. 412 | 413 | d. Nothing in this Public License constitutes or may be interpreted 414 | as a limitation upon, or waiver of, any privileges and immunities 415 | that apply to the Licensor or You, including from the legal 416 | processes of any jurisdiction or authority. 417 | 418 | ======================================================================= 419 | 420 | Creative Commons is not a party to its public 421 | licenses. Notwithstanding, Creative Commons may elect to apply one of 422 | its public licenses to material it publishes and in those instances 423 | will be considered the “Licensor.” The text of the Creative Commons 424 | public licenses is dedicated to the public domain under the CC0 Public 425 | Domain Dedication. Except for the limited purpose of indicating that 426 | material is shared under a Creative Commons public license or as 427 | otherwise permitted by the Creative Commons policies published at 428 | creativecommons.org/policies, Creative Commons does not authorize the 429 | use of the trademark "Creative Commons" or any other trademark or logo 430 | of Creative Commons without its prior written consent including, 431 | without limitation, in connection with any unauthorized modifications 432 | to any of its public licenses or any other arrangements, 433 | understandings, or agreements concerning use of licensed material. For 434 | the avoidance of doubt, this paragraph does not form part of the 435 | public licenses. 436 | 437 | Creative Commons may be contacted at creativecommons.org. 438 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 《计算模型导引》题解 2 | 3 | 配套宋方敏教授编著《计算模型导引》。 4 | 5 | **仅供参考。仅供参考。仅供参考。** 6 | 7 | ## 编译前 8 | 9 | 由于Linux下ctex默认不指定字体从而导致编译出错,不得已手动指定了一番字体,由于字体文件太大,就没传到本仓库上。 10 | 11 | 不想改任何文件的话,将Windows系统内的黑体,宋体,楷体字体复制到fonts文件夹内。 12 | 13 | 假设你的Windows安装在C盘,那么将C:\Windows\Fonts文件夹内的SimHei.ttf, SimKai.ttf, SimSun.ttc复制过来,并把SimSun.ttc重命名为SimSun.ttf。 14 | 15 | 也可以使用自己的字体,修改solution.tex里面的`\setCJKMainFont`命令中对字体的配置即可。 16 | 17 | ## 编译方式 18 | 19 | 使用XeLatex编译solution.tex两次。 20 | 21 | ## 答案参考 22 | 23 | * 宋方敏(课堂讲解) 24 | * 蒋炎岩 https://github.com/jiangyy/NJU-TOC-Solutions 25 | * 张强 https://i-m.dev 26 | * 丁超 https://github.com/sleepycoke/NJU_Com_Models 27 | 28 | ## 许可协议 29 | [![License: CC BY-NC-SA 4.0](https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-sa.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/) 30 | 31 | 本文档采用[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)许可协议。 32 | -------------------------------------------------------------------------------- /ch01/1.01.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: 对于固定的$k$, 一元数论函数$x+k\in\BF$.} 2 | \begin{proof} 3 | 令$f_k(x)=x+k$. 4 | \begin{enumerate} 5 | \item 当$k=0$时, $f_0(x)=x=P_1^1(x)\in\IF$, 命题成立; 6 | \item 当$k=1$时, $f_1(x)=x+1=S(x)\in\IF$, 命题成立; 7 | \item 假设当$k=k_0(k_0\geqslant 1,k_0\in\mathbb{N})$时$f_{k_0}\in\BF$, 那么: 8 | 9 | 当$k=k_0+1$时,$f_{k_0+1}=x+k_0+1=S(x+k_0)=S\circ f_{k_0}(x)=\mathrm{Comp}^1_1[S,f_{k_0}]\in\BF$. 10 | \end{enumerate} 11 | 12 | 由数学归纳法可知, 命题成立. 13 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.02.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: 对任意$k\in\mathbb{N}^+,f:\mathbb{N}^k\to\mathbb{N}$, 若$f\in\BF$, 则存在$h$, 使得$$f(\vec{x})<\|\vec{x}\|+h.$$其中$\|x\|\equiv\max\{x_i:1\leqslant i\leqslant k\}$.} 2 | \begin{proof} 3 | 分情况讨论. 4 | \begin{enumerate} 5 | \item 当$f\in\IF$时, 由于$S(x)=x+1<\|x\|+2,Z(x)=0<\|x\|+2,P(\vec{x})\leqslant\|\vec{x}\|<\|\vec{x}\|+2$, 所以令$h=2$即可让题中式子对于$f\in\IF$均成立; 6 | \item 当$f\in\BF-\IF$时, 假设$f$的构造长度$\ell$满足$0\leqslant l \leqslant k$时, 命题均成立, 那么对这样的函数$f$, 必然存在一个自然数$h_k$使得$f(\vec{x})<\|\vec{x}\|+h_k$恒成立. 对于$f\in\IF$, 其构造长度可视为0, 故令$h_0=2$. 7 | 8 | 当$f$的构造长度为$k+1$时, 设其构造过程为数论函数序列$f_0,f_1,\cdots,f_k,f$, 那么对于任一函数$f_i(0\leqslant i\leqslant k)$, 其构造长度不大于$i$, 自然也不大于$k$, 所以有 9 | \begin{equation}\label{eq1.2.1} 10 | \begin{split} 11 | f&=\mathrm{Comp}_n^m[f_{i_0},f_{i_1},\cdots,f_{i_n}]\\ 12 | &=f_{i_0}(f_{i_1}(\vec{x}),\cdots,f_{i_n}(\vec{x}))\\ 13 | &<\|f_{i_1}(\vec{x}),\cdots,f_{i_n}(\vec{x})\|+h_k 14 | \end{split} 15 | \end{equation} 16 | 其中$f_{i_0},f_{i_1},\cdots,f_{i_n}$从$f_0,f_1,\cdots,f_k$中选择(可重复), 所以式(\ref{eq1.2.1})最后出现的$f_{i_1}(\vec{x}),$ $\cdots,$ $f_{i_n}(\vec{x})$的所有值均小于$\|\vec{x}\|+h_k$, 可得$\|f_{i_1}(\vec{x}),\cdots,f_{i_n}(\vec{x})\|<\|\vec{x}\|+h_k$, 因此$f<\|\vec{x}\|+2h_k$, 也就是说, 当$f$的构造长度$l$满足$0\leqslant l\leqslant k+1$时, $f(\vec{x})<\|\vec{x}\|+2h_k$恒成立, 即$h_{k+1}=2h_k$是满足要求的. 17 | \end{enumerate} 18 | 19 | 又因为$h_0=2$, 可得$h_k=2^{k+1}$对于构造长度不大于$k$的函数都能使不等式$f(\vec{x})<\|\vec{x}\|+h_k$恒成立. 而对一个特定的$f\in\BF$, 它肯定有一个构造长度$\ell$, 所以令$h=2^{\ell+1}$即可使得题中不等式成立. 20 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.03.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: 二元数论函数$x+y\notin\BF$.} 2 | \begin{proof} 3 | 由1.2的结论可知, 若二元数论函数$f\in\BF$, 则存在自然数$h$使得$f(x,y)<\max\{x,y\}+h$恒成立. 4 | 5 | 假设$x+y\in\BF$, 那么存在自然数$h$使得$x+y<\max\{x,y\}+h$恒成立. 因为$x+y=\max\{x,y\}+\min\{x,y\}$, 可推出该自然数$h$使得$\min\{x,y\}0$时, 令$x=0$, 结果肯定不为0; 当$a=0$时, 式子就是$Z$, 同样不对. 因此$\mathrm{pred}\notin\BF$, 从而$x\dotdiv y\notin\BF$. 14 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.05.tex: -------------------------------------------------------------------------------- 1 | \problem{设$\pg(x,y)=2^x(2y+1)\dotdiv 1$, 证明: 存在初等函数$K(x)$和$L(x)$使得 2 | $$\protect\begin{aligned} 3 | K(\pg(x,y))=x,&\\ 4 | L(\pg(x,y))=y,&\\ 5 | \pg(K(z),L(z))=z. 6 | \protect\end{aligned}$$} 7 | \begin{proof} 8 | 当$x,y\in\mathbb{N}$时, 可知$2^x(2y+1)\geqslant 1$恒成立, 因此$\pg(x,y)=2^x(2y+1)-1$(就是把$\dotdiv$换成了普通的减号$-$). 9 | 10 | 又因为$2\nmid (2y+1)$, 所以可使$K(z)=\ep_0(z+1),L(z)=\frac12\left(\frac{z+1}{2^{\ep_0}(z+1)}-1\right)$使得$K(\pg(x,y))=x,L(\pg(x,y))=y$. 11 | 12 | 且$$\pg(K(z),L(z))=2^{\ep_0(z+1)}\frac{z+1}{2^{\ep_0(z+1)}}-1=z.$$ 13 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.06.tex: -------------------------------------------------------------------------------- 1 | \problem{设$f:\mathbb{N}\to\mathbb{N}$, 证明: $f$可以作为配对函数的左函数当且仅当对任何$i\in\mathbb{N}$,$$|\{x\in\mathbb{N}:f(x)=i\}|=\aleph_0.$$} 2 | \begin{proof} 3 | 记$\mathcal{X}_i=\{x\in\mathbb{N}:f(x)=i\}$. 4 | 5 | \textbf{先证明必要性.} 6 | 7 | 显然, $\mathcal{X}_i\subseteq\mathbb{N}$, 因此只需要证明该集合内的元素个数无限即可. \footnote{根据可数选择公理(axiom of countable choice), $\aleph_0$即自然数集等无限可数集的基数是所有无限集的基数里面最小的.} 8 | 9 | 假设$\mathcal{X}_i$是有限集. 10 | 11 | 考虑与之对应的配对函数$\pg:\mathbb{N}^2\to\mathbb{N}$和右函数$g:\mathbb{N}\to\mathbb{N}$, 记$\mathcal{Y}=\{g(x)|x\in\mathcal{X}_i\}$, 那么显然$\mathcal{Y}$也是有限集, 集合$\mathbb{N}-\mathcal{Y}$非空. 12 | 13 | 任取$j\in\mathbb{N}-\mathcal{Y}$, 若$\pg(i,j)\in\mathcal{X}_i$, 则$j=g(\pg(i,j))\in\mathcal{Y}$, 与$j\in\mathbb{N}-\mathcal{Y}$矛盾; 若$\pg(i,j)\notin\mathcal{X}_i$, 则$f(\pg(i,j)) \neq i$, 与配对函数的定义矛盾. 故$\mathcal{X}_i$是无限集, 因而命题成立. 14 | 15 | \textbf{再证明充分性.} 16 | 17 | 对任意的$i\in\mathbb{N}$, 都有$|\{x\in\mathbb{N}:f(x)=i\}|=\aleph_0$, 那么$\mathcal{X}_i$可以与$\mathbb{N}$建立一个双射, 记为函数$F_i:\mathbb{N}\to\mathcal{X}_i$及其反函数$F_i^{-1}:\mathcal{X}_i\to\mathbb{N}$. 18 | 19 | 现在, 可以定义$g:\mathbb{N}\to\mathbb{N}$如下: 20 | $$g(x)=\begin{cases} 21 | j,&\textrm{若} x=F_i(j),\\ 22 | 0,&\textrm{否则}. 23 | \end{cases}$$ 24 | 25 | 那么, 当$x=F_i(j)$时, 因为$F_i(j)\in\mathcal{X}_i$, $f(x)=i$成立; 同时$g(x)=j$成立. 所以, 令$\pg(i,j)=F_i(j)$即可, $f$即为$\pg$的左函数. 26 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.07.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: 从本原函数出发, 经复合和算子$\displaystyle\prod_{i=n}^m[\cdot]$可以生成所有的初等函数. 这里$$\prod_{i=n}^m [f(i)] = 2 | \protect\begin{cases} 3 | f(n)\cdot f(n+1)\cdot\quad\cdots\quad\cdot f(m), & \textrm{若}m\geqslant n,\\ 4 | 1, & \textrm{若}m100, 4 | \protect\end{cases}$$证明: 5 | $$M(x)= 6 | \protect\begin{cases} 7 | 91, & \textrm{若}x\leqslant 100,\\ 8 | x-10, & \textrm{否则}. 9 | \protect\end{cases}$$} 10 | \begin{proof} 11 | 显然, 我们只要证明当$0\leqslant x\leqslant 100$时, $M(x)=91$即可. 12 | 13 | 当$90\leqslant x \leqslant 100$时, $M(x)=M(M(x+11))=M(x+1)$, 因此$M(90)=M(91)=\cdots=M(100)=M(101)=91$, 注意$M(91)=91$; 14 | 15 | 当$0\leqslant x \leqslant 100$时, 存在自然数$k$使得$90\leqslant x+11k\leqslant 100$成立. 因此$M(x)=M^2(x+11\cdot1)=M^{k+1}(x+11k)=M^kM(x+11k)=M^k(91)=91$. 16 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.09.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: 2 | $$\min x\leqslant n. [f(x,\vec{y})]=n\dotdiv\max x\leqslant n. [f(n\dotdiv x,\vec{y})],$$ 3 | $$\max x\leqslant n. [f(x,\vec{y})]=n\dotdiv\min x\leqslant n. [f(n\dotdiv x,\vec{y})].$$} 4 | \begin{proof} 5 | 分情况讨论. 6 | \begin{enumerate} 7 | \item 当$f(x,\vec{y})$在$[0,n]$有零点时, 设$\min x\leqslant n. [f(x,\vec{y})]=k$. 8 | 9 | 那么有$f(k)=0$, 从而$f(n\dotdiv(n\dotdiv k))=0$, $n\dotdiv k$是函数$f(n\dotdiv x)$的零点. 10 | 11 | 因为$k$为$f(k)$最小的零点, 那么$n\dotdiv k$是$f(n\dotdiv x)$在$[0,n]$的最大零点. 因为如果有比$n\dotdiv k$大的$f(n\dotdiv x)$的零点$z$存在, 那么$f(n\dotdiv z)=0$且$n\dotdiv zG(0,2)$, 当$k>0$时, $$f(k+2)=\underbrace{(k+2)^{\cdot^{\cdot^{\cdot (k+2)}}}}_{(k+2)\textrm{个}(k+2)},$$ 28 | $$G(k,k+2)=\underbrace{2^{\cdot^{\cdot^{\cdot 2^{k+2}}}}}_{k\textrm{个}2},$$ 29 | 30 | 显然$$f(k+2)>\underbrace{(k+2)^{\cdot^{\cdot^{\cdot (k+2)}}}}_{(k+1)\textrm{个}(k+2)}>\underbrace{2^{\cdot^{\cdot^{\cdot 2^{k+2}}}}}_{k\textrm{个}2}=G(k,k+2),$$ 31 | 32 | 因此不存在$k$使得$\forall x\in\mathbb{N}. f(x)\leqslant G(k,x)$, 所以假设不成立, $f\notin\EF$. 33 | 34 | 综上, $f\in\PRF-\EF$. 35 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.17.tex: -------------------------------------------------------------------------------- 1 | \problem{设$g:\mathbb{N}\to\mathbb{N}\in\PRF,f:\mathbb{N}^2\to\mathbb{N}$, 满足 2 | $$\protect\begin{aligned} 3 | f(x,0)&=g(x),\\ 4 | f(x,y+1)&=f(f(\cdots f(f(x,y),y-1),\cdots),0), 5 | \protect\end{aligned} 6 | $$证明:$f\in\PRF$.} 7 | \begin{proof} 8 | 先证明$f(x,y)=g^{2^{y-1}}(x)$当$y\geqslant 1$时成立. 9 | 10 | 当$y=1$时, $f(x,y)=f(x,0)=g(x)$, 成立; 11 | 12 | 假设当$y\leqslant k$时命题成立, 那么有$f(x,y)=g^{2^{y-1}}(x)$在$1\leqslant y\leqslant k$时对任意的$x\in\mathbb{N}$均成立. 13 | 14 | 当$y=k+1$时, $$\begin{aligned} 15 | f(x,k+1)&=f(f(\cdots f(f(x,k),k-1),\cdots),0)\\ 16 | &=f(f(\cdots f(g^{2^{k-1}}(x),k-1),\cdots), 0)\\ 17 | &=f(f(\cdots g^{2^{k-2}}(g^{2^{k-1}}(x)),\cdots), 0)\\ 18 | &=f(g^{2^0}\circ g^{2^1}\circ \cdots \circ g^{2^{k-2}}\circ g^{2^{k-1}}(x),0)\\ 19 | &=g(g^{\frac{1-2^k}{1-2}}(x))\\ 20 | &=g^{2^k}(x) 21 | \end{aligned}$$ 22 | 23 | 由数学归纳法可知, $f(x,y)=g^{2^{y-1}}(x)$. 24 | 25 | 现在只要证明$g^{2^{y-1}}(x)\in\PRF$. 26 | 27 | 由于$g(x)\in\PRF$, 所以$G(x,n)=g^n(x)\in\PRF$(由定义1.27可知$G(x,n)\in\mathcal{ITF}$, 而$\mathcal{ITF}=\PRF$). 所以只要证明$$F(y)=\begin{cases} 28 | 2^{y-1},&y>0\\ 29 | 1,&y=0, 30 | \end{cases}$$ 31 | 32 | $F(y)\in\PRF$即可. 33 | 而$$F(y)=\left\lfloor\frac{2^yN^2(y)+2N(y)}{2}\right\rfloor,$$ 34 | 35 | 所以$F(y)\in\PRF$. 36 | 综上, $f\in\PRF$. 37 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.18.tex: -------------------------------------------------------------------------------- 1 | \problem{设$k\in\mathbb{N}^+$, 函数$f:\mathbb{N}^k\to\mathbb{N}$和$g:\mathbb{N}^k\to\mathbb{N}$仅在有穷个点取不同值, 证明: $f$为递归函数当且仅当$g$为递归函数.} 2 | \begin{proof} 3 | 根据对称性, 只要证明$f$为递归函数可以推出$g$为递归函数即可. 4 | 5 | 由于$f$和$g$仅在有穷个点取不同值, 这些取不同值的点构成一个有穷的集合, 记为$\mathcal{S}$, 这样, $f(\vec{x})\neq g(\vec{x})$当且仅当$\vec{x}\in\mathcal{S}$, $f(\vec{x})=g(\vec{x})$当且仅当$\vec{x}\in\mathbb{N}^k-\mathcal{S}$. 6 | 7 | 设$\mathcal{S}$有$k$个元素, 那么其可表示为$\mathcal{S}=\{\vec{x}_1,\vec{x}_2,\cdots,\vec{x}_k\}$, 那么, 有 8 | $$g(\vec{x})=f(\vec{x})(\prod_{i=1}^k \eq(\vec{x},\vec{x}_i))+\sum_{i=1}^k N(\eq(\vec{x},\vec{x}_i))g(\vec{x}_i)$$ 9 | 上式中,$\eq$被扩展为$\mathbb{N}^a\times\mathbb{N}^a\to\mathbb{N}$的函数, 这不影响其依然是初等函数, 因为可以表示成 10 | $$N^2(\sum_{i=1}^a \eq(P^a_i(\vec{x}), P^a_i(\vec{x}_i))).$$ 11 | 12 | 因此, 若$f\in\GRF$, 即可得到$g\in\GRF$. 13 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.19.tex: -------------------------------------------------------------------------------- 1 | \problem{证明:$$f(n)=\left\lfloor\left(\frac{\sqrt{5}+1}{2}\right)n\right\rfloor$$为初等函数.} 2 | \begin{proof} 3 | 因为$\frac{\sqrt{5}+1}{2}\leqslant 2$, 所以$f(n)\leqslant 2n$, 也就是说 4 | $$f(n)=\max x\leqslant 2n. \left[x\leqslant \left(\frac{\sqrt{5}+1}{2}\right)n\right]$$ 5 | 6 | 即在$[0,2n]$内不大于$\left(\frac{\sqrt{5}+1}{2}\right)$的最大自然数. 7 | $$\begin{aligned} 8 | x&\leqslant \left(\frac{\sqrt{5}+1}{2}\right)n\\ 9 | \Leftrightarrow &2x\leqslant (\sqrt{5}+1)n\\ 10 | \Leftrightarrow &2x-n\leqslant \sqrt{5}n\\ 11 | \Leftrightarrow &4x^2-4xn+n^2\leqslant 5n^2\\ 12 | \Leftrightarrow &x^2-xn-n^2\leq 0\\ 13 | \Leftrightarrow &x^2\dotdiv xn\dotdiv n^2 = 0 14 | \end{aligned}$$ 15 | 16 | 所以$f(n)=\max x\leqslant 2n.[N^2(x^2\dotdiv xn\dotdiv n^2)]\in\EF$. 17 | \end{proof} 18 | \iffalse 19 | \subsubsection{$f(n)=\left\lfloor\left(\frac{\sqrt{5}+1}{2}\right)^n\right\rfloor\in\EF.$} 20 | 依照宋公的说法, 题目本来是$f(n)=\left\lfloor\left(\frac{\sqrt{5}+1}{2}\right)^n\right\rfloor$的, 以下给出证明: 21 | \begin{proof} 22 | 因为$\frac{\sqrt{5}+1}{2}\leqslant 2$, 所以$f(n)\leqslant 2^n$, 也就是说 23 | $$f(n)=\max x\leqslant 2^n. \left[x\leqslant \left(\frac{\sqrt{5}+1}{2}\right)^n\right]$$ 24 | $$\begin{aligned} 25 | x&\leqslant \left(\frac{\sqrt{5}+1}{2}\right)^n\\ 26 | \Leftrightarrow &2^nx\leqslant (\sqrt{5}+1)^n\\ 27 | \Leftrightarrow &2^{2n}x^2\leqslant (\sqrt{5}+1)^{2n}\\ 28 | \Leftrightarrow &2^{2n}x^2\leqslant \sum_{i=0}^{2n}{2n \choose i}(\sqrt{5})^{2n-1} 29 | \end{aligned}$$ 30 | 而 31 | $$\sum_{i=0}^{2n}{2n \choose i}(\sqrt{5})^{2n-1}=\sum_{i=0}^{n} {2n \choose 2i} 5^{n-i}+\sum_{i=0}^{n-1}{2n \choose 2i+1}5^{n-i-1}\cdot \sqrt{5}$$ 32 | 令$g_1(n)=\sum_{i=0}^{n} {2n \choose 2i} 5^{n-i}$, $g_2(n)=\sum_{i=0}^{n-1}{2n \choose 2i+1}5^{n-i-1}$, 易证$g_1,g_2\in\EF$. 33 | 34 | 故需要证明$2^{2n}x^2\leqslant g_1(n)+g_2(n)\cdot\sqrt{5}$是初等数论谓词. 35 | $$\begin{aligned} 36 | 2^{2n}x^2&\leqslant g_1(n)+g_2(n)\cdot\sqrt{5}\\ 37 | \Rightarrow (2^{2n}x^2-g_1(n))^2\leqslant (g_1(n))^2\cdot 5 38 | \end{aligned}$$ 39 | \end{proof} 40 | \fi -------------------------------------------------------------------------------- /ch01/1.20.tex: -------------------------------------------------------------------------------- 1 | \problem{证明:$\mathrm{Ack}(4,n)\in\PRF-\EF$, 其中$\mathrm{Ack}(x,y)$是Ackermann函数.} 2 | \begin{proof} 3 | 记$f(n)=\mathrm{Ack}(4,n)+3=\underbrace{2^{\cdot^{\cdot^{\cdot 2}}}}_{n+3\text{个}2}$. 4 | 5 | 令$g(x,y)=2^y$, 那么有$f(0)=2^{2^2},f(n+1)=g(n,f(n))$, 即$f=\mathrm{Prim}^0[2^{2^2},g]$, 6 | 因为$g\in\PRF$, 所以$f\in\PRF$, 自然$\mathrm{Ack}(4,n)\in\PRF$. 7 | 8 | 假设$f\in\EF$, 那么对于$\EF$的控制函数$G(k,x)=\underbrace{2^{2^{\cdot^{\cdot^{\cdot 2^x}}}}}_{k\text{个}2}$, 存在$k\in\mathbb{N}$使得$$\forall x\in\mathbb{N}.f(x)\leqslant G(k,x)$$. 9 | 10 | 然而, 令$x=2k$, 就有 11 | $$f(2k)=\underbrace{2^{\cdot^{\cdot^{\cdot 2}}}}_{(2k+3)\text{个}2}=G(k,\underbrace{2^{\cdot^{\cdot^{\cdot 2}}}}_{k+3\text{个}2})>G(k,2k)=G(k,x),$$ 12 | 矛盾, 故$f\notin\EF$. 13 | 14 | 而且, $\underbrace{2^{\cdot^{\cdot^{\cdot 2}}}}_{(2k+3)\text{个}2}-\underbrace{2^{\cdot^{\cdot^{\cdot 2k}}}}_{(k+1)\text{个}2}$在$k=0$时最小, 此时的值也大于3, 因此$\mathrm{Ack}(4,n)\notin\EF$. 15 | 16 | 综上, $\mathrm{Ack}(4,n)\in\PRF-\EF$. 17 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.21.tex: -------------------------------------------------------------------------------- 1 | \problem{设$f:\mathbb{N}\to\mathbb{N}$,$f$为单射(1-1)且满射(onto), 证明:$f\in\GRF\Leftrightarrow f^{-1}\in\GRF$.} 2 | \begin{proof} 3 | $f^{-1}(y)$的值是使得$f(x)=y$的$x$值, 因为$f$为单射, 这样的$x$值是唯一的, 因此 4 | $$f^{-1}(y)=\mu x.[f(x)\ddot{-}y]$$ 5 | 6 | 由于$f$是满射, 因此$\forall y\in\mathbb{N}. \exists x\in\mathbb{N}. f(x)\ddot{-}y=0$, 7 | 所以$F(x,y)=f(x)\ddot{-}y$是正则的. 8 | 9 | $\GRF$对正则$\mu$-算子封闭, 因此$f\in\GRF\Rightarrow f^{-1}\in\GRF$. 10 | 11 | 因为$f$为单射且满射, 所以$f^{-1}$也是单射且满射, 且$(f^{-1})^{-1}=f$, 所以$f^{-1}\in\GRF\Rightarrow f\in\GRF$. 12 | 13 | 综上, $f\in\GRF\Leftrightarrow f^{-1}\in\GRF$. 14 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.22.tex: -------------------------------------------------------------------------------- 1 | \problem{设$p(x)$为整系数多项式, 令$f:\mathbb{N}\to\mathbb{N}$定义为$f(a)=p(x)-a$对于$x$的非负整数根, 证明: $f\in\RF$.} 2 | \begin{proof} 3 | 令$p(x)=a_nx^n+\cdots+a_1x+a_0, \mathcal{P}=\{i|a_i>0\}, \mathcal{N}=\{i|a_i<0\}$, 有 4 | $$|p(x)-a|=\sum_{i\in\mathcal{P}} |a_i|x^i \ddot{-} \left(a+\sum_{i\in\mathcal{N}} |a_i|x^i\right)$$ 5 | 6 | 此时$\ddot{-}$两边的式子都是正整系数多项式, 因此$|p(x)-a|\in\EF$. 7 | 8 | 而$f=\mu x.[|p(x)-a|]$, 即$f(a)$是让$|p(x)-a|=0$的最小解\footnote{题目中只是说明了$f(a)$对于$x$的非负整数根, 但$f(a)$的非负整数根可能不止一个, 此题可能有些问题.}($|p(x)-a|$处处有定义). 9 | 10 | 所以$f\in\RF$. 11 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.23.tex: -------------------------------------------------------------------------------- 1 | \problem{设 2 | $$f(x)=\protect\begin{cases} 3 | x/y,&\textrm{若}y\neq 0\textrm{且}y\mid x,\\ 4 | \uparrow,&\textrm{否则.} 5 | \protect\end{cases}$$证明:$f\in\RF$.} 6 | \begin{proof} 7 | 可以看出,$f(x)$是使得$ay=x$成立的$a$, 且要求$y\neq 0$时才有定义, 故 8 | $$f(x)=\mu a.[(x\ddot{-}ay)+N(y)]$$ 9 | 10 | 所以$f\in\RF$. 11 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.24.tex: -------------------------------------------------------------------------------- 1 | \problem{设$g:\mathbb{N}\to\mathbb{N}$满足: 2 | $$\protect\begin{aligned} 3 | g(0)&=0,\\ 4 | g(1)&=1,\\ 5 | g(n+2)&=\rs((2002g(n+1)+2003g(n)),2005), 6 | \protect\end{aligned} 7 | $$(1) 试求$g(2006)$, (2) 证明$g\in\EF$.} 8 | \begin{proof} 9 | 先考虑这么一个数列:$a_1=0,a_2=1,a_{n+2}=2002a_{n+1}+2003a_{n}$. 10 | 11 | 我们希望把上面的递推式改写成$a_{n+2}-ba_{n+1}=c(a_{n+1}-ba_n)$的形式, 那么需要得到合适的$b,c$使得$b+c=2002,-bc=2003$. 12 | 13 | 根据韦达定理\footnote{一元二次方程$ax^2+bx+c=0(a\neq 0)$的两个根$x_1,x_2$满足$x_1+x_2=-\frac{b}{a}, x_1x_2=\frac{c}{a}$.}, 上式中的$b,c$是方程$x^2-2002x+2003=0$的两个根, 解得其两个根为-1和2003. 14 | 15 | 有$a_{n+2}+a_{n+1}=2003(a_{n+1}+a_n)$且$a_{n+2}-2003a_{n+1}=-(a_{n+1}-2003a_n)$, 16 | 那么有$a_{n+1}+a_{n}=2003^{n-1}(a_2+a_1)=2003^{n-1}$且$a_{n+1}-2003a_n=(-1)^{n-1}(a_2-2003a_1)=(-1)^{n-1}$, 联立解得: 17 | $$a_n=\frac{2003^{n-1}-(-1)^{n-1}}{2004}$$ 18 | 19 | \textbf{现在证明}$g(n)\equiv a_{n+1}\pmod{2005}$. 20 | 21 | 当$n=0,1$时, 显然成立. 22 | 23 | 假设当$n\leqslant k(k\geqslant 1)$时命题成立, 那么$g(k)\equiv a_{k+1}\pmod{2005}, g(k-1)\equiv a_{k}\pmod{2005}$. 24 | 25 | 当$n=k+1$时, $g(k+1)=\rs((2002g(k)+2003g(k-1)),2005)$, 显然$g(k+1)\equiv (2002g(k)+2003g(k-1))\pmod{2005}$. 26 | 27 | 由于$g(k)\equiv a_{k+1}\pmod{2005}$, 可得$2002g(k)\equiv 2002a_{k+1}\pmod{2005}$.\footnote{$a\equiv b\pmod{m}\Rightarrow an\equiv bn\pmod{m}, \forall n\in \mathbb{Z}.$} 28 | 29 | 由于$g(k-1)\equiv a_{k}\pmod{2005}$, 可得$2003g(k-1)\equiv 2003a_{k}\pmod{2005}$. 30 | 31 | 所以$2002g(k)+2003g(k-1)\equiv 2002a_{k+1}+2003a_k\pmod{2005}$.\footnote{$a\equiv b\pmod{m},c\equiv d\pmod{m}\Rightarrow a\pm c\equiv b\pm d\pmod{m}.$} 32 | 33 | 所以$g(k+1)\equiv 2002a_{k+1}+2003a_k\pmod{2005}$,\footnote{$a\equiv b\pmod{m},b\equiv c\pmod{m}\Rightarrow a\equiv c\pmod{m}.$} 即$g(k+1)\equiv a_{k+2}\pmod{2005}$成立. 34 | 35 | 由数学归纳法得, 命题成立. 36 | 37 | 故$$\begin{aligned} 38 | g(n)&=\rs(a_{n+1},2005)\\ 39 | &=\rs(\frac{2003^n-(-1)^n}{2004},2005)\\ 40 | &=\rs(\frac{2003^n+1}{2004}\rs(n,2)+\frac{2003^n-1}{2004}N(\rs(n,2)),2005), 41 | \end{aligned}$$ 所以$g\in\EF$. 42 | 43 | 现在开始求$g(2006)$. 44 | 45 | 首先$g(2006)=\rs(\frac{2003^{2006}-1}{2004}, 2005)$, 即有$\frac{2003^{2006}-1}{2004}\equiv g(2006)\pmod{2005}$. 46 | 47 | 因为$2005=5\cdot 401$, 5和401均为素数, 根据费马小定理\footnote{若$a$是一个整数, $p$是一个素数, 且$a$不是$p$的倍数, 则有$a^{p-1}\equiv 1\pmod{p}.$}, 有$2^4\equiv 1\pmod{5},2^{400}\equiv 1\pmod{401}$. 我们还有$2^{400}\equiv 1\pmod{5}$(令$a=2^{100}$由费马小定理得到). 而401和5的最小公倍数为2005, 故$2^{400}\equiv 1\pmod{2005}$.\footnote{设$m_1,m_2,\cdots,m_n$的最小公倍数为$[m_1,m_2,\cdots,m_n]$, 且$\forall i=1,2,\cdots,n. a\equiv b\pmod{m_i}$, 则有$a\equiv b\pmod{[m_1,m_2,\cdots,m_n]}$}. 48 | 49 | 因为$m\mid(m-a)^2-a^2$, 所以$(m-a)^2 \equiv a^2\pmod{m}$. 也就是说, $2003^2\equiv 2^2\pmod{2005},2004^2\equiv 1^2\pmod{2005}$. 那么$2003^{2006}\equiv 2^{2006}\pmod{2005}$.\footnote{$a\equiv b\pmod{m}\Rightarrow a^n\equiv b^n\pmod{m}$.} 50 | 51 | 那么, $\frac{2003^{2006}-1}{2004}\cdot 2004^2 \equiv g(2006)\cdot 1\pmod{2005}$.\footnote{$a\equiv b\pmod{m},c\equiv d\pmod{m}\Rightarrow ac\equiv bd\pmod{m}.$}即$(2003^{2006}-1)\cdot 2004\equiv g(2006)\pmod{2005}$. 52 | 53 | 而$(2003^{2006}-1)\cdot 2004\equiv (2^{2006}-1)\cdot 2004\pmod{2005}$. 54 | 55 | 又因为$2^{400}\equiv 1\pmod{2005}$, 所以$2^{2000}\equiv 1\pmod{2005}, 2^{2006}\equiv 2^6\pmod{2005}$. 所以$(2^{2006}-1)\cdot 2004\equiv (2^6-1)\cdot 2004 \pmod{2005}$. 于是我们得到$g(2006)\equiv (2^6-1)\cdot 2004\pmod{2005}$, 只要计算$(2^6-1)\cdot 2004$除以2005的余数即可得到$g(2006)$. 56 | 57 | 而$2004\equiv -1\pmod{2005}$, 所以$63\cdot 2004\equiv -63\pmod{2005}$, 所以$63\cdot 2004\equiv -63+2005\pmod{2005}$, 所以$g(2006)= 2005 - 63 = 1942$. 58 | 59 | \end{proof} -------------------------------------------------------------------------------- /ch01/1.25.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huanght1997/IntroComputationModel/7c441f51092994f962e4983f6cbee82c7d867117/ch01/1.25.pdf -------------------------------------------------------------------------------- /ch01/1.25.tex: -------------------------------------------------------------------------------- 1 | \problem{设$f:\mathbb{N}\to\mathbb{N}$定义为$$f(n)=\pi\text{的十进制展开式中第}n\text{位数字}.$$ 2 | 例如$f(0)=3,f(1)=1,f(2)=4$. 证明: $f\in\GRF$.} 3 | \begin{proof} 4 | 由Hutton's Formula\footnote{实际上, 类似Hutton's Formula的公式还有许多, 应用最广泛的是梅钦公式(Machin's Formula), 这一类公式因此也被称为类梅钦公式(Machin-like Formulas), 详见\texttt{http://mathworld.wolfram.com/Machin-LikeFormulas.html}}知, $\frac{\pi}{4}=2\arctan(\frac13)+\arctan(\frac17)$. 5 | 6 | 而$$\arctan x=\int_0^x\frac{1}{1+t^2}\mathrm{d}t,$$ 7 | 8 | $\frac{1}{1+t^2}$应用牛顿广义二项式定理\footnote{$(x+y)^{\alpha }=\sum _{{k=0}}^{\infty }\binom{\alpha}{k}x^{{\alpha -k}}y^{k}. $其中$\binom{\alpha}{k}=\frac{\alpha(\alpha-1)\cdots(\alpha-k+1)}{k!}$}展开, $k=n$之后的项利用等比数列求和公式, 得到: $$\frac{1}{1+t^2}=\sum_{i=0}^n[(-1)^ix^{2i}]+\frac{(-1)^{n+1}x^{2n+2}}{1+x^2}$$ 9 | 10 | 因此\begin{align*} 11 | \arctan x &=\sum_{i=0}^n (-1)^i \int_0^xt^{2i}\mathrm{d}t+\int_0^x\frac{(-1)^{n+1}}{1+t^2}t^{2n+2}\mathrm{d}t\\ 12 | &=\sum_{i=0}^n(-1)^i\frac{x^{2i+1}}{2i+1}+\int_0^x\frac{(-1)^{n+1}}{1+t^2}t^{2n+2}\mathrm{d}t\tag{*} 13 | \end{align*} 14 | 15 | 为了让余项为正且估计更加精确, 在(*)中取$n=2k+1$. 16 | 17 | \begin{align*} 18 | \pi &= 8\arctan(\frac{1}{3})+4\arctan(\frac{1}{7})\\ 19 | &=8\sum_{i=0}^{2k+1}(-1)^i\frac{1}{(2i+1)3^{2i+1}}+8\int_0^{\frac{1}{3}}\frac{t^{4k+4}}{1+t^2}\mathrm{d}t\\ 20 | &+4\sum_{i=0}^{2k+1}(-1)^i\frac{1}{(2i+1)7^{2i+1}}+4\int_0^{\frac{1}{7}}\frac{t^{4k+4}}{1+t^2}\mathrm{d}t 21 | \end{align*} 22 | 23 | 令 24 | \begin{align*} 25 | t_k &=8\sum_{i=0}^{2k+1}(-1)^i\frac{1}{(2i+1)3^{2i+1}}+4\sum_{i=0}^{2k+1}(-1)^i\frac{1}{(2i+1)7^{2i+1}}\\ 26 | r_k &=8\int_0^{\frac{1}{3}}\frac{t^{4k+4}}{1+t^2}\mathrm{d}t+4\int_0^{\frac{1}{7}}\frac{t^{4k+4}}{1+t^2}\mathrm{d}t\\ 27 | &\leqslant8\int_0^{\frac{1}{3}}t^{4k+4}\mathrm{d}t+4\int_0^{\frac{1}{7}}t^{4k+4}\mathrm{d}t\\ 28 | &=8\cdot \frac{1}{3^{4k+5}\cdot (4k+5)}+4\cdot\frac{1}{7^{4k+5}\cdot(4k+5)}\\ 29 | &< 8\cdot\frac13\cdot\frac{1}{3^{4k+4}}+4\cdot\frac17\cdot\frac{1}{7^{4k+4}}\leqslant \frac{1}{3^{4k}}\leqslant \frac{1}{80^k} 30 | \end{align*} 31 | 32 | 于是$\pi=t_k+r_k$, 且$01$, $N^k\onestepbeta N^{k+1}$, 因此每次做$\beta$-归约一次, 得到的式子都包含$NN$这个有$\beta$-可约式, 永远都无法归约得到$\bnf$. 所以$(\lambda x.xxx)(\lambda x.xxx)$没有$\bnf$. 10 | \end{proof} -------------------------------------------------------------------------------- /ch03/3.04.tex: -------------------------------------------------------------------------------- 1 | \problem{设$F\in\Lambda$呈形$\lambda x.M$, 证明:\\ 2 | (1) $\lambda z.Fz\equivbeta F$;\\ 3 | (2) $\lambda z.yz\neq_\beta y$. \\ 4 | 注意, 对于一般的$F$, $\lambda z.Fz\neq_\beta F$, 但$\lambda z.Fz=_{\eta} F$.} 5 | \begin{proof} 6 | $\lambda z.Fz\equiv \lambda z.(\lambda x.M)z\equivbeta \lambda z.M[x:=z]\equiv M$. 7 | 8 | $\lambda z.yz$本身已是$\bnf$, 其无法$\beta$-归约到$y$. 9 | \end{proof} -------------------------------------------------------------------------------- /ch03/3.05.tex: -------------------------------------------------------------------------------- 1 | \problem{证明二元不动点定理: 对于任何$F,G\in\Lambda$, 存在$X,Y\in\Lambda$, 满足$$FXY=X,$$ $$GXY=Y.$$} 2 | \begin{proof} 3 | 首先, 根据不动点定理, 存在$Y$使得$GXY=Y$, 这可以表示为$Y=\mathbf{Y}(GX)$, $\mathbf{Y}$为不动点组合子. 4 | 5 | 那么现在只要证明, 对于任何$F,G\in\Lambda$, 存在$X\in\Lambda$, 满足$FX(\mathbf{Y}(GX))=X$. 6 | 7 | 而 $FX(\mathbf{Y}(GX))=X\Rightarrow (\lambda x.Fx(\mathbf{Y}(Gx)))X=X$ (根据($\beta),(\sigma),(\tau$)), 于是$$X=\mathbf{Y}(\lambda x.Fx\mathbf{Y}(Gx)).$$ 8 | 9 | 也就是说, 令 10 | 11 | \begin{align*} 12 | X=&\mathbf{Y}(\lambda x.Fx(\mathbf{Y}(Gx))),\\ 13 | Y=&\mathbf{Y}(G\mathbf{Y}(\lambda x.Fx(\mathbf{Y}(Gx)))) 14 | \end{align*} 15 | 16 | 就可以让任何$F,G\in\Lambda$满足$FXY=X, GXY=Y$. 17 | \end{proof} -------------------------------------------------------------------------------- /ch03/3.06.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: 对任何$M,N\in\Lambdaclosed$, 方程$xN=Mx$对于$x$有解.} 2 | \begin{proof} 3 | 令$x$呈形$\lambda a. B$, 那么有$xN=B$成立, 问题可转化为$B=M\lambda a. B$对$B$有解. 4 | $$B=M(\lambda a. B)\Rightarrow B=(\lambda b.M(\lambda a. b)) B.$$ 5 | 6 | 令$\mathbf{Y}$为不动点组合子, 那么$B=\mathbf{Y}(\lambda b.M(\lambda a.b))$. 7 | 8 | 因此$x$有解, $x=\lambda c.\mathbf{Y}(\lambda b.M(\lambda a.b))$可使等式$xN=Mx$成立. 9 | \end{proof} -------------------------------------------------------------------------------- /ch03/3.07.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: 对任何$P,Q\in\Lambda$, 若$P\manystepbeta Q$, 则存在$n\geq 0$以及$P_0,\cdots,P_n\in\Lambda$,满足\\ 2 | (1) $P\equiv P_0$;\\ 3 | (2) $Q\equiv P_n$;\\ 4 | (3) 对任何$i0$ 都成立. 31 | \end{proof} -------------------------------------------------------------------------------- /ch03/3.20.tex: -------------------------------------------------------------------------------- 1 | \problem{构造$F\in\Lambdaclosed$使得对于任何$n\in\mathbb{N}$, 2 | $$F\churchnumber{n}\equivbeta\churchnumber{2^n}.$$} 3 | \begin{solution} 4 | $$F\equiv \lambda x.Dx\churchnumber{1}(\mathrm{Exp}\churchnumber{2}x).$$ 5 | \end{solution} -------------------------------------------------------------------------------- /ch03/3.21.tex: -------------------------------------------------------------------------------- 1 | \problem{设$f,g:\mathbb{N}\to\mathbb{N}, f=\mathrm{Itw}[g]$, 即 2 | $$\protect\begin{aligned} 3 | f(0)&=0,\\ 4 | f(n+1)&=g(f(n)), 5 | \protect\end{aligned}$$ 6 | 且$G\in\Lambdaclosed$ $\lambda$-定义函数$g$. 试求$F\in\Lambdaclosed$使得$F$ $\lambda$-定义函数$f$.} 7 | \begin{proof} 8 | \[ 9 | \begin{array}{rcl} 10 | F\churchnumber{n} & = & D\churchnumber{n}\churchnumber{0} 11 | G[F(\mathrm{pred} \churchnumber{n})] \\ 12 | &= & 13 | \{ \lambda n. Dn\churchnumber{0} 14 | G[F(\mathrm{pred}\quad n)] \} \churchnumber{n} \\ 15 | & = & 16 | \{ (\lambda fn. 17 | \mathrm{D}n\churchnumber{0} 18 | G[f(\mathrm{pred}\quad n)]) F \} \churchnumber{n}. \\ 19 | \end{array} 20 | \] 21 | 22 | $F\equiv \mathbf{Y}(\lambda xy. 23 | \mathrm{D}y\churchnumber{0} 24 | G[x(\mathrm{pred}\quad y)])$ $\lambda$-定义函数$f$. 25 | \end{proof} -------------------------------------------------------------------------------- /ch03/3.22.tex: -------------------------------------------------------------------------------- 1 | \problem{证明引理3.39.} 2 | 3 | 引理3.39表述为: 4 | 5 | 存在一般递归函数$\mathrm{var,app,abs,num}:\mathbb{N}\to\mathbb{N}$使得: 6 | \begin{enumerate}[label=(\arabic*)] 7 | \item $\forall n\in\mathbb{N}. \mathrm{var}(n)=\sharp (v^{(n)});$\label{def:var} 8 | \item $\forall M, N\in \Lambda. \mathrm{app}(\sharp M,\sharp N)=\sharp (MN);$\label{def:app} 9 | \item $\forall x\in\nabla, M\in\Lambda. \mathrm{abs}(\sharp x, \sharp M) = \sharp(\lambda x. M);$]\label{def:abs} 10 | \item $\forall n\in\mathbb{N}. \mathrm{num}(n)=\sharp\churchnumber{n}.$\label{def:num} 11 | \end{enumerate} 12 | 13 | \begin{proof} 14 | 只要函数$[x,y]$是一般递归函数, 那么由定义3.36可以得到\ref{def:var},\ref{def:app},\ref{def:abs}正确. 15 | 16 | 对于\ref{def:num}, 17 | $$\begin{aligned} 18 | \mathrm{num}(n)&=\sharp\churchnumber{n}\\ 19 | &=\sharp(\lambda fx.f^nx)\\ 20 | &=\sharp(\lambda f(\lambda x.f^nx))\\ 21 | &=[2,[\sharp f, \sharp (\lambda x.f^nx)]]\\ 22 | &=[2,[\sharp f, [2, [\sharp x, \sharp (f^nx)]]]], 23 | \end{aligned}$$ 24 | 25 | $\sharp f, \sharp x$应用\ref{def:var}, $\sharp (f^nx)$还应用\ref{def:app}之后, 可知$\mathrm{num}(n)$也是一般递归函数. 26 | \end{proof} -------------------------------------------------------------------------------- /ch03/3.23.tex: -------------------------------------------------------------------------------- 1 | \problem{证明定理3.41的证明过程中提到的$\lambda$-项$B$的存在性.} 2 | \begin{proof} 3 | We can compute $\mathbf{min}$ by a recursive procedure that keeps a table of variable substitution, 4 | and log the minimum unused number in each abstraction operation (very complicated, though). 5 | Since every function in $\PRF$ can be represented in $\lambda$-calculus, 6 | $\mathbf{min}\in\Lambdaclosed$ exists. 7 | Also, we have $\mathbf{minus}\in\Lambdaclosed$ such that 8 | $\mathbf{minus}\churchnumber{x}\churchnumber{y} = 9 | \churchnumber{|x-y|}$. Therefore, let 10 | \[ 11 | B = \lambda fxyz. \mathbf{D}(\mathbf{minus} (\mathbf{min}y) (\mathbf{min}z))x(fz), 12 | \] 13 | $F_{[\churchnumber{x}\mapsto x]} \equivbeta BFx\churchnumber{x}$ 14 | is achieved. 15 | 16 | 17 | 18 | \end{proof} -------------------------------------------------------------------------------- /ch03/3.24.tex: -------------------------------------------------------------------------------- 1 | \problem{构造$H\in\Lambdaclosed$, 使得对于任意$n\in\mathbb{N}, x_1,\cdots, x_n\in\Lambda$, 有$$H\churchnumber{n}x_1\cdots x_n\equivbeta \lambda z.zx_1\cdots x_n.$$} 2 | \begin{proof} 3 | 可知我们需要找到$H$使得$H\churchnumber{n}=\lambda x_1x_2\cdots x_nz. zx_1\cdots x_n$. 4 | 我们可以令$M_n=\lambda x_1x_2\cdots x_nz. zx_1\cdots x_n$, 那么其编码$g(n)=\sharp M_n=[2,[\sharp x_1, \sharp (\lambda x_2\cdots x_n.zx_1\cdots x_n)]]$, 而$\sharp (zx_1\cdots x_n)$是递归的, 因此$g$是递归的. 设$G\in\Lambdaclosed$ $\lambda$-定义了$g$, 从而$G\churchnumber{n}\equivbeta\churchnumber{M_n}$, 因此 5 | $$E(G\churchnumber{n})\equivbeta E\churchnumber{M_n}\equivbeta M_n$$ 6 | 7 | 取$H\equiv \lambda x.E(Gx)$即可. 8 | \end{proof} -------------------------------------------------------------------------------- /ch03/3.25.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: 存在$H_2\in\Lambdaclosed$, 使得对于任意$F\in\Lambda$, 有$$H_2\churchnumber{F}\equivbeta F\churchnumber{H_2\churchnumber{F}}.$$} 2 | \begin{proof} 3 | 由定理3.41可知, 存在枚举子$E\in\Lambdaclosed$, 使得对于任何$M\in\Lambdaclosed$, 有$E\churchnumber{M}\equivbeta M$. 4 | 5 | 令$A=\lambda xy.Ey(\churchnumber{xxy})$, $H_2=AA$, 那么有 6 | 7 | \begin{align*} 8 | H_2\churchnumber{F}&\equiv AA\churchnumber{F}\\ 9 | &\equivbeta E\churchnumber{F}(\churchnumber{AA\churchnumber{F}})\\ 10 | &\equivbeta F(\churchnumber{AA\churchnumber{F}})\\ 11 | &\equiv F\churchnumber{H_2\churchnumber{F}} 12 | \end{align*} 13 | 14 | 因此, 我们找到了使命题成立的$H_2$, 证毕. 15 | \end{proof} -------------------------------------------------------------------------------- /ch04/4.01.tex: -------------------------------------------------------------------------------- 1 | \problem{求$\lambda^{*}xy.xyy$.} 2 | \begin{solution} 3 | 4 | \end{solution} -------------------------------------------------------------------------------- /ch04/4.02.tex: -------------------------------------------------------------------------------- 1 | \problem{令$C\in\mathbb{C}$定义为$$C\equiv S(BBS)(KK).$$ 证明: 对于任意的$X,Y,Z\in\mathbb{C}, CXYZ=XZY$.} 2 | \begin{proof} 3 | \end{proof} -------------------------------------------------------------------------------- /ch04/4.03.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: 若$xP_1\cdots P_m =_{\mathbf{w}} yQ_1\cdots Q_n$, 则$x\equiv y,m\equiv n$, 而且对于任意$i\leq m$, 有$P_i=_{\mathbf{w}}Q_i$.} 2 | \begin{proof} 3 | \end{proof} -------------------------------------------------------------------------------- /ch04/4.04.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: $P=_{\mathbf{w}}Q$当且仅当$\mathrm{CL}_{\mathbf{w}}\vdash P = Q$.} 2 | \begin{proof} 3 | \end{proof} -------------------------------------------------------------------------------- /ch04/4.05.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: $(\lambda^{*}x.M)N=_{\mathbf{w}}M[x:=N].$} 2 | \begin{proof} 3 | \end{proof} -------------------------------------------------------------------------------- /ch04/4.06.tex: -------------------------------------------------------------------------------- 1 | \problem{令$B\equiv S(KS)K$, 证明: 对于任意$P,Q,R\in\mathbb{C}, BPQR=_{\mathbf{w}}P(QR)$.} 2 | \begin{proof} 3 | \end{proof} -------------------------------------------------------------------------------- /ch04/4.07.tex: -------------------------------------------------------------------------------- 1 | \problem{在$\mathrm{CL}$中, 定义$\overline{n}\equiv (SB)^n(KI)$, 其中$n\in\mathbb{N}$, $B$如习题4.6中所定义. 证明: 对于一般递归函数$\varphi:\mathbb{N}\to\mathbb{N}$, 存在组合子$\overline{\varphi}\in\mathbb{C}^{\circ}$, 使得$$\forall n\in\mathbb{N}.\bar{\varphi}\bar{n}=\overline{\varphi(n)}.$$ (此性质由Kleene教授证明)} 2 | \begin{proof} 3 | \end{proof} -------------------------------------------------------------------------------- /ch04/4.08.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: 对于任意$P,Q\in\mathbb{C}$, 若$P=_{\mathbf{w}}Q$, 则$P_{\lambda}\equivbeta Q_{\lambda}$.} 2 | \begin{proof} 3 | \end{proof} -------------------------------------------------------------------------------- /ch04/4.09.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: $(SKK)_{\lambda}\equivbeta \lambda x.x.$} 2 | \begin{proof} 3 | \end{proof} -------------------------------------------------------------------------------- /ch04/4.10.tex: -------------------------------------------------------------------------------- 1 | \problem{证明引理4.13.} 2 | 3 | 引理4.13表述为: 4 | 5 | 设$M,N\in\Lambda, x\in V$, 则$$(M[x:=N])_{\mathrm{CL}}\equiv M_{\mathrm{CL}}[x:=N_{\mathrm{CL}}].$$ 6 | 7 | \begin{proof} 8 | \end{proof} -------------------------------------------------------------------------------- /ch05/5.01.tex: -------------------------------------------------------------------------------- 1 | \problem{构造机器计算函数$f(x,y,z)=y$.} 2 | \begin{solution} 3 | $f(x,y,z)=y$由表\ref{tab:sol5.1}定义的机器$\machine{P^3_2}$计算: 4 | \begin{table}[!htbp] 5 | \centering 6 | \caption{机器$\machine{P^3_2}$} 7 | \label{tab:sol5.1} 8 | \begin{tabularx}{\textwidth}{Y|Y|Y} 9 | \thickhline 10 | & 0 & 1 \\ 11 | \hline 12 | 1 & $0R2$ & $0R1$ \\ 13 | \hline 14 | 2 & $0R3$ & $1R2$ \\ 15 | \hline 16 | 3 & $0L3$ & $1L4$ \\ 17 | \hline 18 | 4 & $0L4$ & $1L5$ \\ 19 | \hline 20 | 5 & $0R6$ & $1L5$ \\ 21 | \thickhline 22 | \end{tabularx} 23 | \end{table} 24 | 25 | 对于$\machine{P^3_2}$输入$1:0\underset{\uparrow}{1}^{x+1}01^{y+1}01^{z+1}0\cdots$, 输出$6:0^{x+3}\underset{\uparrow}{1}^{y+1}0\cdots$. 26 | \end{solution} -------------------------------------------------------------------------------- /ch05/5.02.tex: -------------------------------------------------------------------------------- 1 | \problem{构造机器$\machine{copy_1}$使$\machine{copy_1}|0\underset{\uparrow}{1^x}0\cdots \twoheadrightarrow 01^x0\underset{\uparrow}{1^x}0\cdots$.} 2 | \begin{solution} 3 | 表\ref{tab:sol5.2}定义了机器$\machine{copy_1}$: 4 | \begin{table}[!htbp] 5 | \centering 6 | \caption{机器$\machine{copy_1}$} 7 | \label{tab:sol5.2} 8 | \begin{tabularx}{\textwidth}{Y|Y|Y} 9 | \thickhline 10 | & 0 & 1 \\ 11 | \hline 12 | 1 & $0R6$ & $0R2$ \\ 13 | \hline 14 | 2 & $0R3$ & $1R2$ \\ 15 | \hline 16 | 3 & $1L4$ & $1R3$ \\ 17 | \hline 18 | 4 & $0L5$ & $1L4$ \\ 19 | \hline 20 | 5 & $1R1$ & $1L5$ \\ 21 | \thickhline 22 | \end{tabularx} 23 | \end{table} 24 | 25 | 输入时状态为1,输出时状态为6. 26 | \end{solution} -------------------------------------------------------------------------------- /ch05/5.03.tex: -------------------------------------------------------------------------------- 1 | \problem{构造机器计算函数$f(x,y)=x\times y$.} 2 | \begin{solution} 3 | $f(x,y)=x\times y$由表\ref{tab:sol5.3}定义的机器$\machine{mul}$计算: 4 | \begin{table}[!htbp] 5 | \centering 6 | \caption{机器$\machine{mul}$} 7 | \label{tab:sol5.3} 8 | \begin{tabularx}{\textwidth}{Y|Y|Y} 9 | \thickhline 10 | & 0 & 1 \\ 11 | \hline 12 | 1 & & $0R2$ \\ 13 | \hline 14 | 2 & $0R14$ & $0R3$ \\ 15 | \hline 16 | 3 & $0R4$ & $1R3$ \\ 17 | \hline 18 | 4 & $0R5$ & $0R5$ \\ 19 | \hline 20 | 5 & $0R16$ & $0R6$ \\ 21 | \hline 22 | 6 & $0R7$ & $1R6$ \\ 23 | \hline 24 | 7 & $1L8$ & $1R7$ \\ 25 | \hline 26 | 8 & $0L9$ & $1L8$ \\ 27 | \hline 28 | 9 & $1R5$ & $1L9$ \\ 29 | \hline 30 | 10 & $0L11$ & $1L10$ \\ 31 | \hline 32 | 11 & $0L12$ & \\ 33 | \hline 34 | 12 & $0R14$ & $1L13$ \\ 35 | \hline 36 | 13 & $0R2$ & $1L13$ \\ 37 | \hline 38 | 14 & $0R14$ & $0R15$ \\ 39 | \hline 40 | 15 & $1O18$ & $0R15$ \\ 41 | \hline 42 | 16 & $1L17$ & $1L17$ \\ 43 | \hline 44 | 17 & $0L10$ & $0L10$ \\ 45 | \thickhline 46 | \end{tabularx} 47 | \end{table} 48 | 49 | \iffalse 50 | 由于整个机器比较复杂, 下面解析一下: 51 | 状态1消去$x$的首位来到状态2. 52 | 53 | 状态2在$x$不为0时消去$x$中的1位, 来到状态3; 在$x$为0时, 跳到状态14进行消去$y$的操作. 54 | 55 | 状态3跳过代表$x$的所有位和间隔$x$和$y$的0后来到状态4. 56 | 57 | 如果状态4时发现$y$的首位未消去, 消去之, 来到状态5. 此时指向$y$的第一位. 58 | 59 | 从状态5判断$y$是否已被复制完成, 若是, 来到状态16准备下一次$y$的复制, 若$y$不为0, 则将此位标记为0, 代表准备复制此位, 转状态6. 若$y$为0, 直接视为复制完成. 60 | 61 | 状态6跳过$y$剩下的位和$y$后面的一个0后来到状态7. 62 | 63 | 状态7直接滑动到结果最后, 添上1, 复制完成, 进入状态8. 64 | 65 | 状态8直接向左滑动到结果左边, 并跳过结果前面的0, 进入状态9. 66 | 67 | 状态9往左滑到准备复制的那位, 补上1, 代表该位复制完成, 进入状态5, 此时机器指向下一位要复制的位, 重复5-9, 直到状态5读到的数为0. 此时$y$的所有位都复制完成. 68 | 69 | 先讨论状态16. 当状态5读到0后, 才会转到状态16. 这意味着状态5已经遍历了整个$y$, 来到了$y$后面的0. 此时在状态16, 指针指向$y$后面的第2个0, 写1后(首先, 这里如果已经有部分复制操作, 本来的值必为1, 不影响结果. 而如果不写1, 状态14的寻找$y$将在$y$为0时无限进行)左移1位转到状态17, 这一位是$y$后面的0, 左移1位转到状态10. 此时指向$y$的最后一位. 70 | 71 | 当$y$为0时, 左转2位到状态12, 以此经过$y$被消去的首位1和间隔的0, 到达$x$的最后一位. 当$y$不为0时, 跳过$y$到达$x$的最后一位. 72 | 73 | 当状态12读到的数为0时, $x$为0. 这意味着$x$已经耗尽, 达到了应有的将$y$复制$x$次的效果, 转状态14准备消去$y$. 否则, 往前滑动, 转状态13. 74 | 75 | 状态13向前寻找$x$的第一个1. 在发现1前面的0后, 右移1位以指向$x$的第一位1, 转状态2进行消去, 消去一次, 代表新一轮复制的开始. 76 | 77 | 状态14负责找到$y$. 在状态12和状态2因为$x$的值为0而转到状态14后, 状态14略过之后的0, 从而找到第一个1, 这个第一个1可能是$y$消去首位后的第一位, 可能是$y$为0, 导致状态5转到状态16, 使状态16写了1. 找到第一个1后, 转状态15. 78 | 79 | 状态15负责抹去$y$. 对于$y$为0的情况, 状态15将这个1抹去后在其后面一位写1, 表示结果为0. 对于$y$不为0的情况, 后面的序列是表示$y$的序列和表示结果的序列, 两者中间有1个0间隔开来, 但此时表示结果的序列仅仅是$x\times y$个1, 还需要再添加1个1. 状态15将$y$的连续1序列抹去后, 将本用来间隔的0写成1, 并指向这个位置, 便得到了结果. 80 | \fi 81 | 对于$\machine{mul}$输入$1:0\underset{\uparrow}{1}^{x+1}01^{y+1}0\cdots$, 在$y=0$时输出$18:0^{x+6}\underset{\uparrow}{1}0\cdots$, 在$y\neq 0$时输出$18:0^{x+y+4}\underset{\uparrow}{1}^{x\times y + 1}0\cdots$. 82 | \end{solution} -------------------------------------------------------------------------------- /ch05/5.04.tex: -------------------------------------------------------------------------------- 1 | \problem{构造机器计算函数$f(x)=2^x$.} 2 | \begin{solution} 3 | 由定理5.13的证明过程, 可如此构造: 4 | 5 | 令$f(x,y)=2^xy$, 令$y$恒为1, $g(x)=2x$, 即可计算$f(x)=2^x$. 6 | 7 | 首先, 构造出初始值($y$)1, 使用机器$M_1$, 定义如表\ref{tab:sol5.4m1}: 8 | \begin{table}[!htbp] 9 | \centering 10 | \caption{题5.4机器$M_1$} 11 | \label{tab:sol5.4m1} 12 | \begin{tabularx}{\textwidth}{Y|Y|Y} 13 | \thickhline 14 | & 0 & 1 \\ 15 | \hline 16 | 1 & $0R2$ & $1R1$ \\ 17 | \hline 18 | 2 & $1R3$ & \\ 19 | \hline 20 | 3 & $1L4$ & \\ 21 | \hline 22 | 4 & & $1L5$ \\ 23 | \hline 24 | 5 & $0L6$ & \\ 25 | \hline 26 | 6 & $0R7$ & $1L6$ \\ 27 | \thickhline 28 | \end{tabularx} 29 | \end{table} 30 | 31 | 易知$M_1|1:0\underset{\uparrow}{1}^{x+1}00\cdots\twoheadrightarrow7:0\underset{\uparrow}{1}^{x+1}01100\cdots$. 32 | 33 | 定义机器$M_2$为表\ref{tab:sol5.4m2}: 34 | \begin{table}[!htbp] 35 | \centering 36 | \caption{题5.4机器$M_2$} 37 | \label{tab:sol5.4m2} 38 | \begin{tabularx}{\textwidth}{Y|Y|Y} 39 | \thickhline 40 | & 0 & 1 \\ 41 | \hline 42 | 1 & & $0R2$ \\ 43 | \hline 44 | 2 & $0Ru$ & $1R3$ \\ 45 | \hline 46 | 3 & $0R4$ & $1R3$ \\ 47 | \thickhline 48 | \end{tabularx} 49 | \end{table} 50 | 51 | 易知$x>0$时$M_2|1:0\underset{\uparrow}{1}^{x+1}01100\cdots\twoheadrightarrow 4:001^{x}0\underset{\uparrow}{1}100\cdots$ (在$x=0$时输出为$u:000\underset{\uparrow}{1}100\cdots$). 52 | 53 | 令$M_3=M_2\concat \machine{double} + 3\concat \machine{compress}\concat \machine{shiftl}$, $M_4=\mathrm{repeat}M_3$, 机器$\machine{f}=M_1\concat M_4$为所求. 54 | 55 | 而整个的机器如表\ref{tab:sol5.4}所示. 56 | \begin{table}[!htbp] 57 | \centering 58 | \caption{题5.4机器$\machine{f}$} 59 | \label{tab:sol5.4} 60 | \begin{tabularx}{\textwidth}{Y|Y|Y} 61 | \thickhline 62 | & 0 & 1 \\ 63 | \hline 64 | 1 & $0R2$ & $1R1$ \\ 65 | \hline 66 | 2 & $1R3$ & \\ 67 | \hline 68 | 3 & $1L4$ & \\ 69 | \hline 70 | 4 & & $1L5$ \\ 71 | \hline 72 | 5 & $0L6$ & \\ 73 | \hline 74 | 6 & $0R7$ & $1L6$ \\ 75 | \hline 76 | 7 & & $0R8$ \\ 77 | \hline 78 | 8 & $0R27$ & $1R9$ \\ 79 | \hline 80 | 9 & $0R10$ & $1R9$ \\ 81 | \hline 82 | 10 & & $1R11$ \\ 83 | \hline 84 | 11 & $0R12$ & $1R11$ \\ 85 | \hline 86 | 12 & $1R13$ & $1R12$ \\ 87 | \hline 88 | 13 & $1R14$ & \\ 89 | \hline 90 | 14 & $0L15$ & \\ 91 | \hline 92 | 15 & $0L16$ & $1L15$ \\ 93 | \hline 94 | 16 & $0R17$ & $1L16$ \\ 95 | \hline 96 | 17 & $0R18$ & $1O10$ \\ 97 | \hline 98 | 18 & & $0R19$ \\ 99 | \hline 100 | 19 & & $1L20$ \\ 101 | \hline 102 | 20 & $1L21$ & $0R25$ \\ 103 | \hline 104 | 21 & $0R22$ & $1R20$ \\ 105 | \hline 106 | 22 & $0L23$ & $1R22$ \\ 107 | \hline 108 | 23 & & $0L24$ \\ 109 | \hline 110 | 24 & $0R19$ & $1L24$ \\ 111 | \hline 112 | 25 & $0L26$ & $1L25$ \\ 113 | \hline 114 | 26 & $0R7$ & $1L26$ \\ 115 | \thickhline 116 | \end{tabularx} 117 | \end{table} 118 | 119 | \end{solution} -------------------------------------------------------------------------------- /ch05/5.05.tex: -------------------------------------------------------------------------------- 1 | \problem{设机器$M_1$定义如表5.24.\\ 2 | 对于输入$\bar{x}$, 求输出.} 3 | \begin{table}[H] 4 | \centering 5 | \caption*{\textbf{表5.24}} 6 | \begin{tabularx}{\textwidth}{Y|Y|Y} 7 | \thickhline 8 | & 0 & 1 \\ 9 | \hline 10 | 1 & $0L3$ & $1R2$ \\ 11 | \hline 12 | 2 & $0L3$ & $0R1$ \\ 13 | \hline 14 | 3 & $0L3$ & $1L3$ \\ 15 | \thickhline 16 | \end{tabularx} 17 | \end{table} 18 | 19 | \begin{solution} 20 | $M_1$的操作为如果读到1, 则交替写入1和0并令被指位置向右一位, 换句话说, 把第偶数次读到的1写成0, 读到0后一直向左倒带到最左边无法读取从而停机. 因此当其输入为$\bar{x}$时, 输出为$\overline{(\underbrace{0,0,\cdots,0}_{\left\lceil \frac{x+1}{2}\right\rceil\text{个}0})}$. 21 | \end{solution} -------------------------------------------------------------------------------- /ch05/5.06.tex: -------------------------------------------------------------------------------- 1 | \problem{设机器$M_2$定义如表5.25.\\ 2 | 对于输入$(2,1):01^n01^m01^k00\cdots$, 其中$n,m,k\in\mathbb{N}^+$, 求输出.} 3 | \begin{table}[H] 4 | \centering 5 | \caption*{\textbf{表5.25}} 6 | \begin{tabularx}{\textwidth}{Y|Y|Y} 7 | \thickhline 8 | &0&1\\ 9 | \hline 10 | 1&$0R2$&$0R1$\\ 11 | \hline 12 | 2&$1R3$&$0R1$\\ 13 | \hline 14 | 3&$1R4$&\\ 15 | \hline 16 | 4&$1R5$&\\ 17 | \hline 18 | 5&$1L6$&\\ 19 | \hline 20 | 6&$0R7$&$1L6$\\ 21 | \thickhline 22 | \end{tabularx} 23 | \end{table} 24 | 25 | \begin{solution} 26 | 对于输入$(2,1):01^n01^m01^k00\cdots$, 机器$M_2$有如下计算过程: 27 | \begin{align} 28 | 1:&0\underset{\uparrow}{1}^n01^m01^k00\cdots\tag{0R1}\\ 29 | 1:&0^{n+1}\underset{\uparrow}{0}1^m01^k00\cdots\tag{0R2}\\ 30 | 2:&0^{n+2}\underset{\uparrow}{1}^{m}01^k00\cdots\tag{0R1} 31 | \end{align} 32 | 当$m=1$时, 计算过程为: 33 | \begin{align} 34 | 1:&0^{n+3}\underset{\uparrow}{0}1^k00\cdots\tag{0R2}\\ 35 | 2:&0^{n+4}\underset{\uparrow}{1}^k00\cdots\tag{0R1} 36 | \end{align} 37 | 当$m>1$时, 计算过程为: 38 | \begin{align} 39 | 1:&0^{n+3}\underset{\uparrow}{1}^{m-1}01^k00\cdots\tag{0R1}\\ 40 | 1:&0^{n+m+2}\underset{\uparrow}{0}1^k00\cdots\tag{0R2}\\ 41 | 2:&0^{n+m+3}\underset{\uparrow}{1}^k00\cdots\tag{0R1} 42 | \end{align} 43 | 44 | 此时机器都处于状态为2, 输入为$0^{n+m+3}\underset{\uparrow}{1}^k00\cdots$的时刻. 45 | 46 | 当$k=1$时, 计算过程与$m=1$时类似, 当$k>1$时, 计算过程与$m>1$时类似, 机器都会处于状态2, 输入为$0^{n+m+k+4}\underset{\uparrow}{0}0\cdots$的时刻. 接下来的计算过程为: 47 | \begin{align} 48 | 2:&0^{n+m+k+4}\underset{\uparrow}{0}0\cdots\tag{1R3}\\ 49 | 3:&0^{n+m+k+4}1\underset{\uparrow}{0}0\cdots\tag{1R4}\\ 50 | 4:&0^{n+m+k+4}11\underset{\uparrow}{0}0\cdots\tag{1R5}\\ 51 | 5:&0^{n+m+k+4}111\underset{\uparrow}{0}0\cdots\tag{1L6}\\ 52 | 6:&0^{n+m+k+4}11\underset{\uparrow}{1}10\cdots\tag{1L6}\\ 53 | 6:&0^{n+m+k+3}\underset{\uparrow}{0}11110\cdots\tag{0R7}\\ 54 | 7:&0^{n+m+k+3}\underset{\uparrow}{1}1110\cdots\tag{停} 55 | \end{align} 56 | 57 | 因此机器的输出就是$7:0^{n+m+k+3}\underset{\uparrow}{1}1110\cdots$, 即计算函数$f(x,y,z)=3$. 58 | \end{solution} -------------------------------------------------------------------------------- /ch05/5.07.tex: -------------------------------------------------------------------------------- 1 | \problem{构造机器计算函数$f(x)=\lfloor\sqrt{x}\rfloor$.} 2 | \begin{solution} 3 | 令$y=\lfloor\sqrt{x}\rfloor$, 那么有$y\leqslant \sqrt{x}0)$ 67 | 68 | 那么, 令$M_2=\machine{copy_2}^2\concat\machine{f}\concat\machine{compress}\concat M_1$, $M_3=\mathrm{repeat}M_2$, 则机器$M=M_0\concat M_3$可以计算$f(x)=\lfloor \sqrt{x}\rfloor$. 69 | \end{solution} -------------------------------------------------------------------------------- /ch05/5.08.tex: -------------------------------------------------------------------------------- 1 | \problem{设机器$\machine{f_1}$计算函数$f_1$, 机器$\machine{f_2}$计算函数$f_2$, 这里$f_1,f_2$为一元数论函数. 构造机器$\machine{f}$计算函数$f(x)=f_1(x)+f_2(x)$.} 2 | \begin{solution} 3 | $\machine{f}=\machine{copy_1}\concat \machine{f_1} \concat \machine{compress} \concat \machine{shiftl} \concat \machine{copy_2} \concat \machine{shiftr} \concat \machine{f_2} \concat\machine{compress} \concat\machine{shiftl}^2 \concat \machine{erase} \concat\machine{add}.$ 4 | \end{solution} -------------------------------------------------------------------------------- /ch05/5.09.tex: -------------------------------------------------------------------------------- 1 | \problem{设$f(x)=h(g_1(x),g_2(x),g_3(x))$, 试由机器$\machine{g_1},\machine{g_2},\machine{g_3}$和$\machine{h}$构造机器$\machine{f}$.} 2 | \begin{solution} 3 | \begin{align*} 4 | \machine{f}&=\machine{copy_1}\concat \machine{g_1} \concat \machine{compress} \concat \machine{shiftl}\\ 5 | &\concat \machine{copy_2} \concat \machine{shiftr} \concat \machine{g_2} \concat \machine{compress} \concat \machine{shiftl}^2 \\ 6 | &\concat \machine{copy_3} \concat \machine{shiftr}^2 \concat \machine{g_3} \concat \machine{compress} \concat \machine{shiftl}^3 \\ 7 | &\concat \machine{erase} \concat \machine{h}. 8 | \end{align*} 9 | 10 | \end{solution} -------------------------------------------------------------------------------- /ch05/5.10.tex: -------------------------------------------------------------------------------- 1 | \problem{设$f:\mathbb{N}\to\mathbb{N}$定义如下: 2 | $$\protect\begin{aligned} 3 | f(0)&=0,\\ 4 | f(x+1)&=g(f(x)). 5 | \protect\end{aligned}$$ 6 | 证明: 若$g$为Turing-可计算, 则$f$为Turing-可计算.} 7 | \begin{proof} 8 | 按照定理5.14的证明方式, 令$y$恒为0. 因此首先在原来的输入上添加0作为$y$, 构建机器$M_1$如表\ref{tab:sol5.10m1}: 9 | 10 | \begin{table}[!htbp] 11 | \centering 12 | \caption{题5.10机器$M_1$} 13 | \label{tab:sol5.10m1} 14 | \begin{tabularx}{\textwidth}{Y|Y|Y} 15 | \thickhline 16 | & 0 & 1 \\ 17 | \hline 18 | 1 & $0R2$ & $1R1$ \\ 19 | \hline 20 | 2 & $1L3$ & \\ 21 | \hline 22 | 3 & $0L4$ & \\ 23 | \hline 24 | 4 & $0R5$ & $1L4$ \\ 25 | \thickhline 26 | \end{tabularx} 27 | \end{table} 28 | 29 | 易知$M_1|1:0\underset{\uparrow}{1}^{x+1}0\cdots\twoheadrightarrow5:0\underset{\uparrow}{1}^{x+1}010\cdots$. 30 | 31 | 由于$g$是Turing-可计算的, 所以存在机器$\machine{g}$计算函数$g$. 32 | 33 | 构造机器$M_2$如表\ref{tab:sol5.10m2}所示: 34 | \begin{table}[!htbp] 35 | \centering 36 | \caption{题5.4机器$M_2$} 37 | \label{tab:sol5.10m2} 38 | \begin{tabularx}{\textwidth}{Y|Y|Y} 39 | \thickhline 40 | & 0 & 1 \\ 41 | \hline 42 | 1 & & $0R2$ \\ 43 | \hline 44 | 2 & $0Ru$ & $1R3$ \\ 45 | \hline 46 | 3 & $0R4$ & $1R3$ \\ 47 | \thickhline 48 | \end{tabularx} 49 | \end{table} 50 | 51 | 令$M_3=M_2\concat \machine{g}+3 \concat \machine{compress} \concat \machine{shiftl}$, 并令$\machine{f}=\mathrm{repeat}M_3$, $M=M_1\concat \machine{f}$即为能计算$f$的机器, 因此$f$为Turing-可计算. 52 | \end{proof} -------------------------------------------------------------------------------- /ch05/5.11.tex: -------------------------------------------------------------------------------- 1 | \problem{构造机器计算函数$f(x,y)=x\dotdiv y$.} 2 | \begin{solution} 3 | 基本思想: $x$和$y$每回各消去1, 直到有一个为0为止. 4 | $f(x,y)=x\dotdiv y$由表\ref{tab:sol5.11}定义的机器$\machine{sub}$计算: 5 | \begin{table}[!htbp] 6 | \centering 7 | \caption{题5.11机器$\machine{sub}$} 8 | \label{tab:sol5.11} 9 | \begin{tabularx}{\textwidth}{Y|Y|Y} 10 | \thickhline 11 | & 0 & 1 \\\hline 12 | 1 & & $0R2$ \\\hline 13 | 2 & $0R8$ & $1R3$ \\\hline 14 | 3 & $0R4$ & $1R3$ \\\hline 15 | 4 & $0R4$ & $0R5$ \\\hline 16 | 5 & $0L10$ & $1L6$ \\\hline 17 | 6 & $0L6$ & $1L7$ \\\hline 18 | 7 & $0R1$ & $1L7$ \\\hline 19 | 8 & $0R8$ & $0R9$ \\\hline 20 | 9 & $1O13$ & $0R9$ \\\hline 21 | 10 & $0L10$ & $1R11$ \\\hline 22 | 11 & $1L12$ & \\\hline 23 | 12 & $0R13$ & $1L12$ \\\hline 24 | \thickhline 25 | \end{tabularx} 26 | \end{table} 27 | 28 | 对于$\machine{sub}$输入$1:0\underset{\uparrow}{1}^{x+1}01^{y+1}0\cdots$, 在$x\leqslant y$时输出$13:0^{x+y+4}\underset{\uparrow}{1}0\cdots$, 在$x>y$时输出$13:0^{y+2}\underset{\uparrow}{1}^{x-y+1}0\cdots$. 29 | \end{solution} -------------------------------------------------------------------------------- /ch05/5.12.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: $\mathrm{Even}=\{2x:x\in\mathbb{N}\}$是Turing-可计算的.} 2 | \begin{proof} 3 | 只要能够构造出这样的机器$M$, 它满足 4 | \begin{align*} 5 | M|1:0\underset{\uparrow}{1}^{2x}0\cdots&\twoheadrightarrow u:0\cdots0\underset{\uparrow}{1}10\cdots\\ 6 | M|1:0\underset{\uparrow}{1}^{2x+1}0\cdots&\twoheadrightarrow v:0\cdots0\underset{\uparrow}{1}0\cdots 7 | \end{align*} 8 | 9 | 构造如表\ref{tab:sol5.12}所示: 10 | \begin{table}[!htbp] 11 | \centering 12 | \caption{题5.12机器$M$} 13 | \label{tab:sol5.12} 14 | \begin{tabularx}{\textwidth}{Y|Y|Y} 15 | \thickhline 16 | & 0 & 1 \\\hline 17 | 1 & $1R3$ & $0R2$ \\\hline 18 | 2 & $1O4$ & $0R1$ \\\hline 19 | 3 & $1L4$ & \\ 20 | \thickhline 21 | \end{tabularx} 22 | \end{table} 23 | \end{proof} -------------------------------------------------------------------------------- /ch05/5.13.tex: -------------------------------------------------------------------------------- 1 | \problem{证明: $S=\{a_1,a_2,\cdots,a_k\}$是Turing-可计算的.} 2 | \begin{proof} 3 | 先将$S$中的元素按照升序排列, 即$a_i0$时, $M_1|1:01^{x+1}0\cdots 0\underset{\uparrow}{1}^{y+1}0\cdots\twoheadrightarrow 9:0\underset{\uparrow}{1}^{x+2}0\cdots$ 32 | 33 | 到达$u$状态表示无论如何都停机. (可以改成$0R7$, 因为下一位肯定是1) 34 | 35 | 那么令$M_2=\machine{copy_1}\concat \machine{f}\concat M_1$, 则$M=\mathrm{repeat}M_2$为所求. 在函数$f$没有零点时, 机器$M$将永不停机. 36 | \end{proof} -------------------------------------------------------------------------------- /ch05/5.15.tex: -------------------------------------------------------------------------------- 1 | \problem{证明定理5.21中函数$g$为一般递归函数.} 2 | \begin{proof} 3 | 这里需要使用题5.17的结论. 4 | 5 | 当$m\notin S$时, 有$g(m)=0$. 6 | 7 | 否则, 可以解码出编码$m$对应的机器$M$的行数和各个行的内容. 8 | 9 | 而$M_1$计算常值函数$m$的机器可通过$\machine{Z}\concat \machine{S}^m$构造, 显然可以通过$m$由一般递归函数计算. 10 | 11 | 而$\hat{M}=M_1\concat M$, 这意味着$M$的所有行都要自加$m$, 这个映射也是一般递归的. 12 | 13 | 因此最终整个函数都是一般递归的. 14 | \end{proof} -------------------------------------------------------------------------------- /ch05/5.16.tex: -------------------------------------------------------------------------------- 1 | \problem{证明引理5.25中的函数$e(m,l)$为初等函数.} 2 | \begin{proof} 3 | 利用题5.17的结论, 由$m$可以通过一般递归函数计算每一行的内容$\sharp j$, $\sharp x$, $\sharp y$, $\sharp z$, $\sharp u$, $\sharp v$, $\sharp w$. 4 | 5 | 同时, 由$l$也可以通过一般递归函数计算纸带的编码长度$t$和纸带位置$(j,k):a_1,a_2,\cdot,a_t$. 6 | 7 | 通过循环, 比较, 分支等步骤, 可以计算出$\sharp d(a_j, k),\sharp p(a_j, k),\sharp s(a_j, k)$. 8 | 9 | 因此$e(m,l)=\langle\sharp d(a_j,k),\sharp p(a_j, k),\sharp s(a_j, k)\rangle\in\GRF$. 10 | \end{proof} -------------------------------------------------------------------------------- /ch05/5.17.tex: -------------------------------------------------------------------------------- 1 | \problem{令$S=\{\sharp M:M\text{为Turing机}\}$, 证明$S$为Turing-可计算.} 2 | \begin{proof} 3 | 这相当于用一个Turing机来解码一个数判断其是否为合法的Turing机编码. 4 | 5 | 首先确定机器的行数$k$, $k=\max a\leqslant \sharp M.P(a-1)|\sharp M$. $P(n)$代表第$n$个素数, $n$从0开始计数, 即$P(0)=2, P(1)=3, P(2)=5, \cdots$. 6 | 7 | 然后是每一行的编码, $r_i=\ep(i,\sharp M)$. 8 | 9 | 然后是对行内的元素进行解码, 对于机器的一行$\begin{array}{|c|c|c|}\hline j&xyz&uvw\\\hline\end{array}$, 可得 10 | 11 | $$\sharp j = \ep(0,r_i), \sharp x=\ep(1,r_i), \cdots, \sharp w=\ep(6,r_i)$$ 12 | 13 | 每个数都会得到一个结果, 但是结果需要合法: 14 | 15 | 首先, 1和2肯定不合法. 16 | 17 | 如果解析得到某行$\sharp x=2$, 则应该有$\sharp y=\sharp z=2$, 即$LLL$, 否则, $\sharp x < 2\land \sharp y\in\{2,3,4\}$. 其余情况均不合法. 18 | 19 | 如果解析得到某行$\sharp u=4$, 则应该由$\sharp v=\sharp w=4$, 即$RRR$, 否则, $\sharp u < 2\land \sharp v\in\{2,3,4\}$. 其余情况均不合法. 20 | 21 | $\forall m,n\leqslant k, m\neq n. \sharp j(r_m)\neq \sharp_j(r_n)$. 即每一行的标号都不同. 22 | 23 | 这里已经明确给出了计算流程, 显然我们可以通过编程在有限时间内输出某个自然数是否合法的Turing机编码, 其自然是Turing-可计算的. 24 | \end{proof} -------------------------------------------------------------------------------- /ch05/5.18.tex: -------------------------------------------------------------------------------- 1 | \problem{由CT证明函数$g(n)$可计算, 这里$$g(n)=\text{在自然对数之底}\mathrm{e}\text{的十进制展开式中第}n\text{个数字}.$$} 2 | \begin{proof} 3 | 根据泰勒公式, 4 | 5 | $$\mathrm{e}^x=\sum_{i=0}^n\frac{1}{i!}+\frac{\mathrm{e}^\theta}{(n+1)!},\quad 0<\theta<1.$$ 6 | 7 | 令$f(n)=\lfloor \mathrm{e}\cdot n!\rfloor$, 我们证明$f\in\PRF$. 8 | 9 | $f(0)=f(1)=2$, 当$n\geqslant 2$时, $f(n)=\sum_{i=0}^n\frac{n!}{i!}+\frac{\mathrm{e}^\theta}{n+1}$, 而此时$0<\frac{\mathrm{e}^\theta}{n+1}<1$, 所以$f(n)=\sum_{i=0}^n\frac{n!}{i!}$. 显然$f(n)\in\PRF$. 10 | 11 | 令$h(n)=\lfloor \mathrm{e}\cdot n\rfloor$, 那么有$h(0)=0$, $h(n)=\left\lfloor\frac{f(n)}{(n-1)!}\right\rfloor(n>0)$, 因此$h(n)\in\PRF$. 12 | 13 | 那么$g(1)=2$, $g(n)=h(10^n)\dotdiv h(10^{n\dotdiv 1})\cdot 10(n>0)$, 因此$g(n)\in\PRF$, 所以$g(n)$可计算. 14 | \end{proof} -------------------------------------------------------------------------------- /ch05/5.19.tex: -------------------------------------------------------------------------------- 1 | \problem{(1) 什么是停机问题?\\ 2 | (2) 什么是可判定问题 (decision problem)?\\ 3 | (3) 停机问题可判定吗?} 4 | \begin{solution} 5 | \begin{enumerate}[label=(\arabic*)] 6 | \item 是否存在能行过程来判定机器对所有输入皆停机? 7 | \item 设$A$为$\mathbb{N}$的子集, $A$是可判定的指$A$的特征函数$\chi_A$是Turing-可计算的, 即有机器$M_A$, 其对于输入$\bar{x}$, 若$x\in A$, 则输出$\bar{0}$; 否则, 输出$\bar{1}$. 8 | \item 停机问题不可判定. 9 | \end{enumerate} 10 | \end{solution} -------------------------------------------------------------------------------- /ch05/5.20.tex: -------------------------------------------------------------------------------- 1 | \problem{(1) 什么是通用Turing机 (universal Turing machine)?\\ 2 | (2) 通用Turing机起什么作用?} 3 | \begin{solution} 4 | \begin{enumerate}[label=(\arabic*)] 5 | \item 机器$U$是通用Turing机, 当其满足对任何机器$M$和任何$(n_1,\cdots,n_k)\in\mathbb{N}^k$, 6 | $$M|\overline{(n_1,\cdots,n_k)}\twoheadrightarrow \overline{y}\Leftrightarrow U|\overline{(\sharp M, n_1, \cdots, n_k)}\twoheadrightarrow \overline{y}.$$ 7 | \item 其凭自身就能完成任何Turing机可能做到的任何事, 可以模拟任何其他Turing机, 在早期程序储存式计算机的研制中起到了重要的促进作用. 8 | \end{enumerate} 9 | \end{solution} -------------------------------------------------------------------------------- /config.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%% TeX defines %%%%%%%%%%%%%%%%%%%%%%% 2 | % Listing Style 3 | \lstset { 4 | basicstyle = \sf, 5 | language = Java, 6 | tabsize = 4, 7 | columns = flexible 8 | } 9 | 10 | % Enumeration separations 11 | \usepackage{enumitem} 12 | \usepackage{amsmath} 13 | \usepackage{amssymb} 14 | \usepackage{mathabx} 15 | \setenumerate[1]{itemsep=3pt,partopsep=0pt,parsep=\parskip,topsep=5pt} 16 | \setitemize[1]{itemsep=3pt,partopsep=0pt,parsep=\parskip,topsep=5pt} 17 | \setdescription{itemsep=3pt,partopsep=0pt,parsep=\parskip,topsep=5pt} 18 | \usepackage{sectsty} 19 | 20 | 21 | 22 | %%%%%%%%%%%%%%%%%%%%%%% TOC defines %%%%%%%%%%%%%%%%%%%%%%% 23 | % General terms 24 | \newcommand{\problem}{\subsection} 25 | \newenvironment{solution}{\begin{proof}[解]}{\end{proof}} 26 | 27 | % Recursive functions 28 | \newcommand{\IF}{\mathcal{IF}} 29 | \newcommand{\BF}{\mathcal{BF}} 30 | \newcommand{\EF}{\mathcal{EF}} 31 | \newcommand{\PRF}{\mathcal{PRF}} 32 | \newcommand{\RF}{\mathcal{RF}} 33 | \newcommand{\GRF}{\mathcal{GRF}} 34 | \newcommand{\pg}{\mathrm{pg}} 35 | \newcommand{\rs}{\mathrm{rs}} 36 | \newcommand{\eq}{\mathrm{eq}} 37 | \newcommand{\ep}{\mathrm{ep}} 38 | 39 | % Abacus machines 40 | \newcommand{\AM}{\mathrm{AM}} 41 | \renewcommand{\L}{\left\langle} 42 | \newcommand{\R}{\right\rangle} 43 | \newcommand{\Z}{\mathbf{Z}} 44 | \newcommand{\Sub}{\mathrm{S}} 45 | \newcommand{\A}{\mathrm{A}} 46 | \newcommand{\cp}{\mathrm{copy}} 47 | \newcommand{\mv}{\mathrm{move}} 48 | 49 | % Lambda calculus 50 | \newcommand{\bnf}{\beta\textrm{-nf}} 51 | \newcommand{\subterm}{\textrm{Sub}} 52 | \newcommand{\onestepbeta}{\rightarrow_{\beta}} 53 | \newcommand{\manystepbeta}{\twoheadrightarrow_{\beta}} 54 | \newcommand{\equivbeta}{=_{\beta}} 55 | \newcommand{\Y}{\mathbf{Y}} 56 | \newcommand{\K}{\mathbf{K}} 57 | \newcommand{\D}{\mathbf{D}} 58 | \newcommand{\Lambdaclosed}{\Lambda^\circ} 59 | \newcommand{\churchnumber}[1]{\ulcorner{#1}\urcorner} 60 | \newcommand{\NF}{\mathrm{NF}} 61 | 62 | % Turing Machines 63 | \newcommand{\machine}[1]{\boxed{\mathrm{#1}}} 64 | \newcommand{\concat}{\mapstochar\Rightarrow} -------------------------------------------------------------------------------- /fonts/fonts.md: -------------------------------------------------------------------------------- 1 | ## 字体 2 | 将Windows系统里面的黑体、楷体和宋体(SimHei.ttf, SimKai.ttf, SimSun.ttc重命名为SimSun.ttf)复制到此处. 3 | -------------------------------------------------------------------------------- /solution.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huanght1997/IntroComputationModel/7c441f51092994f962e4983f6cbee82c7d867117/solution.pdf -------------------------------------------------------------------------------- /solution.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper,twoside]{article} 2 | \usepackage[margin=1.25in]{geometry} 3 | \usepackage[UTF8,fontset=none]{ctex} 4 | \usepackage{amssymb} 5 | \usepackage{amsthm} 6 | \usepackage{titlesec} 7 | \usepackage{fancyhdr} 8 | \usepackage{listings} 9 | \usepackage{indentfirst} 10 | \usepackage{caption} 11 | \usepackage{tabularx} 12 | \usepackage{float} 13 | \usepackage{longtable} 14 | %\setlength{\parindent}{2em} 15 | \input{config.tex} 16 | \setCJKmainfont[Path=fonts/, BoldFont=simhei.ttf, ItalicFont=simkai.ttf]{simsun.ttf} 17 | \makeatletter 18 | \def\thickhline{% 19 | \noalign{\ifnum0=`}\fi\hrule \@height \thickarrayrulewidth \futurelet 20 | \reserved@a\@thickhline} 21 | \def\@thickhline{\ifx\reserved@a\thickhline 22 | \vskip\doublerulesep 23 | \vskip-\thickarrayrulewidth 24 | \fi 25 | \ifnum0=`{\fi}} 26 | \makeatother 27 | 28 | \newlength{\thickarrayrulewidth} 29 | \setlength{\thickarrayrulewidth}{2\arrayrulewidth} 30 | \newcolumntype{Y}{>{\centering\arraybackslash}X} 31 | % Page head 32 | \pagestyle{fancy} 33 | \renewcommand{\sectionmark}[1]{\markright{#1}} 34 | \fancyhead{} % clear all fields 35 | \fancyhead[CO]{《计算模型导引》作业} 36 | \fancyhead[CE]{第{\thesection}章 \leftmark} 37 | \fancyhead[LE,RO]{\thepage} 38 | \fancyfoot{} 39 | 40 | % Title 41 | \title{\bf 《计算模型导引》作业} 42 | \author{} 43 | \date{} 44 | \begin{document} 45 | 46 | \begin{titlepage} 47 | \maketitle 48 | \thispagestyle{empty} 49 | \end{titlepage} 50 | \begin{center} 51 | \bf\LARGE 声明 52 | \end{center} 53 | 54 | 本习题解答与南京大学宋方敏教授编著的《计算模型导引》配套。 55 | 56 | 所有习题解答都是经过本人的思考,与周围人的讨论,以及来自大佬的讲解得到,所以整个题解并未完成所有的题目,也不能保证答案的严谨性和正确性,因此仅供参考。由于使用此答案造成的任何后果,请自行承担,本人概不负责。 57 | 58 | 本解答中许多灵感启发来自于蒋炎岩前辈提供的一份英文版参考解答,张强同学、李浩同学的解答,以及来自助教的解答,在此表示特别感谢。 59 | 60 | 同时殷切盼望各位大佬能对这份解答做出哪怕一点微小的贡献,包括但不限于:尚未解出题目的解答,不同于已有解答的另外的解题方法,对已有解答描述不够严谨甚至是错误的部分的补充、纠正或指出,对已有解答推理或描述不够清晰部分的补充或指出,公式中的错误,错别字等。任何的补充指正和提问,都感激不尽。 61 | \thispagestyle{empty} 62 | \newpage 63 | \thispagestyle{empty} 64 | \setcounter{page}{1} 65 | % Chapter 1 66 | \section{递归函数} 67 | \input{ch01/1.01.tex} 68 | \input{ch01/1.02.tex} 69 | \input{ch01/1.03.tex} 70 | \input{ch01/1.04.tex} 71 | \input{ch01/1.05.tex} 72 | \input{ch01/1.06.tex} 73 | \input{ch01/1.07.tex} 74 | \input{ch01/1.08.tex} 75 | \input{ch01/1.09.tex} 76 | \input{ch01/1.10.tex} 77 | \input{ch01/1.11.tex} 78 | \input{ch01/1.12.tex} 79 | \input{ch01/1.13.tex} 80 | \input{ch01/1.14.tex} 81 | \input{ch01/1.15.tex} 82 | \input{ch01/1.16.tex} 83 | \input{ch01/1.17.tex} 84 | \input{ch01/1.18.tex} 85 | \input{ch01/1.19.tex} 86 | \input{ch01/1.20.tex} 87 | \input{ch01/1.21.tex} 88 | \input{ch01/1.22.tex} 89 | \input{ch01/1.23.tex} 90 | \input{ch01/1.24.tex} 91 | \input{ch01/1.25.tex} 92 | \newpage 93 | % Chapter 2 94 | \section{算盘机} 95 | \input{ch02/2.01.tex} 96 | \input{ch02/2.02.tex} 97 | \input{ch02/2.03.tex} 98 | \input{ch02/2.04.tex} 99 | \input{ch02/2.05.tex} 100 | \newpage 101 | % Chapter 3 102 | \section{$\lambda$-演算} 103 | \input{ch03/3.01.tex} 104 | \input{ch03/3.02.tex} 105 | \input{ch03/3.03.tex} 106 | \input{ch03/3.04.tex} 107 | \input{ch03/3.05.tex} 108 | \input{ch03/3.06.tex} 109 | \input{ch03/3.07.tex} 110 | \input{ch03/3.08.tex} 111 | \input{ch03/3.09.tex} 112 | \input{ch03/3.10.tex} 113 | \input{ch03/3.11.tex} 114 | \input{ch03/3.12.tex} 115 | \input{ch03/3.13.tex} 116 | \input{ch03/3.14.tex} 117 | \input{ch03/3.15.tex} 118 | \input{ch03/3.16.tex} 119 | \input{ch03/3.17.tex} 120 | \input{ch03/3.18.tex} 121 | \input{ch03/3.19.tex} 122 | \input{ch03/3.20.tex} 123 | \input{ch03/3.21.tex} 124 | \input{ch03/3.22.tex} 125 | \input{ch03/3.23.tex} 126 | \input{ch03/3.24.tex} 127 | \input{ch03/3.25.tex} 128 | \newpage 129 | \section{组合逻辑} 130 | \input{ch04/4.01.tex} 131 | \input{ch04/4.02.tex} 132 | \input{ch04/4.03.tex} 133 | \input{ch04/4.04.tex} 134 | \input{ch04/4.05.tex} 135 | \input{ch04/4.06.tex} 136 | \input{ch04/4.07.tex} 137 | \input{ch04/4.08.tex} 138 | \input{ch04/4.09.tex} 139 | \input{ch04/4.10.tex} 140 | \newpage 141 | \section{Turing机} 142 | \input{ch05/5.01.tex} 143 | \input{ch05/5.02.tex} 144 | \input{ch05/5.03.tex} 145 | \input{ch05/5.04.tex} 146 | \input{ch05/5.05.tex} 147 | \input{ch05/5.06.tex} 148 | \input{ch05/5.07.tex} 149 | \input{ch05/5.08.tex} 150 | \input{ch05/5.09.tex} 151 | \input{ch05/5.10.tex} 152 | \input{ch05/5.11.tex} 153 | \input{ch05/5.12.tex} 154 | \input{ch05/5.13.tex} 155 | \input{ch05/5.14.tex} 156 | \input{ch05/5.15.tex} 157 | \input{ch05/5.16.tex} 158 | \input{ch05/5.17.tex} 159 | \input{ch05/5.18.tex} 160 | \input{ch05/5.19.tex} 161 | \input{ch05/5.20.tex} 162 | \newpage 163 | \end{document} --------------------------------------------------------------------------------