Mathematical Problem Solving

Download as pdf or txt
Download as pdf or txt
You are on page 1of 833

Math 235: Mathematical Problem

Solving
Darij Grinberg*
December 25, 2021 (unfinished!)

Contents
1. Introduction 11
1.1. Homework set #0: Diagnostic . . . . . . . . . . . . . . . . . . . . . . . 11

2. Induction I 14
2.1. Standard induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2. Fibonacci numbers I . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.3. Strong induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.4. Recitation #1: More induction problems . . . . . . . . . . . . . . . . . 35

3. Number Theory I: Divisibility and congruence 43


3.1. Quotients and remainders . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.2. Modular arithmetic I: Congruences . . . . . . . . . . . . . . . . . . . . 45
3.3. Congruences vs. remainders . . . . . . . . . . . . . . . . . . . . . . . 52
3.4. Greatest common divisors . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.4.1. The definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.4.2. Basic properties . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.4.3. Bezout’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.4.4. The universal property . . . . . . . . . . . . . . . . . . . . . . . 61
3.4.5. Using gcds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.4.6. Gcds of multiple numbers . . . . . . . . . . . . . . . . . . . . . 65
3.4.7. An exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.5. Coprimality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.5.1. Definition and basic properties . . . . . . . . . . . . . . . . . . 68
3.5.2. More properties and examples . . . . . . . . . . . . . . . . . . 69
3.5.3. Using coprimality . . . . . . . . . . . . . . . . . . . . . . . . . 69
* Drexel University, Korman Center, 15 S 33rd Street, Philadelphia PA, 19104, USA

1
Math 235 notes page 2

3.5.4. Multiplying coprimalities . . . . . . . . . . . . . . . . . . . . . 71


3.5.5. Reduced fractions . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.5.6. The rational root test . . . . . . . . . . . . . . . . . . . . . . . . 74
3.6. Lowest common multiples . . . . . . . . . . . . . . . . . . . . . . . . . 77
3.7. Homework set #1: Induction and number theory . . . . . . . . . . . 80
3.8. Recitation #2: Coprimality and more number theory . . . . . . . . . 82

4. Sequences and sums 91


4.1. Finite sums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4.1.1. The ∑ sign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
4.1.2. The simplest rules: factoring out and splitting addends . . . 95
4.1.3. Substitution of the summation index . . . . . . . . . . . . . . 97
4.1.4. The telescope principle . . . . . . . . . . . . . . . . . . . . . . 102
4.1.5. Splitting a sum into two . . . . . . . . . . . . . . . . . . . . . . 107
4.1.6. Splitting a sum into several . . . . . . . . . . . . . . . . . . . . 110
4.1.7. Fubini’s principle and interchange of summation signs . . . . 114
4.2. Finite products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
4.3. Binomial coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
4.4. Recitation #3: Sums, products, binomial coefficients . . . . . . . . . . 136
4.5. Homework set #2: More number theory and sums . . . . . . . . . . . 144
4.6. Guessing sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
4.7. Periodicity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
4.7.1. Periodic sequences . . . . . . . . . . . . . . . . . . . . . . . . . 156
4.7.2. Periodic functions on R and on R+ . . . . . . . . . . . . . . . 161
4.8. Homework set #3: Sequences and more sums . . . . . . . . . . . . . 167
4.9. Linear recurrences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
4.9.1. Two-term recurrences: definition and examples . . . . . . . . 170
4.9.2. Two-term recurrences: Binet-like formulas . . . . . . . . . . . 173
4.9.3. Two-term recurrences: various properties . . . . . . . . . . . . 180
4.9.4. Two-term recurrences: the matrix approach . . . . . . . . . . 189
4.9.5. Recitation #4: Two-term recurrences . . . . . . . . . . . . . . . 194
4.9.6. Two-term recurrences: arithmetical properties . . . . . . . . . 197
4.9.7. Two-term recurrences: odds and ends . . . . . . . . . . . . . . 202
4.9.8. k-term recurrences . . . . . . . . . . . . . . . . . . . . . . . . . 205
4.10. Homework set #4: More sequences . . . . . . . . . . . . . . . . . . . . 208
4.11. More integer sequences . . . . . . . . . . . . . . . . . . . . . . . . . . 209
4.11.1. Propp’s tn tn−k = 1 + tn−1 tn−2 ...tn−k+1 recurrence . . . . . . . 210
4.11.2. The Somos sequences . . . . . . . . . . . . . . . . . . . . . . . 216
4.11.3. Odds and ends . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

5. The Extremal Principle 223


5.1. Existence theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
5.2. Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
5.2.1. Writing numbers as sums of powers of 2 . . . . . . . . . . . . 226

December 25, 2021


Math 235 notes page 3

5.2.2. Students in a lecture . . . . . . . . . . . . . . . . . . . . . . . . 231


5.2.3. Matching n points to n points with no intersection . . . . . . 233
5.2.4. The round track puzzle . . . . . . . . . . . . . . . . . . . . . . 241
5.2.5. n cowboys, n bullets . . . . . . . . . . . . . . . . . . . . . . . . 245
5.2.6. The three chess clubs problem . . . . . . . . . . . . . . . . . . 247
5.3. Infinite descent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
5.4. Homework set #5: More sequences and the extremal principle . . . . 257

6. The Pigeonhole Principle 261


6.1. The principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
6.1.1. The Pigeonhole Principle for Injections . . . . . . . . . . . . . 261
6.1.2. The Pigeonhole Principle for “Multi-injections” . . . . . . . . 263
6.1.3. The Dual Pigeonhole Principle for Surjections . . . . . . . . . 264
6.2. Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
6.2.1. Simple applications . . . . . . . . . . . . . . . . . . . . . . . . 264
6.2.2. Handshakes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
6.2.3. Back to Bezout . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
6.2.4. An endofunction of a finite set . . . . . . . . . . . . . . . . . . 271
6.2.5. Periodicity of linear recurrences modulo m . . . . . . . . . . . 276
6.2.6. The eventual image of an endofunction . . . . . . . . . . . . . 277
6.3. Homework set #6: Extremal and pigeonhole principles . . . . . . . . 281

7. Mostly Enumerative Combinatorics 285


7.1. The basic principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
7.2. Notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
7.3. Elementary examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
7.3.1. Subsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
7.3.2. Integer compositions . . . . . . . . . . . . . . . . . . . . . . . . 288
7.3.3. Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
7.3.4. Injective maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
7.3.5. Tuples with non-repetition requirements . . . . . . . . . . . . 296
7.4. Permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
7.4.1. All permutations . . . . . . . . . . . . . . . . . . . . . . . . . . 301
7.4.2. Permutations σ with σ (1) > σ (2) . . . . . . . . . . . . . . . . 302
7.4.3. The average number of fixed points of a permutation . . . . . 306
7.5. Double counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
7.5.1. The Chu–Vandermonde identity for nonnegative integers . . 310
7.5.2. The trinomial revision formula for nonnegative integers . . . 312
7.5.3. The polynomial identity trick . . . . . . . . . . . . . . . . . . . 314
7.5.4. A probabilistic proof . . . . . . . . . . . . . . . . . . . . . . . . 325
7.6. Recitation #7: More on counting and binomial coefficients . . . . . . 328
7.6.1. More binomial identities . . . . . . . . . . . . . . . . . . . . . . 328
7.6.2. Counting perfect matchings of a finite set . . . . . . . . . . . . 333
7.7. Homework set #7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

December 25, 2021


Math 235 notes page 4

7.8. Alternating sums and Inclusion/Exclusion . . . . . . . . . . . . . . . 342


7.8.1. The Principle of Inclusion and Exclusion . . . . . . . . . . . . 342
7.8.2. An example: counting surjections . . . . . . . . . . . . . . . . 348
7.8.3. A weighted version and a proof . . . . . . . . . . . . . . . . . 351
7.8.4. Recitation #8: More subtractive counting . . . . . . . . . . . . 359
7.9. A bit of extremal combinatorics . . . . . . . . . . . . . . . . . . . . . . 366
7.9.1. Sperner’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . 367
7.9.2. Intersecting collections . . . . . . . . . . . . . . . . . . . . . . . 375

8. Invariants and Monovariants 387


8.1. Invariants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
8.1.1. Simple examples . . . . . . . . . . . . . . . . . . . . . . . . . . 389
8.1.2. More examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
8.1.3. Applications to sequence integrality . . . . . . . . . . . . . . . 401
8.2. Monovariants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
8.3. Homework set #8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
8.4. Homework set #9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441

9. Number Theory II: Primes 445


9.1. Primes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
9.1.1. Definition and examples . . . . . . . . . . . . . . . . . . . . . . 445
9.1.2. The infinitude of the primes . . . . . . . . . . . . . . . . . . . 445
9.1.3. Basic properties . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
9.1.4. A few exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
9.1.5. Homework set #10A: Elementary properties of primes . . . . 454
9.1.6. Fermat’s little theorem . . . . . . . . . . . . . . . . . . . . . . . 455
9.1.7. Euler’s totient function . . . . . . . . . . . . . . . . . . . . . . 457
9.2. The Fundamental Theorem of Arithmetic . . . . . . . . . . . . . . . . 463
9.3. p-valuations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
9.3.1. The p-valuation of an integer . . . . . . . . . . . . . . . . . . . 470
9.3.2. p-valuations and prime factorizations . . . . . . . . . . . . . . 477
9.3.3. The canonical factorization . . . . . . . . . . . . . . . . . . . . 477
9.3.4. Some applications . . . . . . . . . . . . . . . . . . . . . . . . . 483
9.3.5. Factorials and their p-valuations . . . . . . . . . . . . . . . . . 492
9.3.6. Homework set #10B: More about primes and numbers . . . . 506

A. Discussion of homework questions 511


A.1. Homework set #0 discussion . . . . . . . . . . . . . . . . . . . . . . . 511
A.1.1. Discussion of Exercise 1.1.1 . . . . . . . . . . . . . . . . . . . . 511
A.1.2. Discussion of Exercise 1.1.2 . . . . . . . . . . . . . . . . . . . . 513
A.1.3. Discussion of Exercise 1.1.3 . . . . . . . . . . . . . . . . . . . . 515
A.1.4. Discussion of Exercise 1.1.4 . . . . . . . . . . . . . . . . . . . . 517
A.1.5. Discussion of Exercise 1.1.5 . . . . . . . . . . . . . . . . . . . . 519
A.1.6. Discussion of Exercise 1.1.6 . . . . . . . . . . . . . . . . . . . . 521

December 25, 2021


Math 235 notes page 5

A.1.7. Discussion of Exercise 1.1.7 . . . . . . . . . . . . . . . . . . . . 525


A.1.8. Discussion of Exercise 1.1.8 . . . . . . . . . . . . . . . . . . . . 527
A.1.9. Discussion of Exercise 1.1.9 . . . . . . . . . . . . . . . . . . . . 530
A.2. Homework set #1 discussion . . . . . . . . . . . . . . . . . . . . . . . 530
A.2.1. Discussion of Exercise 3.7.1 . . . . . . . . . . . . . . . . . . . . 530
A.2.2. Discussion of Exercise 3.7.2 . . . . . . . . . . . . . . . . . . . . 535
A.2.3. Discussion of Exercise 3.7.3 . . . . . . . . . . . . . . . . . . . . 537
A.2.4. Discussion of Exercise 3.7.4 . . . . . . . . . . . . . . . . . . . . 538
A.2.5. Discussion of Exercise 3.7.5 . . . . . . . . . . . . . . . . . . . . 540
A.2.6. Discussion of Exercise 3.7.6 . . . . . . . . . . . . . . . . . . . . 542
A.2.7. Discussion of Exercise 3.7.7 . . . . . . . . . . . . . . . . . . . . 544
A.2.8. Discussion of Exercise 3.7.8 . . . . . . . . . . . . . . . . . . . . 545
A.2.9. Discussion of Exercise 3.7.9 . . . . . . . . . . . . . . . . . . . . 552
A.2.10. Discussion of Exercise 3.7.10 . . . . . . . . . . . . . . . . . . . 555
A.3. Homework set #2 discussion . . . . . . . . . . . . . . . . . . . . . . . 570
A.3.1. Discussion of Exercise 4.5.1 . . . . . . . . . . . . . . . . . . . . 570
A.3.2. Discussion of Exercise 4.5.2 . . . . . . . . . . . . . . . . . . . . 573
A.3.3. Discussion of Exercise 4.5.3 . . . . . . . . . . . . . . . . . . . . 574
A.3.4. Discussion of Exercise 4.5.4 . . . . . . . . . . . . . . . . . . . . 575
A.3.5. Discussion of Exercise 4.5.5 . . . . . . . . . . . . . . . . . . . . 577
A.3.6. Discussion of Exercise 4.5.6 . . . . . . . . . . . . . . . . . . . . 579
A.3.7. Discussion of Exercise 4.5.7 . . . . . . . . . . . . . . . . . . . . 580
A.3.8. Discussion of Exercise 4.5.8 . . . . . . . . . . . . . . . . . . . . 582
A.3.9. Discussion of Exercise 4.5.9 . . . . . . . . . . . . . . . . . . . . 582
A.3.10. Discussion of Exercise 4.5.10 . . . . . . . . . . . . . . . . . . . 586
A.4. Homework set #3 discussion . . . . . . . . . . . . . . . . . . . . . . . 589
A.4.1. Discussion of Exercise 4.8.1 . . . . . . . . . . . . . . . . . . . . 589
A.4.2. Discussion of Exercise 4.8.2 . . . . . . . . . . . . . . . . . . . . 592
A.4.3. Discussion of Exercise 4.8.3 . . . . . . . . . . . . . . . . . . . . 594
A.4.4. Discussion of Exercise 4.8.4 . . . . . . . . . . . . . . . . . . . . 598
A.4.5. Discussion of Exercise 4.8.5 . . . . . . . . . . . . . . . . . . . . 606
A.4.6. Discussion of Exercise 4.8.6 . . . . . . . . . . . . . . . . . . . . 612
A.4.7. Discussion of Exercise 4.8.7 . . . . . . . . . . . . . . . . . . . . 613
A.4.8. Discussion of Exercise 4.8.8 . . . . . . . . . . . . . . . . . . . . 616
A.4.9. Discussion of Exercise 4.8.9 . . . . . . . . . . . . . . . . . . . . 619
A.4.10. Discussion of Exercise 4.8.10 . . . . . . . . . . . . . . . . . . . 621
A.5. Homework set #4 discussion . . . . . . . . . . . . . . . . . . . . . . . 628
A.5.1. Discussion of Exercise 4.10.1 . . . . . . . . . . . . . . . . . . . 628
A.5.2. Discussion of Exercise 4.10.2 . . . . . . . . . . . . . . . . . . . 630
A.5.3. Discussion of Exercise 4.10.3 . . . . . . . . . . . . . . . . . . . 631
A.5.4. Discussion of Exercise 4.10.4 . . . . . . . . . . . . . . . . . . . 633
A.5.5. Discussion of Exercise 4.10.5 . . . . . . . . . . . . . . . . . . . 635
A.5.6. Discussion of Exercise 4.10.6 . . . . . . . . . . . . . . . . . . . 637
A.5.7. Discussion of Exercise 4.10.7 . . . . . . . . . . . . . . . . . . . 651

December 25, 2021


Math 235 notes page 6

A.5.8. Discussion of Exercise 4.10.8 . . . . . . . . . . . . . . . . . . . 652


A.5.9. Discussion of Exercise 4.10.9 . . . . . . . . . . . . . . . . . . . 654
A.5.10. Discussion of Exercise 4.10.10 . . . . . . . . . . . . . . . . . . . 658
A.5.11. Discussion of Exercise 4.11.6 . . . . . . . . . . . . . . . . . . . 661
A.5.12. Discussion of Exercise 4.11.7 . . . . . . . . . . . . . . . . . . . 663
A.5.13. Discussion of Exercise 4.11.8 . . . . . . . . . . . . . . . . . . . 667
A.6. Homework set #5 discussion . . . . . . . . . . . . . . . . . . . . . . . 669
A.6.1. Discussion of Exercise 5.4.1 . . . . . . . . . . . . . . . . . . . . 669
A.6.2. Discussion of Exercise 5.4.2 . . . . . . . . . . . . . . . . . . . . 671
A.6.3. Discussion of Exercise 5.4.3 . . . . . . . . . . . . . . . . . . . . 679
A.6.4. Discussion of Exercise 5.4.4 . . . . . . . . . . . . . . . . . . . . 684
A.6.5. Discussion of Exercise 5.4.5 . . . . . . . . . . . . . . . . . . . . 687
A.6.6. Discussion of Exercise 5.4.6 . . . . . . . . . . . . . . . . . . . . 688
A.6.7. Discussion of Exercise 5.4.7 . . . . . . . . . . . . . . . . . . . . 688
A.6.8. Discussion of Exercise 5.4.8 . . . . . . . . . . . . . . . . . . . . 689
A.6.9. Discussion of Exercise 5.4.9 . . . . . . . . . . . . . . . . . . . . 696
A.6.10. Discussion of Exercise 5.4.10 . . . . . . . . . . . . . . . . . . . 700
A.7. Homework set #6 discussion . . . . . . . . . . . . . . . . . . . . . . . 704
A.7.1. Discussion of Exercise 6.3.1 . . . . . . . . . . . . . . . . . . . . 704
A.7.2. Discussion of Exercise 6.3.2 . . . . . . . . . . . . . . . . . . . . 706
A.7.3. Discussion of Exercise 6.3.3 . . . . . . . . . . . . . . . . . . . . 708
A.7.4. Discussion of Exercise 6.3.4 . . . . . . . . . . . . . . . . . . . . 710
A.7.5. Discussion of Exercise 6.3.5 . . . . . . . . . . . . . . . . . . . . 711
A.7.6. Discussion of Exercise 6.3.6 . . . . . . . . . . . . . . . . . . . . 713
A.7.7. Discussion of Exercise 6.3.7 . . . . . . . . . . . . . . . . . . . . 716
A.7.8. Discussion of Exercise 6.3.8 . . . . . . . . . . . . . . . . . . . . 718
A.7.9. Discussion of Exercise 6.3.9 . . . . . . . . . . . . . . . . . . . . 720
A.7.10. Discussion of Exercise 6.3.10 . . . . . . . . . . . . . . . . . . . 727
A.8. Homework set #7 discussion . . . . . . . . . . . . . . . . . . . . . . . 729
A.8.1. Discussion of Exercise 7.7.1 . . . . . . . . . . . . . . . . . . . . 729
A.8.2. Discussion of Exercise 7.7.2 . . . . . . . . . . . . . . . . . . . . 731
A.8.3. Discussion of Exercise 7.7.3 . . . . . . . . . . . . . . . . . . . . 732
A.8.4. Discussion of Exercise 7.7.4 . . . . . . . . . . . . . . . . . . . . 738
A.8.5. Discussion of Exercise 7.7.5 . . . . . . . . . . . . . . . . . . . . 747
A.8.6. Discussion of Exercise 7.7.6 . . . . . . . . . . . . . . . . . . . . 750
A.8.7. Discussion of Exercise 7.7.7 . . . . . . . . . . . . . . . . . . . . 755
A.8.8. Discussion of Exercise 7.7.8 . . . . . . . . . . . . . . . . . . . . 756
A.8.9. Discussion of Exercise 7.7.9 . . . . . . . . . . . . . . . . . . . . 760
A.8.10. Discussion of Exercise 7.7.10 . . . . . . . . . . . . . . . . . . . 762
A.9. Homework set #8 discussion . . . . . . . . . . . . . . . . . . . . . . . 765
A.9.1. Discussion of Exercise 8.3.1 . . . . . . . . . . . . . . . . . . . . 765
A.9.2. Discussion of Exercise 8.3.2 . . . . . . . . . . . . . . . . . . . . 771
A.10.Homework set #9 discussion . . . . . . . . . . . . . . . . . . . . . . . 774
A.10.1. Discussion of Exercise 8.4.1 (TODO: add details!) . . . . . . . 775

December 25, 2021


Math 235 notes page 7

A.10.2. Discussion of Exercise 8.4.2 (TODO: add details!) . . . . . . . 777


A.10.3. Discussion of Exercise 8.4.3 (TODO: add details!) . . . . . . . 792
A.10.4. Discussion of Exercise 8.4.4 (TODO: add details!) . . . . . . . 796
A.10.5. Discussion of Exercise 8.4.5 (TODO: add details!) . . . . . . . 797
A.10.6. Discussion of Exercise 8.4.6 (TODO: add details!) . . . . . . . 797
A.10.7. Discussion of Exercise 8.4.7 (TODO: add details!) . . . . . . . 798
A.10.8. Discussion of Exercise 8.4.8 (TODO: add details!) . . . . . . . 798
A.10.9. Discussion of Exercise 8.4.9 (TODO: add details!) . . . . . . . 802
A.10.10.Discussion of Exercise 8.4.10 (TODO: add details!) . . . . . . 804
A.11.Homework set #10A discussion . . . . . . . . . . . . . . . . . . . . . . 806
A.11.1. Discussion of Exercise 9.1.4 . . . . . . . . . . . . . . . . . . . . 806
A.11.2. Discussion of Exercise 9.1.5 (TODO: add details!) . . . . . . . 809
A.11.3. Discussion of Exercise 9.1.6 . . . . . . . . . . . . . . . . . . . . 811
A.11.4. Discussion of Exercise 9.1.7 . . . . . . . . . . . . . . . . . . . . 813
A.11.5. Discussion of Exercise 9.1.8 . . . . . . . . . . . . . . . . . . . . 814

This work is licensed under a Creative Commons “CC0


1.0 Universal” license.

Preface
This is the text accompanying my Math 235 (Mathematical Problem Solving) class
at Drexel University in Fall 2020. The website of this class can be found at

http://www.cip.ifi.lmu.de/~grinberg/t/20f .

This document is a work in progress. It might become a textbook one day, but
for now is a construction zone.
Please report any errors you find to [email protected] .

What is this?
This course is an introduction to the art of mathematical problem solving. This
means solving the type of problems that usually are posed in competitions (like
the Putnam Competition or the International Mathematical Olympiad) or in jour-
nals (like the American Mathematical Monthly or Crux Mathematicorum): self-
contained mathematical questions that do not require any specialized knowledge
(beyond the basic undergraduate curriculum) to understand, but often a significant
amount of ingenuity, creativity and effort to solve, although the resulting solutions
again are readable without specialized knowledge.
There is no panacea for solving such problems; the hardest ones constitute seri-
ous challenges for even the most well-trained solvers. Yet there is a variety of ideas,
techniques and tools that can help attacking these problems; while they offer no

December 25, 2021


Math 235 notes page 8

guarantee of success, they are sufficiently useful that they nowadays get systemat-
ically taught to olympiad participants in many countries and universities. Most of
these techniques are also helpful in mathematical research – even though the typi-
cal research question poses a rather different kind of challenge than a competition
problem.1
Some of these techniques are very basic. Mathematical induction, for example, is
fundamental to all of mathematics. The Pigeonhole Principle says (roughly speak-
ing) that if you put 6 or more pigeons into 5 pigeonholes, then at least two pigeons
will be roommates. The Extremal Principle says that (at least) one of the pigeons
has the longest beak. These principles are neither surprising nor deep; but they can
often be applied in unexpected and surprising ways. We will study them mainly
by exploring their applications, as there is little to say about these principles them-
selves.
Another part of the problem solving toolkit is a selection of “little” theories (“lit-
tle” in the sense of not going deep; typically, the main results and their proofs fit
on 20 pages at most). The most well-known such theory is elementary number
theory, due to a large extent to Euclid (or to whoever discovered the results in
his Elements) and expanded somewhat by Fermat, Euler and Gauss. The lore of
polynomials (commonly over the rational or complex numbers) can be regarded
as another such theory, with results like Viete’s theorems. The art of elementary
inequalities (like Cauchy–Schwarz, Hölder, rearrangement), too, can be counted as
a theory.
The tools and theories we will see are thus a cross-section of elementary math-
ematics. This text will omit most of analysis (which will only appear in some
exercises; see [GelAnd17] for a lot more) and all of elementary geometry (which is
its own subject, worthy of its own books; see [Honsbe12] for a selection of neat re-
sults and [Hadama09] for a systematic introduction). We will also not use abstract
algebra beyond a few basic ideas that can be explained from scratch. As to linear
algebra, we will occasionally make use of it, but we will not introduce it, as there
are enough good texts for that.
This is not the first introductory text on mathematical problem solving, and
has no ambitions to be the last. The classics in this genre are Polya’s [Polya81]
and Engel’s [Engel98]2 ; many other sources have been published since, including

1 For starters, a researcher attacking a research question does not know whether it has an answer
and, if it has one, how difficult it will be to find; meanwhile, questions posed in competitions
have been “pre-solved” by their proposers and/or the selection committees, and usually have a
somewhat predictable level of difficulty. Also, one of the frequent challenges in research is asking
the right question; but competitions preempt this challenge (although it tends to resurface in the
solving process, as one looks for useful auxiliary results).
However, competition problems can (and often do) have a lot in common with research ques-
tions; in particular, several have crystallized out of the research of their proposers. For the solver,
mathematical competitions can provide inspiration and training for proper research; when de-
signed well, they are research “writ small”.
2 The even earlier book [Polya73] by Polya is, in some ways, a harbinger of this kind of book,

although in itself it is too short (just a few dozen solved problems), too philosophical (replete

December 25, 2021


Math 235 notes page 9

[GelAnd17], [Zeitz17], [ZawHit09] and [Chen20, OTIS Excerpts]3 . There is also a


plenitude of problem books – i.e., collections of (solved) problems either taken from
a specific contest (or journal) over the years (such as [DJMP11] or [Strasz65], or the
“Hungarian Problem Books” published by the MAA), or chosen from specific sub-
jects (the classics in the latter genre are [DynUsp06], [ShChYa62], [YagYag64] and
[YagYag67]). The present text intends to differ from these both in the choice of
subjects and in the choice of examples and problems (based on my personal taste);
that said, there is likely to be more overlap than difference, since both the most im-
portant techniques and their most prominent examples are generally agreed upon.

Prerequisites
I expect you, the reader, to be familiar with mathematical proofs. In particular, you
should be able to

• apply (and verify) arguments by mathematical induction, by contradiction,


by case distinction and by similar fundamental tactics,

• write up your proofs at a reasonable level of mathematical rigor, and read


similarly rigorous proofs written by others (as frequently seen in textbooks
written for mathematics majors),

• understand and use basic mathematical language such as the summation


sign4 or set builder notation5 .

If not, there is a whole industry of texts from which these skills can be learned
(such as [LeLeMe16, Chapters 1–5], [Day16], [Hammac15], [Newste20, Part I and

with didactical comments and Socratic dialogues) and too basic (typical strategies suggested are
“do you know a related problem?” and “introduce suitable notations”). Even in the much more
content-rich and concrete [Polya81], Polya spends quite a lot of space attempting to construct
a general theory of mathematical problem solving, with input from philosophy and psychol-
ogy (two chapters are called “Rules of Discovery?” and “On Learning, Teaching, and Learning
Teaching”, although they are more hands-on than the names may suggest).
Engel’s main innovation in [Engel98] was to scrap the philosophy and fill as much of his book
as possible with actual problems and solutions. The problem solving strategies he presents
are mathematical ones, and they are taught by doing (worked examples, then problems). The
occasional personal story or heuristical remark gives some variety (but the mathematics itself
is already pretty varied, as one and the same strategy often has applications in very different
fields).
In the notes you are now reading, I intend to stick to Engel’s paradigm (but aim at a higher
level of detail).
3 also, various books in foreign languages: e.g., [Grinbe08] and [Carl17] (in German) and [Jarvin20]

(in Finnish) and [DLPS16] (in Dutch)


b 1 1 1 1
4 for example,
∑ = + +···+
k= a k a a + 1 b
5 for example, {i ∈ Z | i is even} for the set of all even integers

December 25, 2021


Math 235 notes page 10

Appendices A–B] and [Swanso20, Chapters 1–3], just to mention a few freely avail-
able ones6 ).

Acknowledgments
I thank Natalia Grinberg, Sam Hopkins, Pasha Pylyavskyy, Tom Roby and David
Speyer for helpful conversations on the problem solving literature.

6I recommend the MIT text [LeLeMe16] in particular for its lively writing and its enjoyable exer-
cises. It is long and goes far beyond the basics; it has significant overlap with what I will be
doing in this class.
Newstead’s [Newste20] (work in progress) is also far more than an introduction to proofs. It
covers a lot of the “no man’s land” between such an introduction and advanced courses.
Swanson’s [Swanso20] is focussed on setting up the prerequisites for a rigorous treatment of
analysis.

December 25, 2021


Math 235 notes page 11

1. Introduction
1.1. Homework set #0: Diagnostic
This is a special problem set: Its main purpose is to give you an idea of what is to
come in this course, and to give me an idea of your level of familiarity with certain
things (including proof writing). Do not expect to solve all these problems.
This problem set (and only this one!) will be graded on completion – each
problem will be graded out of 2; any serious work on a problem (e.g., a partial
solution, a particular case solved, or even an attempt that shows you have thought
about it) will get 2 points. (All future problem sets will be graded on correctness,
with a correct and well-written solution worth 10 points.)

Tips:

• Ways to make partial progress can include


– trying out small values of n (in problems that depend on an integer n –
even if it is not explicitly mentioned7 ),
– replacing some numbers by smaller numbers (to make the problem eas-
ier to check on examples),
– ruling some cases out, or
– rewriting some of the expressions involved in the problem.
• You don’t need to be too detailed in your solutions (nor will I always be in
mine). If you solve (say) Exercise 1.1.2 by induction on n, I trust you that you
can do the base case without you going into the details. Likewise, you don’t
need to show any intermediate steps when claiming algebraic identities like
1 
a2 + b2 + c2 − (bc + ca + ab) = (b − c)2 + (c − a)2 + ( a − b)2 ; it is clear

2
enough that the reader can just expand both sides and compare. (Thus, your
solution to Exercise 1.1.7 can consist of a single equation.) Details are needed
when a reader (who has been following the course, but doesn’t already know
the solution of the specific problem) might realistically stumble or get stuck.
• I will proofread your solutions, so this is a good chance to get feedback on
your writing before we get to homework worth more serious points.

Exercise 1.1.1. Let n be an even positive integer. Find a q ∈ {1, 2, . . . , 2n} such
that
1! · 2! · · · · · (2n)!
is a perfect square.
q!

7 E.g.,
a problem about a polynomial always has an “implicit n”, namely the degree of the polyno-
mial involved. Thus one can start by considering polynomials of degrees 1, 2, 3.

December 25, 2021


Math 235 notes page 12

Exercise 1.1.2. Define a sequence (t0 , t1 , t2 , . . .) of positive rational numbers re-


cursively by setting

t0 = 1, t1 = 1, t2 = 1, and
1 + t n −1 t n −2
tn = for each n ≥ 3.
t n −3

1 + t2 t1 1+1·1 1 + t3 t2 1+2·1
(For example, t3 = = = 2 and t4 = = = 3.)
t0 1 t1 1
(a) Prove that tn+2 = 4tn − tn−2 for each n ≥ 2.
(b) Prove that tn is a positive integer for each integer n ≥ 0.

The next exercise uses the floor function, which is defined as follows:

Definition 1.1.1. For every real x, we let b x c denote the largest integer that is
≤ x. This integer b x c is called the floor (or the integer part) of x.

For example, b3c = bπ c = 3 and b−π c = −4. It is easy to see8 that for every
x ∈ R, we have
b x c ≤ x < b x c + 1. (1)
(Note that the chain of inequalities (1) determines b x c uniquely, and thus can be
used as an alternative definition of b x c. This is how b x c is defined in [Grinbe16,
Definition 1.1.1], for example.) Older sources use the notation [ x ] for b x c; this
notation, however, can mean many other things.

Exercise 1.1.3. Let x ∈ R and let n be a positive integer. Prove that


n −1  
k
∑ x+
n
= bnx c .
k =0

Exercise 1.1.4. Let a, b, c, n be positive integers such that a | bn and b | cn and


2 + n +1
c | an . Prove that abc | ( a + b + c)n .

Exercise 1.1.5. A mountain ridge has the form of a (finite) line segment, bordered
on each end by a cliff. Several (finitely many) lemmings are walking along the
ridge, with equal speeds (but not necessarily in the same direction). Whenever
two lemmings meet, they “bounce off” one another, keeping their respective
speeds but reversing their directions. Whenever a lemming arrives at an end-
point of the ridge, it falls off the cliff. Prove that eventually, all lemmings will
fall off the cliff.

8 and well-known enough to be used without proof on any contest

December 25, 2021


Math 235 notes page 13

[Example: Here is a possible lemming configuration:



→ ←
− ←
− −
→ ←

1 2 3 4 5

(with 1, 2, 3, 4, 5 being the lemmings, and the arrows signifying their walking
directions). The first two lemmings to meet here will be 1 and 2, after which
they both change their directions:

−−→ ←
− −
→ ←

1 2 3 4 5

Now lemming 1 is on its way to the cliff, which it will reach without interference
from other lemmings.]

Exercise 1.1.6. You have 20 white socks and 20 black socks hanging on a clothes-
line, in some order.
(a) Prove that you can pick 10 consecutive socks from the clothesline such that
5 of them are black and the other 5 white. (You can call such a pick color-balanced.)
(b) Prove the same if the number 20 is replaced by 13 (so you have 13 white
and 13 black socks).
[Example: If the number 20 is replaced by 7, then the claim does not hold.
For example, the configuration B3 W 7 B4 (standing for “3 black socks, followed
by 7 white socks, followed by 4 white socks”) has no color-balanced pick of 10
consecutive socks.]

Exercise 1.1.7. Factor the polynomial

bc (b − c) (b + c) + ca (c − a) (c + a) + ab ( a − b) ( a + b)

into a product of four linear (i.e., degree-1) polynomials.

Exercise 1.1.8. (a) Let a, b, c be three nonnegative reals. Prove that

|ca − ab| + | ab − bc| + |bc − ca| ≤ b2 − c2 + c2 − a2 + a2 − b2 .

(b) Is this still true if the word “nonnegative” is omitted?

Exercise 1.1.9. Let n ≥ 1. Let a1 , a2 , . . . , an be any n integers. Prove that there


exist some p, q ∈ {1, 2, . . . , n} with p ≤ q and n | a p + a p+1 + · · · + aq .

Exercise 1.1.10. Briefly review the problems above: Which ones did you like?
Which ones did you not like? Why? How long did they take you? Which parts
did you get stuck on? Did you learn anything from solving (or trying to solve)
them? If you knew the solution already (nothing wrong with that!), where did
you learn it? (No need to rate every exercise; just say some words about some 4
of them.)

December 25, 2021


Math 235 notes page 14

2. Induction I
Mathematical induction is essentially the main strategy for proving theorems in
mathematics: Any statement that involves a natural number (even implicitly, such
as by talking of a finite set) potentially lends itself to be proved by induction. This
does not mean induction is always the best way to go, or even a viable one, but it
is a method you should certainly not be surprised to see working. Only recently,
two long books [AndCri17] and [Gunder10] (with 400 and 850 pages, respectively)
entirely devoted to applications of induction have appeared9 . We will not go into
this depth or detail; but we will show examples for the most frequent ways in
which induction can be applied.

2.1. Standard induction


We assume you are familiar with standard mathematical induction. Just as a re-
minder, it is a way to prove that a certain statement A (n) holds for every integer
n ≥ g, where g is a fixed integer. Stated as a theorem itself, here is what it says:

Theorem 2.1.1. Let g ∈ Z. For each integer n ≥ g, let A (n) be a logical state-
ment. Assume the following:

• Assumption 1: The statement A ( g) holds.

• Assumption 2: If m is an integer such that m ≥ g and such that A (m) holds,


then A (m + 1) also holds.

Then, A (n) holds for all integers n ≥ g.

Theorem 2.1.1 is one of the facts known as the principle of mathematical induction.
Some consider it to be an axiom; others use essentially equivalent axioms that it
can easily be derived from.10 We will not dwell on its logical status, but rather
explore its use.
Theorem 2.1.1 provides a way to prove any result that can be stated in the form
“some statement A (n) holds for each integer n ≥ g” (commonly, g is taken to be
0 or 1, but any integer is fine). All one needs to do is to prove Assumption 1 and
Assumption 2. The proof of Assumption 1 is commonly called the induction base
(or base case), while the proof of Assumption 2 is commonly called the induction
step. In the induction step, the assumption that A (m) holds is called the induction
hypothesis (or induction assumption). The whole proof is called an “induction on n”
(or “induction over n”). Here is a simple example:
9 This is not to say that the method has not been appreciated before; it is just that the idea of
gathering mathematical results by their method of proof (as opposed to their objects of concern)
is fairly new.
10 You may have seen it stated for g = 0 only (or for g = 1 only). But the general case of Theorem

2.1.1 easily follows from these particular cases (see, e.g., [Grinbe15, proof of Theorem 2.53]).

December 25, 2021


Math 235 notes page 15

Exercise 2.1.1. Let b be a real number. Prove that


 
( b − 1 ) b 0 + b 1 + · · · + b n −1 = b n − 1 (2)

for each integer n ≥ 0. 11

Solution to Exercise 2.1.1. We will prove (2) by induction on n (that is, we shall apply
Theorem 2.1.1 to g = 0 and to A  (n) being the statement
 (2)).
Induction base: We have (b − 1) b0 + b1 + · · · + b0−1 = 0 = b0 − 1 (since b0 = 1).
| {z }
=(empty sum)=0
In other words, (2) holds for n = 0. This completes the induction base.
Induction step: Let m ≥ 0 be an integer. Assume (as the induction hypothesis)
that (2) holds for n = m. We must  prove that (2) holds for n = m + 1. In other
words, we must prove that (b − 1) b0 + b1 + · · · + b(m+1)−1 = bm+1 − 1.
Our induction hypothesis says that (2) holds for n = m. In other words,
 
m −1
0 1
( b − 1) b + b + · · · + b = bm − 1. (3)

Now, (m + 1) − 1 = m, so that
   
(b − 1) b0 + b1 + · · · + b(m+1)−1 = (b − 1) b0 + b1 + · · · + bm
| {z }
=(b0 +b1 +···+bm−1 )+bm
  
= ( b − 1 ) b 0 + b 1 + · · · + b m −1 + b m
 
= ( b − 1 ) b 0 + b 1 + · · · + b m −1 + ( b − 1 ) b m
| {z } | {z m m
}
= b m −1 =bb −b
(by (3))
m
bbm −1 = bm+1 − 1.
= bm − 1 + bb − b = |{z} m

= b m +1

But this is precisely what we need to prove. Thus, the induction step is complete.
Hence, (2) is proved. Thus, Exercise 2.1.1 is solved.
We note that if b is a real number distinct from 1, then the claim of (2) entails
bn − 1 1 − bn
b 0 + b 1 + · · · + b n −1 = = (4)
b−1 1−b
for each integer n ≥ 0. This is the classical formula for the sum of a (finite) geo-
metric progression. There are other proofs of this formula (in particular, we shall
11 Note that if n = 0, then the sum b0 + b1 + · · · + bn−1 is an empty sum and thus equals 0 by
definition.

December 25, 2021


Math 235 notes page 16

prove something slightly more general in a later chapter), but the induction proof
that we gave above has the advantage of being entirely straightforward.
A particularly simple particular case of Exercise 2.1.1 is the following: Each inte-
ger n ≥ 0 satisfies
20 + 21 + · · · + 2n−1 = 2n − 1. (5)
Indeed, this follows by applying Exercise 2.1.1 to b = 2 (since 2 − 1 = 1).
Here is another basic example for a proof by induction (which appears, e.g., in
[Grinbe15, Proposition 2.164], in [Gunder10, Exercise 74] and in [AndCri17, Prob-
lem 2.2]):

Exercise 2.1.2. Prove that every integer n ≥ 0 satisfies

1 1 1 1 1 1 1 1 1
− + − +···+ − = + +···+ . (6)
1 2 3 4 2n − 1 2n n+1 n+2 2n

Solution to Exercise 2.1.2. Let us denote the left hand side of (6) by L (n), and let us
denote the right hand side by R (n). That is, we set
1 1 1 1 1 1
L (n) = − + − +···+ − and
1 2 3 4 2n − 1 2n
1 1 1
R (n) = + +···+
n+1 n+2 2n
for each n ≥ 0. Thus, we need to prove that L (n) = R (n) for each n ≥ 0. We
shall do this by induction on n (that is, we shall apply Theorem 2.1.1 to g = 0 and
A (n) = (“L (n) = R (n) ”)).
Induction base: The equality L (0) = R (0) holds, since both L (0) and R (0) are
empty sums (and thus 0). In other words, L (n) = R (n) holds for n = 0. This
completes the induction base.
Induction step: Let m ≥ 0 be an integer. Assume (as the induction hypothesis)
that L (m) = R (m). We must prove that L (m + 1) = R (m + 1).
The definition of L (n) shows that L (m + 1) is the same sum as L (m) except with
1 1
the two extra addends and − added to it. Thus,
2 ( m + 1) − 1 2 ( m + 1)
1 1
L ( m + 1) = L ( m ) + − . (7)
2 ( m + 1) − 1 2 ( m + 1)
The definition of R (n) shows that R (m + 1) is the same sum as R (m) except with-
1 1 1
out the addend but with the two new addends and added
m+1 2m + 1 2m + 2
to it. Thus,
1 1 1
R ( m + 1) = R ( m ) − + + . (8)
m + 1 2m + 1 2m + 2
Now it is clear what to do: We need to show that the left hand sides of the two
equalities (7) and (8) are equal, but we know that the L (m) and R (m) terms on

December 25, 2021


Math 235 notes page 17

their right hand sides are equal (since L (m) = R (m) by assumption). So we need
to show that the remaining terms on the right hand sides are also equal – i.e., that
we have
1 1 1 1 1
− =− + + .
2 ( m + 1) − 1 2 ( m + 1) m + 1 2m + 1 2m + 2
But this can be checked by a straightforward computation (which is simplified by
the facts that 2 (m + 1) − 1 = 2m + 1 and 2m + 2 = 2 (m + 1)). Thus, the right hand
sides of (7) and (8) are equal (since L (m) = R (m)), and therefore so are the left
hand sides. In other words, L (m + 1) = R (m + 1). This completes the induction
step. Exercise 2.1.2 is thus solved.
Equalities between finite sums (such as in Exercise 2.1.2) provide lots of exercise
in using induction; for example, you can use induction to prove the equalities
n ( n + 1)
1+2+···+n = ; (9)
( 2
n/2 + 1, if n is even;
1 − 2 + 3 − 4 ± · · · + (−1)n (n + 1) =
− (n + 1) /2, if n is odd;
n (n + 1) (2n + 1)
12 + 22 + · · · + n2 = ;
6
n ( n + 1) 2
 
3 3 3
1 +2 +···+n = ;
2
2−1

n ( 2n + 1 ) ( n + 1 ) 3n + 3n
14 + 24 + · · · + n4 =
30
for each integer n ≥ 0 (see [Grinbe15, §2.4] and [Grinbe15, Exercise 2.9], respec-
tively, for detailed proofs of the first two equalities).
We shall now come to a more combinatorial application. Recall that a bit is
defined to be an element of the 2-element set {0, 1}.
Exercise 2.1.3. Fix a positive integer n. An n-bitstring shall mean an n-tuple
( a1 , a2 , . . . , an ) ∈ {0, 1}n of bits. Prove that there exists a list (b1 , b2 , . . . , b2n ) con-
taining all n-bitstrings (each exactly once) such that for every i ∈ {1, 2, . . . , 2n },
the two n-bitstrings bi and bi−1 differ in exactly one entry. Here, we understand
b0 to mean b2n .
[Example: For n = 3, one such list is (b1 , b2 , . . . , b8 ), where

b1 = (0, 0, 0) , b2 = (0, 0, 1) , b3 = (0, 1, 1) , b4 = (0, 1, 0) ,


b5 = (1, 1, 0) , b6 = (1, 1, 1) , b7 = (1, 0, 1) , b8 = (1, 0, 0) .

It is far from the only such list.]


Before we solve this exercise, a few comments on its significance are in order.
A list (b1 , b2 , . . . , b2n ) satisfying the requirement of Exercise 2.1.3 is known as a
(circular) Gray code. Quoting the (extensive) Wikipedia article on these:

December 25, 2021


Math 235 notes page 18

“Gray codes are used in linear and rotary position encoders (absolute
encoders and quadrature encoders) in preference to weighted binary
encoding. This avoids the possibility that, when multiple bits change in
the binary representation of a position, a misread will result from some
of the bits changing before others.”
That is, the property that bi and bi−1 differ in exactly one entry ensures that bi−1
can be turned into bi by only changing a single bit, which removes the need for
changing several bits simultaneously to prevent unintended intermediate states.
Another way to think of Exercise 2.1.3 is as follows: Imagine a combination lock
with n dials, where each dial has exactly 2 disks labeled 0 and 1. Then, a Gray
code provides a way to cycle through all 2n possible combinations in a way that
getting from each combination to the other (and from the last back to the first) only
requires rotating a single dial. Variants of Gray codes exist for dials with more
than 2 disks, and for various other similar situations; a comprehensive discussion
of various such contraptions can be found in [TAoCP4A, §7.2.1.1].12
Solution to Exercise 2.1.3 (sketched). We define an n-Gray code to be a list (b1 , b2 , . . . , b2n )
containing all n-bitstrings (each exactly once) such that for every i ∈ {1, 2, . . . , 2n },
the two n-bitstrings bi and bi−1 differ in exactly one entry, where b0 means b2n .
Thus, the exercise wants us to prove that there exists an n-Gray code.
We shall prove this by induction on n, so we forget that we fixed n. Note that
we have to start our induction at n = 1 (that is, we must apply Theorem 2.1.1 to
g = 1), since the exercise is stated for all positive integers n (rather than for all
integers n ≥ 0, as the two previous exercises were).
Induction base: There exists a 1-Gray code – namely, the list ((0) , (1)). Thus,
Exercise 2.1.3 is proved13 for n = 1. This completes the induction base.
Induction step: Let m ≥ 1 be an integer. Assume (as the induction hypothesis)
that there exists an m-Gray code. We must show that there exists an (m + 1)-Gray
code.
We introduce a notation: For any m-bitstring a = ( a1 , a2 , . . . , am ), we let 0a denote
the (m + 1)-bitstring (0, a1 , a2 , . . . , am ), and we let 1a denote the (m + 1)-bitstring
(1, a1 , a2 , . . . , am ). Thus, 0a and 1a are the two possible (m + 1)-bitstrings that can
be obtained from a by inserting a new bit at the front. For example, if a = (1, 1, 0)
(so m = 3), then 0a = (0, 1, 1, 0) and 1a = (1, 1, 1, 0).
We have assumed that there exists an m-Gray code; let (b1 , b2 , . . . , b2m −1 , b2m ) be
this m-Gray code. Then,
(0b1 , 0b2 , . . . , 0b2m −1 , 0b2m , 1b2m , 1b2m −1 , . . . , 1b2 , 1b1 )
12 We note that Exercise 2.1.3 is also a popular contest problem. For instance, Problem A3 on the
Putnam Mathematical Competition 1968 is a thinly-veiled restatement of Exercise 2.1.3 (more
precisely, of a weaker version of this exercise, which requires bi and bi−1 differ in exactly one
entry only for i ∈ {1, 2, . . . , 2n − 1} rather than for all i ∈ {1, 2, . . . , 2n }).
13 Here, we are being slightly sloppy with our language: When we say “Exercise 2.1.3”, we mean

“the claim of Exercise 2.1.3”. Thus, “Exercise 2.1.3 is proved” means “the claim of Exercise 2.1.3
is proved”. We shall use this sloppy language occasionally, as it saves us space.

December 25, 2021


Math 235 notes page 19

(note that the subscripts first go up from 1 to 2m , then go back down from 2m to
1) is an (m + 1)-Gray code (check this!). Thus, there exists an (m + 1)-Gray code.
This completes the induction step. Thus, Exercise 2.1.3 is solved by induction.
The verb “induct” is often used to mean “perform an induction”. Thus, for in-
stance, in the above proof, we could have said “We induct on n” instead of “We
shall prove this by induction on n”. A proof by induction is also known as an
inductive proof.14
As mentioned above, when one inducts on n to prove a statement, the n needs
not explicitly appear in the statement; it suffices that the statement can be restated
in a way that contains an n. As an example, let us show the following (seemingly
evident) fact:

Proposition 2.1.2. Let S be a nonempty finite set of integers. Then, S has a


maximum.

Recall that a “maximum” (also known as a “largest element”) of a set S of integers15


is defined to be an element s ∈ S such that we have s ≥ t for all t ∈ S. It is easy to
see that any set of integers has at most one maximum (because if s1 and s2 are two
maxima of the same set, then s1 ≥ s2 and s2 ≥ s1 , whence s1 = s2 ); but some sets of
integers have none. (For example, the sets ∅ and Z have none.) Proposition 2.1.2
says that for a nonempty finite set, there always is a maximum (and thus, according
to what we just said, a unique maximum).
Proof of Proposition 2.1.2 (sketched). (See [Grinbe15, first proof of Theorem 2.35] for
details16 .) Forget that we fixed S. We thus must prove the following:

Claim 1: Every nonempty finite set S of integers has a maximum.

We can rewrite this claim as follows:

Claim 2: Let n be a positive integer. Then, every n-element set of integers


has a maximum.

Claim 2 is equivalent to Claim 1, because a set S is a nonempty and finite if and


only if its size |S| is a positive integer. But Claim 2 has the advantage of depending
on a positive integer n, which gives us an opportunity to use induction. And that’s
what we will do now:
[Proof of Claim 2: We induct on n:
14 This is not to be confused with the epistemological concept of “inductive reasoning”, which is
not a proof method.
15 You can replace “integers” by “rational numbers” or “real numbers” here, and nothing will

change.
16 This said, [Grinbe15, first proof of Theorem 2.35] is organized somewhat differently (in particular,

most of the argument is relegated into a lemma), and uses the nonnegative integer |S| − 1 instead
of the positive integer |S| to do the induction.

December 25, 2021


Math 235 notes page 20

Induction base: Every 1-element set of integers has a maximum (namely, its unique
element). In other words, Claim 2 holds for n = 1. This completes the induction
base.
Induction step: Let m be a positive integer. Assume (as the induction hypothesis)
that Claim 2 holds for n = m. We must prove that Claim 2 holds for n = m + 1.
In other words, we must prove that every (m + 1)-element set of integers has a
maximum.
So let S be an (m + 1)-element set of integers. Then, |S| = m + 1 ≥ 1 > 0, so
that S is nonempty. Hence, there exists some s ∈ S. Consider such an s. The set
S \ {s} then must be an m-element set (since S is an (m + 1)-element set), and thus
has a maximum (because our induction hypothesis says that every m-element set
of integers has a maximum). Let t be this maximum.
Now, we can see that S has a maximum: Indeed, if t ≥ s, then t is a maximum
of S, whereas otherwise, s is a maximum of S. (Check this!)
Forget that we fixed S. We thus have proved that every (m + 1)-element set S
of integers has a maximum. In other words, Claim 2 holds for n = m + 1. This
completes the induction step. Claim 2 is thus proved.]
Since Claim 2 is equivalent to Claim 1, we thus conclude that Claim 1 also holds,
i.e., Proposition 2.1.2 is proved.
In advanced mathematics, most inductions are of the kind we just showed (al-
though usually more complicated) – i.e., the n that is being inducted upon does
not explicitly appear in the claim that is being proved, but rather is a “derived
quantity” (like the size |S| of the set S in the above proof). Commonly, this is done
quickly and tacitly – that is, instead of restating the claim in terms of n as we did
above, one simply says that one is doing an induction on the derived quantity (i.e.,
in the above example, an induction on |S|). See [Grinbe15, §2.5.3] for the exact
convention that is being used here; let me just show how the above proof could be
rewritten using this convention:
Proof of Proposition 2.1.2 (short version). (See [Grinbe15, second proof of Theorem
2.35] for details.) Forget that we fixed S. Notice that |S| is a positive integer
whenever S is a nonempty finite set. Hence, we induct on |S|:
Induction base: If S is a nonempty finite set of integers satisfying |S| = 1, then
S has a maximum (namely, its unique element). In other words, Proposition 2.1.2
holds for |S| = 1. This completes the induction base.
Induction step: Let m be a positive integer. Assume (as the induction hypothesis)
that Proposition 2.1.2 holds for |S| = m. We must prove that Proposition 2.1.2 holds
for |S| = m + 1. In other words, we must prove that every nonempty finite set S of
integers satisfying |S| = m + 1 has a maximum.
So let S be a nonempty finite set of integers satisfying |S| = m + 1. Then, |S| =
m + 1 ≥ 1 > 0, so that S is nonempty. Hence, there exists some s ∈ S. Consider
such an s. The set S \ {s} then satisfies |S \ {s}| = |S| − 1 = m (since |S| = m + 1),
and thus is nonempty (since m is a positive integer); hence, this set S \ {s} has a

December 25, 2021


Math 235 notes page 21

maximum (because our induction hypothesis says that every nonempty finite set
of integers that has size m has a maximum). Let t be this maximum.
Now, we can see that S has a maximum: Indeed, if t ≥ s, then t is a maximum
of S, whereas otherwise, s is a maximum of S. (Check this!)
Forget that we fixed S. We thus have proved that every nonempty finite set S of
integers satisfying |S| = m + 1 has a maximum. In other words, Proposition 2.1.2
holds for |S| = m + 1. This completes the induction step. Proposition 2.1.2 is thus
proved.
We shall see more complicated examples of induction on a derived quantity soon.

2.2. Fibonacci numbers I


The Fibonacci sequence, with its recursive definition and multiple properties, is a
veritable induction playground. But it is also an object of serious research; a whole
book about it has been written [Vorobi02], and the Fibonacci Association publishes
the Fibonacci Quarterly since 1963 and organizes the two-yearly Fibonacci Conference.
Arguably these are only partly concerned with the Fibonacci sequence, but its role
in them is substantial if not leading.
Let us recall the definition of this venerable sequence and show a few of its
properties; we’ll see more of it at times later on.

Definition 2.2.1. The Fibonacci sequence is the sequence ( f 0 , f 1 , f 2 , . . .) of integers


which is defined recursively by

f 0 = 0, f 1 = 1, and f n = f n−1 + f n−2 for all n ≥ 2.

The entries of this sequence are called the Fibonacci numbers.

The first Fibonacci numbers are

f 0 = 0, f 1 = 1, f 2 = 1, f 3 = 2, f 4 = 3, f 5 = 5,
f 6 = 8, f 7 = 13, f 8 = 21, f 9 = 34, f 10 = 55,
f 11 = 89, f 12 = 144, f 13 = 233.

Some authors17 prefer to start the sequence at f 1 rather than f 0 ; of course, the
recursive definition then needs to be modified to require f 2 = 1 instead of f 0 = 0.
The first property of Fibonacci numbers that we prove is the following:

Exercise 2.2.1. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Prove that each inte-
ger n ≥ 0 satisfies
f 1 + f 2 + · · · + f n = f n+2 − 1. (10)

17 such as Vorobiev in his book [Vorobi02]

December 25, 2021


Math 235 notes page 22

Solution to Exercise 2.2.1. We prove (10) by induction on n:


Induction base: We have f 1 + f 2 + · · · + f 0 = (empty sum) = 0 = f 2 − 1 (since
f 2 = 1). In other words, (10) holds for n = 0. This completes the induction base.18
Induction step: Let m ≥ 0. Assume (as the induction hypothesis) that (10) holds
for n = m. We must show that (10) holds for n = m + 1.
Our assumption says that (10) holds for n = m; in other words, f 1 + f 2 + · · · +
f m = f m+2 − 1.
Now, our goal is to prove that (10) holds for n = m + 1; in other words, our goal
is to prove that f 1 + f 2 + · · · + f m+1 = f m+3 − 1 (since this is what (10) says for
n = m + 1). But this follows by comparing

f 1 + f 2 + · · · + f m +1 = ( f 1 + f 2 + · · · + f m ) + f m +1 = f m +2 − 1 + f m +1
| {z }
= f m +2 −1

with
f − 1 = f m +2 + f m +1 − 1 = f m +2 − 1 + f m +1 .
|m{z+}3
= f m +2 + f m +1
(by the recursive definition
of the Fibonacci sequence)

So we have shown that (10) holds for n = m + 1. This completes the induction step,
and thus proves (10). Hence, Exercise 2.2.1 is solved.
Let us briefly discuss two notational aspects of induction. So far, we have always
been using the letter m for the integer that is introduced in the induction step,
because it was called m in the statement of Theorem 2.1.1. Clearly, we can use any
other letter (for example, k) instead, as long as that letter does not already have
a different meaning. It is also perfectly fine to use k − 1 for it – i.e., instead of
assuming that the claim holds for n = m and proving that it holds for n = m + 1,
we can just as well assume that the claim holds for n = k − 1 and prove that it
holds for n = k. (Of course, if we do this, then we need to assume k > g instead of
k ≥ g.) This just boils down to substituting k − 1 for m in Theorem 2.1.1. Here is
how Theorem 2.1.1 looks like after this substitution:

Theorem 2.2.2. Let g ∈ Z. For each integer n ≥ g, let A (n) be a logical state-
ment. Assume the following:

• Assumption 1: The statement A ( g) holds.

• Assumption 2: If k is an integer such that k > g and such that A (k − 1)


holds, then A (k ) also holds.

Then, A (n) holds for all integers n ≥ g.

18 Wewill no longer write this sentence at the end of an induction base, since the “Induction step:”
that follows it should make it clear enough that the induction base ends here.

December 25, 2021


Math 235 notes page 23

As an example for an induction proof written in this way, let us prove another
property of the Fibonacci sequence (the so-called Cassini identity):
Exercise 2.2.2. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Prove that

f n+1 f n−1 − f n2 = (−1)n

for any positive integer n.


Solution to Exercise 2.2.2. We induct on n (using Theorem 2.2.2):
Induction base: We have f 0 = 0, f 1 = 1 and f 2 = 1. Thus, f 2 f 0 − f 12 = 1 · 0 − 12 =
−1 = (−1)1 . In other words, Exercise 2.2.2 holds for n = 1.
Induction step: Let k be an integer such that k > 1. Assume (as the induction
hypothesis) that Exercise 2.2.2 holds for n = k − 1. We must show that Exercise
2.2.2 holds for n = k. In other words, we must show that f k+1 f k−1 − f k2 = (−1)k .
Our induction hypothesis says that Exercise 2.2.2 holds for n = k − 1. In other
words, it says that f k f k−2 − f k2−1 = (−1)k−1 . But the recursive definition of the
Fibonacci sequence yields f k+1 = f k + f k−1 (since k > 1). Hence,
f k +1 f k −1 = ( f k + f k −1 ) f k −1 = f k f k −1 + f k2−1
|{z} |{z}
= f k + f k −1 = f k f k−2 −(−1)k−1
(since f k f k−2 − f k2−1 =(−1)k−1 )

= f k f k−1 + f k f k−2 − (−1)k−1 = f k ( f k −1 + f k −2 ) − (−1)k−1


| {z } | {z }
= fk =−(−1)k
(since the recursive definition
of the Fibonacci sequence
yields f k = f k−1 + f k−2 )
 
k
= f k f k − − (−1) = f k2 + (−1)k ,

so that f k+1 f k−1 − f k2 = (−1)k . This is exactly what we wanted to prove. This
completes the induction step, and with it the solution to Exercise 2.2.2.

Some writers shorten their induction proofs even further by reusing the letter n itself
(instead of m or k as we did above) in the induction step. That is, instead of fixing a k > g
and assuming that the claim holds for n = k − 1 and proving that it holds for n = k, they
fix an n > g and assume that the claim holds “for n − 1 instead of n” (i.e., the claim holds
if n is replaced by n − 1 in it) and prove that it holds for n as well. This saves a letter and
a bit of writing, at the cost of being potentially more confusing and slippery (as it requires
you to check that you have properly replaced n by n − 1 in the induction hypothesis); thus
I do not recommend it. But you should be aware that it is a commonly used “figure of
speech”.19
The next exercise (a particular case of [Grinbe15, Theorem 2.26 (a)]) illustrates a
point about choosing the right claim when doing induction.
19 For example, here is how the above solution to Exercise 2.2.2 could be rewritten using this con-

December 25, 2021


Math 235 notes page 24

Exercise 2.2.3. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Prove that

f n + m +1 = f n f m + f n +1 f m +1 (11)

for any nonnegative integers n and m.

We have two nonnegative integer variables here (n and m), so we can try to do
induction on either. As to the other, it appears reasonable to just fix it beforehand.
So we try the following:
First attempt at solving Exercise 2.2.3. Let us fix m and induct on n (using Theorem
2.1.1).
Induction base: The equality (11) holds for n = 0. Indeed, for n = 0, this equality
boils down to f 0+m+1 = f 0 f m + f 1 f m+1 , which follows easily from f 0 = 0 and
f 1 = 1.
Induction step: Let k be a nonnegative integer.20 Assume (as the induction hy-
pothesis) that (11) holds for n = k. We must show that (11) holds for n = k + 1.
In other words, we must show that f (k+1)+m+1 = f k+1 f m + f (k+1)+1 f m+1 . In other
words, we must show that f k+m+2 = f k+1 f m + f k+2 f m+1 .
Our induction hypothesis says that (11) holds for n = k, that is, we have f k+m+1 =
f k f m + f k +1 f m +1 .
The recursive definition of the Fibonacci sequence yields

f k + m +2 = f k + m +1 + f k + m .
vention:
We induct on n (using Theorem 2.2.2):
Induction base: We have f 0 = 0, f 1 = 1 and f 2 = 1. Thus, f 2 f 0 − f 12 = 1 · 0 − 12 = −1 = (−1)1 .
In other words, Exercise 2.2.2 holds for n = 1.
Induction step: Let n be an integer such that n > 1. Assume (as the induction hypothesis) that
Exercise 2.2.2 holds for n − 1 instead of n. We must show that Exercise 2.2.2 holds for n. In other
words, we must show that f n+1 f n−1 − f n2 = (−1)n .
Our induction hypothesis says that Exercise 2.2.2 holds for n − 1 instead of n. In other words,
it says that f n f n−2 − f n2−1 = (−1)n−1 . But the recursive definition of the Fibonacci sequence
yields f n+1 = f n + f n−1 (since n > 1). Hence,

f n +1 f n −1 = ( f n + f n −1 ) f n −1 = f n f n −1 + f n2−1 = f n f n−1 + f n f n−2 − (−1)n−1


|{z} |{z}
= f n + f n −1 = f n f n−2 −(−1)n−1
(since f n f n−2 − f n2−1 =(−1)n−1 )

− (−1)n−1 = f n f n − − (−1)n = f n2 + (−1)n ,



= fn ( f n −1 + f n −2 )
| {z } | {z }
= fn =−(−1)n
(since the recursive definition
of the Fibonacci sequence
yields f n = f n−1 + f n−2 )

so that f n+1 f n−1 − f n2 = (−1)n . This is exactly what we wanted to prove. This completes the
induction step, and with it the solution to Exercise 2.2.2.
20 This k will play the role of the m in Theorem 2.1.1, since we cannot use the letter m for it here

(because m is already a fixed number).

December 25, 2021


Math 235 notes page 25

Now, our induction hypothesis lets us decompose the f k+m+1 on the right hand side
as f k f m + f k+1 f m+1 ; but how do we decompose the f k+m ? The induction hypothesis
does not help us here, and we are stuck.
This suggests that we need a better induction hypothesis. The easiest way to get
one is to not fix m before starting the induction. The result is that we have to carry
a “for all nonnegative integers m” through our induction; but this extra weight
turns out to be useful:
Second attempt at solving Exercise 2.2.3. Let us induct on n.
Induction base: The equality (11) holds for n = 0 and every nonnegative integer
m. Indeed, for n = 0, this equality boils down to f 0+m+1 = f 0 f m + f 1 f m+1 , which
follows easily from f 0 = 0 and f 1 = 1.
Induction step: Let k be a nonnegative integer. Assume (as the induction hypoth-
esis) that (11) holds for n = k and every nonnegative integer m. We must show that
(11) holds for n = k + 1 and every nonnegative integer m. In other words, we must
show that f (k+1)+m+1 = f k+1 f m + f (k+1)+1 f m+1 for every nonnegative integer m. In
other words, we must show that f k+m+2 = f k+1 f m + f k+2 f m+1 for every nonnegative
integer m.
Our induction hypothesis says that (11) holds for n = k and every nonnegative
integer m. In other words, we have

f k + m +1 = f k f m + f k +1 f m +1 (12)

for every nonnegative integer m.


Now, let m be a nonnegative integer. The recursive definition of the Fibonacci
sequence yields
f k + m +2 = f k + m +1 + f k + m . (13)
Once again, we can use our induction hypothesis (12) to rewrite the f k+m+1 on
the right hand side as f k f m + f k+1 f m+1 . But this time, we can also apply (12) to
m − 1 instead of m (since the m in (12) was an arbitrary nonnegative integer, not
related to the m we have currently fixed), and thus obtain f k+(m−1)+1 = f k f m−1 +
f k+1 f (m−1)+1 . To be fully honest, we can only do this when m − 1 is a nonnegative
integer, which means that we cannot do this when m = 0; but the m = 0 case is
easy and left to the reader. So we WLOG assume that m 6= 0; therefore, m ≥ 1, and
thus m − 1 is a nonnegative integer. Hence, (12) (applied to m − 1 instead of m)
yields f k+(m−1)+1 = f k f m−1 + f k+1 f (m−1)+1 . Since (m − 1) + 1 = m, this rewrites as

f k + m = f k f m −1 + f k +1 f m . (14)

December 25, 2021


Math 235 notes page 26

Now, (13) becomes


f k + m +2 = f m +1 + f +m
|k+{z } |k{z }
= f k f m + f k +1 f m +1 = f k f m −1 + f k +1 f m
(by (12)) (by (14))
= f k f m + f k +1 f m +1 + f k f m −1 + f k +1 f m
= f k +1 f m + f k ( f m + f m −1 ) + f k +1 f m +1
| {z }
= f m +1
(since the recursive definition
of the Fibonacci sequence
yields f m+1 = f m + f m−1 )
= f k +1 f m + f k f m +1 + f k +1 f m +1
= f k +1 f m + ( f k + f k +1 ) f m +1 = f k +1 f m + f k +2 f m +1 .
| {z }
= f k +2
(since the recursive definition
of the Fibonacci sequence
yields f k+2 = f k+1 + f k = f k + f k+1 )

But this is exactly what we wanted to show. Thus, the induction step is complete,
and Exercise 2.2.3 is solved.
The solution we just gave is not the simplest possible; there is a different one,
which avoids having to special-case the m = 0 case (as we did above). The trick is
to rewrite f k+m+2 not as f k+m+1 + f k+m , but rather as follows:
f k+m+2 = f k+(m+1)+1 = f k f m+1 + f k+1 f m+2
(by (12), applied to m + 1 instead of m). It is a nice exercise for the reader to finish
this argument (see [Grinbe15, proof of Theorem 2.26 (a)] for the answer).
Another version of induction is tailored to proving theorems about integers n
in a finite interval21 rather than about all integers n ≥ g. Instead of relying on
Theorem 2.1.1, it relies on the following theorem ([Grinbe15, Theorem 2.74]):

Theorem 2.2.3. Let g ∈ Z and h ∈ Z. For each n ∈ { g, g + 1, . . . , h}, let A (n) be


a logical statement.
Assume the following:

Assumption 1: If g ≤ h, then the statement A ( g) holds.22

Assumption 2: If m ∈ { g, g + 1, . . . , h − 1} is such that A (m) holds,


then A (m + 1) also holds.

Then, A (n) holds for each n ∈ { g, g + 1, . . . , h}.


21 Here, the word “interval” means a set of the form
{ g, g + 1, . . . , h} = {all integers between g and h (inclusive)}
for two fixed integers g and h. Thus, unlike in analysis, our intervals here consist entirely of
integers.

December 25, 2021


Math 235 notes page 27

Theorem 2.2.3 can easily be derived from Theorem 2.1.1, by applying the latter
to the statement “if n ≤ h, then A (n)” instead of A (n). (See [Grinbe15, proof
of Theorem 2.74] for the details of this derivation.) It is clear how to perform
induction using Theorem 2.2.3: It differs from standard induction only in that we
assume g ≤ m ≤ h − 1 (instead of only assuming m ≥ g) in the induction step.
Here is an example of an induction proof using Theorem 2.2.3:

Proposition 2.2.4. Let g and h be integers such that g ≤ h. Let bg , bg+1 , . . . , bh be


any h − g + 1 nonzero integers. Assume that bg ≥ 0. Assume further that

| bi + 1 − bi | ≤ 1 for every i ∈ { g, g + 1, . . . , h − 1} . (15)

Then, bn > 0 for each n ∈ { g, g + 1, . . . , h}.

Proposition 2.2.4 is often called the “discrete intermediate value theorem” or the
“discrete continuity principle”. Its intuitive meaning is that if a finite list of nonzero
integers starts with a nonnegative integer, and every further entry of this list differs
from its preceding entry by at most 1 (you can think of this as a discrete version
of continuity), then all entries of this list must be positive.23 Intuitively, this is
obvious: It just says that it isn’t possible to go from a nonnegative integer to a
negative integer by steps of 1 without ever stepping at 0. The following proof is
just a rigorous restatement of this intuitive argument:
Proof of Proposition 2.2.4 (sketched). (See [Grinbe15, proof of Proposition 2.75] for de-
tails.) We induct on n using Theorem 2.2.3 (that is, we apply Theorem 2.2.3 to the
statement A (n) = (“bn > 0”)):
Induction base: We must prove that if g ≤ h, then the statement bg > 0 holds. So
let us assume that g ≤ h. (Actually, we have already assumed so in the statement of
the proposition.) Recall that bg , bg+1 , . . . , bh are nonzero; thus, in particular, bg 6= 0.
But we also have bg ≥ 0. Combining these, we find bg > 0. This completes the
induction base.
Induction step: Let m ∈ { g, g + 1, . . . , h − 1} be such that bm > 0 holds. We must
show that bm+1 > 0 also holds.
Applying (15) to i = m, we find |bm+1 − bm | ≤ 1. But it is well-known (and easy
to see) that every integer x satisfies − x ≤ | x |. Applying this to x = bm+1 − bm ,
we obtain − (bm+1 − bm ) ≤ |bm+1 − bm | ≤ 1. In other words, 1 ≥ − (bm+1 − bm ) =
bm − bm+1 . In other words, 1 + bm+1 ≥ bm . Hence, 1 + bm+1 ≥ bm > 0, so that
1 + bm+1 ≥ 1 (since 1 + bm+1 is an integer). In other words, bm+1 ≥ 0. However,
bm+1 6= 0 (since bg , bg+1 , . . . , bh are nonzero). Combining this with bm+1 ≥ 0, we
obtain bm+1 > 0. This completes the induction step. Hence, Proposition 2.2.4 is
proved.
22 The “If g ≤ h” in this assumption is a bit silly: If we don’t have g ≤ h, then the claim we are
proving is vacuous to begin with (because the set { g, g + 1, . . . , h} is empty in this case). But
sometimes it is good to have vacuous cases covered, too.
23 An example of such a list is (2, 3, 3, 2, 3, 4, 4, 3, 2, 3, 2, 3, 2, 1).

December 25, 2021


Math 235 notes page 28

In the future, we will no longer say “We induct on n using Theorem 2.2.3”,
but instead just say “We induct on n”. Indeed, it is clear that we must be using
Theorem 2.2.3 if we are inducting on a variable that is bound to an interval (like
the n in Proposition 2.2.4).

2.3. Strong induction


The induction principle (in the form of Theorem 2.2.2) can be briefly summarized
as follows: If we want to prove that a statement A (n) holds for all integers n ≥ g,
then it suffices to prove it under the assumption that A (n − 1) holds (as long as
one has proved that A ( g) holds). In our above examples, this idea was enough
to make the proof straightforward or at least fairly easy. Sometimes, however, this
assumption is not enough. Here is one example, known as Binet’s formula:
√ √
1+ 5 1− 5
Theorem 2.3.1. Let ϕ = and ψ = be the two solutions of the
2 2
quadratic equation X 2 − X − 1 = 0. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence.
Then,
1 1
f n = √ ϕn − √ ψn (16)
5 5
for every nonnegative integer n.

Theorem 2.3.1 is an explicit formula for Fibonacci numbers, and what a surpris-
ing one – would you have expected the irrational numbers ϕ and ψ √ to appear in
1+ 5
a formula for an integer sequence? Note that the number ϕ = ≈ 1. 618
2
in Theorem 2.3.1 is known as the golden ratio (although it shares that distinction
1
with its reciprocal ≈ 0.618), and the number ψ is what is known as a conjugate
ϕ
of ϕ (although the notion is only properly understood in abstract algebra24 ). The
golden ratio is famous for appearing in various places in mathematics, and this is
one of them.
How can we prove Theorem 2.3.1? It appears reasonable to induct on n (using
Theorem 2.2.2); the base case (n = 0) is easy, and the induction step would have
us assume that (16) holds for n = k − 1 and try to prove that (16) holds for n = k.
Unfortunately, here we hit a wall: While the induction hypothesis lets us compute
f k−1 , it would not let us compute f k−2 , but we would need both f k−1 and f k−2 in
order to simplify f k = f k−1 + f k−2 .
24 Ina nutshell: If a (real or complex) number ζ is a root of an irreducible polynomial P with rational
coefficients,
√ then√all roots√ of P are called the conjugates of ζ. For example, the conjugates of the
number
√ 2 are 2 and − 2, since they are the roots of the irreducible polynomial x2 − 2 whose
root 2 is. One of the ideas of Galois theory is that conjugates of a number “belong together
with it”; while we will not formalize this idea in this class, we will see its manifestations several
times.

December 25, 2021


Math 235 notes page 29

Thus we are in want of a stronger induction hypothesis: one that claims (16) not
only for n = k − 1, but also for n = k − 2. Better yet, why not claim that (16) holds
for all n < k ?
This is what strong induction does: It strengthens the induction hypothesis from
“the claim holds for n = k − 1” to “the claim holds for all n < k”. The underlying
principle is the following:25

Theorem 2.3.2. Let g be an integer. For each integer n ≥ g, let A (n) be a logical
statement.
Assume the following:

• Assumption 1: If k is an integer such that k ≥ g and such that

(A (n) holds for every integer n ≥ g satisfying n < k) , (17)

then A (k ) holds.

Then, A (n) holds for each integer n ≥ g.

This looks a bit tortuous, so let us unravel what it means to prove something
using Theorem 2.3.2. This will be called a proof by strong induction.
Let g be an integer (which is typically taken to be 0 or 1, as in standard induction).
Say that we want to prove that some statement A (n) holds for every integer n ≥ g.
Doing this via standard induction (i.e., using Theorem 2.2.2) would require us to
prove (in the induction step) that A (k ) follows from A (k − 1) (whenever k > g
is an integer). (It would also require an induction base, which we disregard for
now.) On the other hand, doing this via strong induction (i.e., using Theorem
2.3.2) would instead require us to prove that A (k) follows from (17) – that is, from
A ( g) ∧ A ( g + 1) ∧ · · · ∧ A (k − 1). Obviously, when k > g, then A ( g) ∧ A ( g + 1) ∧
· · · ∧ A (k − 1) is a stronger statement than A (k − 1); thus, when we are applying
strong induction, we have a stronger induction hypothesis than when applying
standard induction.
There is one more difference between standard and strong induction: A strong
induction needs no induction base. Indeed, in Theorem 2.2.2 there are two assump-
tions, but in Theorem 2.3.2 there is only one. This might appear strange, because
how comes we can afford omitting the induction base? However, this is not as fishy
as it looks like; it turns out that Assumption 1 in Theorem 2.3.2 already contains a
“base case” in it. To be more precise, I claim that if Assumption 1 in Theorem 2.3.2
is satisfied, then A ( g) must hold. Indeed, Assumption 1 in Theorem 2.3.2 (applied
to k = g) says that if

(A (n) holds for every integer n ≥ g satisfying n < g) , (18)

then A ( g) holds. But (18) is a vacuous statement (since there is no integer n ≥ g


25 Theorem 2.3.2 is [Grinbe15, Theorem 2.60], with m renamed as k.

December 25, 2021


Math 235 notes page 30

satisfying n < g), and thus is vacuously true26 ; therefore, the previous sentence
entails that A ( g) holds. This argument might appear like a sleight of hand, but it
is logically sound.
All of this theoretical chatter is probably less useful than an actual example of a
proof by strong induction; so let us have one now:
Proof of Theorem 2.3.1. Let us try to prove Theorem 2.3.1 by strong induction on n.
This means that we apply Theorem 2.3.2 to g = 0 and to the statement
 
1 n 1 n
A (n) = “ f n = √ ϕ − √ ψ ” .
5 5

Induction step:27 Let k be an integer such that k ≥ 0. Assume that

(A (n) holds for every integer n ≥ 0 satisfying n < k) . (19)

We must show that A (k ) holds. In other words, we must prove that


1 1
f k = √ ϕk − √ ψk . (20)
5 5
Of course, we would want to apply the recursive definition of the Fibonacci
sequence to obtain the equality f k = f k−1 + f k−2 . This is slightly complicated by
the fact that this equality holds only for k ≥ 2 (since we have not defined f −1
and f −2 ); thus we need to handle the case k < 2 separately. Fortunately, this is
straightforward (and fairly quick): If k < 2, then k = 0 or k = 1, and in each of
these two cases we can√verify (20) by hand (noticing that the definitions of ϕ and ψ
easily imply ϕ − ψ = 5). Thus, we WLOG assume that k ≥ 2. Hence, we do have
f k = f k−1 + f k−2 . Note also that (because of k ≥ 2) we have k − 2 ≥ 0 and k − 1 ≥ 0.
Our assumption (19) plays the role of an induction hypothesis. In particular, we
can apply it to n = k − 1 (since k − 1 ≥ 0 is an integer satisfying k − 1 < k). We
thus obtain that A (k − 1) holds, i.e., that we have
1 1
f k −1 = √ ϕ k −1 − √ ψ k −1 . (21)
5 5
Likewise, we can apply (19) to n = k − 2 (since k − 2 ≥ 0 is an integer satisfying
k − 2 < k). We thus conclude that A (k − 2) holds, i.e., that we have
1 1
f k −2 = √ ϕ k −2 − √ ψ k −2 . (22)
5 5
26 For the meaning of the words “vacuously true”, see the Wikipedia page on “vacuous truth” (or
most introductions to mathematical proof).
27 In a strong induction, “induction step” means the part where we check that Assumption 1 in

Theorem 2.3.2 holds. As we just discussed, a strong induction needs no induction base, so the
induction step is the only real part of it. Thus, many writers don’t even bother to say “Induction
step:”.

December 25, 2021


Math 235 notes page 31

(Note that we have used k − 1 ≥ 0 and k − 2 ≥ 0 here; this is another reason why
we needed to handle the case k < 2 separately.)
But ϕ is a solution of the quadratic equation X 2 − X − 1 = 0; thus, ϕ2 − ϕ − 1 = 0,
so that ϕ + 1 = ϕ2 . Likewise, ψ + 1 = ψ2 . Now,

fk = f k −1 + f k −2
|{z} |{z}
1 1 1 1
= √ ϕ k −1 − √ ψ k −1 = √ ϕ k −2 − √ ψ k −2
5 5 5 5
(by (21)) (by (22))
1 1 1 1
= √ ϕ k −1 − √ ψ k −1 + √ ϕ k −2 − √ ψ k −2
5 5 5 5
1 
k −1 k −2
 1 
k −1 k −2

=√ ϕ +ϕ −√ ψ +ψ
5| {z } 5| {z }
= ϕ k −2 ( ϕ +1 ) = ψ k −2 ( ψ +1 )
1 1
= √ ϕ k −2 ( ϕ + 1 ) − √ ψ k −2 ( ψ + 1 )
5 | {z } 5 | {z }
= ϕ2 = ψ2
1 1 1 1
= √ ϕ k −2 ϕ 2 − √ ψ k −2 ψ 2 = √ ϕ k − √ ψ k .
5 | {z } 5 | {z } 5 5
= ϕk =ψk

In other words, (20) holds. In other words, A (k ) holds. Thus, the induction step is
complete, and we are done proving Theorem 2.3.1.
A few general remarks are in order. First of all, as we already saw in the proof
of Theorem 2.3.1, the statement (17) that is being assumed in the induction step of
a strong induction plays the role of an induction hypothesis; thus it is commonly
referred to as the induction hypothesis. Second, while (technically speaking) our
strong induction had no induction base, we nevertheless had to treat some “small-
k” cases by hand (in our case, the case k < 2, which split into k = 0 and k =
1). Thus, we had a “de-facto” induction base in our induction step, even though
we didn’t call it an induction base. This is fairly common for proofs by strong
induction.
Strong induction is a standard method for proving properties of Fibonacci num-
bers. Indeed, the latter are defined by a recursion ( f k = f k−1 + f k−2 ) that refers back
not just to the previous entry f k−1 but to the entry f k−2 as well; thus, when proving
a claim about f k , it is useful to have not just the corresponding claim about f k−1 ,
but also the corresponding claim about f k−2 at one’s disposal. With its stronger
induction hypothesis, strong induction is uniquely suited to providing both claims
in its induction step.
Our proof of Theorem 2.3.1 was fairly straightforward, but it does nothing to
demystify it. In particular, if you didn’t know this formula, how could you come
up with it in the first place? We will see an answer to this question in Subsection

December 25, 2021


Math 235 notes page 32

4.9.4 (specifically, in the second proof of Theorem 4.9.11).28


Let me note in passing that Theorem 2.3.1 is useful as a tool in proving identities
for Fibonacci numbers. In particular, Exercise 2.2.3 boils down to a straightforward
computation once both sides are rewritten using Theorem 2.3.1.
Proofs by strong induction rely on Theorem 2.3.2. This theorem itself can be
proved by standard induction (so it is not a new fundamental principle, but merely
a “better interface” to standard induction); see [Grinbe15, proof of Theorem 2.60]
for this proof. See also [Grinbe15, §2.8] for more examples of proofs by strong
induction.
The next result we are going to prove using strong induction is yet another prop-
erty of Fibonacci numbers, namely a combinatorial interpretation of them. This
relies on the following notion:

Definition 2.3.3. A set S of integers is said to be lacunar if it contains no two


consecutive integers (i.e., there is no s ∈ S such that s + 1 ∈ S).

For example, the sets {1, 4} and {3, 5} and {3, 7, 9} are lacunar, while the sets
{1, 2, 5} and {3, 4} are not. (The empty set is lacunar, and so is any 1-element set
of integers.)
We can now state the result we want to prove:

Theorem 2.3.4. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. For each nonnega-


tive integer n, let [n] denote the n-element set {1, 2, . . . , n}.
Let n ≥ 0 be an integer. Then, the number of all lacunar subsets of [n] is f n+2 .

Example 2.3.5. Let us verify Theorem 2.3.4 for small values of n:

• The only lacunar subset of [0] is ∅ (since the set [0] itself is empty). Thus,
the number of all lacunar subsets of [0] is 1, which is precisely what Theo-
rem 2.3.4 says for n = 0 (since f 0+2 = f 2 = 1).

• The only lacunar subsets of [1] are ∅ and {1} (since [1] = {1}). Thus, the
number of all lacunar subsets of [1] is 2, which is precisely what Theorem
2.3.4 says for n = 1 (since f 1+2 = f 3 = 2).

• The only lacunar subsets of [2] are ∅, {1} and {2} (since [2] = {1, 2}).
Thus, the number of all lacunar subsets of [2] is 3, which is precisely what
Theorem 2.3.4 says for n = 2 (since f 2+2 = f 4 = 3).

• The only lacunar subsets of [3] are ∅, {1}, {2}, {3} and {1, 3} (since [3] =
{1, 2, 3}). Thus, the number of all lacunar subsets of [3] is 5, which is
precisely what Theorem 2.3.4 says for n = 3 (since f 3+2 = f 5 = 5).

28 A rather elementary answer is found in [Grinbe15, Remark 4.3], but note that linear algebra
(specifically, the notion of eigenvalues and diagonalization) provides some more motivation.

December 25, 2021


Math 235 notes page 33

Proof of Theorem 2.3.4 (sketched). Apply strong induction on n. (That is, apply The-
orem 2.3.2 with g = 0.)
Induction step:29 Let k ∈ N. Assume (as the induction hypothesis) that Theorem
2.3.4 holds for each integer n ≥ 0 satisfying n < k. (This is precisely the assumption
(17) in Theorem 2.3.2.) We must show that Theorem 2.3.4 holds for n = k. In other
words, we must prove that the number of all lacunar subsets of [k ] is f k+2 .
Here is a sketch of how this is done (see [19fco, first proof of Proposition 1.4.9]
for details): If k < 2, then this has already been done in Example 2.3.5; thus, we
WLOG assume that k ≥ 2. (We will see later why this assumption is needed.30 ) We
shall call a subset of [k ]

• red if it contains k;

• green if it does not contain k.

Thus, each subset of [k] is either red or green (but not both). Hence, in order to
count the lacunar subsets of [k ], we can count the red ones and the green ones
separately, and then add the results.
Our induction hypothesis says that Theorem 2.3.4 holds for each integer n ≥ 0
satisfying n < k. In other words, for each integer n ≥ 0 satisfying n < k, we have

(the number of all lacunar subsets of [n]) = f n+2 . (23)

Counting the green lacunar subsets of [k ] is easy: They are plainly the lacunar
subsets of [k − 1]. Thus,

(the number of all green lacunar subsets of [k])


= (the number of all lacunar subsets of [k − 1])
= f (k−1)+2 (by (23), applied to n = k − 1)
= f k +1 . (24)

Here, in applying (23) to n = k − 1, we have tacitly used the facts that k − 1 ≥ 0


(since k ≥ 2 ≥ 1) and that k − 1 < k (obviously).
Now let us count the red lacunar subsets of [k ]. These subsets contain k, and
thus do not contain k − 1 (since they are lacunar, but k and k − 1 are consecutive
integers). Hence, if we remove k from them, then we end up with lacunar subsets
of [k − 2]. Thus, to each red lacunar subset S of [k ] corresponds a lacunar subset
S \ {k } of [k − 2]. This is a 1-to-1 correspondence31 , because conversely, if T is a
29 As we said, no induction base is needed in a strong induction.
30 Of course, if you were to solve a problem, you wouldn’t make this WLOG assumption here; you
would make it at the point you need it. I just found it better to make it here in order to uncrowd
the argument later on.
31 Here is an example of this correspondence: If k = 5, then the red lacunar subsets

{5} , {1, 5} , {2, 5} , {3, 5} , {1, 3, 5} of [5]

December 25, 2021


Math 235 notes page 34

lacunar subset of [k − 2], then T ∪ {k } is a red lacunar subset of [k ] (check this!).


This 1-to-1 correspondence entails that

(the number of all red lacunar subsets of [k])


= (the number of all lacunar subsets of [k − 2])
= f (k−2)+2 (by (23), applied to n = k − 2)
= fk (25)

(where we now have used k − 2 ≥ 0 and k − 2 < k).


Now, recall that each subset of [k ] is either red or green (but not both). Hence,

(the number of all lacunar subsets of [k])


= (the number of all red lacunar subsets of [k])
+ (the number of all green lacunar subsets of [k]) (26)
= f k + f k +1 (by (25) and (24))
= f k +1 + f k = f k +2
(since the recursive definition of the Fibonacci sequence yields f k+2 = f k+1 + f k ).
In other words, Theorem 2.3.4 holds for n = k. This completes the induction step,
and so Theorem 2.3.4 is proved.
Let me stress a basic fact from set theory that we have tacitly used in the above
proof:

Theorem 2.3.6. If P and Q are two disjoint finite sets, then the set P ∪ Q is finite
as well, and satisfies
| P ∪ Q| = | P| + | Q| . (27)

Theorem 2.3.6 is known as the sum rule for two sets; it is the reason why the
equality (26) holds. Indeed, since each lacunar subset of [k ] is either red or green,
we have

{lacunar subsets of [k]}


= {red lacunar subsets of [k]} ∪ {green lacunar subsets of [k]}
and thus

|{lacunar subsets of [k]}|


= |{red lacunar subsets of [k]} ∪ {green lacunar subsets of [k]}|
= |{red lacunar subsets of [k]}| + |{green lacunar subsets of [k]}|
correspond to the lacunar subsets

∅, {1} , {2} , {3} , {1, 3} of [3] ,

respectively.

December 25, 2021


Math 235 notes page 35

(by (27), applied to

P = {red lacunar subsets of [k ]} and


Q = {green lacunar subsets of [k ]} ,

because the sets {red lacunar subsets of [k]} and {green lacunar subsets of [k ]} are
disjoint); but this is precisely the equality (26).

2.4. Recitation #1: More induction problems


Here are some exercises that use induction in non-obvious ways. The first one is
about an infinite series:

Exercise 2.4.1. Prove that



1
∑ i (i + 1) = 1.
i =1

Discussion of Exercise 2.4.1. There is no “n” here to induct over, so one might won-
der whether induction really can help. But let’s not give up. Induction can be very
useful for computing finite sums; but an infinite sum is the limit of its partial sums,
which are finite. So let us consider some partial sums.
n 1
For each integer n ≥ 0, let S (n) denote the sum ∑ . This is a partial sum
i =1 i ( i + 1 )
∞ 1
of the infinite sum ∑ ; thus,
i =1 i ( i + 1 )

1
∑ i (i + 1) = nlim
→∞
S (n) . (28)
i =1

(This assumes that the limit lim S (n) exists in the first place; we don’t know this
n→∞
yet, but it will fall out of our argument in the end.)
To get a feeling for the S (n), let us compute the first few values:
1 2 3
S (0) = 0, S (1) = , S (2) = , S (3) = .
2 3 4
This suggests a conjecture: Namely, we suspect that
n
S (n) = for every integer n ≥ 0. (29)
n+1
But this conjecture can easily be verified by induction:
[Proof of (29): Induct on n.
0 1
Base case: The definition of S (0) yields S (0) = ∑ = (empty sum) =
i =1 i ( i + 1 )
0
0 = . In other words, (29) holds for n = 0.
1

December 25, 2021


Math 235 notes page 36

Induction step: Let m ≥ 0 be an integer. Assume (as the induction hypothesis)


that (29) holds for n = m. We must prove that (29) holds for n = m + 1. In other
m+1
words, we must prove that S (m + 1) = .
m+2
Our induction hypothesis says that (29) holds for n = m. In other words, it says
m
that S (m) = .
m+1
∞ 1
Both S (m) and S (m + 1) are partial sums of ∑ ; they differ only in that
i =1 i ( i + 1 )
1
S (m + 1) has an extra addend that S (m) does not have. Thus,
( m + 1) ( m + 2)
1 m 1 m+1
S ( m + 1) = S ( m ) + = + =
| {z } ( m + 1) ( m + 2) m + 1 ( m + 1) ( m + 2) m+2
m
=
m+1
m+1
(by straightforward computations). Thus, we have shown that S (m + 1) = .
m+2
In other words, (29) holds for n = m + 1. This completes the induction step, and
with it the proof of (29).]
Now, (28) becomes

1 n 1 1
∑ i (i + 1) = nlim
→∞
S (n) = lim
n→∞ n + 1
= lim
n→∞ 1
=
1
i =1 1+ 1 + lim
| {z }
n | {z }
n n→∞ n
= 1
n+1 =
(by (29)) 1
1+
n
1
= = 1.
1+0
This solves the exercise.
The “induct, then take the limit” approach from the previous exercise has other
uses as well. The following exercise is a more intricate example:

1+ 5
Exercise 2.4.2. Let ϕ = (so that ϕ ≈ 1.618 . . .). Prove that
2
1
ϕ = 1+ . (30)
1
1+
1
1+
1
1+
...

Note: The infinite nested fraction on the right hand side of (30) is called an
(infinite) continued fraction. It is rigorously defined as the limit of the sequence of

December 25, 2021


Math 235 notes page 37

its finite initial segments – i.e., in our case, of the sequence


 
 
 1 1 1 
1, 1 + , 1 + , 1 + , . . . .
 
1 1 1

1+ 1+
 
1 1
 
1+
1

Discussion of Exercise 2.4.2. Let us first restate the claim without scary-looking nested
fractions. Define a sequence ( x1 , x2 , x3 , . . .) of rational numbers recursively by

1
x1 = 1, and xn = 1 + for all n ≥ 2.
x n −1
Thus,
1 1 1
x1 = 1, x2 = 1 + , x3 = 1 + , x4 = 1 + , ....
1 1 1
1+ 1+
1 1
1+
1
Thus, ( x1 , x2 , x3 , . . .) is the sequence of finite initial segments of the infinite con-
tinued fraction on the right hand side of (30). The latter fraction is thus defined
as lim xn . Hence, our claim rewrites as ϕ = lim xn . So we need to prove that
n→∞ n→∞
ϕ = lim xn .
n→∞
There are many ways to go about this; let us outline two:
First approach. Computing the first few entries of the sequence ( x1 , x2 , x3 , . . .)
shows that
3 5 8 13
x1 = 1, x2 = 2, x3 = , x4 = , x5 = , x6 = .
2 3 5 8
Both the numerators and the denominators in these fractions belong to the Fi-
bonacci sequence ( f 0 , f 1 , f 2 , . . .) introduced in Definition 2.2.1. A quick comparison
suggests the conjecture that

f n +1
xn = for each n ≥ 1. (31)
fn

This is indeed true; indeed, (31) can easily be shown by induction on n (exercise!).
Better yet, even if you forgot about the Fibonacci sequence, you could easily discover the
formula (31) as follows: The values of x1 , x2 , . . . , x6 we computed above do not look very
random; they are fractions32 , with the numerator of each xi reappearing as the denominator

32 Here 1 2
we rewrite x1 = 1 as , and x2 = 2 as .
1 1

December 25, 2021


Math 235 notes page 38

of xi+1 . (This is not surprising, given the recursive definition of ( x1 , x2 , x3 , . . .).) This
a n +1
suggests that the numbers xn have the form xn = for some sequence ( a1 , a2 , a3 , . . .)
an
of integers. And indeed, we can try to define such a sequence ( a1 , a2 , a3 , . . .) by setting
ai = x1 x2 · · · xi−1 for each i ≥ 1 (which, in particular, entails that a1 = x1 x2 · · · x0 =
(empty product) = 1, because empty products are defined to be 1). Now, the recursive
1
equation xn = 1 + can be restated in terms of the sequence ( a1 , a2 , a3 , . . .) as follows:
x n −1
 
1
xn = 1 +
x n −1
 
 
 a n +1 1  a n +1 an
⇐⇒   = 1+    since xn = and xn−1 =
an an  an a n −1
a n −1
 
a n +1 a n −1
⇐⇒ = 1+
an an
⇐⇒ ( an+1 = an + an−1 ) (here, we multiplied both sides by an ) .

Thus, the sequence ( a1 , a2 , a3 , . . .) must satisfy the recursive equation an+1 = an + an−1
for each n ≥ 2. But this is the same recursive equation that the Fibonacci sequence
( f 0 , f 1 , f 2 , . . .) satisfies! Moreover, the first two entries a1 and a2 of the sequence ( a1 , a2 , a3 , . . .)
are the second and third entries f 1 and f 2 of the Fibonacci sequence ( f 0 , f 1 , f 2 , . . .) (since
a1 = 1 = f 1 and a2 = x1 = 1 = f 2 ). Thus, the sequence ( a1 , a2 , a3 , . . .) is precisely the
“shifted” Fibonacci sequence ( f 1 , f 2 , f 3 , . . .) (“shifted” in the sense that the first entry f 0 = 1
a n +1 f n +1
is discarded). Now, xn = becomes xn = , so we have arrived at (31) without
an fn
relying on our integer sequence identification skills.
What can we do with (31)? We still need to prove that ϕ = lim xn . While (31)
n→∞
gives a formula for xn in terms of Fibonacci numbers, we still need to find lim xn
n→∞
somehow. √
1− 5
Binet’s formula (Theorem 2.3.1) comes to our help now. Set ψ = . Note
2
that our ϕ and ψ here are precisely the ϕ and ψ from Theorem 2.3.1. Thus, for
every nonnegative integer n, we have

1 1
f n = √ ϕn − √ ψn (by Theorem 2.3.1)
5 5
 n 
ψn
  
1 n n 1 n 1 n ψ
= √ (ϕ − ψ ) = √ ϕ 1 − n = √ ϕ 1 −
5 5 ϕ 5 ϕ
1
= √ ϕ n (1 − ρ n ) , (32)
5

ψ 1− 5
where we have set ρ := . Note that this ρ is explicitly given by ρ = √ =
ϕ 1+ 5

December 25, 2021


Math 235 notes page 39


5−3
≈ −0.381 97 . . ..
2
Now, for each n ≥ 1, we have
f n +1
xn = (by (31))
fn
= f n +1 / fn
|{z} |{z}
1 1
= √ ϕ n +1 ( 1 − ρ n +1 ) = √ ϕ n (1− ρ n )
5 5
(by (32)) (by (32))

1 − ρ n +1
   1 
1 n +1  n +1 n n
= √ ϕ 1−ρ / √ ϕ (1 − ρ ) = ϕ · .
5 5 1 − ρn
Hence,
1 − ρ n +1 1 − ρ n +1
 
lim xn = lim ϕ· = ϕ · lim . (33)
n→∞ n→∞ 1 − ρn n→∞ 1 − ρn

The limit on the right hand side is now easy to find: Since |ρ| < 1, we have ρn → 0
1 − ρ n +1 1−0
as n → ∞, and therefore also ρn+1 → 0 as n → ∞. Hence, n
→ =1
1−ρ 1−0
1 − ρ n +1
as n → ∞. In other words, lim = 1. Hence, (33) becomes
n→∞ 1 − ρn

1 − ρ n +1
lim xn = ϕ · lim = ϕ.
n→∞ n→∞ 1 − ρn
| {z }
=1

This proves ϕ = lim xn , and thus solves the exercise.


n→∞
Second approach. The first approach showed above relied on an exact computation
of the first few entries of the sequence ( x1 , x2 , x3 , . . .). In contrast, for our second
approach (which is mostly taken from [GelAnd17, §3.1.4]), let us compute them
approximately:

x1 = 1, x2 = 2, x3 = 1.5, x4 ≈ 1.667, x5 = 1.6, x6 ≈ 1.625.

This creates the impression that the sequence ( x1 , x2 , x3 , . . .) converges to ϕ ≈ 1.618


alternatingly from the bottom and the top: the odd-numbered entries x1 , x3 , x5 , . . .
appear to be smaller than ϕ, while the even-numbered entries x2 , x4 , x6 , . . . appear
to be larger than ϕ. Better yet, it seems that

x2 < x4 < x6 < · · · < ϕ < · · · < x5 < x3 < x1 . (34)

While this alone would not suffice to solve the exercise, it seems like a good step
forward, so let us try to prove this. We need to show the following two statements:

• If i ≥ 1 satisfies xi > ϕ, then xi+1 < ϕ and xi+2 < xi .

December 25, 2021


Math 235 notes page 40

• If i ≥ 1 satisfies xi < ϕ, then xi+1 > ϕ and xi+2 > xi .

Both of these statements follow by some manipulation of inequalities.33 Thus, (34)


is proved.
Now, (34) shows that the sequence ( x1 , x3 , x5 , . . .) is decreasing and bounded
from below; hence, the monotone convergence theorem shows that this sequence
( x1 , x3 , x5 , . . .) has a limit a := lim x2n+1 . Likewise, the sequence ( x2 , x4 , x6 , . . .) has
n→∞
a limit b := lim x2n (since (34) shows that this sequence is increasing and bounded
n→∞
from above). We shall now show that a = b = ϕ.
Indeed, we have
 
1 1 1  
a = lim x2n+1 = lim 1 + = 1+ = 1+ since lim x2n = b
n→∞ | {z } n→∞ x2n lim x2n b n→∞
n→∞
1
=1+
x2n

and

b = lim x2n = lim x 2( n +1) (since we can substitute n + 1 for n in a limit)


n→∞ n→∞ | {z }
= x2n+2
1
=1+
x2n+1
 
1 1 1  
= lim 1+ = 1+ = 1+ since lim x2n+1 = a .
n→∞ x2n+1 lim x2n+1 a n→∞
n→∞

How can we solve these two equalities for a and b ? The simplest way is perhaps
1
the following: Multiplying the equation a = 1 + by b, we find ab = b + 1; on
b
33 Forexample, let us prove the first statement. So let i ≥ 1 be an integer satisfying xi > ϕ. We must
1 1
prove that xi+1 < ϕ and xi+2 < xi . The recursive definition of xi+1 yields xi+1 = 1 + < 1+
xi ϕ
1 1
(since xi > ϕ). But a straightforward computation shows that 1 + = ϕ. Hence, xi+1 < 1 + =
ϕ ϕ
ϕ. Furthermore, the recursive definition of xi+2 yields
 
1 1 1
x i +2 = 1 + = 1+ since xi+1 = 1 +
x i +1 1 xi
1+
xi
xi
= 1+ < xi ,
1 + xi

where the last inequality is a consequence of the fact that xi > ϕ and the (straightforward) fact
x
that 1 + < x for every real x > ϕ. Thus, both xi+1 < ϕ and xi+2 < xi are proved.
1+x
xi
The second statement is proved similarly, except that this time 1 + > xi follows from
1 + xi
xi < ϕ and xi ≥ 0. We leave the details to the reader.

December 25, 2021


Math 235 notes page 41

1
the other hand, multiplying the equation b = 1 + by a, we find ab = a + 1.
a
Comparing ab = a + 1 with ab = b + 1, we find a + 1 = b + 1, thus a = b. However,
b = lim x2n ≤ lim ϕ = ϕ and a = lim x2n+1 ≥ lim ϕ = ϕ, so that ϕ ≤ a.
n→∞ |{z} n→∞ n→∞ | {z } n→∞
<ϕ >ϕ
(by (34)) (by (34))
Combined with a = b ≤ ϕ, this yields a = ϕ. Similarly, b = ϕ.
Now, we know that both subsequences ( x1 , x3 , x5 , . . .) and ( x2 , x4 , x6 , . . .) of the
sequence ( x1 , x2 , x3 , . . .) converge to ϕ (since lim x2n+1 = a = ϕ and lim x2n = b =
n→∞ n→∞
ϕ). By basic properties of limits, this implies that the whole sequence ( x1 , x2 , x3 , . . .)
converges to ϕ. In other words, ϕ = lim xn . Again, the exercise is solved.
n→∞

Here is another exercise that does not look like an induction problem, yet is one:

Exercise 2.4.3. We say that a number is funny if it can be written in the form

±12 ± 22 ± 32 ± · · · ± m2

for some nonnegative integer m and some choice of ± signs. For example, 4 is
funny because 4 = −12 − 22 + 32 , whereas 5 is funny because 5 = +12 + 22 .
Also, 0 is funny since 0 = (empty sum) (this corresponds to choosing m = 0).
Prove that every integer is funny.

Discussion of Exercise 2.4.3. I will not give a full solution, but here is a sequence of
hints that should suffice:

1. First, let’s try to solve the “little brother” of the problem, which is obtained
by replacing the squares by 1-st powers: We say that a number is giggly if it
can be written in the form

±1 ± 2 ± 3 ± · · · ± m

for some nonnegative integer m and some choice of ± signs. Prove that every
integer is giggly.

2. It suffices to prove that every positive integer is giggly (resp. funny), since
flipping all the ± signs will flip the sign of the number.

3. If some number n is giggly, then so is n + 1, because n = ±1 ± 2 ± 3 ± · · · ± m


entails n + 1 = ±1 ± 2 ± 3 ± · · · ± m − (m + 1) + (m + 2).

4. So much for the “little brother”. What about the original problem? We need
an analogue of the formula − (m + 1) + (m + 2) = 1 that we just used.

5. The most obvious thing to try is − (m + 1)2 + (m + 2)2 . Unfortunately, this is


not 1 but 2m + 3, but this is already a good step forward, since it is linear (not
quadratic) in m.

December 25, 2021


Math 235 notes page 42

6. Now, let us subtract − (m + 1)2 + (m + 2)2 = 2m + 3 from − (m + 3)2 +


(m + 4)2 = 2 (m + 2) + 3, since this should get rid of the linear term and
leave a constant behind. We obtain

( m + 1)2 − ( m + 2)2 − ( m + 3)2 + ( m + 4)2


   
2 2 2 2
= − ( m + 1) − ( m + 2) + − ( m + 3) + ( m + 4)
| {z } | {z }
=2m+3 =2(m+2)+3=2m+7
= − (2m + 3) + (2m + 7) = 4. (35)

7. Thus, if some number n is funny, then so is n + 4.

8. Hence, by strong induction, it suffices to show that every n ∈ {0, 1, 2, 3} is


funny.

9. Do it!

This ends our first excursion into the uses of induction. We will see more uses,
and even more variants of induction, in the following chapters.

December 25, 2021


Math 235 notes page 43

3. Number Theory I: Divisibility and congruence


We shall now discuss some of the most classical results in mathematics: the proper-
ties of divisibility and modular congruence of integers. Most of them were known
to Euclid, although the concept of congruence was first defined by Gauss. These
results are doubly important: first, these facts are basic and commonly used in con-
test mathematics; second, they make good examples for induction proofs. Proofs
will be mostly skipped or sketched; detailed proofs can be found in every text on
elementary number theory (or in [19s, Chapter 2], from which I am copypasting
some of the statements). We are not trying to be comprehensive or detailed; there
are better sources for this (e.g., [Burton11], [NiZuMo91] or [UspHea39], or, for a
shorter introduction, [Dudley12]).

3.1. Quotients and remainders


First, a few definitions. I begin by weighing in on one of the most controversial
issues of our time:

Definition 3.1.1. The symbol N will denote the set {0, 1, 2, . . .} of all nonnegative
integers.

(The faultline between the “N = {0, 1, 2, . . .} people” and the “N = {1, 2, 3, . . .}


people” is rather close to that between algebraists/combinatorialists and number
theorists; as you can see, I am one of the former.)

Definition 3.1.2. Let a and b be two integers. We say that a | b (or “a divides b”
or “b is divisible by a” or “b is a multiple of a” or “a is a divisor of b”) if there exists
an integer c such that b = ac.
We furthermore say that a - b if a does not divide b.

This definition, too, is a bit controversial: It implies that 0 | 0. Some authors don’t
like this (arguing that a | b should mean that b/a is uniquely determined, which
0/0 is not); while I understand their thinking, I believe that forbidding 0 from
dividing itself would create more headaches than it would prevent. The words
“divides” and “divisor”, too, can mean different things depending on whom you
ask; in particular, Knuth (e.g. in [GrKnPa94]) likes to define them differently from
how I do34 .
Note that 1 | b holds for any b ∈ Z; but 0 | b holds only for b = 0. Note also that
a | − a for each a ∈ Z.
34 He defines “a divides b” to mean “b > 0, and there exists an integer c such that b = ac”. This
is to be distinguished from “b is a multiple of a”, which he (like me) defines to mean only
“there exists an integer c such that b = ac”. Thus, quoting [GrKnPa94, §4.1]: “Every integer
is a multiple of −1, but no integer is divisible by −1 (strictly speaking)”. Again, I understand
the reasons for this (e.g., this way, the divisors of 6 are 1, 2, 3, 6 rather than the unnecessarily
duplicated −6, −3, −2, −1, 1, 2, 3, 6), but I am not convinced that it is worth the headache.

December 25, 2021


Math 235 notes page 44

Here are some basic properties of divisibility (all of which are easy to prove35 ):

Proposition 3.1.3. Let a and b be two integers.


(a) We have a | b if and only if | a| | |b|. (Here, “| a| | |b|” means “| a| divides
|b|”.)
(b) If a | b and b 6= 0, then | a| ≤ |b|.
(c) If a | b and b | a, then | a| = |b|.
b
(d) Assume that a 6= 0. Then, a | b if and only if ∈ Z.
a

Proposition 3.1.4. (a) We have a | a for every a ∈ Z. (This is called the reflexivity
of divisibility.)
(b) If a, b, c ∈ Z satisfy a | b and b | c, then a | c. (This is called the transitivity
of divisibility.)
(c) If a1 , a2 , b1 , b2 ∈ Z satisfy a1 | b1 and a2 | b2 , then a1 a2 | b1 b2 .
(d) If a, b ∈ Z satisfy a | b, then ak | bk for any nonnegative integer k.

Proposition 3.1.5. Let a, b, c be three integers such that c 6= 0. Then, a | b holds if


and only if ac | bc.

Proposition 3.1.6. Let n ∈ Z. Let a, b ∈ N be such that a ≤ b. Then, n a | nb .

Proposition 3.1.7. Let a, b, c ∈ Z be such that a | b and a | c. Then, a | b + c and


a | b − c.

We shall use these facts many times (and often without saying). They provide
basic rules for manipulating divisibilities36 . For example, Proposition 3.1.4 (c) al-
lows multiplying two divisibilities, while Proposition 3.1.5 allows multiplying both
sides of a divisibility by a nonzero integer c or, conversely, cancelling the factor
c from both sides. Proposition 3.1.3 (a) ensures that both sides of a divisibility
can be replaced by their absolute values, which is why it often suffices to consider
nonnegative integers in divisibility arguments.
The next fact ([19s, Theorem 2.6.1]) is significantly more important:

Theorem 3.1.8. Let n be a positive integer. Let u ∈ Z. Then, there exists a unique
pair (q, r ) ∈ Z × {0, 1, . . . , n − 1} such that u = qn + r.

Theorem 3.1.8 essentially says that any integer u can be uniquely divided with
remainder by any positive integer n. The entries q and r of the pair (q, r ) in Theorem
3.1.8 are called the quotient and the remainder of this division.
35 For what it’s worth: Proposition 3.1.3 is a combination of [19s, Proposition 2.2.3 and Exercise
2.2.2]. Proposition 3.1.4 is a combination of [19s, Proposition 2.2.4 and Exercise 2.2.6]. Propo-
sition 3.1.5 is [19s, Exercise 2.2.3]. Proposition 3.1.6 is [19s, Exercise 2.2.4]. Finally, Proposition
3.1.7 follows easily from [19s, Proposition 2.3.4 (d)] or can be straightforwardly proved using the
definition of divisibility.
36 A divisibility means a statement of the form “a | b”.

December 25, 2021


Math 235 notes page 45

We shall not prove Theorem 3.1.8 in detail, but the reader is advised to recall (or
construct) at least one proof – as it is a nice exercise on induction. One detailed
proof (using strong induction) is given in [19s, §2.6]; another appears in [Grinbe15,
proof of Theorem 2.153]. Let me say a few words about the second proof, as it
illustrates a little variation on standard induction: two-sided induction. This means
using the following two-sided induction principle ([Grinbe15, Theorem 2.149]):

Theorem 3.1.9. Let g ∈ Z. For each integer n, let A (n) be a logical statement.
Assume the following:

• Assumption 1: The statement A ( g) holds.

• Assumption 2: If m is an integer such that m ≥ g and such that A (m) holds,


then A (m + 1) also holds.

• Assumption 3: If m is an integer such that m ≤ g and such that A (m) holds,


then A (m − 1) also holds.

Then, A (n) holds for all integers n.

While standard induction (Theorem 2.1.1) and strong induction (Theorem 2.3.2) are
tailored for proving theorems about nonnegative (or positive) integers, two-sided
induction (Theorem 3.1.9) is best suited for proving theorems about all integers.
Thus, a two-sided induction has an induction base and two induction steps, one
of which goes “upwards” (from A (m) to A (m + 1)) while the other goes “down-
wards” (from A (m) to A (m − 1)). Now, Theorem 3.1.8 can be proved by two-sided
induction on u (for fixed n). More precisely, we can use two-sided induction on u
to prove the existence of a pair (q, r ) ∈ Z × {0, 1, . . . , n − 1} such that u = qn + r;
the uniqueness of this pair is easiest to prove directly. (See [Grinbe15, proof of
Theorem 2.153] for details.)

3.2. Modular arithmetic I: Congruences


Judged by their definition, congruences – or, more precisely, modular congruences –
are just reformulated divisibilities. But the reformulation is worth it, as it exposes
their most useful qualities. In this section, we will define congruences and state
their most basic properties; later we shall return to take a deeper look at them.
First, the definition:

Definition 3.2.1. Let n, a, b ∈ Z. We say that a is congruent to b modulo n if and


only if n | a − b. We shall use the notation “a ≡ b mod n” for “a is congruent to
b modulo n”.
We furthermore shall use the notation “a 6≡ b mod n” for “a is not congruent
to b modulo n”.

December 25, 2021


Math 235 notes page 46

Example 3.2.2. (a) Is 3 ≡ 7 mod 2 ? Yes, since 2 | 3 − 7 = −4.


(b) Is 3 ≡ 6 mod 2 ? No, since 2 - 3 − 6 = −3. So we have 3 6≡ 6 mod 2.
Now, let a and b be two integers.
(c) We have a ≡ b mod 0 if and only if a = b. (Indeed, a ≡ b mod 0 is defined
to mean 0 | a − b, but the latter divisibility happens only when a − b = 0, which
is tantamount to saying a = b.)
(d) We have a ≡ b mod 1 always, since 1 | a − b always holds (remember: 1
divides everything).

Statements of the form “a ≡ b mod n” are called congruences (just as statements


of the form “a = b” are called equalities). The number n is called the modulus of
the congruence a ≡ b mod n. The following properties of congruences are proved
in [19s, §2.3] (but the proofs make good exercises!):

Proposition 3.2.3. Let n ∈ Z and a ∈ Z. Then, a ≡ 0 mod n if and only if n | a.


(Thus, in particular, n ≡ 0 mod n always holds.)

Proposition 3.2.4. Let a, b, n ∈ Z. Then, a ≡ b mod n if and only if there exists


some d ∈ Z such that b = a + nd.

Proposition 3.2.5. Let a, b, c, n ∈ Z. Then, a − b ≡ c mod n if and only if a ≡


b + c mod n.

Proposition 3.2.6. Let n ∈ Z.


(a) We have a ≡ a mod n for every a ∈ Z. (This is called the reflexivity of
congruence.)
(b) If a, b, c ∈ Z satisfy a ≡ b mod n and b ≡ c mod n, then a ≡ c mod n. (This
is called the transitivity of congruence.)
(c) If a, b ∈ Z satisfy a ≡ b mod n, then b ≡ a mod n. (This is called the
symmetry of congruence.)
(d) If a1 , a2 , b1 , b2 ∈ Z satisfy a1 ≡ b1 mod n and a2 ≡ b2 mod n, then

a1 + a2 ≡ b1 + b2 mod n; (36)
a1 − a2 ≡ b1 − b2 mod n; (37)
a1 a2 ≡ b1 b2 mod n. (38)

(e) Let m ∈ Z be such that m | n. If a, b ∈ Z satisfy a ≡ b mod n, then


a ≡ b mod m.

Proposition 3.2.7. Let n, a, b ∈ Z be such that a ≡ b mod n. Then, ak ≡ bk mod n


for each k ∈ N.

December 25, 2021


Math 235 notes page 47

Proposition 3.2.8. Let n be an integer. Let S be a finite set. For each s ∈ S, let as
and bs be two integers. Assume that

as ≡ bs mod n for each s ∈ S. (39)

Then,
∑ as ≡ ∑ bs mod n (40)
s∈S s∈S
and
∏ as ≡ ∏ bs mod n. (41)
s∈S s∈S

Proposition 3.2.6 (d) shows that any two congruences can be added, subtracted
and multiplied like equalities (as long as their moduli are equal; e.g., we cannot
add the congruences 1 ≡ 3 mod 2 and 1 ≡ 4 mod 3, because their moduli 2 and 3
are distinct)37 . Proposition 3.2.8 extends this to any (finite) number of congruences
(instead of just two). Proposition 3.2.7 says that a congruence can be taken to the
k-th power for every k ∈ N (again like an equality).38 There is yet another way in
which congruences behave like equalities: Namely, they can be chained together
like equalities. To state this precisely, we need a definition:

Definition 3.2.9. Let n ∈ Z. If a1 , a2 , . . . , ak are k integers, then the statement


“a1 ≡ a2 ≡ · · · ≡ ak mod n” shall mean that

ai ≡ ai+1 mod n holds for each i ∈ {1, 2, . . . , k − 1} .

(In other words, it shall mean that a1 ≡ a2 mod n and a2 ≡ a3 mod n and a3 ≡
a4 mod n and · · · and ak−1 ≡ ak mod n. This is vacuously true when k ≤ 1. If
k = 2, then it simply means that a1 ≡ a2 mod n.)
Such a statement will be called a chain of congruences modulo n.

Proposition 3.2.10. Let n ∈ Z. Let a1 , a2 , . . . , ak be k integers such that a1 ≡ a2 ≡


· · · ≡ ak mod n. Let u and v be two elements of {1, 2, . . . , k}. Then, au ≡ av mod n.

Proposition 3.2.10 follows easily from Proposition 3.2.6 by induction. (See [Grinbe15,
proof of Proposition 2.16] for the details of this proof.)
Proposition 3.2.10 allows chaining congruences (with equal moduli) together.
Thus, for example, we can quickly see that 715 ≡ 7 mod 8 via the following compu-

37 That said, congruences cannot be divided. That is, if we have a1 ≡ b1 mod n and a2 ≡ b2 mod n,
then we cannot conclude that a1 /a2 ≡ b1 /b2 mod n, even if we assume something like a2 6≡
0 mod n and b2 6≡ 0 mod n. (Most of the time, the congruence a1 /a2 ≡ b1 /b2 mod n will be
meaningless, since a1 /a2 and b1 /b2 are usually not integers. But even if they are integers, the
congruence need not hold.)
38 Note, however, that a ≡ b mod n does not imply k a ≡ k b mod n.

December 25, 2021


Math 235 notes page 48

tation: Since 7 ≡ −1 mod 8, we have


715 ≡ (−1)15 (by Proposition 3.2.7, applied to n = 8, a = 7, b = −1 and k = 15)
| {z }
=−1
≡ −1 ≡ 7 mod 8.
Note that the second “≡” sign in this chain is actually an equality sign, because
every equality a = b is automatically a congruence a ≡ b mod n (by Proposition
3.2.6 (a)).
Proposition 3.1.4 (b) shows that divisibilities can also be chained together:

Definition 3.2.11. If a1 , a2 , . . . , ak are k integers, then the statement “a1 | a2 | · · · |


ak ” shall mean that

ai | ai+1 holds for each i ∈ {1, 2, . . . , k − 1} .

(In other words, it shall mean that a1 | a2 and a2 | a3 and a3 | a4 and · · · and
ak−1 | ak . Again, this is vacuously true when k ≤ 1.)
Such a statement will be called a chain of divisibilities.

Thus, the analogue of Proposition 3.2.10 for divisibilities is the following:

Proposition 3.2.12. Let a1 , a2 , . . . , ak be k integers such that a1 | a2 | · · · | ak . Let u


and v be two elements of {1, 2, . . . , k } such that u ≤ v. Then, au | av .

For example, if four integers a, b, c, d satisfy a | b | c | d (by which we mean a | b


and b | c and c | d), then a | d. Note that we required u ≤ v in Proposition 3.2.12,
because chains of divisibilities cannot be reversed (e.g., we cannot derive d | a from
a | b | c | d). Proposition 3.2.12 is easily proved by induction.
Here is a sample exercise to illustrate manipulation of congruences:

Exercise 3.2.1. Let n ∈ N. Show that 7 | 32n+1 + 2n+2 .

Solution to Exercise 3.2.1. We have 32 = 9 ≡ 2 mod 7. Thus, Proposition 3.2.7 (ap-


n
plied to 7, 32 , 2 and n instead of n, a, b and k) yields 32 ≡ 2n mod 7. Mul-
tiplying this congruence39 by the obvious congruence 3 ≡ 3 mod 7, we obtain
n n
32 · 3 ≡ 2n · 3 mod 7. Thus, 32n+1 = 32 · 3 ≡ 2n · 3 mod 7. On the other
hand, 2n+2 = 2n · 22 = 2n · 4, so that 2n+2 ≡ 2n · 4 mod 7 (since any equality is a
congruence).
Now, adding the two congruences40 32n+1 ≡ 2n · 3 mod 7 and 2n+2 ≡ 2n · 4 mod 7,
we obtain
32n+1 + 2n+2 ≡ 2n · 3 + 2n · 4 = 2n · (3 + 4) = 2n · 7 ≡ 0 mod 7
| {z }
=7
39 i.e., applying (38)
40 i.e., applying (36)

December 25, 2021


Math 235 notes page 49

(since 2n · 7 is clearly divisible by 7). In other words, 7 | 32n+1 + 2n+2 . This solves
Exercise 3.2.1.
Congruences can not only be added, subtracted, multiplied and chained together,
but they can also be substituted into one another, in the following sense:41

Example 3.2.13. Let n be an integer. Assume you have two integers a and b
that are congruent modulo n (that is, they satisfy a ≡ b mod n). Then, if you
have any polynomial expression P involving a, then you can substitute b for a in
this expression, and obtain a new expression Q that satisfies P ≡ Q mod n. For
example,
a + 2 ≡ b + 2 mod n;
a5 ≡ b5 mod n;
( a + 2) ( a + 9) − a ≡ (b + 2) (b + 9) − b mod n;
a2 + c2 + ac ≡ b2 + c2 + bc mod n for any integer c;
k k
∑a i
≡ ∑ bi mod n for every k ∈ N.
i =0 i =0

This is called the substitution principle for congruences. I will not formalize this
principle (see [19s, §2.5] for a more detailed treatment, which too stops short of
properly formalizing it), but I will make four comments:
First, you don’t have to replace every a by b when substituting; you can choose
some a’s to replace by b’s while leaving the remaining a’s unchanged. Thus, for
example, a ≡ b mod n yields a7 + a4 + a ≡ b7 + a4 + b mod n and a7 + a4 + a ≡
b7 + a4 + a mod n and various other such congruences.
Second, it is worth stressing that the only powers that can appear in a poly-
nomial expression are powers with constant exponents. In particular, we can-
not have “2a ” in a polynomial expression. This is important because we could
not substitute b for a in 2a ; it is not usually true that a ≡ b mod n implies
2a ≡ 2b mod n.
Third, when using the substitution principle for congruences, I will use un-
derbraces to point out what is being replaced by what. Thus, for example, when
substituting b’s for the three a’s in ( a + 2) ( a + 9) − a, I will write
  
 a
|{z} +2  |{z}
a +9 − |{z}
a ≡ (b + 2) (b + 9) − b mod n.
≡b mod n ≡b mod n ≡b mod n

(This is the same convention that I am using when substituting equal things in
an equality.)
41 Here, a “polynomial expression” means an expression that contains only variables, integers, the
symbols “+”, “−” and “·” and powers with constant exponents (i.e., things like “a3 ” or “a9 ”,
but never “2a ” or “ab ”) such that all exponents are nonnegative integers (so “a−1 ” is not allowed
either).

December 25, 2021


Math 235 notes page 50

Fourth, instead of proving the substitution principle for congruences, let me


explain how any specific application of this principle (i.e., any substitution in
a congruence) can be justified by references to Proposition 3.2.6, Proposition
3.2.7 and Proposition 3.2.8. For example, let’s say we want to justify that
a ≡ b mod n entails ( a + 2) ( a + 9) − a ≡ (b + 2) (b + 9) − b mod n. To do so,
we first add the two congruences a ≡ a mod n and 2 ≡ 2 mod n to obtain
a + 2 ≡ b + 2 mod n. Likewise, we can get a + 9 ≡ b + 9 mod n. Multiply-
ing the latter two congruences, we find ( a + 2) ( a + 9) ≡ (b + 2) (b + 9) mod n.
Subtracting the congruence a ≡ b mod n from the latter congruence, we obtain
( a + 2) ( a + 9) − a ≡ (b + 2) (b + 9) − b mod n, as desired. Similar reasoning can
be used to rigorously prove any instance of the substitution principle for con-
gruences. Thus, we don’t really need the substitution principle; we can always
circumvent it (by adding, subtracting and multiplying congruences, and by tak-
ing congruences to powers). However, the substitution principle saves time and
mental effort.

The following exercise is a slightly more intricate example of the use of congru-
ences:

Exercise 3.2.2. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Prove the following:


If a, b ∈ N satisfy a | b, then f a | f b .

For example, this exercise entails that f 7 | f 21 (since 7 | 21).


Solution to Exercise 3.2.2. Nothing forces us to use congruence here (after all, this
exercise only talks about divisibility), and it is indeed quite easy to avoid it; but I
believe the solution is easier to find using congruences.
Fix a ∈ N. We must prove that for each b ∈ N, the following statement holds:

if a | b, then f a | f b . (42)

We shall prove (42) by strong induction on b:


Induction step: Let k ∈ N. Assume (as the induction hypothesis) that (42) holds
for all b < k. We must prove that (42) holds for b = k. In other words, we must
prove that
if a | k, then f a | f k . (43)
So let us assume that a | k. We must then prove that f a | f k .
If k = 0, then this is clearly true (since we have f k = f 0 = 0 in this case, and
since f a | 0 is true42 ). Thus, for the rest of this proof, we WLOG assume that k 6= 0.
Hence, k ≥ 1 (since k ∈ N).

42 because any integer divides 0

December 25, 2021


Math 235 notes page 51

It is fairly easy to see (from a | k and k ≥ 1 and a ∈ N) that a ≥ 1 and k − a ∈ N


and k − a < k and a | k − a 43 .
Our induction hypothesis says that (42) holds for all b < k. In other words,
for each b ∈ N satisfying b < k, the statement (42) holds. We can apply this to
b = k − a (since k − a ∈ N and k − a < k), and thus conclude that the statement
(42) holds for b = k − a. In other words, if a | k − a, then f a | f k−a . Thus, f a | f k−a
(since we know that a | k − a). In other words, f k−a ≡ 0 mod f a . Note also that
f a ≡ 0 mod f a (since every integer n satisfies n ≡ 0 mod n).
But a − 1 ∈ N (since a ≥ 1). Hence, Exercise 2.2.3 (applied to n = a − 1 and
m = k − a) yields
f (a−1)+(k−a)+1 = f a−1 f k−a + f (a−1)+1 f (k−a)+1 .
In view of ( a − 1) + (k − a) + 1 = k and ( a − 1) + 1 = a, this rewrites as
f k = f a−1 f k−a + f a f (k−a)+1 .
Hence,
f k = f a −1 f k−a + f a f (k−a)+1
|{z}
≡0 mod f a
≡ f a −1 · 0 + fa f (k−a)+1
|{z}
≡0 mod f a
 
here, we have used the substitution principle
(from Example 3.2.13) to replace f k−a by 0
≡ f a−1 · 0 + 0 · f (k−a)+1
 
here, we have used the substitution principle
(from Example 3.2.13) to replace f a by 0
= 0 mod f a , (44)
and thus f a | f k . This is precisely what we wanted to show. Thus, we have proved
that (42) holds for b = k. This completes the induction step. Thus, Exercise 3.2.2 is
solved.
Two remarks are in order:
43 Proof.
We have a | k (by assumption); in other words, there exists an integer c such that k = ac.
Consider this c. If we had a = 0, then we would have k = |{z}
a c = 0, which would contradict
=0
k 6= 0. Hence, we have a 6= 0. Thus, a ≥ 1 (since a ∈ N). Also, if we had c ≤ 0, then we would
c ≤ 0 (since a ≥ 0), which would contradict k ≥ 1 > 0. Thus, we cannot have
have k = a |{z}
≤0
c ≤ 0; hence, we have c > 0. (This is all pretty obvious if you think about it; I’m just arguing
that the quotient of two positive integers must be positive.)
From c > 0, we obtain c ≥ 1 (since c is an integer), thus a |{z}
c ≥ a (since a ≥ 0). Hence,
≥1
k = ac ≥ a, so that k − a ∈ N. Moreover, a | k − a (since |{z}
k − a = ac − a = a (c − 1) is obviously
= ac
a multiple of a). Finally, k − a < k (since a ≥ 1 > 0).

December 25, 2021


Math 235 notes page 52

• We could have avoided using the substitution principle in the computation


that led to (44). In order to do so, we should have argued as follows: Mul-
tiplying the congruence f a−1 ≡ f a−1 mod f a (which is obvious) with the con-
gruence f k−a ≡ 0 mod f a , we get f a−1 f k−a ≡ f a−1 · 0 mod f a . Adding the obvi-
ous congruence f a f (k−a)+1 ≡ f a f (k−a)+1 mod f a to this congruence, we obtain
f a−1 f k−a + f a f (k−a)+1 ≡ f a−1 · 0 + f a f (k−a)+1 mod f a . This justifies the first “≡”
sign in (44). A similar argument justifies the second “≡” sign.
In the future, we will, however, be even terser and not only use the substitu-
tion principle, but also do both substitutions at once:

f a −1 f k− a + fa f (k−a)+1 ≡ f a−1 · 0 + 0 · f (k−a)+1 mod f a .


|{z} |{z}
≡0 mod f a ≡0 mod f a

• Instead of using a strong induction on b, we could have used a (standard)


induction on b/a, after first ruling out the case a = 0. This is essentially how
Exercise 3.2.2 (actually a slight generalization thereof) is solved in [Grinbe15,
proof of Theorem 2.26 (b)].

3.3. Congruences vs. remainders


Let us now come back to division with remainder. As we mentioned above, the
entries of the pair (q, r ) in Theorem 3.1.8 have names; let us also give them nota-
tions44 :

Definition 3.3.1. Let n be a positive integer. Let u ∈ Z. Theorem 3.1.8 shows


that there exists a unique pair (q, r ) ∈ Z × {0, 1, . . . , n − 1} such that u = qn + r.
Consider this pair.
(a) We denote the integer q by u//n, and refer to it as the quotient of the division
of u by n (or as the quotient obtained when u is divided by n).
(b) We denote the integer r by u%n, and refer to it as the remainder of the division
of u by n (or as the remainder obtained when u is divided by n).

Here are some basic properties of these integers:

Proposition 3.3.2. Let n be a positive integer. Let u ∈ Z.


(a) Then, u%n ∈ {0, 1, . . . , n − 1} and u%n ≡ u mod n.
(b) We have n | u if and only if u%n = 0.
(c) If c ∈ {0, 1, . . . , n − 1} is such that c ≡ u mod n, then c = u%n.
(d) We have u = (u//n) n + (u%n).
44 Warning: The notations u//n and u%n are not standard across the literature; I have taken them
from the Python programming language. Various authors write u mod n for what I call u%n, but
the notation u mod n typically means a different things (which we will meet in a later chapter),
so I prefer not to overload it thus.

December 25, 2021


Math 235 notes page 53

Proposition 3.3.3. Let n be a positive integer. Let u, v ∈ Z.


(a) We have u%n + v%n − (u + v) %n ∈ {0, n}.
(b) We have (u + v) //n − u//n − v//n ∈ {0, 1}.

Proposition 3.3.4. Let n be a positive integer. Let u and v be integers. Then,


u ≡ v mod n if and only if u%n = v%n.
juk
Proposition 3.3.5. Let n be a positive integer. Let u ∈ Z. Then, u//n = .
juk n
u
(See Section 1.1 for the definition of the floor of .)
n n

(The first three of these four propositions are proved in [19s, §2.6]; all four are
easy to prove.)
Note that Proposition 3.3.4 can be viewed as another definition of congruence
modulo n (at least when n is a positive integer).
Recall that an integer is said to be even if it is divisible by 2, and odd if it is not.
The following exercise illustrates how remainders interact with congruence:

Exercise 3.3.1. Prove that the sum of any two odd integers is even.

Solution to Exercise 3.3.1. Let a and b be two odd integers. We must prove that a + b
is even.
The integer a is odd, i.e., not divisible by 2 (by the definition of “odd”). In other
words, we don’t have 2 | a.
Proposition 3.3.2 (b) (applied to n = 2 and u = a) yields that we have 2 | a if
and only if a%2 = 0. Thus, we don’t have a%2 = 0 (since we don’t have 2 | a).
But Proposition 3.3.2 (a) (applied to n = 2 and u = a) yields that a%2 ∈ {0, 1} and
a%2 ≡ a mod 2. From a%2 ∈ {0, 1}, we obtain a%2 = 1 (since we don’t have a%2 =
0). But from a%2 ≡ a mod 2, we obtain a ≡ a%2 mod 2 (by Proposition 3.2.6 (c)).
This rewrites as a ≡ 1 mod 2 (since a%2 = 1). Similarly, b ≡ 1 mod 2. Adding these
two congruences45 , we obtain a + b ≡ 1 + 1 mod 2. But 1 + 1 = 2 ≡ 0 mod 2 (since
2 | 2 − 0). Hence, a + b ≡ 1 + 1 ≡ 0 mod 2. In other words, 2 | ( a + b) − 0 = a + b.
In other words, a + b is divisible by 2. In other words, a + b is even. This solves
Exercise 3.3.1.
The following simple exercises (see [19s, §2.7] for solutions) collect various basic
properties of even and odd integers:

Exercise 3.3.2. Let u be an integer.


(a) Prove that u is even if and only if u%2 = 0.
(b) Prove that u is odd if and only if u%2 = 1.
(c) Prove that u is even if and only if u ≡ 0 mod 2.
(d) Prove that u is odd if and only if u ≡ 1 mod 2.
45 i.e., applying (36)

December 25, 2021


Math 235 notes page 54

(e) Prove that u is odd if and only if u + 1 is even.


(f) Prove that exactly one of the two numbers u and u + 1 is even.
(g) Prove that u (u + 1) ≡ 0 mod 2.
(h) Prove that u2 ≡ −u ≡ u mod 2.
(i) Let v be a further integer. Prove that u ≡ v mod 2 holds if and only if u and
v are either both odd or both even.

Exercise 3.3.3. (a) Prove that each even integer u satisfies u2 ≡ 0 mod 4.
(b) Prove that each odd integer u satisfies u2 ≡ 1 mod 4.
(c) Prove that no two integers x and y satisfy x2 + y2 ≡ 3 mod 4.
(d) Prove that if x and y are two integers satisfying x2 + y2 ≡ 2 mod 4, then x
and y are both odd.

As an application of these simple facts, let us prove something a little bit less
trivial:

Exercise 3.3.4. Let n be an odd integer. Prove that 8 | n2 − 1.

Solution to Exercise 3.3.4. Exercise 3.3.2 (d) (applied to u = n) shows that n is odd
if and only if n ≡ 1 mod 2. Hence, n ≡ 1 mod 2 (since n is odd). In other words,
2 | n − 1. In other words, there exists an integer c such that n − 1 = 2c. Consider
this c. From n − 1 = 2c, we obtain n = 2c + 1, hence n2 = (2c + 1)2 = 4c2 + 4c + 1
and therefore n2 − 1 = 4c2 + 4c = 4c (c + 1). But Exercise 3.3.2 (g) (applied to
u = c) yields c (c + 1) ≡ 0 mod 2; in other words, 2 | c (c + 1). Hence, there exists
an integer d such that c (c + 1) = 2d. Consider this d. Now,

n2 − 1 = 4 c (c + 1) = 4 · 2d = 8d.
| {z }
=2d

Thus, 8 | n2 − 1 (since d is an integer). This solves Exercise 3.3.4.


Here is another, very similar exercise to illustrate how remainders can be used
to prove congruences almost mechanically:

Exercise 3.3.5. Let n be an integer such that 3 - n. Prove that 3 | n2 − 1.

Solution to Exercise 3.3.5. Proposition 3.3.2 (a) (applied to 3 and n instead of n and
u) yields that n%3 ∈ {0, 1, 2} and n%3 ≡ n mod 3. Symmetry of congruence yields
n ≡ n%3 mod 3 (since n%3 ≡ n mod 3).
Proposition 3.3.2 (b) (applied to 3 and n instead of n and u) yields that we have
3 | n if and only if n%3 = 0. Since we don’t have 3 | n (because we assumed 3 - n),
we thus conclude that we don’t have n%3 = 0.
Thus we know that n%3 ∈ {0, 1, 2}, but we don’t have n%3 = 0. Hence, n%3 ∈
{0, 1, 2} \ {0} = {1, 2}. Hence, we are in one of the following two cases:
Case 1: We have n%3 = 1.

December 25, 2021


Math 235 notes page 55

Case 2: We have n%3 = 2.


Let us first consider Case 1. In this case, we have n%3 = 1. Recall that n ≡ n%3 =
1 mod 3. We can square both sides of this congruence (by applying Proposition 3.2.7
to 3, n, 1 and 2 instead of n, a, b and k), and thus obtain n2 ≡ 12 = 1 mod 3. In
other words, 3 | n2 − 1. Hence, Exercise 3.3.5 is solved in Case 1.
Let us now consider Case 2. In this case, we have n%3 = 2. Recall that
n ≡ n%3 = 2 mod 3. We can square both sides of this congruence (by apply-
ing Proposition 3.2.7 to 3, n, 2 and 2 instead of n, a, b and k), and thus obtain
n2 ≡ 22 = 4 ≡ 1 mod 3 (where the last “≡” sign is a consequence of 3 | 4 − 1). In
other words, 3 | n2 − 1. Hence, Exercise 3.3.5 is solved in Case 2.
We have now solved Exercise 3.3.5 in both possible cases, so we are done.
The solution to Exercise 3.3.5 we just gave is an example of the “try all possible
remainders” technique for proving divisibilities and congruences. It should be
clear that we could also have used it to get a more-or-less mechanical solution to
Exercise 3.3.4: Since n%8 ∈ {0, 1, . . . , 7}, we would just have to check that 8 | n2 − 1
holds for all possible values 0, 1, . . . , 7 of n%8. (Out of these 8 values, only 1, 3, 5, 7
are possible, because n is assumed to be odd in Exercise 3.3.4.) In a similar fashion,
we can prove that every integer n satisfies the divisibilities

6 | n3 − n; 12 | n4 − n2 ; 10 | n5 − n; 24 | n5 − n3 ;
6 | n ( n + 1) ( n + 2) ; 24 | n (n + 1) (n + 2) (n + 3)
and many others.
As another example for the use of congruence arguments, let us find out when
Fibonacci numbers are even and when they are odd. A look at the first values
suggests that every third Fibonacci number (starting with f 0 ) is even, while the
remaining ones are odd. Equipped with the notion of a congruence (and parts (c)
and (d) of Exercise 3.3.2), we can restate this as follows:

Exercise 3.3.6. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Then,


(
0, if 3 | n;
fn ≡ mod 2 (45)
1, if 3 - n

for every nonnegative integer n.

Solution to Exercise 3.3.6 (sketched). We shall prove (45) by strong induction on n:


Induction step: Let m ∈ N. Assume (as the induction hypothesis) that (45) holds
for all n < m. We must prove that (45) for n = m. In other words, we must prove
that (
0, if 3 | m;
fm ≡ mod 2. (46)
1, if 3 - m
If m < 2, then we can see this directly from f 0 = 0 and f 1 = 1. Thus, we WLOG
assume that m ≥ 2. Hence, m − 2 and m − 1 are nonnegative integers. Since these

December 25, 2021


Math 235 notes page 56

two nonnegative integers m − 2 and m − 1 are < m, we can thus apply (45) to
n = m − 2 and to n = m − 1 (by our induction hypothesis). We thus obtain
(
0, if 3 | m − 1;
f m −1 ≡ mod 2
1, if 3 - m − 1

and (
0, if 3 | m − 2;
f m −2 ≡ mod 2.
1, if 3 - m − 2
Adding these two congruences, we obtain
( (
0, if 3 | m − 1; 0, if 3 | m − 2;
f m −1 + f m −2 ≡ + mod 2.
1, if 3 - m − 1 1, if 3 - m − 2

This rewrites as
( (
0, if 3 | m − 1; 0, if 3 | m − 2;
fm ≡ + mod 2 (47)
1, if 3 - m − 1 1, if 3 - m − 2

(since the recursive definition of the Fibonacci sequence yields f m = f m−1 + f m−2 ).
Our goal is now to deduce (46) from this congruence. In order to do so, it suffices
to show that
( (
0, if 3 | m − 1; 0, if 3 | m − 2;
+
1, if 3 - m − 1 1, if 3 - m − 2
(
0, if 3 | m;
≡ mod 2 (48)
1, if 3 - m

(because then, combining (47) with (48) will immediately yield (46) by the transi-
tivity of congruence).
The proof of (48) is a straightforward case distinction. Indeed, Proposition 3.3.2
(a) (applied to n = 3 and u = m) yields that m%3 ∈ {0, 1, 2} and m%3 ≡ m mod 3.
Symmetry of congruence yields m ≡ m%3 mod 3 (since m%3 ≡ m mod 3). Since
m%3 ∈ {0, 1, 2}, we are in one of the following three cases:
Case 1: We have m%3 = 0.
Case 2: We have m%3 = 1.
Case 3: We have m%3 = 2.
Let me work through Case 1 in detail, leaving the other two cases to the reader
(the arguments are closely similar). In Case 1, we have m%3 = 0. Thus, m ≡ m%3 =
0 mod 3. According to Proposition 3.2.3 (applied to n = 3 and a = m), we have
m ≡ 0 mod 3 if and only if 3 | m. Thus, 3 | m (since m ≡ 0 mod 3). Furthermore,
subtracting the congruence 1 ≡ 1 mod 3 from the congruence m ≡ 0 mod 3, we
obtain m − 1 ≡ 0 − 1 = −1 mod 3. Thus, we do not have m − 1 ≡ 0 mod 3 (because

December 25, 2021


Math 235 notes page 57

if we had m − 1 ≡ 0 mod 3, then we would have 0 ≡ m − 1 ≡ −1 mod 3, or,


equivalently, 3 | 0 − (−1) = 1, which is absurd). According to Proposition 3.2.3
(applied to n = 3 and a = m − 1), we have m − 1 ≡ 0 mod 3 if and only if 3 | m − 1.
Hence, we do not have 3 | m − 1 (since we do not have m − 1 ≡ 0 mod 3). In other
words, we have 3 - m − 1. A similar computation yields 3 - m − 2 (since 3 | 2
is as absurd as 3 | 1). Now, we know that 3 | m and 3 - m − 1 and 3 - m − 2.
In light of these facts, the congruence (48) (which we need to prove) rewrites as
1 + 1 ≡ 0 mod 2. In other words, it is equivalent to 2 | (1 + 1) − 0, which is obvious.
Thus, we have proved (48) in Case 1.
The proof of (48) in Case 2 is similar, except that this time we have m ≡ 1 mod 3
(instead of m ≡ 0 mod 3) and thus 3 | m − 1 and 3 - m and 3 - m − 2.
The proof of (48) in Case 3 is similar, too.

3.4. Greatest common divisors


3.4.1. The definitions
One of the main workhorses of number theory is the notion of a common divisor,
defined exactly as one would expect:
Definition 3.4.1. Let b1 , b2 , . . . , bk be integers. Then, the common divisors of
b1 , b2 , . . . , bk are defined to be the integers a that satisfy

( a | bi for all i ∈ {1, 2, . . . , k}) (49)

(in other words, that divide all of the integers b1 , b2 , . . . , bk ).

For example, the common divisors of 6 and 8 are −2, −1, 1, 2. We refer to [19s,
§2.9] for a thorough treatment of common divisors; here we shall only sketch the
main steps (particularly to the extent they illustrate induction). The notion of a
greatest common divisor is crucial:46
Definition 3.4.2. Let b1 , b2 , . . . , bk be finitely many integers. The greatest com-
mon divisor (or, for short, the gcd) of b1 , b2 , . . . , bk is the nonnegative integer
gcd (b1 , b2 , . . . , bk ) defined as follows:

• If b1 , b2 , . . . , bk are not all 0, then it is defined as the name suggests: It is the


largest of all common divisors of b1 , b2 , . . . , bk .

• If b1 , b2 , . . . , bk are all 0, then it is defined to be 0.

46 Itis easy to see that any nonzero integer b has only finitely many divisors; indeed, each divisor
of b is an integer between − |b| and |b|. Hence, if b1 , b2 , . . . , bk are finitely many integers that are
not all 0, then there are only finitely many common divisors of b1 , b2 , . . . , bk . Moreover, there is
at least one common divisor of b1 , b2 , . . . , bk (since 1 is always such a divisor). Hence, the set of
all common divisors of b1 , b2 , . . . , bk is nonempty and finite (when b1 , b2 , . . . , bk are not all zero);
therefore, this set has a largest element. This is used implicitly in Definition 3.4.2.

December 25, 2021


Math 235 notes page 58

(Note that the second case should make some eyes roll; if b1 , b2 , . . . , bk are all
0, then every integer is a common divisor of b1 , b2 , . . . , bk ; it is thus strange to
designate 0 the greatest common divisor. But this makes the more sense the more
you learn about greatest common divisors. For now, treat it as an annoying special
case.)
For example, gcd (4, 6) = 2 and gcd (3, 5) = 1 and gcd (6, 10, 15) = 1. Definition
3.4.2 easily entails the following (see [19s, Definition 2.9.6] for the details):

Proposition 3.4.3. Let b1 , b2 , . . . , bk be finitely many integers.


(a) The number gcd (b1 , b2 , . . . , bk ) is a nonnegative integer.
(b) If b1 , b2 , . . . , bk are not all 0, then gcd (b1 , b2 , . . . , bk ) is a positive integer.

3.4.2. Basic properties


The following properties of greatest common divisors ([19s, Proposition 2.9.7]) are
easy to check using the definition:

Proposition 3.4.4. (a) We have gcd ( a, 0) = gcd ( a) = | a| for all a ∈ Z.


(b) We have gcd ( a, b) = gcd (b, a) for all a, b ∈ Z.
(c) We have gcd ( a, ua + b) = gcd ( a, b) for all a, b, u ∈ Z.
(d) If a, b, c ∈ Z satisfy b ≡ c mod a, then gcd ( a, b) = gcd ( a, c).
(e) If a, b ∈ Z are such that a is positive, then gcd ( a, b) = gcd ( a, b%a).
(f) We have gcd ( a, b) | a and gcd ( a, b) | b for all a, b ∈ Z.
(g) We have gcd (− a, b) = gcd ( a, b) for all a, b ∈ Z.
(h) We have gcd ( a, −b) = gcd ( a, b) for all a, b ∈ Z.
(i) If a, b ∈ Z satisfy a | b, then gcd ( a, b) = | a|.
(j) The greatest common divisor of the empty list of integers is gcd () = 0.

Note that we are focusing on gcds of two or fewer numbers for now; we will
eventually come back to the general case.

3.4.3. Bezout’s theorem


The most important fact about greatest common divisors is the following fact ([19s,
Theorem 2.9.12]), known as Bezout’s theorem (or Bezout’s identity, despite being an
existence statement rather than a literal identity):

Theorem 3.4.5 (Bezout’s theorem). Let a and b be two integers. Then, there exist
integers x ∈ Z and y ∈ Z such that

gcd ( a, b) = xa + yb.

I shall prove this theorem here not just because it is crucial for the development
of number theory, but also because its proof is an instructive example of strong
induction on a derived quantity (namely, a + b). First, an example:

December 25, 2021


Math 235 notes page 59

Example 3.4.6. Set a = 6 and b = 10. Then, gcd ( a, b) = gcd (6, 10) = 2. Theorem
3.4.5 says that there exist integers x ∈ Z and y ∈ Z such that gcd ( a, b) = xa + yb,
that is, 2 = x · 6 + y · 10. And indeed, it is not hard to find such x and y: For
example, we can take x = 2 and y = −1. (Alternatively, we can take x = 7 and
y = −4. There are infinitely many valid choices.)

Proof of Theorem 3.4.5 (sketched). Forget that we fixed a and b.


If a and b are two integers, then Za + Zb shall denote the set

{ xa + yb | x ∈ Z and y ∈ Z} .

This is a subset of Z. Thus, Theorem 3.4.5 is saying that for any two integers a and
b, we have
gcd ( a, b) ∈ Za + Zb. (50)
We aim to prove this by strong induction on a + b, but first we need to ensure
that a + b belongs to N (or at least to Z≥ g for some g ∈ Z); this does not come
for free, since a + b can be arbitrarily small when a and b range over Z. We will
ensure a + b ∈ N by restricting ourselves to the case a, b ∈ N and then deducing
the general case from this case.
So, at first, let us prove (50) for a, b ∈ N only. We shall prove this by strong
induction on a + b; that is, we shall prove the following claim:

Claim 1: Let n ∈ N. Then, any a, b ∈ N satisfying a + b = n satisfy


gcd ( a, b) ∈ Za + Zb.

[Proof of Claim 1: Apply strong induction on n:


Induction step: Let k ∈ N. Assume (as the induction hypothesis) that Claim 1 is
true for all n < k. We must prove that Claim 1 holds for n = k.
So let a, b ∈ N be such that a + b = k. We shall show that gcd ( a, b) ∈ Za + Zb.
Proposition 3.4.4 (b) yields gcd ( a, b) = gcd (b, a). Proposition 3.4.4 (a) yields
gcd ( a, 0) = gcd ( a) = | a| = a (since a ∈ N). The same argument (applied to b
instead of a) yields gcd (b, 0) = b.
Note that a and b play symmetric roles in Claim 1 (since gcd ( a, b) = gcd (b, a)
and Za + Zb = Zb + Za), and thus can be swapped at will. By swapping a and b
if necessary, we can ensure that a ≤ b. Hence, we WLOG assume that a ≤ b. Thus,
b − a ∈ N.
If a = 0, then

gcd ( a, b) = gcd (b, a) = gcd (b, 0) (since a = 0)


= b = 0a + 1b ∈ Za + Zb.

Thus, we are done if a = 0. Hence, we WLOG assume that a 6= 0. Therefore, a > 0


(since a ∈ N). Thus, a + b > b, so that b < a + b = k.

December 25, 2021


Math 235 notes page 60

But our induction hypothesis says that Claim 1 is true for all n < k. Hence, we
can apply Claim 1 to b − a and b instead of b and n (since b − a ∈ N and a +
(b − a) = b and b < k). We thus obtain gcd ( a, b − a) ∈ Za + Z (b − a). However,

gcd ( a, b − a) = gcd ( a, (−1) a + b) (since b − a = (−1) a + b)


= gcd ( a, b) (by Proposition 3.4.4 (c), applied to u = −1) ,

so that gcd ( a, b) = gcd ( a, b − a) ∈ Za + Z (b − a).


But it is easy to see that Za + Z (b − a) ⊆ Za + Zb 47 . (Actually, it is easy to
see that Za + Z (b − a) = Za + Zb, but we will not need this.)
Hence, gcd ( a, b) ∈ Za + Z (b − a) ⊆ Za + Zb.
Now, forget that we fixed a, b. We thus have shown that any a, b ∈ N satisfying
a + b = k satisfy gcd ( a, b) ∈ Za + Zb. In other words, Claim 1 holds for n = k.
This completes the induction step. Thus, Claim 1 is proved.]
We still need to prove (50) for arbitrary integers a and b. Claim 1 handles the
case when a, b ∈ N (that is, when a, b are nonnegative). The general case can be
reduced to this case as follows:

• If a is negative, then we replace a by the positive integer − a ∈ N. This does


not change our claim because gcd (− a, b) = gcd ( a, b) and Z (− a) + Zb =
Za + Zb (check this!).

• If b is negative, then we replace b by the positive integer −b ∈ N. This does


not change our claim because gcd ( a, −b) = gcd ( a, b) and Za + Z (−b) =
Za + Zb (check this!).

Thus, in proving (50) for arbitrary integers a and b, we can WLOG assume that
a and b belong to N. But if they do, then Claim 1 (applied to n = a + b) yields that
gcd ( a, b) ∈ Za + Zb, and we are done. Theorem 3.4.5 is proved.
Our above proof of Theorem 3.4.5 essentially encodes (the most basic form of) the
extended Euclidean algorithm, which computes gcd ( a, b) (for a, b ∈ N) and represents
gcd ( a, b) in the form xa + yb (with x, y ∈ Z) by repeatedly subtracting one of the
numbers a and b from the other until one of the numbers becomes 0. While we have
not explicitly shown any algorithm in our proof, it can be recovered by unraveling
our (strong) induction; generally, inductive proofs encode recursive algorithms. We
shall not usually dwell on the algorithmic content of our proofs.

Let z ∈ Za + Z (b − a). Then, there exist x ∈ Z and y ∈ Z such that z = xa + y (b − a) (by


47 Proof.

the definition of Za + Z (b − a)). Consider these x and y. Then,

z = xa + y (b − a) = xa + yb − ya = ( x − y) a + yb.

Hence, there exist x 0 ∈ Z and y0 ∈ Z such that z = x 0 a + y0 b (namely, x 0 = x − y and y0 = y). In


other words, z ∈ Za + Zb.
Forget that we fixed z. We thus have shown that z ∈ Za + Zb for each z ∈ Za + Z (b − a). In
other words, Za + Z (b − a) ⊆ Za + Zb.

December 25, 2021


Math 235 notes page 61

3.4.4. The universal property


Theorem 3.4.5 is the workhorse of classical Euclidean number theory (i.e., the num-
ber theory done in Euclid’s Elements); it quickly proves many important results.
For example, watch how the following fact ([19s, Theorem 2.9.15 (a)]) – sometimes
known as the universal property of the greatest common divisor – easily follows from it:

Theorem 3.4.7. Let a, b ∈ Z and m ∈ Z. Then, we have the following logical


equivalence:
(m | a and m | b) ⇐⇒ (m | gcd ( a, b)) . (51)

Proof of Theorem 3.4.7. In order to prove (51), we need to prove the “=⇒” and “⇐=”
directions of the equivalence (51).
Proof of the “=⇒” direction:48 We must show that the statement (m | a and m | b)
implies the statement (m | gcd ( a, b)). So let us assume that m | a and m | b.
Theorem 3.4.5 shows that there exist integers x ∈ Z and y ∈ Z such that

gcd ( a, b) = xa + yb. (52)

Consider these x and y. Now, (using the transitivity of divisibility) we have m |


a | xa, so that xa ≡ 0 mod m. Also, m | b | yb, thus yb ≡ 0 mod m. Adding the
congruences xa ≡ 0 mod m and yb ≡ 0 mod m together, we find xa + yb ≡ 0 + 0 =
0 mod m; in other words, m | xa + yb. In view of (52), this rewrites as m | gcd ( a, b).
This proves the “=⇒” direction of the equivalence (51).
Proof of the “⇐=” direction:49 We must show that the statement (m | gcd ( a, b))
implies the statement (m | a and m | b). So let us assume that m | gcd ( a, b). Then,

m | gcd ( a, b) | a (by Proposition 3.4.4 (f))

and
m | gcd ( a, b) | b (by Proposition 3.4.4 (f)) .
Thus, we have m | a and m | b. This proves the “⇐=” direction of the equivalence
(51).
Now, both directions of the equivalence (51) are proved, so the equivalence holds.
This proves Theorem 3.4.7.
Theorem 3.4.7 can be restated as “an integer m divides two integers a and b if
and only if it divides their gcd”. This gives a useful way to show that something
divides a gcd. A sample application of Theorem 3.4.7 (as well as a useful fact in
itself) is the following theorem ([19s, Theorem 2.9.20]):

48 Commonly, mathematicians just write “=⇒:” instead of “Proof of the “=⇒” direction:”.
49 Commonly, mathematicians just write “⇐=:” instead of “Proof of the “⇐=” direction:”.

December 25, 2021


Math 235 notes page 62

Theorem 3.4.8. Let s, a, b ∈ Z. Then,

gcd (sa, sb) = |s| gcd ( a, b) .

Proof of Theorem 3.4.8 (sketched). What follows is perhaps not the simplest way to
prove Theorem 3.4.8, but it serves as a wonderful illustration of Theorem 3.4.7, as
it will use the latter theorem three times.
If we want to prove that two nonnegative integers x and y are equal, it suffices to
show that they mutually divide each other (i.e., that they satisfy x | y and y | x). In
fact, once this is shown, Proposition 3.1.3 (c) (applied to x and y instead of a and b)
will yield | x | = |y|, and this will rewrite as x = y (since x and y are nonnegative).
This might appear like a roundabout approach to proving equalities, but it turns
out to be pretty useful when x and y are characterized through their divisibility
properties (and this is the case for gcds, among other things).
We shall apply this approach to x := gcd (sa, sb) and y := |s| gcd ( a, b). Our goal
is to show that x = y; thus, we shall achieve it by showing that x | y and y | x.
(Indeed, Proposition 3.4.3 (a) shows that x and y are nonnegative.)
If s = 0, then both x and y are 0 (since gcd (0, 0) = 0), and thus we are done.
Hence, we WLOG assume that s 6= 0. Therefore, |s| 6= 0. This will come handy as
we will divide by |s| soon.
Let us first prove y | x. Indeed, Proposition 3.4.4 (f) yields gcd ( a, b) | a. We
can multiply both sides of this divisibility by s (by applying Proposition 3.1.5 to
gcd ( a, b), a and s instead of a, b and c), and thus obtain gcd ( a, b) · s | as. Note that
the two integers gcd ( a, b) · s and y are equal up to sign, since
y = |s| gcd ( a, b) = ±s gcd ( a, b) = ± gcd ( a, b) · s.
|{z}
=±s
Thus, they mutually divide each other; in particular, we have y | gcd ( a, b) · s | as =
sa. Similarly, y | sb. Thus, the integer y divides both sa and sb. Hence, Theorem
3.4.7 (applied to sa, sb and y instead of a, b and m) shows that it divides gcd (sa, sb).
In other words, y | gcd (sa, sb). In other words, y | x (since x = gcd (sa, sb)).
Let us next prove x | y. The integer |s| divides both sa and sb (since |s| | s | sa
and |s| | s | sb). Thus, Theorem 3.4.7 (applied to sa, sb and |s| instead of a, b
and m) shows that it divides gcd (sa, sb). In other words, it divides x (since x =
x
gcd (sa, sb)). Hence, is an integer (since |s| 6= 0). We shall now show that this
|s|
x
integer divides gcd ( a, b). According to Theorem 3.4.7, this will follow if we can
|s|
show that it divides both a and b. So let us prove that it divides a and b. Indeed,
x
|s| equals either s or −s (depending on the sign of s); thus, · s equals either x or
|s|
x
− x. In either case, we have · s | x. Now,
|s|
x
· s | x = gcd (sa, sb) | sa = as.
|s|

December 25, 2021


Math 235 notes page 63

We can “cancel” the factor s from this divisibility (by applying Proposition 3.1.5
x x x
to , a and s instead of a, b and c), and thus obtain | a. Similarly, | b.
|s| |s| |s|
x x x
Combining | a with | b, we obtain | gcd ( a, b) (by Theorem 3.4.7, applied
|s| |s| |s|
x x
to m = ). This, in turn, is equivalent to · s | gcd ( a, b) · s (by Proposition 3.1.5,
|s| |s|
x
applied to , gcd ( a, b) and s instead of a, b and c). In view of gcd ( a, b) · s =
|s|
x x
s gcd ( a, b) = y, this rewrites as · s | y. But as we recall, · s equals either x or
|s| |s|
x
− x; in either case, we have x | · s | y. Hence, x | y is proved.
|s|
We have now proved both x | y and y | x. As we have seen above, this entails
x = y (since x and y are nonnegative). This proves Theorem 3.4.8.

3.4.5. Using gcds


The next theorem ([19s, Theorem 2.9.17]) is crucial in a way that might not imme-
diately meet one’s eye:

Theorem 3.4.9. Let a, b, c ∈ Z satisfy a | c and b | c. Then, ab | gcd ( a, b) · c.

Before we prove this theorem, let us chat about it a bit. Here is an example first:

Example 3.4.10. Let a = 6 and b = 10 and c = 30. Then, a = 6 | 30 = c and


b = 10 | 30 = c. Thus, Theorem 3.4.9 yields ab | gcd ( a, b) · c. In view of a = 6,
b = 10, c = 13 and gcd ( a, b) = gcd (6, 10) = 2, we can rewrite this as 6 · 10 | 2 · 30,
which is not only true but actually an equality (we have 6 · 10 = 2 · 30). Note that
we do not have ab | c.

What makes Theorem 3.4.9 useful is that it lets us “swim upstream” in divisibility
arguments, in the sense of deriving “stronger” divisibilities from “weaker” ones.
(Here, we not-so-rigorously designate a divisibility x | y as “weak” if the ratio y/x
is large and “strong” if it is small. Thus, for example, the divisibility 4 | 24 is
much weaker than either of the two divisibilities 4 | 12 and 12 | 24, so that we
are “swimming downstream” when we derive 4 | 24 from 4 | 12 | 24. We are also
“swimming downstream” when we apply Proposition 3.1.4 (c); indeed, a1 a2 | b1 b2
is “weaker” than a1 | b1 and a2 | b2 (or “equally strong” at best). In contrast, as we
saw in Example 3.4.10, the divisibility ab | gcd ( a, b) · c that we gain from Theorem
3.4.9 can be much “stronger” than the two divisibilities a | c and b | c we have
invested; thus, Theorem 3.4.9 is taking us “upstream”. All this should not be taken
literally, but it gives a useful intuition.)
Again, as the following proof shows, the active ingredient in Theorem 3.4.9 is
Bezout’s theorem:

December 25, 2021


Math 235 notes page 64

First proof of Theorem 3.4.9. Theorem 3.4.5 yields that there exist integers x ∈ Z and
y ∈ Z such that gcd ( a, b) = xa + yb. Consider these x and y.
There exists an integer u such that c = au (since a | c). Consider this u.
There exists an integer v such that c = bv (since b | c). Consider this v.
Now,

gcd ( a, b) ·c = ( xa + yb) c = xa |{z}


c +yb |{z}
c = xabv + ybau = ab ( xv + yu) .
| {z }
= xa+yb =bv = au

Thus, there exists an integer d such that gcd ( a, b) · c = abd (namely, d = xv + yu).
In other words, ab | gcd ( a, b) · c. This proves Theorem 3.4.9.
Second proof of Theorem 3.4.9. We have a | a and b | c, thus ab | ac (by Proposition
3.1.4 (c), applied to a1 = a, a2 = b, b1 = a and b2 = c). Also, we have a | c and b | b,
thus ab | cb (by Proposition 3.1.4 (c), applied to a1 = a, a2 = c, b1 = b and b2 = b).
However, we have the logical equivalence

( ab | ac and ab | cb) ⇐⇒ ( ab | gcd ( ac, cb))

(by Theorem 3.4.7, applied to ac, cb and ab instead of a, b and m). Therefore,
we have ab | gcd ( ac, cb) (since we have ab | ac and ab | cb). This rewrites as
ab | gcd (ca, cb) (since ac = ca).
But Theorem 3.4.8 (applied to s = c) yields

gcd (ca, cb) = |c| gcd ( a, b) = ±c gcd ( a, b) | c gcd ( a, b) = gcd ( a, b) · c.


|{z}
=±c

Hence,
ab | gcd (ca, cb) | gcd ( a, b) · c.
This proves Theorem 3.4.9 again.
Here is yet another fact ([19s, Theorem 2.9.19]) that follows from Bezout’s theo-
rem:

Theorem 3.4.11. Let a, b, c ∈ Z satisfy a | bc. Then, a | gcd ( a, b) · c.

Theorem 3.4.11, too, is a tool for “swimming upstream” (as the resulting divisi-
bility a | gcd ( a, b) · c is usually “stronger” than a | bc).
First proof of Theorem 3.4.11. Theorem 3.4.5 yields that there exist integers x ∈ Z
and y ∈ Z such that gcd ( a, b) = xa + yb. Consider these x and y.
We have axc ≡ 0 mod a (since a | axc) and ybc ≡ 0 mod a (since a | bc | ybc).
Adding these two congruences together, we obtain axc + ybc ≡ 0 + 0 = 0 mod a.
In view of axc + ybc = ( xa + yb) c = gcd ( a, b) · c, this rewrites as gcd ( a, b) · c ≡
| {z }
=gcd( a,b)
0 mod a. In other words, a | gcd ( a, b) · c. This proves Theorem 3.4.11.

December 25, 2021


Math 235 notes page 65

Second proof of Theorem 3.4.11. We have the logical equivalence

( a | ac and a | bc) ⇐⇒ ( a | gcd ( ac, bc))

(by Theorem 3.4.7, applied to ac, bc and a instead of a, b and m). Therefore, we
have a | gcd ( ac, bc) (since we have a | ac and a | bc). This rewrites as a | gcd (ca, cb)
(since ac = ca and bc = cb). But just as in the Second proof of Theorem 3.4.9, we
can show that gcd (ca, cb) | gcd ( a, b) · c. Hence, a | gcd (ca, cb) | gcd ( a, b) · c. This
proves Theorem 3.4.11 again.
Here is yet another property of gcds:

Proposition 3.4.12. Let a1 , a2 , b1 , b2 ∈ Z satisfy a1 | b1 and a2 | b2 . Then,

gcd ( a1 , a2 ) | gcd (b1 , b2 ) .

Hint to proof of Proposition 3.4.12. Show that gcd ( a1 , a2 ) divides both b1 and b2 ; then
argue by Theorem 3.4.7. (See [19s, Exercise 2.9.4] for details.)

3.4.6. Gcds of multiple numbers


A few words are worth saying about gcds of more than two numbers. In many
ways, they behave similarly to those of two numbers. For example, Theorem 3.4.5
can be generalized to multiple numbers:

Theorem 3.4.13. Let b1 , b2 , . . . , bk be integers. Then, there exist integers


x1 , x2 , . . . , xk such that

gcd (b1 , b2 , . . . , bk ) = x1 b1 + x2 b2 + · · · + xk bk .

Theorem 3.4.13 can be proved similarly to Theorem 3.4.5: If b1 , b2 , . . . , bk ∈ N,


then the claim follows by strong induction on b1 + b2 + · · · + bk (where the induc-
tion step proceeds by subtracting the smallest nonzero number among b1 , b2 , . . . , bk
from the largest50 ); the general case can be reduced to this case by observing that
replacing any bi by −bi changes nothing. Another proof of Theorem 3.4.13 can be
found in [19s, proof of Theorem 2.9.22].
A generalization of Theorem 3.4.7 to multiple numbers also exists:

Theorem 3.4.14. Let k ∈ N, let b1 , b2 , . . . , bk ∈ Z and m ∈ Z. Then, we have the


following logical equivalence:

(m | bi for all i ∈ {1, 2, . . . , k}) ⇐⇒ (m | gcd (b1 , b2 , . . . , bk )) .

50 If there is only one nonzero number among b1 , b2 , . . . , bk , then the claim is easily verified by hand.

December 25, 2021


Math 235 notes page 66

Theorem 3.4.14 can easily be derived from Theorem 3.4.13 just as Theorem 3.4.7
was derived from Theorem 3.4.5. An alternative proof of Theorem 3.4.14 is found
in [19s, proof of Theorem 2.9.21 (a)].
It is an instructive exercise to derive from Theorem 3.4.14 the following conse-
quence:

Theorem 3.4.15. Let b1 , b2 , . . . , bk be integers, and let c1 , c2 , . . . , c` be integers.


Then,

gcd (b1 , b2 , . . . , bk , c1 , c2 , . . . , c` ) = gcd (gcd (b1 , b2 , . . . , bk ) , gcd (c1 , c2 , . . . , c` )) .

See [19s, proof of Theorem 2.9.26] for a detailed proof of Theorem 3.4.15.
It is also not hard to extend Theorem 3.4.8 to multiple numbers ([19s, Exercise
2.9.7]):

Theorem 3.4.16. Let s ∈ Z, and let b1 , b2 , . . . , bk be integers. Then,


gcd (sb1 , sb2 , . . . , sbk ) = |s| gcd (b1 , b2 , . . . , bk ).

3.4.7. An exercise
Here is a sample exercise on greatest common divisors, before we go on to properly
exploit them:

Exercise 3.4.1. Let u be an integer.


(a) Prove that ub − 1 ≡ u a − 1 mod ub−a − 1 for any a ∈ N and b ∈ N satisfying
b ≥ a.
(b) Prove that gcd u a − 1, ub − 1 = ugcd(a,b) − 1 for all a ∈ N and b ∈ N.


Solution to Exercise 3.4.1 (sketched). This is an outline; see [19s, solution to Exercise
2.9.3] for a detailed version.
(a) Let a ∈ N and b ∈ N be such that b ≥ a. We have b − a ∈ N (since b ≥ a).
Hence, ub−a is an integer. We have
   
u b − 1 − ( u a − 1) = u b − u a = u b − a − 1 u a .

Thus, ub−a − 1 | ub − 1 − (u a − 1) (since u a is an integer). In other words, ub − 1 ≡




u a − 1 mod ub−a − 1. This solves Exercise 3.4.1 (a).


(b) The following argument will imitate our proof of Theorem 3.4.5 above (specif-
ically the proof of Claim 1 in it).
We use strong induction on a + b:
Induction step: Let k ∈ N. Assume (as the induction hypothesis) that Exercise
3.4.1 (b) is true for a + b < k. We must prove that Exercise 3.4.1 (b) is true for
a + b = k.

December 25, 2021


Math 235 notes page 67

So let a, b ∈ N be such that a + b = k. We must show that gcd u a − 1, ub − 1 =




ugcd(a,b) − 1 .
Note that a and b play symmetric roles in this claim51 , and thus can be swapped
at will. By swapping a and b if necessary, we can ensure that a ≤ b. Hence, we
WLOG assume that a ≤ b. Thus, b − a ∈ N.
It is easy to see that our claim gcd u a − 1, ub − 1 = ugcd(a,b) − 1 holds if a = 0


52 .
Thus, we are done if a = 0. Hence, we WLOG assume that a 6= 0. Therefore,
a > 0 (since a ∈ N). Thus, a + b > b, so that b < a + b = k.
But our induction hypothesis says that Exercise 3.4.1 (b) is true for a + b < k.
Hence, we can apply Exercise 3.4.1 (b) to b − a instead of b (since b − a ∈ N and
a + (b − a) = b < k). We thus obtain
 
gcd u a − 1, ub−a − 1 = ugcd(a,b−a) − 1 . (53)

But we have gcd ( a, b − a) = gcd ( a, b) (this has already been proved during our
proof of Theorem 3.4.5). Furthermore, Exercise 3.4.1 (a) (applied to b − a instead of
a) yields ub − 1 ≡ ub−a − 1 mod ub−(b−a) − 1 (since b − a ∈ N and b ≥ b − a). Since
b − (b − a) = a, this rewrites as ub − 1 ≡ ub−a − 1 mod u a − 1. Hence, Proposition
3.4.4 (d) (applied to u a − 1, ub − 1 and ub−a − 1 instead of a, b and c) yields
   
b− a
a b
gcd u − 1, u − 1 = gcd u − 1, u a
− 1 = ugcd(a,b−a) − 1 (by (53))

= ugcd(a,b) − 1 (since gcd ( a, b − a) = gcd ( a, b)) .

Now, forget that we fixed a, b. We thus have shown that any a, b ∈ N satisfying
a + b = k satisfy gcd u a − 1, ub − 1 = ugcd(a,b) − 1 . In other words, Exercise 3.4.1


(b) is true for a + b = k. This completes the induction step. Thus, Exercise 3.4.1 (b)
is solved.
[See also https://math.stackexchange.com/questions/7473/ for various solu-
tions of Exercise 3.4.1 (b).]
 
51 because Proposition 3.4.4 (b) yields gcd ( a, b) = gcd (b, a) and gcd u a − 1, ub − 1 =
 
gcd ub − 1, u a − 1
52 Proof. Assume that a = 0. Then, gcd ( a, b) = b (this has already been proved during our above
proof of Theorem 3.4.5) and thus b = gcd ( a, b). Furthermore, from a = 0, we obtain u a − 1 =
u0 − 1 = 0 (since u0 = 1) and therefore
   
gcd u a − 1, ub − 1 = gcd 0, ub − 1
 
= gcd ub − 1, 0 (by Proposition 3.4.4 (b))

= ub − 1 (by Proposition 3.4.4 (a))

= ugcd(a,b) − 1 (since b = gcd ( a, b)) ,

qed.

December 25, 2021


Math 235 notes page 68

3.5. Coprimality
3.5.1. Definition and basic properties
Perhaps ironically, gcds are at their most useful when they equal 1. This situation
has a name:

Definition 3.5.1. Let a and b be two integers. We say that a is coprime to b if and
only if gcd ( a, b) = 1.

Instead of “coprime”, some authors say “relatively prime”53 .

Example 3.5.2. (a) The number 2 is coprime to 3, since gcd (2, 3) = 1. More
generally, if a is any integer, then a is coprime to a + 1. (Check this! Or see [19s,
Example 2.10.2 (c)] for the proof.)
(b) The number 6 is not coprime to 15, since gcd (6, 15) = 3 6= 1.
(c) Let a be an integer. Then, it is easy to see (see [19s, Example 2.10.2 (d)] for
the proof) that
(
2, if a is even;
gcd ( a, a + 2) = gcd ( a, 2) =
1, if a is odd.

Hence, a is coprime to a + 2 if and only if a is odd.

Following the book [GrKnPa94], we introduce a slightly quaint notation:

Definition 3.5.3. Let a and b be two integers. We write “a ⊥ b” to signify that a


is coprime to b.

The relation “⊥” is symmetric:

Proposition 3.5.4. Let a and b be two integers. Then, a ⊥ b if and only if b ⊥ a.

Proof of Proposition 3.5.4. Follows from Proposition 3.4.4 (b). (See [19s, proof of
Proposition 2.10.4] for details.)
Note that coprimality is not transitive: i.e., if we have a ⊥ b and b ⊥ c, then we
don’t usually have a ⊥ c. (A simple counterexample is a = 2, b = 1 and c = 2.)

Definition 3.5.5. Let a and b be two integers. Proposition 3.5.4 shows that a is
coprime to b if and only if b is coprime to a. Hence, we shall sometimes use a
more symmetric terminology for this situation: We shall say that “a and b are
coprime” to mean that a is coprime to b (or, equivalently, that b is coprime to a).

53 The book [NiZuMo91] even abbreviates “coprime” as “prime”, which I find somewhat misleading
(as the concept is only mildly related to the notion of a “prime” that we will discuss later on).

December 25, 2021


Math 235 notes page 69

3.5.2. More properties and examples


The following is easy ([19s, Exercise 2.10.1]) and will be used without saying:
Exercise 3.5.1. Let a ∈ Z. Prove the following:
(a) We have 1 ⊥ a.
(b) We have 0 ⊥ a if and only if | a| = 1.
We can get more examples of coprime integers from the Fibonacci sequence:
Exercise 3.5.2. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Prove that f n ⊥ f n+1
for each n ∈ N.
Solution to Exercise 3.5.2. We use induction on n:
Induction base: We have gcd (0, 1) = 1. In other words, 0 ⊥ 1 (by the definition
of “coprime”). In other words, f 0 ⊥ f 1 (since f 0 = 0 and f 1 = 1). In other words,
Exercise 3.5.2 holds for n = 0.
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that Exercise
3.5.2 holds for n = m. We must prove that Exercise 3.5.2 holds for n = m + 1. In
other words, we must prove that f m+1 ⊥ f m+2 .
Our induction hypothesis says that Exercise 3.5.2 holds for n = m. In other
words, we have f m ⊥ f m+1 . According to Proposition 3.5.4 (applied to a = f m
and b = f m+1 ), this entails f m+1 ⊥ f m . In other words, gcd ( f m+1 , f m ) = 1 (by
the definition of “coprime”). But the recursive definition of the Fibonacci sequence
yields f m+2 = f m+1 + f m = 1 f m+1 + f m . Hence,
gcd ( f m+1 , f m+2 ) = gcd ( f m+1 , 1 f m+1 + f m ) = gcd ( f m+1 , f m )
(by Proposition 3.4.4 (c), applied to a = f m+1 , b = f m and u = 1)
= 1.
In other words, f m+1 ⊥ f m+2 (by the definition of “coprime”). This is exactly what
we needed to prove. Thus, the induction step is complete, and Exercise 3.5.2 is
solved.

3.5.3. Using coprimality


We can now state two important theorems about coprime numbers (and, as a re-
ward for our previous troubles, their proofs will follow immediately from the prop-
erties of gcds). Both of them are tools for “swimming upstream” (in the sense ex-
plained in the previous section). The first one states that we can “cancel” a factor b
from a divisibility a | bc as long as this factor is coprime to a:
Theorem 3.5.6. Let a, b, c ∈ Z satisfy a | bc and a ⊥ b. Then, a | c.
Proof of Theorem 3.5.6. We have a ⊥ b; in other words, a is coprime to b (by Defini-
tion 3.5.3). In other words, gcd ( a, b) = 1 (by the definition of “coprime”). Now,
Theorem 3.4.11 yields a | gcd ( a, b) ·c = c. This proves Theorem 3.5.6.
| {z }
=1

December 25, 2021


Math 235 notes page 70

I like to think of Theorem 3.5.7 as a way of removing “unsolicited guests” from


divisibilities. Indeed, it says that we can remove the factor b from a | bc if we know
that b is “unrelated” (i.e., coprime) to a. This is used all over number theory.
The next theorem lets us “combine” two divisibilities a | c and b | c to ab | c as
long as a and b are coprime:

Theorem 3.5.7. Let a, b, c ∈ Z satisfy a | c and b | c and a ⊥ b. Then, ab | c.

Proof of Theorem 3.5.7. We have gcd ( a, b) = 1 (as in the proof of Theorem 3.5.6).
Now, Theorem 3.4.9 yields ab | gcd ( a, b) ·c = c. This proves Theorem 3.5.7.
| {z }
=1

Theorem 3.5.7 is highly useful, and will become more so once we have learnt
about prime factorization. For now, here is a quick sample application:

Exercise 3.5.3. Let n be an integer such that 2 - n and 3 - n. Prove that 24 | n2 − 1.

Solution to Exercise 3.5.3. The integer n is odd (since 2 - n); thus, Exercise 3.3.4 yields
8 | n2 − 1. Also, 3 - n; thus Exercise 3.3.5 yields 3 | n2 − 1. But it is easy to see
that gcd (8, 3) = 1, so that 8 ⊥ 3 (by the definition of “coprime”). Thus, Theorem
3.5.7 (applied to a = 8, b = 3 and c = n2 − 1) yields 8 · 3 | n2 − 1. In other words,
24 | n2 − 1 (since 8 · 3 = 24). This solves Exercise 3.5.3.
Coprimality is “inherited” by divisors, in the sense that coprime integers have
coprime divisors. To be more precise:

Proposition 3.5.8. Let a1 , a2 , b1 , b2 ∈ Z satisfy a1 | b1 and a2 | b2 and b1 ⊥ b2 .


Then, a1 ⊥ a2 .

Proof of Proposition 3.5.8. We have b1 ⊥ b2 ; in other words, gcd (b1 , b2 ) = 1 (by the
definition of “coprime”). But Proposition 3.4.12 yields gcd ( a1 , a2 ) | gcd (b1 , b2 ) = 1.
Since gcd ( a1 , a2 ) is a nonnegative integer (by Proposition 3.4.3 (a)), this entails that
gcd ( a1 , a2 ) = 1 (since the only nonnegative integer that divides 1 is 1). In other
words, a1 ⊥ a2 (by the definition of “coprime”). This proves Proposition 3.5.8.
The next theorem (still part of the fallout of Bezout’s theorem) is important, but
we will not truly appreciate it until later:

Theorem 3.5.9. Let a, n ∈ Z.


(a) There exists an a0 ∈ Z such that aa0 ≡ gcd ( a, n) mod n.
(b) If a ⊥ n, then there exists an a0 ∈ Z such that aa0 ≡ 1 mod n.
(c) If there exists an a0 ∈ Z such that aa0 ≡ 1 mod n, then a ⊥ n.

If a, n ∈ Z, then an integer a0 ∈ Z satisfying aa0 ≡ 1 mod n is called a modular


inverse of a modulo n. The word “modular inverse” is chosen in analogy to the
usual concept of an “inverse” in Z (which stands for an integer a0 ∈ Z satisfying

December 25, 2021


Math 235 notes page 71

aa0 = 1; this exists if and only if a equals 1 or −1). Theorem 3.5.9 (b) shows that
such a modular inverse always exists when a ⊥ n; Theorem 3.5.9 (c) is the converse
of this statement (i.e., it says that if a modular inverse of a modulo n exists, then
a ⊥ n).
Proof of Theorem 3.5.9 (sketched). (See [19s, proof of Theorem 2.10.8] for details.)
(a) Theorem 3.4.5 (applied to b = n) yields that there exist integers x ∈ Z and y ∈
Z such that gcd ( a, n) = xa + yn. Consider these x and y. We have54 gcd ( a, n) =
xa + yn ≡ xa = ax mod n, so that ax ≡ gcd ( a, n) mod n. Thus, there exists an
|{z}
≡0 mod n
a0 ∈ Z such that aa0 ≡ gcd ( a, n) mod n (namely, a0 = x). This proves Theorem 3.5.9
(a).
(b) Assume that a ⊥ n. In other words, gcd ( a, n) = 1 (by the definition of
“coprime”). Hence, the claim of Theorem 3.5.9 (a) rewrites immediately as the
claim of Theorem 3.5.9 (b).
(c) Assume that there exists an a0 ∈ Z such that aa0 ≡ 1 mod n. Consider this a0 .
Let g = gcd ( a, n). Then, g is a nonnegative integer55 , and Proposition 3.4.4 (f)
(applied to b = n) yields g | a and g | n.
Now, g | a | aa0 , so that aa0 ≡ 0 mod g. But also g | n. Hence, from aa0 ≡ 1 mod n,
we obtain aa0 ≡ 1 mod g (by Proposition 3.2.6 (e), applied to g, aa0 and 1 instead of
m, a and b). Hence, 1 ≡ aa0 ≡ 0 mod g. Equivalently, g | 1 − 0 = 1. Hence, g = 1
(since the only nonnegative integer that divides 1 is 1). Thus, gcd ( a, n) = g = 1. In
other words, a ⊥ n. This proves Theorem 3.5.9 (c).

3.5.4. Multiplying coprimalities


The next theorem provides a way to “multiply” coprimalities. Note how modular
inverses are used in its proof:

Theorem 3.5.10. Let a, b, c ∈ Z such that a ⊥ c and b ⊥ c. Then, ab ⊥ c.

Proof of Theorem 3.5.10. Theorem 3.5.9 (b) (applied to n = c) yields that there exists
an a0 ∈ Z such that aa0 ≡ 1 mod c. Likewise, Theorem 3.5.9 (b) (applied to b and
c instead of a and n) yields that there exists a b0 ∈ Z such that bb0 ≡ 1 mod c.
Consider these a0 and b0 .
Multiplying the two congruences aa0 ≡ 1 mod c and bb0 ≡ 1 mod c, we obtain
( aa0 ) (bb0 ) ≡ 1 · 1 = 1 mod c.
Now, define the integers r = ab and s = a0 b0 . Then, |{z}
r |{z}s = ( ab) ( a0 b0 ) =
= ab = a0 b0
≡ 1 mod c. Hence, there exists an ∈ Z such
( aa0 ) (bb0 ) r0 that rr 0 ≡ 1 mod c
(namely,
r 0 = s). Thus, Theorem 3.5.9 (c) (applied to r and c instead of a and n) yields that
r ⊥ c. In view of r = ab, this rewrites as ab ⊥ c. This proves Theorem 3.5.10.
54 Here, we are again using the substitution principle for congruences (from Example 3.2.13). Con-
vince yourself that you know how to do without this principle.
55 by Proposition 3.4.3 (a)

December 25, 2021


Math 235 notes page 72

Theorem 3.5.10 can be generalized (in a straightforward way) to products of


several numbers:
Exercise 3.5.4. Let c ∈ Z. Let a1 , a2 , . . . , ak be integers such that each i ∈
{1, 2, . . . , k} satisfies ai ⊥ c. Prove that a1 a2 · · · ak ⊥ c.
Hint to Exercise 3.5.4. Induct on k. (See [19s, solution to Exercise 2.10.2] for the
details.)
A quick consequence of this exercise is that powers of coprime integers are still
coprime:
Exercise 3.5.5. Let a, b ∈ Z be such that a ⊥ b. Let n, m ∈ N. Prove that an ⊥ bm .
Thus, for example, 214 ⊥ 36 , because 2 ⊥ 3.
Hint to Exercise 3.5.5. We have a ⊥ b. Thus, Exercise 3.5.4 (applied to k = n and
ai = a) yields an ⊥ b. According to Proposition 3.5.4, this entails b ⊥ an . Hence,
another application of Exercise 3.5.4 yields bm ⊥ an . Thus, by Proposition 3.5.4, we
get an ⊥ bm . (See [19s, solution to Exercise 2.10.4] for the details.)
We can generalize Theorem 3.5.7 to show that the product of several mutually
coprime divisors of an integer c must again be a divisor of c:
Exercise 3.5.6. Let c ∈ Z. Let b1 , b2 , . . . , bk be integers that are mutually coprime
(i.e., they satisfy bi ⊥ b j for all i 6= j). Assume that bi | c for each i ∈ {1, 2, . . . , k}.
Prove that b1 b2 · · · bk | c.
Hint to Exercise 3.5.6. Induct on k using Exercise 3.5.4. (See [19s, solution to Exer-
cise 2.10.3] for the details.)
The above results have one important application to congruences. Recall that
if a, b, c are integers satisfying ab = ac, then we can “cancel” a from the equality
ab = ac to obtain b = c as long as a is nonzero. Something similar is true for
congruences modulo n, but the condition “a is nonzero” has to be replaced by “a
is coprime to n”:
Lemma 3.5.11. Let a, b, c, n be integers such that a ⊥ n and ab ≡ ac mod n. Then,
b ≡ c mod n.
Lemma 3.5.11 says that we can cancel an integer a from a congruence ab ≡
ac mod n as long as a is coprime to n. Let us give two proofs of this lemma, to
illustrate the uses of some of the previous results:
First proof of Lemma 3.5.11. We have ab ≡ ac mod n. In other words, n | ab − ac =
a (b − c). But Proposition 3.5.4 (applied to n instead of b) shows that a ⊥ n if and
only if n ⊥ a. Thus, we have n ⊥ a (since a ⊥ n).
Thus, we know that n | a (b − c) and n ⊥ a. Hence, Theorem 3.5.6 (applied to n,
a and b − c instead of a, b and c) yields n | b − c. In other words, b ≡ c mod n. This
proves Lemma 3.5.11.

December 25, 2021


Math 235 notes page 73

Second proof of Lemma 3.5.11. Theorem 3.5.9 (b) yields that there exists an a0 ∈ Z
such that aa0 ≡ 1 mod n (since a ⊥ n). Consider this a0 . Now, multiplying both
sides of the congruence ab ≡ ac mod n by a0 , we obtain

a0 ab ≡ a0 ac mod n.

But we have a0 a
|{z} c ≡ 1c = c mod n and similarly a0 ab ≡ b mod n. Hence,
= aa0 ≡1 mod n

b ≡ a0 ab ≡ a0 ac ≡ c mod n.

This proves Lemma 3.5.11.

3.5.5. Reduced fractions


We notice that any two integers can be “made coprime” by factoring out their gcd,
unless they are both 0:

Proposition 3.5.12. Let a and b be two integers such that ( a, b) 6= (0, 0). Let
a b
g = gcd ( a, b). Then, g > 0 and ⊥ .
g g

Proof of Proposition 3.5.12. The integers a and b are not both 0 (since ( a, b) 6= (0, 0)).
Hence, gcd ( a, b) is a positive integer (by Proposition 3.4.3 (b)). Thus, gcd ( a, b) > 0.
In other words, g > 0 (since g = gcd ( a, b)).
Moreover, g = gcd ( a, b), so that Proposition 3.4.4 (f) yields g | a and g | b. Hence,
a b a b
and are integers. Thus, Theorem 3.4.8 (applied to g, and ) yields
g g g g
     
a b a b a b
gcd g · , g · = | g| gcd , = g gcd , .
g g |{z} g g g g
=g
(since g>0)

Therefore,
 
 
a b 1  a b 1
gcd , = gcd  g · , g ·  = gcd ( a, b) = 1
 
g g g  g g g
|{z} |{z}
=a =b

a b
(since g = gcd ( a, b)). In other words, ⊥ (by the definition of “coprime”). This
g g
proves Proposition 3.5.12.
An easy consequence of Proposition 3.5.12 is the following fundamental fact
([19s, Exercise 2.10.14]):

December 25, 2021


Math 235 notes page 74

Corollary 3.5.13. Let r ∈ Q. Then, there exist two coprime integers a and b
satisfying r = a/b.

Proof of Corollary 3.5.13. Write r as r = x/y for some integers x and y (with y 6= 0).
Apply Proposition 3.5.12 to a = x and b = y. (Details are found in [19s, solution to
Exercise 2.10.14].)
Corollary 3.5.13 is commonly stated in the form “any rational number can be
represented as a reduced fraction”. Here, “reduced fraction” means a fraction in
which the numerator and the denominator are coprime integers. (Such fractions
are also known as “irreducible fractions” or “fractions in lowest terms”.)

3.5.6. The rational root test

Exercise 3.5.7. Find three integers x, y and z such that gcd ( x, y, z) = 1, yet no
two of x, y and z are coprime.

Solution to Exercise 3.5.7 (sketched). Computer experiments quickly reveal that x =


6, y = 10 and z = 15 is an answer. Indeed, gcd (6, 10, 15) = 1, yet no two of 6,
10 and 15 are coprime (since gcd (6, 10) = 2 6= 1 and gcd (6, 15) = 3 6= 1 and
gcd (10, 15) = 5 6= 1).
This can be found without a computer. The trick is to find three integers a, b and
c that are mutually coprime (i.e., any two of a, b and c are coprime) and greater
than 1, and then set x = bc, y = ca and z = ab. Then, these integers x, y and z
satisfy

gcd ( x, y) = gcd (bc, ca) = gcd (ca, bc) = gcd (ca, cb)
= |c| gcd ( a, b) (by Theorem 3.4.8)
| {z }
=1
(since any two of a, b and c
are coprime)
= |c| = c (since c > 1 ≥ 0)
>1

and similarly gcd (y, z) > 1 and gcd (z, x ) > 1 (which shows that no two of x, y
and z are coprime), but also
 
 
gcd ( x, y, z) = gcd gcd ( x, y), gcd (z) (by Theorem 3.4.15)
 

| {z } | {z } 
=c =z
(by Proposition 3.4.4 (a))
 

= gcd c, |{z}


z  = gcd (c, ab) = 1
= ab

December 25, 2021


Math 235 notes page 75

(since Theorem 3.5.10 yields ab ⊥ c). Thus, in order to solve the exercise, it remains
to find three integers a, b and c that are mutually coprime and greater than 1. But
this is easy – for example, one can take a = 5 and b = 3 and c = 2. Taking these
yields x = 6, y = 10 and z = 15, which is our above example.
Another application of coprime integers is the following fact (known as the ra-
tional root test):

Theorem 3.5.14. Let P ( x ) = an x n + an−1 x n−1 + · · · + a0 x0 be a polynomial in a


single variable x with integer coefficients (i.e., all of a0 , a1 , . . . , an are integers).
Let r be a rational root of P ( x ) (that is, a rational number satisfying P (r ) = 0).
Write r in the form r = p/q for some integers p and q satisfying p ⊥ q. Then,
p | a0 and q | an .

Remark 3.5.15. Theorem 3.5.14 provides an algorithm for finding all rational
roots of a polynomial with integer coefficients. Indeed, let P ( x ) = an x n +
an−1 x n−1 + · · · + a0 x0 be such a polynomial. We can WLOG assume that an 6= 0
(otherwise, we throw away the an x n term and replace n by n − 1) and that a0 6= 0
(otherwise, we record 0 as a root of our polynomial and divide P ( x ) by x). Any
rational root r of P ( x ) can be written in the form r = p/q for some integers p
and q satisfying p ⊥ q (by Corollary 3.5.13). Writing it in this form, we then con-
clude from Theorem 3.5.14 that p | a0 and q | an . But p | a0 yields only finitely
many options for p (since a0 is nonzero and thus has only finitely many divi-
sors), and q | an yields only finitely many options for q (since an is nonzero and
thus has only finitely many divisors). Thus, we have only finitely many options
for r (since r = p/q). By listing all these options and checking which of them
actually satisfy P (r ) = 0, we can identify all rational roots of P ( x ). (Note that
divisors of a positive integer can be negative; however, we can WLOG assume
that q > 0 because otherwise we can replace p and q by − p and −q.)

Proof of Theorem 3.5.14. We have P (r ) = 0 (since r is a root of P ( x )), thus

0 = P (r ) = P ( p/q) (since r = p/q)


= an ( p/q) + an−1 ( p/q)n−1 + · · · + a0 ( p/q)0
n
 
since P ( x ) = an x n + an−1 x n−1 + · · · + a0 x0
pn p n −1 p0
= an · + a n − 1 · + · · · + a 0 ·
qn q n −1 q0
1  
= n an pn + an−1 pn−1 q + · · · + a1 pqn−1 + a0 qn .
q

Multiplying both sides of this equality by qn , we find

0 = an pn + an−1 pn−1 q + · · · + a1 pqn−1 + a0 qn . (54)

December 25, 2021


Math 235 notes page 76

Solving the equation (54) for a0 qn , we find


 
a0 qn = − an pn + an−1 pn−1 q + · · · + a1 pqn−1
 
n −1 n −2 n −1
= − p an p + a n −1 p q + · · · + a 1 q .

Thus, − p | a0 qn (since an pn−1 + an−1 pn−2 q + · · · + a1 qn−1 is an integer). Hence,


p | − p | a0 q n = q n a0 .
But p ⊥ q. Hence, Exercise 3.5.5 (applied to p, q, 1 and n instead of a, b, n and
m) yields p1 ⊥ qn . In other words, p ⊥ qn . Hence, Theorem 3.5.6 (applied to p, qn
and a0 instead of a, b and c) yields p | a0 (since p | qn a0 ).
The proof of q | an is similar: Solving the equation (54) for an pn , we find
 
an pn = − an−1 pn−1 q + · · · + a1 pqn−1 + a0 qn
 
n −1 n −2 n −1
= − q a n −1 p + · · · + a1 pq + a0 q .

Thus, −q | an pn (since an−1 pn−1 + · · · + a1 pqn−2 + a0 qn−1 is an integer). Hence,


q | −q | an pn = pn an .
But p ⊥ q. Hence, Exercise 3.5.5 (applied to p, q, n and 1 instead of a, b, n and
m) yields pn ⊥ q1 . In other words, pn ⊥ q. By Proposition 3.5.4, this yields q ⊥ pn .
Hence, Theorem 3.5.6 (applied to q, pn and an instead of a, b and c) yields q | an
(since q | pn an ).
Thus, Theorem 3.5.14 is proved.

Corollary 3.5.16. Let P ( x ) = an x n + an−1 x n−1 + · · · + a0 x0 be a polynomial in


a single variable x with integer coefficients (i.e., all of a0 , a1 , . . . , an are integers).
Let r be an integer root of P ( x ) (that is, an integer satisfying P (r ) = 0). Then,
r | a0 .
Proof of Corollary 3.5.16. We have r = r/1 and r ⊥ 1. Hence, Theorem 3.5.14 (ap-
plied to p = r and q = 1) yields r | a0 and 1 | an . Corollary 3.5.16 is thus proved.

Corollary 3.5.17. Let P ( x ) = an x n + an−1 x n−1 + · · · + a0 x0 be a polynomial in


a single variable x with integer coefficients (i.e., all of a0 , a1 , . . . , an are integers)
and with an = ±1. Let r be a rational root of P ( x ) (that is, a rational number
satisfying P (r ) = 0). Then, r is an integer and satisfies r | a0 .
Proof of Corollary 3.5.16. Corollary 3.5.13 yields that there exist two coprime inte-
gers a and b satisfying r = a/b. Consider these a and b, and denote them by p and
q. Thus, p and q are two coprime integers satisfying r = p/q. Hence, p ⊥ q (since
p and q are coprime). Thus, Theorem 3.5.14 yields p | a0 and q | an . However, from
an = ±1, we obtain an | 1, so that q | an | 1 and therefore q = ±1 (since the only
divisors of 1 are 1 and −1). Thus, r = p/ q = p/ (±1) = ± p ∈ Z (since p ∈ Z).
|{z}
=±1
In other words, r is an integer. Moreover, from r = ± p, we obtain r | p | a0 . Thus,
the proof of Corollary 3.5.17 is complete.

December 25, 2021


Math 235 notes page 77

We state another property of gcds and coprimality, which will come useful in an
exercise later on:

Proposition 3.5.18. Let a, b, c ∈ Z satisfy a ⊥ c. Then, gcd ( a, bc) = gcd ( a, b).

Proof of Proposition 3.5.18. Proposition 3.4.4 (f) (applied to bc instead of b) yields


gcd ( a, bc) | a and gcd ( a, bc) | bc. Proposition 3.5.8 (applied to a1 = gcd ( a, bc),
a2 = c, b1 = a and b2 = c) yields gcd ( a, bc) ⊥ c (since gcd ( a, bc) | a and c | c and
a ⊥ c).
We have gcd ( a, bc) | bc = cb and gcd ( a, bc) ⊥ c. Hence, Theorem 3.5.6 (applied
to gcd ( a, bc), c and b instead of a, b and c) yields gcd ( a, bc) | b.
But Theorem 3.4.7 (applied to m = gcd ( a, bc)) shows that we have the following
logical equivalence:

(gcd ( a, bc) | a and gcd ( a, bc) | b) ⇐⇒ (gcd ( a, bc) | gcd ( a, b)) .

Hence, we have gcd ( a, bc) | gcd ( a, b) (since we have gcd ( a, bc) | a and gcd ( a, bc) |
b).
On the other hand, a | a and b | bc. Hence, Proposition 3.4.12 (applied to a1 = a,
a2 = b, b1 = a and b2 = bc) yields

gcd ( a, b) | gcd ( a, bc) .

Recall also that gcd ( a, bc) | gcd ( a, b). Thus, Proposition 3.1.3 (c) (applied to
gcd ( a, bc) and gcd ( a, b) instead of a and b) yields |gcd ( a, bc)| = |gcd ( a, b)|. But a
gcd is always a nonnegative integer (by Proposition 3.4.3 (a)); thus, both gcd ( a, bc)
and gcd ( a, b) are nonnegative integers, and therefore satisfy |gcd ( a, bc)| = gcd ( a, bc)
and |gcd ( a, b)| = gcd ( a, b). Hence, gcd ( a, bc) = |gcd ( a, bc)| = |gcd ( a, b)| =
gcd ( a, b). This proves Proposition 3.5.18.

3.6. Lowest common multiples


The notion of a lowest common multiple is, so to speak, an “upside-down” coun-
terpart to the notion of a greatest common divisor. We shall restrict ourselves to
defining this notion and stating its most important properties.
First, we define the notion of a common multiple:

Definition 3.6.1. Let b1 , b2 , . . . , bk be integers. Then, the common multiples of


b1 , b2 , . . . , bk are defined to be the integers a that satisfy

(bi | a for all i ∈ {1, 2, . . . , k}) .

(In other words, a common multiple of b1 , b2 , . . . , bk is an integer that is a multiple


of each of b1 , b2 , . . . , bk .)

December 25, 2021


Math 235 notes page 78

For example, the common multiples of the two integers 6, 9 are


. . . , −54, −36, −18, 0, 18, 36, 54, . . ., that is, all multiples of 18. Clearly, if b1 , b2 , . . . , bk
are k integers, then the product b1 b2 · · · bk is a common multiple of b1 , b2 , . . . , bk (and
so is any multiple of this product, including the number 0).
Now, we can define the lowest common multiple of k integers b1 , b2 , . . . , bk . This
concept is a bit of a misnomer, since the word “lowest” is not to be taken literally;
to be more precise, it should be called “lowest positive common multiple” (and
even this would be wrong when one of b1 , b2 , . . . , bk is 0). So here is the rigorous
definition of the lowest common multiple:

Definition 3.6.2. Let b1 , b2 , . . . , bk be finitely many integers. The lowest com-


mon multiple (also known as the least common multiple, or, for short, the lcm)
of b1 , b2 , . . . , bk is the nonnegative integer lcm (b1 , b2 , . . . , bk ) defined as follows:

• If b1 , b2 , . . . , bk are all nonzero, then it is defined as the smallest posi-


tive common multiple of b1 , b2 , . . . , bk . (It is easy to see that this is well-
defined56 .)

• If b1 , b2 , . . . , bk are not all nonzero (i.e., at least one of b1 , b2 , . . . , bk is zero),


then it is defined to be 0.

For example, lcm (6, 9) = 18 and lcm (3, 5) = 15 and lcm (6, 10, 15) = 30 and
lcm (2, 4, 0) = 0. Definition 3.6.2 immediately yields the following:

Proposition 3.6.3. Let b1 , b2 , . . . , bk be finitely many integers.


(a) The number lcm (b1 , b2 , . . . , bk ) is a nonnegative integer.
(b) If b1 , b2 , . . . , bk are all nonzero, then lcm (b1 , b2 , . . . , bk ) is a positive integer.

The following theorem ([19s, Theorem 2.11.6]) gives an alternative characteriza-


tion for lcms of two integers:

Theorem 3.6.4. Let a, b ∈ Z. Then, gcd ( a, b) · lcm ( a, b) = | ab|.

Hints to the proof of Theorem 3.6.4. (See [19s, Theorem 2.11.6] for the details.) We
WLOG assume that a 6= 0 and b 6= 0 (since otherwise, our claim immediately boils
ab
down to 0 = 0). Then, set c = . It is now easy to see that c is a nonzero
gcd ( a, b)
integer (since gcd ( a, b) | a | ab and ab 6= 0) and is a common multiple of a and b
56 Proof. Assume that b1 , b2 , . . . , bk are nonzero. Then, the product b1 b2 · · · bk is nonzero, so that
its absolute value |b1 b2 · · · bk | is a positive integer. Moreover, |b1 b2 · · · bk | is a common multiple
of b1 , b2 , . . . , bk (indeed, each i ∈ {1, 2, . . . , k} satisfies bi | b1 b2 · · · bk | |b1 b2 · · · bk | ). Hence,
there exists at least one positive common multiple of b1 , b2 , . . . , bk (namely, |b1 b2 · · · bk |). Hence,
the set of all positive common multiples of b1 , b2 , . . . , bk is nonempty. Since this set is a set of
nonnegative integers, we thus conclude (using Theorem 5.1.2) that it has a minimum. In other
words, the smallest positive common multiple of b1 , b2 , . . . , bk is well-defined.

December 25, 2021


Math 235 notes page 79

(since gcd ( a, b) | b and gcd ( a, b) | a). Thus, |c| is a positive common multiple of a
and b (indeed, c 6= 0, so that |c| is positive).
On the other hand, the definition of c yields gcd ( a, b) · c = ab. Now, if x is any
positive common multiple of a and b, then Theorem 3.4.9 (applied to x instead of
c) yields ab | gcd ( a, b) · x, so that gcd ( a, b) · c = ab | gcd ( a, b) · x and therefore
c | x (here, we have cancelled the nonzero factor gcd ( a, b) from our divisibility),
which entails x ≥ |c|. In other words, any positive common multiple of a and b
is ≥ |c|. Thus, |c| is the smallest positive common multiple of a and b (since we
already know that |c| is a positive common multiple of a and b). In other words,
|c| = lcm ( a, b). Hence,
ab | ab|
lcm ( a, b) = |c| = =
gcd ( a, b) gcd ( a, b)

(since gcd ( a, b) is positive), and this yields the claim of Theorem 3.6.4.
The lowest common multiple lcm ( a, b) of two integers a and b has a universal
property analogous to that of the greatest common divisor (Theorem 3.4.7):

Theorem 3.6.5. Let a, b ∈ Z and m ∈ Z. Then, we have the following logical


equivalence:
( a | m and b | m) ⇐⇒ (lcm ( a, b) | m) . (55)

Hints to the proof of Theorem 3.6.5. (See [19s, Theorem 2.11.7 (a)] for the details.) We
WLOG assume that a 6= 0 and b 6= 0 (since otherwise, both sides of (55) are equiv-
alent to the statement “m = 0” and therefore are equivalent to each other). Let
n = lcm ( a, b). Thus, n is a positive integer. Now, our goal is to prove the equiva-
lence (55). The “⇐=” direction of this equivalence is easy (in fact, if lcm ( a, b) | m,
then a | lcm ( a, b) | m and b | lcm ( a, b) | m), so we only need to prove the “=⇒”
direction. To achieve this, we assume that a | m and b | m. Thus, m is a common
multiple of a and b. Therefore, the remainder m%n must also be a common multiple
of a and b (why?). However, this remainder m%n belongs to {0, 1, . . . , n − 1}, and
thus is either 0 or a positive integer smaller than n. However, as a common multi-
ple of a and b, it cannot be a positive integer smaller than n (because n = lcm ( a, b)
is the smallest positive common multiple of a and b). Hence, it must be 0. In other
words, m%n = 0. Equivalently, n | m, so that lcm ( a, b) = n | m. This proves
the “=⇒” direction of the equivalence (55); thus, our proof of Theorem 3.6.5 is
complete.
Theorem 3.6.5 can be generalized to k integers:

Theorem 3.6.6. Let k ∈ N, let b1 , b2 , . . . , bk ∈ Z and m ∈ Z. Then, we have the


following logical equivalence:

(bi | m for all i ∈ {1, 2, . . . , k}) ⇐⇒ (lcm (b1 , b2 , . . . , bk ) | m) .

December 25, 2021


Math 235 notes page 80

Hints to the proof of Theorem 3.6.6. This is a straightforward adaptation of our proof
of Theorem 3.6.5.
We end our first dive into number theory here, but we shall come back to it a few
more times during this course. One last comment at this point: It is commonly be-
lieved that number theory quickly starts requiring advanced mathematics (analysis,
geometry, abstract algebra) as one goes beyond the basics. This is not true; there
are several books full of beautiful results treated with elementary means ([Stein09],
[UspHea39], [NiZuMo91]; see also [AnDoMu17] for a text specifically targeted at
olympiad problems). There also are miraculous applications accessible at the most
basic level, such as the RSA cryptosystem; as these are nowadays treated in most
courses on abstract algebra or cryptography, I shall not discuss them here.

3.7. Homework set #1: Induction and number theory


This is a regular problem set. Each problem will be graded out of 10 points based
on correctness and readability. You don’t need to motivate your proofs, but they
should be readable to a reasonably competent reader (say, to your fellow students).
The topic of this homework set is induction and elementary number theory; this
means that several (but not all!) of its problems are about these topics.
Please solve at most 5 problems. (No points will be given for further solutions.)

Exercise 3.7.1. Let k be a positive integer. A set S of integers is said to be k-lacunar


if every two distinct elements u, v ∈ S satisfy |u − v| ≥ k. (Thus, a 2-lacunar set
is the same as a lacunar set as defined in Definition 2.3.3.)
Let n ∈ N. Let S be a k-lacunar subset of {1, 2, . . . , n}. Prove that

n+k−1
|S| ≤ .
k
n+1
(Thus, in particular, if S is a lacunar subset of {1, 2, . . . , n}, then |S| ≤ .)
2

Exercise 3.7.2. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Prove that any n, m ∈


N satisfy
gcd ( f n , f m ) = f gcd(n,m) .

Exercise 3.7.3. Let ( F0 , F1 , F2 , . . .) be the Fermat sequence – that is, the sequence of
integers defined by
n
Fn = 22 + 1 for each n ∈ N.

(Keep in mind that nested powers are to be read top-to-bottom: That is, the
c c c
expression “ab ” means a(b ) rather than ab .)

December 25, 2021


Math 235 notes page 81

(a) Prove that

Fn = F0 F1 · · · Fn−1 + 2 for every integer n ≥ 0.

(b) Prove that gcd ( Fn , Fm ) = 1 for any two distinct nonnegative integers n and
m.
Exercise 3.7.4. Prove that there exist infinitely many odd positive integers n for
which
1! · 2! · · · · · (2n)!
is a perfect square.
( n + 1) !

Exercise 3.7.5. Let x ∈ R. Let n and m be positive integers. Prove that


mn−1 
n ( m − 1)
  
k
∑ x+
n
= m bnx c +
2
.
k =0

Exercise 3.7.6. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Prove that each non-
negative integer n satisfies

f n ≡ f n%5 · 3n//5 mod 5.

(See Definition 3.3.1 for the notations used here.)

Exercise 3.7.7. Let a and b be two positive integers. Prove that there exist posi-
tive integers x and y such that

gcd ( a, b) = xa − yb.

Exercise 3.7.8. Prove that any positive integer a can be uniquely expressed in the
form
a = 3m + bm−1 3m−1 + bm−2 3m−2 + · · · + b0 30
where m is a nonnegative integer, and where b0 , b1 , . . . , bm−1 ∈ {0, 1, −1}. (This
is called the balanced ternary representation.)

Exercise 3.7.9. Let p, q, m, n ∈ N with p ≤ m and q ≤ n. Consider an m × n-table


T of integers, with all entries distinct. In each column of T, we mark the p largest
entries with a cyan marker. In each row of T, we mark the q largest entries with
a red marker. Prove that at least pq entries of T are marked twice (i.e., with both
colors).
[Example: Let p = 2 and q = 2 and m = 3 and n = 3 and
 
1 2 9
T =  4 3 8 .
5 6 7

December 25, 2021


Math 235 notes page 82

Then,

the cyan entries are 4, 5, 3, 6, 8, 9, while


the red entries are 2, 9, 4, 8, 6, 7.

Thus, the entries 4, 6, 8, 9 are marked twice. This is exactly the pq entries claimed
in the exercise. You can easily find situations in which there are more than pq
doubly-marked entries.]

Exercise 3.7.10. A bitstring shall mean a finite sequence consisting of 0’s and 1’s.
(This is what we called an “n-bitstring” in Exercise 2.1.3, except that the length is
no longer fixed.) We shall write our bitstrings without commas and parentheses
– i.e., we shall simply write a1 a2 · · · an for the bitstring ( a1 , a2 , . . . , an ).
Bitstrings can be transformed by moves. In each move, you pick two consecutive
entries 01 in the bitstring (appearing in this order), and replace them by three
consecutive entries 100 (in this order). In other words, in each, move you replace
a bitstring of the form . . . 01 . . . by . . . 100 . . ., where the two “. . .” parts stay
unchanged. For example, here is a move:

01101101 → 011100101

(where we are using an underscore to mark the place where the move is hap-
pening). Here is a sequence of moves:

0101 → 01100 → 100100 → 1010000 → 11000000

(where we are putting an underscore under the position of the next move). Note
that the last bitstring in this sequence has no two consecutive entries 01 any
more, and thus no more moves can be applied to it.
(a) Prove that there are no infinite sequences of moves. That is, if you start
with a bitstring a, then any sequence of moves that can be applied successively
must have an end.
(b) A bitstring shall be called immovable if no move can be applied to it. Part
(a) shows that, starting with any bitstring a, we can always reach an immovable
bitstring by performing moves until no more moves are possible. Prove that this
immovable bitstring is uniquely determined by a – that is, no matter how you
perform the moves, the immovable bitstring that results at the end will be the
same. Moreover, the number of moves needed to reach the immovable bitstring
will be the same.

3.8. Recitation #2: Coprimality and more number theory


We shall now discuss a sample of exercises related to divisibility and coprimality.
The following exercise is essentially Problem 1 from the 1st International Math-
ematical Olympiad 1959:

December 25, 2021


Math 235 notes page 83

Exercise 3.8.1. Let n ∈ Z. Prove that 21n + 4 ⊥ 14n + 3.

We shall give two solutions for this exercise:


First solution to Exercise 3.8.1. We shall apply Proposition 3.4.4 similarly to how it is
employed in the Euclidean algorithm – using Proposition 3.4.4 (b) to interchange
the two arguments in gcd ( a, b), and using Proposition 3.4.4 (c) to subtract a multi-
ple of the first argument from the second in gcd ( a, b). We perform these operations
in such a way that the two arguments gradually get simpler.
Here is how this looks like:

gcd (21n + 4, 14n + 3)


 

= gcd 14n + 3, | {z+ 4}


21n (by Proposition 3.4.4 (b))
 

=1·(14n+3)+(7n+1)

= gcd (14n + 3, 1 · (14n + 3) + (7n + 1))


= gcd (14n + 3, 7n + 1)
(by Proposition 3.4.4 (c), applied to a = 14n + 3, b = 7n + 1 and u = 1)
 

= gcd 7n + 1, 14n


| {z+ 3}  (by Proposition 3.4.4 (b))
 

=2·(7n+1)+1

= gcd (7n + 1, 2 · (7n + 1) + 1)


= gcd (7n + 1, 1)
(by Proposition 3.4.4 (c), applied to a = 7n + 1, b = 1 and u = 2)
= gcd (1, 7n + 1) (by Proposition 3.4.4 (b))
=1

(since Exercise 3.5.1 (a) yields 1 ⊥ 7n + 1 and thus gcd (1, 7n + 1) = 1). In other
words, 21n + 4 ⊥ 14n + 3. This solves Exercise 3.8.1.
A second solution to Exercise 3.8.1 can be given using the following converse of
Bezout’s theorem:

Proposition 3.8.1. Let a, b, x and y be four integers. Then:


(a) We have gcd ( a, b) | xa + yb.
(b) If xa + yb = 1, then a ⊥ b.

Proof of Proposition 3.8.1. (a) Let g = gcd ( a, b). Thus, g = gcd ( a, b) | a (by Proposi-
tion 3.4.4 (f)), so that a ≡ 0 mod g. Similarly, b ≡ 0 mod g. Now, x |{z} a +y |{z}
b ≡
≡0 mod g ≡0 mod g
x · 0 + y · 0 = 0 mod g. In other words, g | xa + yb. In other words, gcd ( a, b) |
xa + yb (since g = gcd ( a, b)). This proves Proposition 3.8.1 (a).

December 25, 2021


Math 235 notes page 84

(b) We know (from Proposition 3.4.3 (a)) that gcd ( a, b) is a nonnegative integer.
But Proposition 3.8.1 (a) yields gcd ( a, b) | xa + yb = 1. Thus, gcd ( a, b) is a divisor
of 1, and therefore a nonnegative divisor of 1 (since gcd ( a, b) is nonnegative). But
the only nonnegative divisor of 1 is 1 itself. Hence, we conclude that gcd ( a, b) = 1.
In other words, a ⊥ b. This proves Proposition 3.8.1 (b).
Second solution to Exercise 3.8.1. We have (−2) · (21n + 4) + 3 · (14n + 3) = 1. Hence,
Proposition 3.8.1 (b) (applied to a = 21n + 4, x = −2, b = 14n + 3 and y = 3) yields
21n + 4 ⊥ 14n + 3. This solves Exercise 3.8.1 again.
This second solution to Exercise 3.8.1 is slick, but how could we have found
it? The answer turns out to be “pretty easily, once we made up our mind to
apply Proposition 3.8.1 (b)”. Indeed, in order to prove 21n + 4 ⊥ 14n + 3 us-
ing Proposition 3.8.1 (b), it is necessary to find two integers x and y that satisfy
x · (21n + 4) + y · (14n + 3) = 1. In theory, these x and y could depend on n, but
the first thing you should try are constants. So you are looking for two (constant)
integers x and y that satisfy x · (21n + 4) + y · (14n + 3) = 1 for each n ∈ Z. But
this boils down to a system of infinitely many linear equations in x and y (one for
each n); any two of them determine x and y uniquely. Solving the system thus
yields x = −2 and y = 3, which is exactly the two numbers used in the solution
above.
Here is another little exercise:

Exercise 3.8.2. You have a corridor with 1000 lamps, which are initially all off.
Each lamp has a light switch controlling its state.
Every night, a ghost glides through the corridor (always in the same direction)
and flips some of the switches:
On the 1st night, the ghost flips every switch.
On the 2nd night, the ghost flips switches 2, 4, 6, 8, 10, . . ..
On the 3rd night, the ghost flips switches 3, 6, 9, 12, 15, . . ..
etc.
(That is: For each k ∈ {1, 2, . . . , 1000}, the ghost spends the k-th night flipping
switches k, 2k, 3k, . . ..)
Which lamps will be on after 1000 nights?

Discussion of Exercise 3.8.2. Let us first make the problem more manageable by fo-
cussing on a single lamp. So let us fix some m ∈ {1, 2, . . . , 1000} and find out
whether lamp m is on after 1000 nights.
Indeed, switch m gets flipped on the k-th night if and only if m is a multiple of k.
In other words, switch m gets flipped on the k-th night if and only if k is a divisor
of m. Thus, the number of times that switch m gets flipped (during the entire 1000
nights) is precisely the number of positive divisors of m. Of course, lamp m will be
on after 1000 nights if and only if this number of times is odd. Thus, asking which
lamps will be on after 1000 nights is equivalent to asking which of the numbers
1, 2, . . . , 1000 have an odd number of positive divisors.

December 25, 2021


Math 235 notes page 85

Experiments reveal that among the first 10 positive integers, only three have an
odd number of positive divisors: namely, 1, 4 and 9. (For example, 9 has the 3
positive divisors 1, 3 and 9.) This suggests the following:

Exercise 3.8.3. Let n be a positive integer. Prove that the number of positive
divisors of n is even if and only if n is not a perfect square.

Solution to Exercise 3.8.3 (sketched). A detailed proof can be found in [19s, Proposi-
tion 2.14.7], so we shall keep to the main idea. We will use the word “posdiv” as
n
shorthand for “positive divisor”. If d is a posdiv of n, then is an integer and
d
n
again a posdiv of n. We shall refer to as the complement of d. Note that being the
d
complement is a symmetric relation: If d is a posdiv of n, and if e is the complement
of d, then d is in turn the complement of e.
We can thus pair up each posdiv of n with its complement. This results in
a “pairing” that covers all posdivs of n, except that it might fail to be a proper
pairing: Namely, if a posdiv of n is its own complement, then this posdiv will be
paired with itself.
Example 3.8.2. Let us see how this “pairing” looks like:

• If n = 12, then the posdivs of n are 1, 2, 3, 4, 6, 12. Their complements are


12, 6, 4, 3, 2, 1, respectively. Thus, our “pairing” pairs 1 with 12, pairs 2 with
6, and pairs 3 with 4.

• If n = 16, then the posdivs of n are 1, 2, 4, 8, 16. Their complements are


16, 8, 4, 2, 1, respectively. Thus, our “pairing” pairs 1 with 16, pairs 2 with
8, and pairs 4 with itself.

When does n have a posdiv that gets paired with itself? In other words, when is
n
there a posdiv d of n that is its own complement? Clearly, this means that d = ,
d
or, equivalently, n = d2 . If n is
√ a perfect square, then there is exactly one posdiv d
2
that satisfies n = d (namely, n); otherwise, there is no such d. Thus:

• If n is a perfect square, then exactly one posdiv of n gets paired with itself.

• If n is not a perfect square, then no posdiv of n gets paired with itself.

Hence:

• If n is a perfect square, then our “pairing” of the posdivs of n leaves exactly


one posdiv of n paired with itself, while all others have proper partners.
Therefore, in this case, the number of posdivs of n is odd.

December 25, 2021


Math 235 notes page 86

• If n is not a perfect square, then our “pairing” of the posdivs of n is a proper


pairing (i.e., no posdiv gets paired with itself). Therefore, in this case, the
number of posdivs of n is even.

Combining these facts, we conclude that the number of posdivs of n is even if


and only if n is not a perfect square. This solves Exercise 3.8.3.
Exercise 3.8.3 quickly yields an answer to Exercise 3.8.2: Namely, the lamps that
will be on after 1000 nights are precisely the m-th lamps where m ∈ {1, 2, . . . , 1000}
is a perfect square – i.e., the 12 -th, 22 -th, 32 -th etc. lamps.
Exercise 3.8.3 is due to John Wallis (1685, [Wallis85, Additional Treatises, Chapter
III, §16]).
Next, we shall discuss some variations on Bezout’s theorem. As a warmup exer-
cise, here is an easy one:

Exercise 3.8.4. Let a and b be two coprime integers. Let n be an integer.


Prove that there exist integers x and y such that n = xa + yb.

Solution to Exercise 3.8.4. The numbers a and b are coprime; in other words, gcd ( a, b) =
1.
But Theorem 3.4.5 yields that there exist integers x ∈ Z and y ∈ Z such that
gcd ( a, b) = xa + yb. Consider these x and y, and denote them by x 0 and y0 . (We do
not want to call them x and y, since they are not the x and y we are looking for.)
Thus, x 0 and y0 are integers satisfying gcd ( a, b) = x 0 a + y0 b. Hence, x 0 a + y0 b =
gcd ( a, b) = 1. Multiplying both sides of this equality by n, we find n ( x 0 a + y0 b) =
n · 1 = n. Hence, n = n ( x 0 a + y0 b) = nx 0 a + ny0 b. Thus, there exist integers x and y
such that n = xa + yb (namely, x = nx 0 and y = ny0 ). This solves Exercise 3.8.4.
Now, what happens if we require x and y to be nonnegative in Exercise 3.8.4?
Then, Exercise 3.8.4 is no longer valid. For example, if a = 3 and b = 5, then there
are no nonnegative integers x and y such that 4 = xa + yb. This is, in a way, due
to 4 being “too small”; one is thus tempted to ask whether requiring n to be large
enough (for a and b positive) will force those nonnegative x and y to exist. If so,
then how large is large enough?
The answer is given by a famous result of J. J. Sylvester (who found it in 1882
when studying invariant theory). We state it as an exercise:

Exercise 3.8.5. Let a and b be two coprime positive integers. Let n be an integer
such that n > ab − a − b.
Prove that there exist nonnegative integers x and y such that n = xa + yb.

The “n > ab − a − b” bound in Exercise 3.8.5 is sharp: The claim of the exercise
would no longer hold if we allowed n = ab − a − b. (See Exercise 4.5.2 (b) for why.)
Exercise 3.8.5 is often stated in terms of coins: If a and b are two coprime positive
integers, and if you have unlimited supplies of a-cent coins and of b-cent coins, but
no other coins, then Exercise 3.8.5 says that you can pay any amount that is larger

December 25, 2021


Math 235 notes page 87

than ab − a − b cents57 without asking for change. See Wikipedia on the Sylvester
Coin Problem, which also studies the generalization to more than two sorts of
coins. (This generalization is significantly harder.)58
Discussion of Exercise 3.8.5. Exercise 3.8.4 yields that there exist integers x and y
such that n = xa + yb. Consider these x and y, and denote them by x 0 and y0 . (We
do not want to call them x and y, since they are not the x and y we are looking for.)
Thus, x 0 and y0 are integers satisfying n = x 0 a + y0 b.
If x 0 and y0 are nonnegative, then we are already done (since we can just take
x = x 0 and y = y0 ). But x 0 and y0 might not be nonnegative yet. The trick is
now to modify x 0 and y0 in such a way that they become nonnegative but the sum
x 0 a + y0 b is unchanged. (If you want, you can view this as an instance of the “find
a not-quite-answer and tweak it until it becomes a full answer” technique; the
time-honored regula falsi is another instance of this technique.)
How can we modify x 0 and y0 in a way that x 0 a + y0 b is unchanged? A simple
way to do so is to add b to x 0 and subtract a from y0 (because this causes x 0 a + y0 b to
become ( x 0 + b) a + (y0 − a) b, which is still the same as x 0 a + y0 b). More generally,
we can pick any d ∈ Z and add db to x 0 and subtract da from y0 . Obviously, if
we pick d large enough, then x 0 + db will become nonnegative, whereas a small
enough d will make y0 − da nonnegative. The question is: Is there a (nonempty)
“goldilocks zone” in which d is sufficiently large for x 0 + db to be nonnegative and
yet sufficiently small for y0 − da to be nonnegative?
We can try to describe this “goldilocks zone” explicitly. The number x 0 + db is
− x0
nonnegative if and only if d ≥ (check this!); on the other hand, the number
b
y0
y0 − da is nonnegative if and only if d ≤ . Hence, the “goldilocks zone” for d is
a
− x 0 y0
 
the interval , . Let us check whether this interval is nonempty. We have
b a

y0 − x 0 x 0 a + y0 b ab − a − b
since x 0 a + y0 b = n > ab − a − b

− = >
a b ab ab
1 1
= 1− − ,
a b
which is ≥ 0 in all interesting cases (the only exception being when a or b is 1,
but this case is easy to handle separately). Thus, in all interesting cases, we have
y0 − x0
≥ .
a b
Unfortunately, this is not
 the whole story. We are not looking for a real 0number0
− x 0 y0 y −x
d in the interval , , but for an integer d in this interval. Having ≥
b a a b

57 obviouslyan integer amount of cents


58 See
also https://artofproblemsolving.com/community/c6h373 for further discussions on what
amounts can be paid using two kinds of coins.

December 25, 2021


Math 235 notes page 88

guarantees the former but not the latter. How can we guarantee the latter? What
must the difference β − α of two real numbers α and β satisfy to ensure that the
interval [α, β] contains an integer?
It is not hard to see that the answer to this question is “they must satisfy β − α ≥
y0 − x 0
1”. Unfortunately, this is not true for our “goldilocks zone”; the difference −
a b
is always < 1. So we are stuck.
Being stuck, let us revisit what we did, in the hopes of finding something im-
provable. Did we perhaps throw away some information too early, or make too
weak an estimate? One thing that stands out is that we never really used the fact
that x 0 and y0 are integers.
This turns out to be the key. We said that the number x 0 + db is nonnegative if
−x0
and only if d ≥ . But we can say something slightly stronger: The number
b
− x0 − 1
x 0 + db is nonnegative if and only if d > . Indeed, we have the following
b
chain of equivalences:

x 0 + db is nonnegative ⇐⇒ x 0 + db ≥ 0
 

⇐⇒ x 0 + db > −1 since x 0 + db is an integer


 

− x0 − 1
 
0

⇐⇒ db > − x − 1 ⇐⇒ d > .
b

Notice how rewriting “x 0 + db ≥ 0” as “x 0 + db > −1” has improved our inequality!


y0 + 1
Likewise, we can see that y0 − da is nonnegative if and only if d < . Thus,
a
− x 0 y0 − x 0 − 1 y0 + 1
   
our “goldilocks zone” , has grown to a wider interval ,
b a b a
(an open interval, not a pair of numbers). And as it turns out, this latter interval
has size > 1, since

y0 + 1 − x 0 − 1 x 0 a + y0 b + a + b n+a+b
since x 0 a + y0 b = n

− = =
a b ab ab
>1 (since n + a + b > ab (because n > ab − a − b)) .

But an open
 interval of size > 1 must always contain an integer59 . Hence, the open
− x 0 − 1 y0 + 1

interval , contains an integer d. Picking such a d, we then con-
b a
clude that both x 0 + db and y0 − da are nonnegative, and thus there exist nonnega-
tive integers x and y such that n = xa + yb (namely, x = x 0 + db and y = y0 − da).
Thus, we have found a solution to Exercise 3.8.5.

59 Proof.Let (α, β) be an open interval of size > 1. Thus, α and β are real numbers such that
β − α > 1. We must prove that the interval (α, β) contains an integer.
Indeed, it is easy to see that bαc + 1 is an integer contained in this interval (α, β). Check this!

December 25, 2021


Math 235 notes page 89

It is instructive to see how short this solution becomes if we forget about the
pains we took finding it, and only write down the parts that ended up necessary
for the proof:
Solution to Exercise 3.8.5 (final copy). Exercise 3.8.4 yields that there exist integers x
and y such that n = xa + yb. Consider these x and y, and denote them by x 0 and
y0 . Thus, x 0 and y0 are integers satisfying n = x 0 a + y0 b.
− x0 − 1

Define an integer d by d = + 1. Now, we claim the following:
b

Claim 1: Both integers x 0 + db and y0 − da are nonnegative.

− x0 − 1
[Proof of Claim 1: The chain of inequalities (1) (applied to x = ) shows
b
that
− x0 − 1 −x0 − 1 −x0 − 1
   
≤ < + 1. (56)
b b b
Hence,
−x0 − 1 − x0 − 1 − x0 − 1
     
< +1 = d since d = +1 .
b b b

We can multiply this inequality by b (since b is positive), and thus obtain − x 0 − 1 <
db. Hence, db > − x 0 − 1, so that x 0 + db > −1. Since x 0 + db is an integer, this
entails that x 0 + db ≥ 0. In other words, x 0 + db is nonnegative.
It remains to show that y0 − da is nonnegative. But n + a + b > ab (because
n > ab − a − b). We can divide this inequality by ab (since ab > 0), and thus obtain
n+a+b
> 1. Now,
ab
y0 + 1 − x 0 − 1 x 0 a + y0 b + a + b n+a+b
since x 0 a + y0 b = n

− = =
a b ab ab
> 1,

so that
y0 + 1 −x0 − 1 − x0 − 1
 
> +1 ≥ + 1 = d.
a b }
| {z b
0
 
 −x − 1 

≥
b
(by the first inequality in (56))

We can multiply this inequality by a (since a is positive), and find y0 + 1 > da. In
other words, y0 − da > −1. Since y0 − da is an integer, this entails y0 − da ≥ 0. In
other words, y0 − da is nonnegative. This completes our proof of Claim 1.]
Thus, the integers x 0 + db and y0 − da are nonnegative. They furthermore satisfy

x 0 + db a + y0 − da b = x 0 a + dba + y0 b − dab = x 0 a + y0 b = n,
 

December 25, 2021


Math 235 notes page 90

so that n = ( x 0 + db) a + (y0 − da) b. Thus, there exist nonnegative integers x and
y such that n = xa + yb (namely, x = x 0 + db and y = y0 − da). This solves Exercise
3.8.5.

December 25, 2021


Math 235 notes page 91

4. Sequences and sums


In this chapter, we shall explore sequences and finite sums and products. This is
a vast subject and one that is popular on mathematical competitions; my choice
of material is “informed” more by my own tastes than by relevance for current
olympiads. In particular, I will mostly avoid any analysis (limits and infinite
sums); good sources for this are [GelAnd17, §3.1] and much of [PolSze78]. Se-
rious number-theoretical questions will have to wait for future chapters. In this
chapter, I will begin with some rules and tricks for dealing with finite sums and
products; then I will introduce the binomial coefficients and their most fundamen-
tal properties (nothing too combinatorial yet). After that, I will turn to some more
specific kinds of sequences: ones that are integer (i.e., their entries are integers)
although their definitions involve fractions; ones that are defined by recursions yet
can be explicitly computed; periodic ones; and ones satisfying linear recurrences.
More diverse selections of problems on sequences can be found in [Engel98,
Chapter 9] and [GelAnd17, §3.1]. It is worth keeping in mind that there is an
Online Encyclopedia of Integer Sequences that knows hundreds of thousands of in-
teger sequences and can be used to answer questions such as “what meaningful
sequences begin with 1, 0, 1, 2, 9, 44, 265, and what facts are known about them?”
(check it out if you are curious). It is a useful tool for mathematical researchers,
not just for puzzle solvers, as integer sequences appear frequently in mathematics,
and knowing that two questions lead to one and the same integer sequence often
foreshadows some deeper connection between the questions. There is also a Journal
of Integer Sequences.

4.1. Finite sums


We begin with finite sums and products. While we have already used these con-
cepts and the corresponding notations (the ∑ and ∏ symbols), let us nevertheless
quickly recall some of their basic properties. We refer to [Grinbe15, §1.4] for a much
more thorough (although probably not very exciting) survey of the properties of
finite sums and products with detailed proofs, and to [GrKnPa94, Chapter 2] for
a hands-on introduction to the art of manipulating them. Also, [AndTet18] is an
entire book devoted to (mostly finite) sums and products.
This section will be a long yet (most likely) fast read, as much of it just will be
spent stating rules and definitions that you have likely already encountered in your
mathematical life history. Furthermore, almost all of these rules are just formalizing
common sense about sums and products, so you won’t be surprised by them even
if you see them for the first time. The rules will be illustrated by exercises, and
some of the latter might actually be surprising. Thus, skim this section, but do not
skip the exercises!

December 25, 2021


Math 235 notes page 92

4.1.1. The ∑ sign


v
The most well-known type of finite sums are those of the form ∑ ai (for example,
i =u
10
∑ i2 ). But let us first define finite sums of a more general shape (from which we
i =2
v
shall later obtain the ∑ ai kind as a special case):60
i =u

Definition 4.1.1. If S is a finite set, and if as is a number for each s ∈ S, then


∑ as denotes the sum of all of these numbers as . Formally, this sum is defined
s∈S
by recursion on |S|, as follows:

• If |S| = 0, then ∑ as is defined to be 0. (In this case, ∑ as is called an


s∈S s∈S
empty sum.)

• Let n ∈ N. Assume that we have defined ∑ as for every finite set S with
s∈S
|S| = n (and every choice of numbers as ). Now, if S is a finite set with
|S| = n + 1 (and if a number as is chosen for each s ∈ S), then ∑ as is
s∈S
defined by picking any t ∈ S and setting

∑ as = at + ∑ as . (57)
s∈S s∈S\{t}

It is not immediately clear why this definition is legitimate; in fact, the right hand
side of (57) is defined using a choice of t, but theoretically one can imagine that
different choices of t would lead to different results. Nevertheless, one can prove
(see, e.g., [Grinbe15, Theorem 2.118] for this proof) that this definition is indeed
legitimate (i.e., the right hand side of (57) does not depend on t). This is essentially
saying that if we sum the numbers as for all s ∈ S by starting with 0 and adding
these numbers one by one, then the result does not depend on the order in which
the numbers are being added. (Note that this is not true of multiplying matrices,
or of putting on clothes, or of chemical reactions. So it’s not an obvious claim!)
Expressions of the form ∑ as for finite sets S are called finite sums. Here are
s∈S
some examples:

60 Throughout Section 4.1, “number” means an integer or a rational number or a real number or
a complex number. More generally, the concept of a finite sum can be applied to any sort of
object that has an addition operation with reasonable properties (such as commutativity and
associativity); e.g., in linear algebra, one defines finite sums of vectors in a vector space, and in
abstract algebra, one generalizes this further to finite sums of elements of an abelian group (or
even monoid).

December 25, 2021


Math 235 notes page 93

Example 4.1.2. (a) If S = {2, 6, 9} and as = 3s for each s ∈ S, then ∑ as =


s∈S
a2 + a6 + a9 = 32 + 36 + 39 .
(b) If S = {1, 2, . . . , n} (for some n ∈ N) and as = s2 for every s ∈ S, then
∑ a s = ∑ s 2 = 12 + 22 + · · · + n 2 .
s∈S s∈S
(c) If S = ∅, then ∑ as = 0 (since |S| = 0).
s∈S

The sum ∑ as is usually pronounced “sum of the as over all s ∈ S” or “sum of


s∈S
the as with s ranging over S” or “sum of the as with s running through all elements
of S”. The letter “s” in the sum is called the “summation index”, and its exact
choice is immaterial (for example, you can rewrite ∑ as as ∑ at or as ∑ aΦ or as
s∈S t∈S Φ∈S
∑ a♠ ), as long as it does not already have a different meaning outside of the sum.
♠∈S
The sign ∑ itself is called “the summation sign” or “the ∑ sign”. The numbers as
are called the addends (or summands or terms) of the sum ∑ as . More precisely, for
s∈S
any given t ∈ S, we can refer to the number at as the “addend corresponding to the
index t” (or as the “addend for s = t”, or as the “addend for t”) of the sum ∑ as .
s∈S
The summation index in a finite sum does not always have to be a single letter.
For instance, if S is a set of pairs, then we can write ∑ a( x,y) (meaning the same
( x,y)∈S
as ∑ as ). Here is an example of this notation:
s∈S

x 1 1 1 2 2 2 3 3 3
∑ y
= + + + + + + + +
1 2 3 1 2 3 1 2 3
( x,y)∈{1,2,3}2

x
(here, we are using the notation ∑ a( x,y) with S = {1, 2, 3}2 and a( x,y) = ).
( x,y)∈S y

Warning 4.1.3. There is no agreement on the operator precedence of the ∑ sign


versus the + sign. By this I mean the following question: Does ∑ as + b (where
  s∈S

b is some other number) mean ∑ ( as + b) or ∑ as + b ? I will use the second


s∈S   s∈S
interpretation (i.e., I will read it as ∑ as + b), but I have seen both used in
s∈S
the literature (although I believe that the second is more popular).
However, the · sign definitely has higher precedence than the ∑ sign. That is,
an expression of the form ∑ bas c is always understood to mean ∑ (bas c).
s∈S s∈S

As I mentioned above, the most common finite sums are of a special kind:

December 25, 2021


Math 235 notes page 94

Definition 4.1.4. Let u and v be integers. We agree to understand the set


{u, u + 1, . . . , v} to be empty if u > v.
Let as be a number for each s ∈ {u, u + 1, . . . , v}. Then, the finite sum
v
∑ as will also be denoted by ∑ as or by au + au+1 + · · · + av .
s∈{u,u+1,...,v} s=u

v
Thus, finite sums of the form ∑ as satisfy
s=u

v
∑ as = 0 for v < u, and (58)
s=u
v v v −1
∑ as = au + ∑ as = ∑ as + av for v ≥ u. (59)
s=u s = u +1 s=u

The equality (58) says that a sum that “ends before it begins” is 0. For example,
2
∑ i = 0. This is not completely uncontroversial61 , but it shall be so in this course.
i =5
v
In a sum of the form ∑ as , the integer u is called the lower limit (or lower bound)
s=u
of the sum, whereas the integer v is called the upper limit (or upper bound) of the
sum.62 The sum is said to start (or begin) at u and end at v.
Another way to use ∑ signs is in describing sums that sum over all elements of
a given set that satisfy a given statement. This is done as follows:

Definition 4.1.5. Let S be a finite set, and let A (s) be a logical statement defined
for every s ∈ S. (For example, if S is a set of integers, then A (s) can be the
statement “s is even”.) For each s ∈ S satisfying A (s), let as be a number. Then,
the sum ∑ as is defined by
s∈S;
A(s)

∑ as = ∑ as .
s∈S; s∈{t∈S | A(t)}
A(s)

In other words, ∑ as is the sum of the as for all s ∈ S which satisfy A (s).
s∈S;
A(s)

2
61 I have seen authors who would “sum backwards” when v < u, thus interpreting ∑ i as −4 − 3.
i =5
This has some advantages (because why let a notation go to waste?), but it would mean that
v
∑ as cannot be rewritten as ∑ as without checking the order relation between u and
s=u s∈{u,u+1,...,v}
v, and I don’t want this extra headache.
62 This has nothing to do with the notions of “bounds” and “limits” in analysis.

December 25, 2021


Math 235 notes page 95

Example 4.1.6. If S = {1, 2, 3, 4, 5}, then ∑ as = a2 + a4 and ∑ as =


s∈S; s∈S;
s is even s is odd
a1 + a3 + a5 .

4.1.2. The simplest rules: factoring out and splitting addends


Having defined the notations, let us recall some rules for manipulating finite sums.
We shall give no proofs (see [Grinbe15, §1.4] for them, or treat them as induction
exercises), but we shall illustrate them with examples whenever reasonable.
We begin with four very simple rules. The first one ([Grinbe15, (6)]) says that if
all addends in a sum are equal to some number a, then the sum equals the number
of addends times a:
Theorem 4.1.7. Let S be a finite set. Let a be a number. Then,

∑ a = |S| · a. (60)
s∈S

This is trivial to prove by induction and needs no further explanation. Applying


(60) to a = 0 yields ∑ 0 = |S| · 0 = 0.
s∈S
The next rule ([Grinbe15, (9)]) is just a distributive law for finite sums; it says
that a factor common to all addends of a sum can be factored out:
Theorem 4.1.8. Let S be a finite set. For every s ∈ S, let as be a number. Also, let
λ be a number. Then,
∑ λas = λ ∑ as . (61)
s∈S s∈S

Example 4.1.9. Let u and v be two integers. Let as be a number for each s ∈
{u, u + 1, . . . , v}. Also, let λ be a number. Then, Theorem 4.1.8 (applied to S =
{u, u + 1, . . . , v}) yields
v v
∑ λas = λ ∑ as . (62)
s=u s=u
Equivalently,
λau + λau+1 + · · · + λav = λ ( au + au+1 + · · · + av ) . (63)
For example, if n ∈ N, then the sum of the first n even positive integers is
2 + 4 + · · · + 2n = 2 · 1 + 2 · 2 + · · · + 2 · n
 
by (63), applied to λ = 2
= 2 (1 + 2 + · · · + n )
and u = 1 and v = n and as = s
n ( n + 1)
= 2· (by (9))
2
= n ( n + 1) .

December 25, 2021


Math 235 notes page 96

The next rule ([Grinbe15, (7)]) says that if each addend in a sum is itself a sum
of two numbers, then we can split the sum up:

Theorem 4.1.10. Let S be a finite set. For every s ∈ S, let as and bs be numbers.
Then,
∑ ( a s + bs ) = ∑ a s + ∑ bs . (64)
s∈S s∈S s∈S

Example 4.1.11. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Let n ∈ N. Then,


n n n
∑ ( f s + 1) = ∑ fs + ∑1
s =1 s =1 s =1
| {z } |{z}
= f 1 + f 2 +···+ f n = n ·1
= f n +2 −1 (as a consequence of (60))
(by Exercise 2.2.1)

(by (64), applied to S = {1, 2, . . . , n} and as = f s and bs = 1)


= f n+2 − 1 + n · 1 = f n+2 − 1 + n.

The equality (64) is often used forwards (i.e., in order to split a sum of the form
∑ ( as + bs ) into ∑ as + ∑ bs ) and backwards (i.e., in order to combine two sums
s∈S s∈S s∈S
∑ as + ∑ bs into ∑ ( as + bs )). When applying it backwards, don’t forget to check
s∈S s∈S s∈S
that the two sums being combined are ranging over the same set!
An easy consequence of Theorem 4.1.10 is the following:

Exercise 4.1.1. Let S be a finite set. For every s ∈ S, let as and bs be numbers.
Then,
∑ ( a s − bs ) = ∑ a s − ∑ bs .
s∈S s∈S s∈S

Solution to Exercise 4.1.1. Theorem 4.1.10 (applied to as − bs instead of as ) yields

∑ ((as − bs ) + bs ) = ∑ (as − bs ) + ∑ bs .
s∈S s∈S s∈S

Solving this equation for ∑ ( as − bs ), we find


s∈S

∑ (as − bs ) = ∑ (( a − b ) + bs ) − ∑ bs = ∑ a s − ∑ bs .
| s {zs
s∈S s∈S s∈S s∈S s∈S
}
= as

This solves Exercise 4.1.1.

December 25, 2021


Math 235 notes page 97

4.1.3. Substitution of the summation index


The next rule ([Grinbe15, (12)]) is intuitively simple, yet highly useful:
Theorem 4.1.12. Let S and T be two finite sets. Let f : S → T be a bijective
map63 . Let at be a number for each t ∈ T. Then,

∑ at = ∑ a f (s) . (65)
t∈ T s∈S

Roughly speaking, (65) holds because the sum ∑ a f (s) contains the same ad-
s∈S
dends as the sum ∑ at . We say that the sum ∑ a f (s) is obtained from the sum
t∈ T s∈S
∑ at by substituting f (s) for t. (Conversely, ∑ at is obtained from ∑ a f (s) by
t∈ T t∈ T s∈S
substituting t for f (s).)
Example 4.1.13. For any n ∈ N, we have

∑ t3 = ∑ (−s)3 .
t∈{1,2,...,n} s∈{−n,−n+1,...,−1}

Indeed, this follows from (65), applied to S = {−n, −n + 1, . . . , −1}, T =


{1, 2, . . . , n}, f (s) = −s, and at = t3 .
When substituting the index in a sum, it is perfectly okay to re-use the same
letter for the new index. Thus, (65) can be rewritten as

∑ as = ∑ a f (s) .
s∈ T s∈S

Theorem 4.1.12 has several well-known and oft-used consequences. The first one
says that we can shift the index of a sum by any integer k:
Corollary 4.1.14. Let u, v and k be integers. Let at be a number for each t ∈
{u + k, u + k + 1, . . . , v + k}. Then,
v+k v
∑ at = ∑ as+k .
t=u+k s=u

Proof of Corollary 4.1.14. Let f denote the map


{u, u + 1, . . . , v} → {u + k, u + k + 1, . . . , v + k} ,
s 7→ s + k.
63 Recall: A map is said to be bijective if it is injective (i.e., one-to-one) and surjective (i.e., onto).
Bijective maps are also known as bijections or one-to-one correspondences. See, e.g., the detailed
Wikipedia page for more about these kinds of maps.

December 25, 2021


Math 235 notes page 98

This map f is easily seen to be well-defined and bijective64 . Thus, Theorem 4.1.12
(applied to S = {u, u + 1, . . . , v} and T = {u + k, u + k + 1, . . . , v + k }) yields

∑ at = ∑ a f (s) = ∑ as+k .
t∈{u+k,u+k+1,...,v+k } s∈{u,u+1,...,v} |{z} s∈{u,u+1,...,v}
= as+k
(since f (s)=s+k)

In other words,
v+k v
∑ at = ∑ as+k .
t=u+k s=u
This proves Corollary 4.1.14.
The next corollary says that sums can be turned around: i.e., we have
a u + a u +1 + · · · + a v = a v + a v −1 + · · · + a u . (66)
Restated using ∑ signs, and generalized by shifting the index, this takes the fol-
lowing form:
Corollary 4.1.15. Let u, v and k be integers. Let at be a number for each t ∈
{k − v, k − v + 1, . . . , k − u}. Then,
k−u v
∑ at = ∑ ak−s . (67)
t=k−v s=u

Proof of Corollary 4.1.15. Let f denote the map


{u, u + 1, . . . , v} → {k − v, k − v + 1, . . . , k − u} ,
s 7→ k − s.
This map f is easily seen to be well-defined and bijective65 . Thus, Theorem 4.1.12
(applied to S = {u, u + 1, . . . , v} and T = {k − v, k − v + 1, . . . , k − u}) yields

∑ at = ∑ a f (s) = ∑ ak−s .
t∈{k−v,k−v+1,...,k−u} s∈{u,u+1,...,v} |{z} s∈{u,u+1,...,v}
= ak−s
(since f (s)=k−s)

In other words,
k−u v
∑ at = ∑ ak−s .
t=k−v s=u
This proves Corollary 4.1.15.
Here is an example for the use of substitution in sums. Recall the formula (9),
which is easily proved by induction. We shall now prove it in a more elegant way:

64 Indeed, it has an inverse map, which sends each t ∈ {u + k, u + k + 1, . . . , v + k} to t − k.


65 Indeed, it has an inverse map, which sends each t ∈ {k − v, k − v + 1, . . . , k − u} to k − t.

December 25, 2021


Math 235 notes page 99

Exercise 4.1.2. Let n ∈ N. Prove the equality (9) without using induction.

Solution to Exercise 4.1.2. First of all, we notice that


n n n
∑i = 0+ ∑i = ∑ i = 1 + 2 + · · · + n. (68)
i =0 i =1 i =1

n
Thus, we shall focus on computing ∑ i.
i =0
n
We can substitute n − i for i in the sum ∑ i (since the map {0, 1, . . . , n} →
i =0
{0, 1, . . . , n} , i 7→ n − i is a bijection). Thus, we obtain
n n
∑i= ∑ (n − i ) .
i =0 i =0

(If you are too lazy to think about bijections, you can also derive this immediately
by applying Corollary 4.1.15 to u = 0, v = n, k = n and at = t. This is the main
purpose of Corollary 4.1.15: avoid the use of bijections.)
Now comes Gauss’s “doubling trick”: Recall that 2q = q + q for every q ∈ Q.
Hence,
n n n n n
2∑i= ∑i+ ∑i = ∑ i + ∑ (n − i )
i =0 i =0 i =0 i =0 i =0
|{z}
n
= ∑ ( n −i )
i =0
n
= ∑ |(i + ({z
n − i )) (here, we have used (64) backwards)
i =0
}
=n
n
= ∑ n = ( n + 1) n (by (60))
i =0
= n ( n + 1) , (69)

and therefore
n
n ( n + 1)
∑i= 2
. (70)
i =0

n ( n + 1)
In view of (68), this rewrites as 1 + 2 + · · · + n = , which is precisely the
2
equality (9). Hence, Exercise 4.1.2 is solved.
Let us remark how the computation (69) could be rewritten without the use of ∑

December 25, 2021


Math 235 notes page 100

signs:
2 · (0 + 1 + · · · + n )
= (0 + 1 + · · · + n ) + (0 + 1 + · · · + n )
= (0 + 1 + · · · + n ) + ( n + ( n − 1) + · · · + 0)
(here, we have turned the second sum around using (66))
= (0 + n) + (1 + (n − 1)) + · · · + (n + 0)
| {z } | {z } | {z }
=n =n =n
(here, we have used (64) backwards)
= |n + n +{z· · · + n} = (n + 1) n = n (n + 1) .
n+1 times

66This arguably looks simpler than (69), but it is clear that with more complicated
sums it will become progressively harder to avoid the use of ∑ signs.
Gauss’s “doubling trick” used in the above solution is not a one-trick pony. Here
is a more advanced use:

Exercise 4.1.3. Let n ∈ N. Let d be an odd positive integer. Prove that

1 + 2 + · · · + n | 1d + 2d + · · · + n d .

Solution to Exercise 4.1.3 (sketched). This is solved in detail in [19s, Exercise 2.10.8];
thus, we only give the skeleton of the argument. In view of (9), the claim that we
66 We can also visualize this computation as a “picture proof”. For example, here is the picture for
the case n = 5:
1
2
3
4
n=5 5 5
4
3
2
1

n+1 = 6 .
The addends of the sum 0 + 1 + · · · + n are drawn as purple rectangles, whereas the addends of
the sum n + (n − 1) + · · · + 0 are drawn as red rectangles. (Rectangles of area 0, corresponding
to 0 addends, are degenerate and thus invisible.) The rectangles are matched in such a way
that the i-th column (counted from left, started with 0) has a purple rectangle of area i and a
red rectangle of area n − i. This matching corresponds precisely to the way we matched our
addends: (0 + n) + (1 + (n − 1)) + · · · + (n + 0).
| {z } | {z } | {z }
=n =n =n

December 25, 2021


Math 235 notes page 101

must prove rewrites as

n ( n + 1) d
| 1 + 2d + · · · + n d .
2
This is equivalent to  
n ( n + 1 ) | 2 1d + 2d + · · · + n d (71)
(by Proposition 3.1.5). Hence, it suffices to prove (71).
In order to prove (71), it suffices to show that
 
d d d
n | 2 1 +2 +···+n and (72)
 
n + 1 | 2 1d + 2d + · · · + n d . (73)

Indeed, Example 3.5.2 (a) (applied to a = n) yields that n is coprime to n + 1; in


other words, n ⊥ n + 1. Hence, if we can prove (72) and (73), then we will get (71)
by applying Theorem 3.5.7.
We shall prove (73) first:
[Proof of (73): We have
     
2 1d + 2d + · · · + n d = 1d + 2d + · · · + n d + 1d + 2d + · · · + n d
   
d d d d d d
= 1 + 2 + · · · + n + n + ( n − 1) + · · · + 1
n n
= ∑ kd + ∑ (n + 1 − k )d
k =1 k =1
| {z }
≡(−k)d mod n+1
(by taking the congruence n+1−k≡−k mod n+1
to the d-th power)
n n n  
≡ ∑ kd + ∑ (−k) d
= ∑ d d
k + (−k )
k =1 k =1 k =1 | {z }
=0
(since d is odd, so that (−k)d =−kd )
n
= ∑ 0 = 0 mod n + 1.
k =1

In other words, n + 1 | 2 1d + 2d + · · · + nd . Thus, (73) is proven.]




[Proof of (72): If n = 0, then (72) boils down to 0 | 2 · 0, which is obvious. Thus, for
the rest of this proof, we WLOG assume that n 6= 0. Hence, n − 1 ∈ N. Therefore,
we can apply (73) to n − 1 instead of n (since we have already proven (73) for each
n ∈ N). We thus obtain
 
n | 2 1d + 2d + · · · + ( n − 1 ) d .

December 25, 2021


Math 235 notes page 102

 
In other words, 2 1d + 2d + · · · + (n − 1)d ≡ 0 mod n. Also, d > 0 (since d is
odd), so that n | nd and thus nd ≡ 0 mod n. Now,
 
 
2 1d + 2d + · · · + nd = 2 1d + 2d + · · · + (n − 1)d + |{z}
nd 
≡0 mod n
 
≡ 2 1d + 2d + · · · + (n − 1)d ≡ 0 mod n.

That is, n | 2 1d + 2d + · · · + nd . This proves (72).]




We have now proven both (72) and (73). As we have explained, this yields (71),
which in turn solves Exercise 4.1.3.

4.1.4. The telescope principle


The next summation rule is the so-called telescope principle ([Grinbe15, (16)]), which
has a number of simple yet elegant applications:

Theorem 4.1.16. Let u and v be two integers such that u − 1 ≤ v. Let as be a


number for each s ∈ {u − 1, u, . . . , v}. Then,
v
∑ ( a s − a s −1 ) = a v − a u −1 . (74)
s=u

Intuitively, the claim of Theorem 4.1.16 is obvious: The left hand side of (74) is
v v
∑ ( a s − a s −1 ) = ∑ (−as−1 + as )
s=u | {z } s=u
=− as−1 + as
= (− au−1 + au ) + (− au + au+1 ) + (− au+1 + au+2 ) + · · · + (− av−1 + av ) .
If we expand the right hand side of this equality, then it “contracts like a telescope”
(thus the name of Theorem 4.1.16): All addends except for the − au−1 and the av
cancel each other, and you are left with − au−1 + av = av − au−1 , which is exactly
the right hand side of (74). (Be careful with this argument, though: It does not
work for v = u − 1. But this case is trivial anyway.) This intuitive argument can
be formalized. Alternatively, Theorem 4.1.16 can be proved by induction on v (the
proof is utterly straightforward), or derived from Exercise 4.1.1.
Note that Theorem 4.1.16 can be regarded as a discrete version of the Second
Part
R v 0 of the Fundamental Theorem of Calculus. In fact, the latter fact says that
u F ( x ) dx = F ( v ) − F ( u ) for any differentiableRfunction F on a (real) interval
[u, v]. But the ∑ sign is a discrete analogue of the sign, whereas the consecutive
differences as − as−1 are discrete analogues of the values of the derivative F 0 .
For all its simplicity, Theorem 4.1.16 is a surprisingly helpful tool for simplifying
sums. The next four exercises are examples of this:

December 25, 2021


Math 235 notes page 103

n
Exercise 4.1.4. Let n ∈ N. Simplify the sum ∑ i · i! (that is, rewrite it without
i =1
using the ∑ sign).

Solution to Exercise 4.1.4. The trick is to realize that each i ∈ N satisfies


i · i! = (i + 1)! − i! (75)
(because (i + 1)! = (i + 1) · i! = i · i! + i!). Thus,
  
n n n +1
∑ i · i!
|{z} = ∑ ((i + 1)! − i!) = ∑ (|s −{z
1) + 1 ! − ( s − 1) ! 
i =1 =(i +1)!−i! i =1 s =2
}
=s
(by (75))

(here, we have substituted s for i + 1 in the sum)


n +1
= ∑ (s! − (s − 1)!) = (n + 1)! − (|2 − 1) !
s =2
{z }
=1!=1
 
by Theorem 4.1.16, applied
to u = 2, v = n + 1 and as = s!
= (n + 1)! − 1. (76)
This solves Exercise 4.1.4.
Before we move on to the next example, let us observe what we have gained
from the telescope principle. This equality (76), once it has been found, can easily
be proved by induction on n (see [19s-hw0s, solution to Exercise 2 (b)] for such a
proof); but the telescope principle has helped us find this equality in the first place
(once we had the fancy to rewrite i · i! as (i + 1)! − i!). Thus, the telescope princi-
ple turns the (often difficult) question of simplifying a sum into an (often simpler)
question of rewriting its addends as differences.67 Of course, it is not magic: Any
proof using the telescope principle can easily be rewritten as an induction proof,
because the telescope principle itself is easily proved by induction. The main ad-
vantage of the principle is its convenience.
In future proofs, we shall be less detailed than in our above solution to Exercise
4.1.4, and simply say “by the telescope principle” instead of specifying what we
are applying Theorem 4.1.16 to.
The next exercise is about generalizing the formula (29):
Exercise 4.1.5. Let p be a positive integer, and let n ∈ N. Simplify the sum
n
1
∑ i ( i + 1) ( i + 2) · · · ( i + p ) .
i =1

67 Thisis similar to computing an integral by finding an antiderivative of the function under the
integral sign.

December 25, 2021


Math 235 notes page 104

Solution to Exercise 4.1.5. We define


1
ai : =
( i + 1) ( i + 2) · · · ( i + p )
for each i ∈ N. Then, it is easy to see that

1 a a
= i −1 − i (77)
i ( i + 1) ( i + 2) · · · ( i + p ) p p

for any positive integer i.


Indeed, if i is a positive integer, then

a i −1 − ai
|{z} |{z}
1 1
= =
i ( i + 1) · · · ( i + p − 1) ( i + 1) ( i + 2) · · · ( i + p )
(by the definition of ai−1 ) (by the definition of ai )
1 1
= −
i ( i + 1) · · · ( i + p − 1) ( i + 1) ( i + 2) · · · ( i + p )
| {z } | {z }
i+p i
= =
i ( i + 1) · · · ( i + p − 1) · ( i + p ) i · ( i + 1) ( i + 2) · · · ( i + p )
i+p i
= −
i ( i + 1) · · · ( i + p − 1) · ( i + p ) i · ( i + 1) ( i + 2) · · · ( i + p )
i+p i
= −
i ( i + 1) ( i + 2) · · · ( i + p ) i ( i + 1) ( i + 2) · · · ( i + p )
(i + p ) − i p
= = (78)
i ( i + 1) ( i + 2) · · · ( i + p ) i ( i + 1) ( i + 2) · · · ( i + p )

and thus
a i −1 a 1 1 p
− i = ( a i −1 − a i ) = · (by (78))
p p p p i ( i + 1) ( i + 2) · · · ( i + p )
1
= ;
i ( i + 1) ( i + 2) · · · ( i + p )

this proves (77).

December 25, 2021


Math 235 notes page 105

Now,
n
1
∑ i ( i + 1) ( i + 2) · · · ( i + p )
i =1 | {z }
a i −1 a i
= −
p p
(by (77))
n n 
− a i − a i −1
  
a i −1 a i
=∑ − =∑ −
i =1 |
p p p p
{z } i =1
− a i − a i −1
= −
p p
− a n − a 1−1
= − (by the telescope principle)
p p
 
 
   
 
1 1  
= a 1−1 − a n =  a0 − an
  
p p |{z} |{z} 
|{z} 
= a0  1 1 
= =
 
1·2····· p ( n + 1) ( n + 2) · · · ( n + p )
 
(by the definition of a0 ) (by the definition of an )
 
1 1 1
= − . (79)
p 1 · 2 · · · · · p ( n + 1) ( n + 2) · · · ( n + p )

This solves the exercise.


n 1
Note that Exercise 4.1.5 has no good answer for p = 0. Indeed, the sum ∑
i =1 i
cannot be simplified. (It is known as the n-th harmonic number.)
Note also that, as an easy consequence of (79), we have

1 1 1
∑ i ( i + 1) ( i + 2) · · · ( i + p ) = ·
p 1·2····· p
(80)
i =1

for any positive integer p. This also “holds” for p = 0, in the sense that the infinite
∞ 1
series ∑ (known as the harmonic series) diverges (which is precisely what one
i =1 i
1 1
would expect from seeing the = term on the right hand side of (80)). This is a
p 0
well-known fact, with several proofs on the Wikipedia.
To facilitate its future application, let us restate Theorem 4.1.16 in a form that
will allow us to apply it without substituting indices:

December 25, 2021


Math 235 notes page 106

Corollary 4.1.17. Let u and v be two integers such that u − 1 ≤ v. Let ai be a


number for each i ∈ {u, u + 1, . . . , v + 1}. Then,
v
∑ ( a i +1 − a i ) = a v +1 − a u .
i =u

Proof of Corollary 4.1.17. We have (u + 1) − 1 = u ≤ v + 1 (since u − 1 ≤ v). Also,


 
v v +1
∑ ( a i +1 − a i ) = ∑  a(s−1)+1 − as−1 
 
i =u s=u+1 | {z }
= as
 
here, we have substituted s − 1 for i in the sum
(i.e., formally speaking, applied Corollary 4.1.14)
v +1
= ∑ ( as − as−1 ) = av+1 − a(u+1)−1
s = u +1 | {z }
= au
 
by Theorem 4.1.16,
applied to u + 1 and v + 1 instead of u and v
= a v +1 − a u .
This proves Corollary 4.1.17.
Corollary 4.1.17 is just Theorem 4.1.16 restated with a shifted index; thus, we
shall still refer to it as the “telescope principle”.
n 1
Exercise 4.1.6. Let n ∈ N. Simplify the sum ∑ √ √ .
i =1 i+ i+1
Solution to Exercise 4.1.6. If x and y are two distinct positive reals, then
√ √  √ √  √ 2 √
x− y x+ y = x − ( y )2 = x − y
and thus √ √
1 x− y
√ √ = . (81)
x+ y x−y
This formula might be well-known from high school (where it is used to rationalize
denominators).
Now, for each positive real i, we have
√ √
1 i− i+1
√ √ = (by (81))
i+ i+1 i − ( i + 1)
√ √
i− i+1
= (since i − (i + 1) = −1)
−1 √

= i + 1 − i.

December 25, 2021


Math 235 notes page 107

Hence,
n
1 n √ √ √ √
∑ i+ i+1 ∑
√ √ = i + 1 − i = n+1− 1
i =1 | {z √ } i=1

= i +1− i

(by the telescope principle68 ). This simplifies further to n + 1 − 1.
Finally, here is what might be the simplest application of the telescope principle;
we state it mainly because of its usefulness:

Exercise 4.1.7. Let a and b be any numbers. Let m ∈ N. Then,


m −1
( a − b) ∑ a i b m −1− i = a m − b m . (82)
i =0

Solution to Exercise 4.1.7. From (61), we obtain


 
m −1 m −1 m −1
( a − b) ∑ a i b m −1− i = ∑ ( a − b ) a i b m −1− i = ∑  aai bm−1−i − bai bm−1−i 
| {z } | {z }
i =0 i =0 i =0
| {z }
= aai bm−1−i −bai bm−1−i = ai+1 bm−(i+1) = ai b m −i
m −1  
= ∑ ai+1 bm−(i+1) − ai bm−i
i =0
(m−1)+1 m−((m−1)+1)
= |a {z } b| {z a0 b| m{z−}0
} − |{z}
= am = b0 =1 =1 =bm
!
by the telescope principle (Corollary 4.1.17,
applied to u = 0, v = m − 1 and ai = ai bm−i )
= am − bm .

We notice that Exercise 4.1.7 generalizes Exercise 2.1.1 and also yields a rather
explicit new proof of Proposition 3.2.7 (check it!).

4.1.5. Splitting a sum into two


Another general rule for sums is the following ([Grinbe15, (3)]):

Theorem 4.1.18. Let S be a finite set. Let X and Y be two subsets of S such that
X ∩ Y = ∅ and X ∪ Y = S. (Equivalently, X and Y are two subsets of S such that

68 specifically,

by Corollary 4.1.17, applied to u = 1, v = n and ai = i

December 25, 2021


Math 235 notes page 108

each element of S lies in exactly one of X and Y.) Let as be a number for each
s ∈ S. Then,
∑ as = ∑ as + ∑ as . (83)
s∈S s∈ X s ∈Y
   
Here, as we explained, ∑ as + ∑ as stands for ∑ as + ∑ as .
s∈ X s ∈Y s∈ X s ∈Y
Behind Theorem 4.1.18 stands the intuitively obvious fact that a sum ∑ as can
s∈S
be computed by first sorting its addends into two “heaps” ∑ as and ∑ as , then
s∈ X s ∈Y
summing each heap separately, and finally adding the two heap sums together. For
example, this says that
a1 + a2 + a3 + a4 + a5 = ( a1 + a4 ) + ( a2 + a3 + a5 ) .
(This is the particular case of (83) for S = {1, 2, 3, 4, 5}, X = {1, 4} and Y = {2, 3, 5}.)
w
Most commonly, Theorem 4.1.18 is used to split a sum of the form ∑ as into two
s=u
parts:

Corollary 4.1.19. Let u, v and w be three integers such that u − 1 ≤ v ≤ w. Let


as be a number for each s ∈ {u, u + 1, . . . , w}. Then,
w v w
∑ as = ∑ as + ∑ as . (84)
s=u s=u s = v +1

Proof of Corollary 4.1.19. Recall the assumption u − 1 ≤ v ≤ w. Thus, the sets


{u, u + 1, . . . , v} and {v + 1, v + 2, . . . , w} are subsets of the set {u, u + 1, . . . , w}
and satisfy

{u, u + 1, . . . , v} ∩ {v + 1, v + 2, . . . , w} = ∅ and
{u, u + 1, . . . , v} ∪ {v + 1, v + 2, . . . , w} = {u, u + 1, . . . , w} .
Thus, Theorem 4.1.18 (applied to S = {u, u + 1, . . . , w} and X = {u, u + 1, . . . , v}
and Y = {v + 1, v + 2, . . . , w}) yields

∑ as = ∑ as + ∑ as .
s∈{u,u+1,...,w} s∈{u,u+1,...,v} s∈{v+1,v+2,...,w}

But this rewrites as


w v w
∑ as = ∑ as + ∑ as .
s=u s=u s = v +1
Hence, Corollary 4.1.19 is proved.
Here are two examples of sums getting split:

December 25, 2021


Math 235 notes page 109

Exercise 4.1.8. Let n ∈ N.


n
(a) Compute ∑ |s|.
s=−n
2n−1
(b) Compute ∑ (s%2).
s =0

Solution to Exercise 4.1.8 (sketched). (a) Corollary 4.1.19 (applied to u = −n, v = 0,


w = n and as = |s|) yields
n 0 n 0 n
∑ |s| = ∑ |s| +∑ |s| = ∑ (−s) +∑s
s=−n s=−n |{z} s =1
|{z} s=−n s =1
=−s =s
(since s≥1≥0)
| {z }
(since s≤0) −1
= ∑ (−s)+(−0)
s=−n

−1 n n n
= ∑ (−s) + (−0) + ∑ s = ∑ t + ∑ s
s=−n | {z } s=1 t =1 s =1
| {z } =0
n
=∑ t
t =1
(here, we have substituted t for −s
in the sum, since the
map {1,2,...,n}→{−n,−n+1,...,−1}, s7→−s
is a bijection)
n n  
here, we have renamed the summation index t
= ∑ s+ ∑ s as s in the first sum
s =1 s =1
n
= 2· ∑ s = 2 · (1 + 2 + · · · + n ) = n ( n + 1) (by (70)) .
s =1

(b) Set S = {0, 1, . . . , 2n − 1}. Let X be the set of all even elements of S, and let Y
be the set of all odd elements of S. Then, each element of S lies in exactly one of X
and Y (since each element of S is either even or odd, but not both). In other words,
X ∩ Y = ∅ and X ∪ Y = S. Therefore, we can apply Theorem 4.1.18 to as = s%2.
We obtain
∑ (s%2) = ∑ (s%2) + ∑ (s%2) . (85)
s∈S s∈ X s ∈Y
Let us now simplify the right hand side. If s ∈ X, then s is even (by the definition of
X) and thus satisfies s%2 = 0 (by Exercise 3.3.2 (a)). Hence, ∑ (s%2) = ∑ 0 = 0.
s∈ X | {z } s∈ X
=0
On the other hand, if s ∈ Y, then s is odd (by the definition of Y) and thus satisfies
s%2 = 1 (by Exercise 3.3.2 (b)). Hence, ∑ (s%2) = ∑ 1 = |Y | · 1 (by (60)). Now,
s∈Y | {z } s ∈Y
=1
what is |Y | ? We defined Y as the set of all odd elements of S = {0, 1, . . . , 2n − 1};
hence, the elements of Y are 1, 3, 5, . . . , 2n − 1. These are precisely n elements69 .
69 Strictly
speaking, this needs to be proved. It can be easily proved by induction on n, or using
Theorem 3.1.8.

December 25, 2021


Math 235 notes page 110

Thus, |Y | = n. Hence, ∑ (s%2) = |Y | · 1 = |Y | = n. Now, (85) becomes


s ∈Y

∑ (s%2) = ∑ (s%2) + ∑ (s%2) = 0 + n = n. (86)


s∈S s∈ X s ∈Y
| {z } | {z }
=0 =n

Since S = {0, 1, . . . , 2n − 1}, we can rewrite the ∑ sign on the left hand side as
s∈S
2n−1 2n−1
∑ . Thus, (86) rewrites as ∑ (s%2) = n.
s =0 s =0

The following is just a restatement of Theorem 4.1.18 using the notation from
Definition 4.1.5:

Theorem 4.1.20. Let S be a finite set. For each s ∈ S, let as be a number, and let
A (s) be a logical statement. Then,

∑ as = ∑ as + ∑ as = ∑ as + ∑ as .
s∈S s∈S; s∈S; s∈S; s∈S;
A(s) is true A(s) is false A(s) not A(s)

(The right hand side is just a shorter way to rewrite the middle hand side; there
is nothing profound happening here.)

4.1.6. Splitting a sum into several


Theorem 4.1.18 has a rather natural generalization ([Grinbe15, (26)]), in which a
sum is split into n instead of 2 smaller sums:

Theorem 4.1.21. Let S be a finite set. Let S1 , S2 , . . . , Sn be finitely many subsets


of S. Assume that these subsets S1 , S2 , . . . , Sn are pairwise disjoint (i.e., we have
Si ∩ S j = ∅ for any two distinct elements i and j of {1, 2, . . . , n}) and their union
is S. (Thus, every element of S lies in precisely one of the subsets S1 , S2 , . . . , Sn .)
Let as be a number for each s ∈ S. Then,
n
∑ as = ∑ ∑ as (87)
s∈S w =1 s ∈ Sw
= ∑ as + ∑ as + · · · + ∑ as . (88)
s ∈ S1 s ∈ S2 s ∈ Sn

Note that the sum on the right hand side of (87) is a double sum – i.e., a sum of
sums.
Theorem 4.1.18 is the particular case of Theorem 4.1.21 obtained if we set n = 2,
S1 = X and S2 = Y.
As an example for the use of Theorem 4.1.21, here is a pretty obvious exercise:

December 25, 2021


Math 235 notes page 111

Exercise 4.1.9. Let I be a finite set of integers. For each pair (i, j) ∈ I × I, let a(i,j)
be a number. Prove that
 
∑ (i,j) ∑ (i,i)
a = a + ∑ a (i,j) + a ( j,i ) .
(i,j)∈ I × I i∈ I (i,j)∈ I × I;
i< j

Solution to Exercise 4.1.9. Let S be the set I × I. Define three subsets S1 , S2 and S3
of S by

S1 = {(i, j) ∈ I × I | i < j} ,
S2 = {(i, j) ∈ I × I | i = j} ,
S3 = {(i, j) ∈ I × I | i > j} .

Then, every element of S lies in precisely one of the subsets S1 , S2 , S3 . In other


words, the three subsets S1 , S2 , S3 are pairwise disjoint and their union is S. Hence,
(88) (applied to n = 3) yields

∑ as = ∑ as + ∑ as + ∑ as .
s∈S s ∈ S1 s ∈ S2 s ∈ S3

Renaming the index s as (i, j) in each sum of this equality, we obtain

∑ a(i,j) = ∑ a(i,j) + ∑ a(i,j) + ∑ a(i,j) . (89)


(i,j)∈S (i,j)∈S1 (i,j)∈S2 (i,j)∈S3

We shall now take a closer look at the sums on the right hand side.
The set S2 = {(i, j) ∈ I × I | i = j} consists of the pairs (i, i ) for all i ∈ I. More
precisely, there is a bijection

I → S2 ,
i 7→ (i, i ) .

Thus, we can substitute (i, i ) for (i, j) in the sum ∑ a(i,j) . This sum therefore
(i,j)∈S2
rewrites as follows:
∑ a(i,j) = ∑ a(i,i) . (90)
(i,j)∈S2 i∈ I

Furthermore, there is a bijection between the two sets S1 = {(i, j) ∈ I × I | i < j}


and S3 = {(i, j) ∈ I × I | i > j}. Namely, the map

S1 → S3 ,
(i, j) 7→ ( j, i )

December 25, 2021


Math 235 notes page 112

is a bijection (because if (i, j) ∈ I × I satisfies i < j, then j > i, and vice versa).
Therefore, we can substitute ( j, i ) for (i, j) in the sum ∑ a(i,j) . This sum therefore
(i,j)∈S3
rewrites as follows:
∑ a(i,j) = ∑ a( j,i) . (91)
(i,j)∈S3 (i,j)∈S1

Finally, I × I = S, so that

∑ a(i,j) = ∑ a(i,j) = ∑ a(i,j) + ∑ a(i,j) + ∑ a(i,j) (by (89))


(i,j)∈ I × I (i,j)∈S (i,j)∈S1 (i,j)∈S2 (i,j)∈S3
| {z } | {z }
= ∑ a(i,i) = ∑ a( j,i)
i∈ I (i,j)∈S1
(by (90)) (by (91))

= ∑ a(i,j) + ∑ a(i,i) + ∑ a( j,i) = ∑ a(i,i) + ∑ a(i,j) + ∑ a( j,i)


(i,j)∈S1 i∈ I (i,j)∈S1 i∈ I (i,j)∈S1 (i,j)∈S1
| {z }
= ∑ ( a(i,j) +a( j,i) )
(i,j)∈S1
(by (64))
   
= ∑ a(i,i) + ∑ a(i,j) + a( j,i) = ∑ a(i,i) + ∑ a(i,j) + a( j,i) .
i∈ I (i,j)∈S1 i∈ I (i,j)∈ I × I;
| {z } i< j
= ∑ ( a(i,j) +a( j,i) )
(i,j)∈ I × I;
i< j
(since S1 ={(i,j)∈ I × I | i < j})

This solves Exercise 4.1.9.


The following theorem ([Grinbe15, (22)]) provides a more elaborate way of split-
ting a sum:

Theorem 4.1.22. Let S be a finite set. Let W be a finite set. Let f : S → W be a


map. Let as be a number for each s ∈ S. Then,

∑ as = ∑ ∑ as . (92)
s∈S w ∈W s∈S;
f (s)=w

The idea behind the formula (92) is the following: The left hand side is the sum
of all as for s ∈ S. The right hand side is what you get if you first subdivide the
collection of numbers as into heaps according to the value of f (s) (with one heap
for each w ∈ W), then sum each heap, and then sum the resulting heap sums. That
the two sides are equal is thus quite obvious, although the rigorous proof would
require some bookkeeping70 .

70 See [Grinbe15, Theorem 2.127] for a proof by induction on |S|.

December 25, 2021


Math 235 notes page 113

When we apply Theorem 4.1.22 to rewrite a sum ∑ as as ∑ ∑ as , we say


s∈S w ∈W s∈S;
f (s)=w
that we are splitting the sum ∑ as according to the value of f (s).
s∈S
Let us illustrate the use of Theorem 4.1.22 by an exercise that generalizes Exercise
4.1.8 (b):

Exercise 4.1.10. Let n be a positive integer. Let m ∈ N. Prove that


mn−1
mn (n − 1)
∑ (k%n) =
2
.
k =0

(It is easy to see that Exercise 4.1.8 (b) follows from Exercise 4.1.10, applied to 2
and n instead of n and m.)
Solution to Exercise 4.1.10 (sketched). We let S be the set {0, 1, . . . , mn − 1}. Let W be
the set {0, 1, . . . , n − 1}. Define a map

f : S → W,
k 7→ k%n.

(This is well-defined, since each k ∈ S satisfies k%n ∈ {0, 1, . . . , n − 1} = W.) Thus,


(92) (applied to as = k%n) yields

∑ (s%n) = ∑ ∑ (s%n) = ∑ ∑ (s%n)


s∈S w ∈W s∈S; w ∈W s∈S;
| {z }
f (s)=w s%n=w =w
| {z }
= ∑ (s%n)
s∈S;
s%n=w
(since f (s)=s%n for each s∈S)

= ∑ ∑ w. (93)
w ∈W s∈S;
s%n=w

Now, let us simplify the sum ∑ w for each w ∈ W. Indeed, fix w ∈ W. The
s∈S;
s%n=w
summation sign ∑ is just shorthand for ∑ (by Definition 4.1.5).
s∈S; s∈{k∈S | k%n=w}
s%n=w
Thus, we have

∑ w= ∑ w = |{k ∈ S | k%n = w}| · w (94)


s∈S; s∈{k∈S | k%n=w}
s%n=w

(by (60)). Now, we need to compute |{k ∈ S | k%n = w}|, that is, find the number
of all k ∈ S satisfying k%n = w.

December 25, 2021


Math 235 notes page 114

Recall that S = {0, 1, . . . , mn − 1} and w ∈ W = {0, 1, . . . , n − 1}. Thus, the


elements k ∈ S satisfying k%n = w are the m elements

w, n + w, 2n + w, 3n + w, . . . , (m − 1) n + w.

Hence, there are exactly m such elements. In other words,

|{k ∈ S | k%n = w}| = m.


In light of this, (94) becomes

∑ w = |{k ∈ S | k%n = w}| ·w = mw. (95)


s∈S;
| {z }
s%n=w =m

Forget that we fixed w. We thus have proved (95) for each w ∈ W. Now, (93)
becomes
n −1
∑ (s%n) = ∑ ∑ w= ∑ mw = ∑ mw (since W = {0, 1, . . . , n − 1})
s∈S w ∈W s∈S; w ∈W w =0
s%n=w
| {z }
=mw
(by (95))
n −1
(n − 1) ((n − 1) + 1) ( n − 1) n
=m ∑ w =m
2
=m
2
w =0
| {z }
=0+1+2+···+(n−1)
=1+2+···+(n−1)
(n − 1) ((n − 1) + 1)
=
2
(by (70), applied
to n−1 instead of n)
mn (n − 1)
= .
2
This solves Exercise 4.1.10.

4.1.7. Fubini’s principle and interchange of summation signs


Probably the most complicated rule for summation signs (although this is not say-
ing a lot) is Fubini’s theorem for finite sums. We first state it in a particular case
([Grinbe15, (28)]):

Theorem 4.1.23. Let n ∈ N and m ∈ N. Let a( x,y) be a number for each ( x, y) ∈


{1, 2, . . . , n} × {1, 2, . . . , m}. Then,
n m m n
∑∑ a( x,y) = ∑ a( x,y) = ∑ ∑ a(x,y) . (96)
x =1 y =1 ( x,y)∈{1,2,...,n}×{1,2,...,m} y =1 x =1

December 25, 2021


Math 235 notes page 115

Intuitively, Theorem 4.1.24 says that if you have a rectangular table filled with
numbers, then you can sum the entries of the table by going along rows (and
then summing the row tallies), or by going along columns (and then summing the
column tallies), or plainly by summing all the entries in some unspecified way.
Indeed, if our table is the rectangular table

a(1,1) a(1,2) ··· a(1,m)


a(2,1) a(2,2) ··· a(2,m)
.. .. .. .. ,
. . . .
a(n,1) a(n,2) ··· a(n,m)

then the sum obtained by going along rows is


 
a(1,1) + a(1,2) + · · · + a(1,m)
 
+ a(2,1) + a(2,2) + · · · + a(2,m)
+···
 
+ a(n,1) + a(n,2) + · · · + a(n,m)
n m
= ∑ ∑ a(x,y) ,
x =1 y =1

whereas the sum obtained by going along columns is


 
a(1,1) + a(2,1) + · · · + a(n,1)
 
+ a(1,2) + a(2,2) + · · · + a(n,2)
+···
 
+ a(1,m) + a(2,m) + · · · + a(n,m)
m n
= ∑ ∑ a(x,y) ,
y =1 x =1

and the sum obtained in an unspecified way is simply

∑ a( x,y) .
( x,y)∈{1,2,...,n}×{1,2,...,m}

Thus, (96) states precisely that these three sums are equal.
We can generalize Theorem 4.1.23 by replacing the sets {1, 2, . . . , n} and {1, 2, . . . , m}
by any two finite sets X and Y:

December 25, 2021


Math 235 notes page 116

Theorem 4.1.24. Let X and Y be two finite sets. Let a( x,y) be a number for each
( x, y) ∈ X × Y. Then,

∑ ∑ a(x,y) = ∑ a( x,y) = ∑ ∑ a( x,y) . (97)


x ∈ X y ∈Y ( x,y)∈ X ×Y y ∈Y x ∈ X

Theorem 4.1.24 is [Grinbe15, (27)] (and a proof can be found there). Of course,
Theorem 4.1.24 can in turn be recovered from Theorem 4.1.23, because any two
finite sets X and Y can be relabeled as {1, 2, . . . , n} and {1, 2, . . . , m} for appropriate
n and m.
Theorem 4.1.24 is called Fubini’s theorem for finite sums, due to its similarity to the
(much deeper and subtler) Fubini’s theorems in analysis (which allow interchang-
ing infinite sums or integrals). Unlike the latter, it comes with no restrictions (like
absolute convergence or measurability).
Theorem 4.1.24 can be used in multiple ways. When we use it to rewrite a sum
∑ a( x,y) as ∑ ∑ a( x,y) , we say that we are decomposing the summation sign
( x,y)∈ X ×Y x ∈ X y ∈Y
∑ . When we use it to rewrite a double sum ∑ ∑ a( x,y) as ∑ ∑ a( x,y) ,
( x,y)∈ X ×Y x ∈ X y ∈Y y ∈Y x ∈ X
we say that we are interchanging the summation signs ∑ and ∑ . Note that two
x∈X y ∈Y
summation signs can only be interchanged in this way if the sets X and Y that they
range over are independent of x and y; for example, we can interchange the two
n m
summation signs in the double sum ∑ ∑ , but we cannot interchange the two
x =1 y =1
n x
summation signs in the double sum ∑ ∑ . (But we shall see below how we can
x =1 y =1
nevertheless transform the latter double sum.)
Here is a simple (yet quite useful) application of Theorem 4.1.23:

Exercise 4.1.11. Let n ∈ N and m ∈ N. Let u1 , u2 , . . . , un and v1 , v2 , . . . , vm be


numbers. Prove that
! !
n m
∑ ui ∑ vj = ∑ ui v j .
i =1 j =1 (i,j)∈{1,2,...,n}×{1,2,...,m}

Obviously, Exercise 4.1.11 is nothing else than a souped-up distributivity law,


saying that a product of two finite sums can be expanded into a sum of all possible
products of an addend in the former with an addend in the latter. Facts like this
can be used without proof (and even without saying) on any exam, but let us give
a formal proof to illustrate the use of Theorem 4.1.23:
n
Solution to Exercise 4.1.11. Applying (61) to λ = ∑ ui and S = {1, 2, . . . , m} and
i =1

December 25, 2021


Math 235 notes page 117

as = vs , we find ! ! !
m n n m
∑ ∑ ui vs = ∑ ui ∑ vs .
s =1 i =1 i =1 s =1

Renaming the summation index s as j in this equality, we obtain


! ! !
m n n m
∑ ∑ ui vj = ∑ ui ∑ vj .
j =1 i =1 i =1 j =1

Hence,
! ! !
n m m n m n
∑ ui ∑ vj = ∑ ∑ ui vj = ∑∑ v j ui
i =1 j =1 j =1 i =1 j=1 i =1 |{z}
| {z } = ui v j
n
= v j ∑ ui
i =1
n
= ∑ v j ui
i =1
(again by (61))
m n
= ∑ ∑ ui v j . (98)
j =1 i =1

But Theorem 4.1.23 (applied to a( x,y) = u x vy ) yields


n m m n
∑∑ u x vy = ∑ u x vy = ∑ ∑ u x vy .
x =1 y =1 ( x,y)∈{1,2,...,n}×{1,2,...,m} y =1 x =1

Renaming the indices x and y as i and j in this chain of equalities, we obtain


n m m n
∑ ∑ ui v j = ∑ ui v j = ∑ ∑ ui v j .
i =1 j =1 (i,j)∈{1,2,...,n}×{1,2,...,m} j =1 i =1

Hence, ! !
m n n m
∑ ui v j = ∑ ∑ ui v j = ∑ ui ∑ vj
(i,j)∈{1,2,...,n}×{1,2,...,m} j =1 i =1 i =1 j =1

(by (98)). This solves Exercise 4.1.11.


A consequence of Exercise 4.1.11 is the “multinomial formula” for the square of
a finite sum:

Exercise 4.1.12. Let n ∈ N. Let u1 , u2 , . . . , un be numbers. Prove that


!2
n n
∑ ui = ∑ u2i + 2 ∑ ui u j . (99)
i =1 i =1 1≤ i < j ≤ n

December 25, 2021


Math 235 notes page 118

Here, the summation sign “ ∑ ” is shorthand for ∑ . (For example,


1≤ i < j ≤ n (i,j)∈{1,2,...,n}2 ;
i< j
∑ ui u j = u1 u2 + u1 u3 + u2 u3 .)
1≤ i < j ≤3

Solution to Exercise 4.1.12. Exercise 4.1.11 (applied to m = n and v j = u j ) yields


! !
n n
∑ ui ∑ uj = ∑ ui u j
i =1 j =1 (i,j)∈{1,2,...,n}×{1,2,...,n}

∑ ∑

= ui ui + ui u j + u j ui
|{z}
i ∈{1,2,...,n} (i,j)∈{1,2,...,n}×{1,2,...,n}; | {z }
=u2i i< j =2ui u j
!
by Exercise 4.1.9, applied to I = {1, 2, . . . , n}
and a(i,j) = ui u j
= ∑ u2i + ∑ 2ui u j
i ∈{1,2,...,n} (i,j)∈{1,2,...,n}×{1,2,...,n};
i< j
n
= ∑ u2i + ∑ 2ui u j
i =1 1≤ i < j ≤ n
| {z }
=2 ∑ ui u j
1≤ i < j ≤ n
 
here, we have rewritten the summation
 signs
 ∑ and ∑ 

 i ∈{1,2,...,n} (i,j)∈{1,2,...,n}×{1,2,...,n}; 

 i< j 

 n 
 as ∑ and ∑ 
i =1 1≤ i < j ≤ n
n
= ∑ u2i + 2 ∑ ui u j .
i =1 1≤ i < j ≤ n

In view of
! ! ! !
n n n n  
here, we have renamed the
∑ ui ∑ uj = ∑ ui ∑ ui index j in the second sum as i
i =1 j =1 i =1 i =1
!2
n
= ∑ ui ,
i =1

this rewrites as !2
n n
∑ ui = ∑ u2i + 2 ∑ ui u j .
i =1 i =1 1≤ i < j ≤ n

This solves Exercise 4.1.12.

December 25, 2021


Math 235 notes page 119

Fubini’s theorem can be generalized a little bit more ([Grinbe15, (34)]):

Theorem 4.1.25. Let X and Y be two finite sets. For every pair ( x, y) ∈ X × Y,
let A ( x, y) be a logical statement. For each ( x, y) ∈ X × Y satisfying A ( x, y), let
a( x,y) be a number. Then,

∑ ∑ a( x,y) = ∑ a( x,y) = ∑ ∑ a( x,y) . (100)


x ∈ X y∈Y; ( x,y)∈ X ×Y; y∈Y x ∈ X;
A( x,y) A( x,y) A( x,y)

Theorem 4.1.25 differs from Theorem 4.1.24 in that the sums are restricted to only
those y ∈ Y or only those ( x, y) ∈ X × Y or only those x ∈ X that satisfy A ( x, y).
In other words, if we regard the three sides of (97) as three ways to sum the entries
of a rectangular table, then the three sides of (100) are likewise understood as
three ways to sum the entries of a gappy table (i.e., a rectangular table in which not
every cell has an entry). This added generality is convenient, but it is not profound;
indeed, Theorem 4.1.25 can easily be derived from Theorem 4.1.24 by defining a( x,y)
to be 0 for any ( x, y) ∈ X × Y that does not satisfy A ( x, y).

Example 4.1.26. For any n ∈ N and m ∈ N, we have

∑ ∑ xy = ∑ xy = ∑ ∑ xy.
x ∈{1,2,...,n} y∈{1,2,...,m}; ( x,y)∈{1,2,...,n}×{1,2,...,m}; y∈{1,2,...,m} x ∈{1,2,...,n};
x +y is even x +y is even x +y is even

(This follows from (100), applied to X = {1, 2, . . . , n}, Y = {1, 2, . . . , m} and


A ( x, y) = (“x + y is even”).)

Finally, the last two variants of Fubini’s theorem we will give are analogues of
Theorem 4.1.23 for triangular (instead of rectangular) tables. Let us state them and
then give an application:

Theorem 4.1.27. Let n ∈ N. Let a( x,y) be a number for each pair ( x, y) ∈


{1, 2, 3, . . .}2 satisfying x + y ≤ n. Then,
n n− x n n−y
∑ ∑ a(x,y) = ∑ a( x,y) = ∑ ∑ a(x,y) . (101)
x =1 y =1 ( x,y)∈{1,2,3,...} ;2 y =1 x =1
x +y≤n

Example 4.1.28. If n = 4, then the formula (101) (rewritten without the use of ∑

December 25, 2021


Math 235 notes page 120

signs) looks as follows:


   
a(1,1) + a(1,2) + a(1,3) + a(2,1) + a(2,2) + a(3,1) + (empty sum)
 
a(1,1) a(1,2) a(1,3)
 
 
= the sum of all entries of the table a(2,1) a(2,2)
 

 
a(3,1)
   
= a(1,1) + a(2,1) + a(3,1) + a(1,2) + a(2,2) + a(1,3) + (empty sum) .

Theorem 4.1.29. Let n ∈ N. Let a( x,y) be a number for each ( x, y) ∈ {1, 2, . . . , n}2
satisfying x ≤ y. Then,
n n n y
∑∑ a( x,y) = ∑ a( x,y) = ∑ ∑ a(x,y) . (102)
x =1 y = x 2
( x,y)∈{1,2,...,n} ; y =1 x =1
x ≤y

Example 4.1.30. If n = 3, then the formula (102) (rewritten without the use of ∑
signs) looks as follows:
   
a(1,1) + a(1,2) + a(1,3) + a(2,2) + a(2,3) + a(3,3)
 
a(1,1) a(1,2) a(1,3)
 
 
=  the sum of all entries of the table a ( 2,2 ) a ( 2,3 ) 

 
a(3,3)
   
= a(1,1) + a(1,2) + a(2,2) + a(1,3) + a(2,3) + a(3,3) .

Theorem 4.1.27 and Theorem 4.1.29 are [Grinbe15, (31) and (33), respectively].
They are commonly used to interchange summation signs: i.e., to rewrite a sum
n n− x n n−y
of the form ∑ ∑ a( x,y) as ∑ ∑ a( x,y) or vice versa, or to rewrite a sum of the
x =1 y =1 y =1 x =1
n n n y
form ∑ ∑ a( x,y) as ∑ ∑ a( x,y) . This kind of interchange is somewhat trickier
x =1 y = x y =1 x =1
than the straightforward interchange facilitated by Theorem 4.1.23; indeed, unlike
the latter, it requires a change of the limits of summation. However, it is not hard
to remember how the limits have to change: After all, the resulting double sum
needs to include the same a( x,y) as the original one. Thus, for example, we rewrite

December 25, 2021


Math 235 notes page 121

n n− x n n−y
∑ ∑ a( x,y) as ∑ ∑ a( x,y) because both of these double sums are really summing
x =1 y =1 y =1 x =1
over all pairs ( x, y) of positive integers that satisfy x + y ≤ n.
An example of this interchange is given by the following exercise:

n
Exercise 4.1.13. Let x be a number distinct from 1. Simplify the sum ∑ ixi =
i =1
1x1 + 2x2 + · · · + nx n .

Solution to Exercise 4.1.13. For each m ∈ N, we have


 
0 1
( x − 1) x + x + · · · + x m
= x m +1 − 1

(by Exercise 2.1.1, applied to x and m + 1 instead of b and n) and therefore

x m +1 − 1
x0 + x1 + · · · + x m = (103)
x−1
(here, we have divided by x − 1, which is allowed since x 6= 1).

December 25, 2021


Math 235 notes page 122

Now, we proceed – informally – as follows:


n
∑ ixi = 1x1 + 2x2 + 3x3 + 4x4 + · · · + nx n
i =1
= x1 + x2 + x3 + · · · + x n
+ x2 + x3 + · · · + x n
+ x3 + · · · + x n
.. .. .. ..
. . . .
+ xn
n   n  
= ∑ x j + x j +1 + · · · + x n = ∑ x j x 0 + x 1 + · · · + x n − j
j =1 | {z } j =1 | {z }
= x j ( x0 + x1 +···+ x n− j ) x n − j + 1 −1
=
x−1
(by (103), applied to m=n− j)
n
x n − j +1 − 1 1 n   1 n  
= ∑ xj x−1
=
x−1 ∑ xj x n − j +1 − 1 =
x−1 ∑ x n +1 − x j
j =1 j =1 | {z } j =1
= x n +1 − x j | {z }
n n
= ∑ x n +1 − ∑ x j
j =1 j =1
 
 
 
 n n 
1  ∑ x n +1 − ∑ xj

= 
x−1 
 j =1 j =1


| {z } | {z } 
 n +1

=nx = x1 + x2 +···+ x n
= x ( x0 + x1 +···+ x n−1 )
 
 
 
 
 
1  n + 1

0 1 n − 1
 
= nx −x x +x +···+x 
x−1 

| {z }

xn − 1
 
 
=
x−1
 
(by (103), applied to m=n−1)
xn − 1
 
1 n +1
= nx −x· .
x−1 x−1

Let us formalize this computation – specifically, its second and third equality

December 25, 2021


Math 235 notes page 123

sign (since the rest is already fully rigorous). It becomes


n n i n n
∑ ixi
|{z} = ∑ ∑ xi = ∑ ∑ xi
i =1 i i =1 j =1 j =1 i= j
= ∑ xi | {z }
j =1 = x j + x j+1 +···+ x n
(by (60)
applied backwards)
 
here, we have interchanged the two summation signs
using (102)
n  
= ∑ x j + x j +1 + · · · + x n .
j =1

4.2. Finite products


Finite products are defined just like finite sums, but using multiplication instead of
addition (and using 1 instead of 0). In other words, they are multiplicative analogues
(i.e., analogues in which addition is replaced by multiplication) of finite sums. Let
me just state the analogues of Definition 4.1.1, Definition 4.1.4 and Definition 4.1.5
for products:
Definition 4.2.1. If S is a finite set, and if as is a number for each s ∈ S, then
∏ as denotes the product of all of these numbers as . Formally, this product is
s∈S
defined by recursion on |S|, as follows:

• If |S| = 0, then ∏ as is defined to be 1. (In this case, ∏ as is called an


s∈S s∈S
empty product.)

• Let n ∈ N. Assume that we have defined ∏ as for every finite set S with
s∈S
|S| = n (and every choice of numbers as ). Now, if S is a finite set with
|S| = n + 1 (and if a number as is chosen for each s ∈ S), then ∏ as is
s∈S
defined by picking any t ∈ S and setting

∏ as = at · ∏ as . (104)
s∈S s∈S\{t}

Definition 4.2.2. Let u and v be integers. Let as be a number for each s ∈


{u, u + 1, . . . , v}. Then, the finite product ∏ as will also be denoted by
s∈{u,u+1,...,v}
v
∏ as or by au au+1 · · · av (or au · au+1 · · · · · av ).
s=u

December 25, 2021


Math 235 notes page 124

Definition 4.2.3. Let S be a finite set, and let A (s) be a logical statement defined
for every s ∈ S. For each s ∈ S satisfying A (s), let as be a number. Then, the
product ∏ as is defined by
s∈S;
A(s)

∏ as = ∏ as .
s∈S; s∈{t∈S | A(t)}
A(s)

In other words, ∏ as is the product of the as for all s ∈ S which satisfy A (s).
s∈S;
A(s)

k
· · · }a = ∏ a for every number a and every k ∈ N. Thus, in
Note that ak = |aa {z
i =1
k times
particular, a0 = (empty product) = 1. This includes 00 = 1.
All the notations we have introduced for finite sums exist just as well for finite
products, mutatis mutandis71 . For example, expressions of the form ∏ as are called
s∈S
finite products, and the terms as in such expressions are called their factors (or terms).
There is no agreement on the operator precedence of the ∏ sign versus the · sign
(i.e., expressions like ∏ as b are ambiguous and need to be avoided), but the ∏
s∈S
 than the + and − signs (so an expression
sign definitely has higher precedence

like ∏ as + b always means ∏ as + b).
s∈S s∈S
In all reasonable regards, finite products (of numbers) behave just like finite
sums, as long as the obvious changes are made (addition replaced by multiplica-
tion, subtraction by division, 0 by 1, products by powers, etc.). Let me state (without
comment) the multiplicative analogues of Theorem 4.1.7, Theorem 4.1.8, Theorem
4.1.10, Theorem 4.1.1, Theorem 4.1.12, Theorem 4.1.16, Theorem 4.1.18, Corollary
4.1.19, Theorem 4.1.21, Theorem 4.1.22 and Theorem 4.1.24, respectively:72

Theorem 4.2.4. Let S be a finite set. Let a be a number. Then,

∏ a = a|S| . (105)
s∈S

Theorem 4.2.5. Let S be a finite set. For every s ∈ S, let as be a number. Also, let
λ ∈ N. Then,

∏ aλs = ∏ as . (106)
s∈S s∈S
71 “Mutatis mutandis” means “once the things that need to be changed have been changed” (i.e.,
“once the necessary changes are made”).
72 The proofs for all these analogues are analogous to the proofs of the original theorems for sums.

December 25, 2021


Math 235 notes page 125

This also holds for λ ∈ Z if all the numbers as are nonzero; and this also holds
for λ ∈ R if all the numbers as are positive reals.

Theorem 4.2.6. Let S be a finite set. For every s ∈ S, let as and bs be numbers.
Then, ! !
∏ ( a s bs ) = ∏ a s ∏ bs . (107)
s∈S s∈S s∈S

Exercise 4.2.1. Let S be a finite set. For every s ∈ S, let as and bs be numbers
such that bs 6= 0. Then,
! !
as
∏ b = ∏ a s / ∏ bs .
s∈S s s∈S s∈S

Theorem 4.2.7. Let S and T be two finite sets. Let f : S → T be a bijective map.
Let at be a number for each t ∈ T. Then,

∏ at = ∏ a f (s) . (108)
t∈ T s∈S

Theorem 4.2.8. Let u and v be two integers such that u − 1 ≤ v. Let as be a


number for each s ∈ {u − 1, u, . . . , v}. Assume that au−1 , au , . . . , av−1 are nonzero.
Then,
v
as av
∏ a s −1 = a u −1 . (109)
s=u

Theorem 4.2.9. Let S be a finite set. Let X and Y be two subsets of S such that
X ∩ Y = ∅ and X ∪ Y = S. (Equivalently, X and Y are two subsets of S such that
each element of S lies in exactly one of X and Y.) Let as be a number for each
s ∈ S. Then, ! !
∏ as = ∏ as ∏ as . (110)
s∈S s∈ X s ∈Y

Corollary 4.2.10. Let u, v and w be three integers such that u − 1 ≤ v ≤ w. Let


as be a number for each s ∈ {u, u + 1, . . . , w}. Then,
! !
w v w
∏ as = ∏ as ∏ as . (111)
s=u s=u s = v +1

December 25, 2021


Math 235 notes page 126

Theorem 4.2.11. Let S be a finite set. Let S1 , S2 , . . . , Sn be finitely many subsets


of S. Assume that these subsets S1 , S2 , . . . , Sn are pairwise disjoint (i.e., we have
Si ∩ S j = ∅ for any two distinct elements i and j of {1, 2, . . . , n}) and their union
is S. (Thus, every element of S lies in precisely one of the subsets S1 , S2 , . . . , Sn .)
Let as be a number for each s ∈ S. Then,
n
∏ as = ∏ ∏ as (112)
s∈S w =1 s ∈ Sw
! ! !
= ∏ as ∏ as ··· ∏ as . (113)
s ∈ S1 s ∈ S2 s ∈ Sn

Theorem 4.2.12. Let S be a finite set. Let W be a finite set. Let f : S → W be a


map. Let as be a number for each s ∈ S. Then,

∏ as = ∏ ∏ as . (114)
s∈S w ∈W s∈S;
f (s)=w

Theorem 4.2.13. Let X and Y be two finite sets. Let a( x,y) be a number for each
( x, y) ∈ X × Y. Then,

∏ ∏ a(x,y) = ∏ a( x,y) = ∏ ∏ a(x,y) . (115)


x ∈ X y ∈Y ( x,y)∈ X ×Y y ∈Y x ∈ X

Using common sense, the reader can easily figure out how all these theorems are
named (for example, Theorem 4.2.8 is known as the telescope principle for products, or
the multiplicative telescope principle), and also state multiplicative analogues for the
remaining rules for finite sums (e.g., for Theorem 4.1.25 and for Theorem 4.1.27).
The most famous finite products are the factorials
n
n! = 1 · 2 · · · · · n = ∏i for all n ∈ N.
i =1

(This includes 0! = (empty product) = 1.)


While there are numerous good exercises on finite products (see [AndTet18] for
a large collection), we shall here only show two. The first is a token application of
the telescope principle for products:
 
n 1
Exercise 4.2.2. Let n be a positive integer. Simplify ∏ 1− .
s =2 s

December 25, 2021


Math 235 notes page 127

Solution to Exercise 4.2.2. For each integer s ≥ 2, we have

1 s−1 1/s
1− = = .
s s 1/ (s − 1)

Hence,
n   n
1 1/s 1/n
∏ 1 − s = ∏ 1/ (s − 1) = 1/ (2 − 1)
s=2 | {z } s =2
1/s
=
1/ (s − 1)
(by (109), applied to u = 2, v = n and as = 1/s)
1
= .
n

The next exercise is a simple formula that is useful in combinatorics (more on its
use perhaps later on):

Exercise 4.2.3. Let n ∈ N. Prove that


(2n)!
1 · 3 · 5 · · · · · (2n − 1) = .
2n n!
(The left hand side of this equality is understood to be the product of all odd
integers from 1 to 2n − 1.)

Solution to Exercise 4.2.3 (sketched). See [Grinbe15, Exercise 3.2 (a)] or [17f-hw2s, Ex-
ercise 1 (a)] for a detailed solution. The main idea:
   

∏ ∏ ∏
   
(2n)! = i= ·
i i (by Theorem 4.2.9)

 
i ∈{1,2,...,2n} i ∈{1,2,...,2n}; i ∈{1,2,...,2n};
i is even i is odd
| {z } | {z }
=2·4·6·····(2n) =1·3·5·····(2n−1)
=2n ·(1·2·3·····n)
(by (107) and (105))
= 2n · (1 · 2 · 3 · · · · · n) · (1 · 3 · 5 · · · · · (2n − 1)) = 2n n! · (1 · 3 · 5 · · · · · (2n − 1)) .
| {z }
=n!

Finally, let us state the natural generalization of Exercise 4.1.11 to products with
several factors (each of which is a finite sum):

December 25, 2021


Math 235 notes page 128

Theorem 4.2.14. For every n ∈ N, let [n] denote the set {1, 2, . . . , n}.
Let n ∈ N. For every i ∈ [n], let pi,1 , pi,2 , . . . , pi,mi be finitely many numbers.
Then,
n mi n
∏ ∑ pi,k = ∑ ∏ pi,ki . (116)
i =1 k =1 (k1 ,k2 ,...,k n )∈[m1 ]×[m2 ]×···×[mn ] i =1

(Pedantic remark: If n = 0, then the Cartesian product [m1 ] × [m2 ] × · · · × [mn ]


has no factors; it is what is called an empty Cartesian product. It is understood to
be a 1-element set, and its single element is the 0-tuple () (also known as the
empty list). Thus the equality (116) indeed holds for n = 0, as it just says 1 = 1
in this case.)

The left hand side of (116) can be rewritten as



p1,1 + p1,2 + · · · + p1,m1 ( p2,1 + p2,2 + · · · + p2,m2 ) · · · ( pn,1 + pn,2 + · · · + pn,mn ) ,

and the right hand side is precisely what one obtains when expanding this product
into a sum of m1 m2 · · · mn monomials (i.e., products of single pi,k ’s). Thus, there is
nothing surprising about Theorem 4.2.14. A formal proof of Theorem 4.2.14 can be
found in [Grinbe15, Lemma 6.20].

4.3. Binomial coefficients


Our next topic are the binomial coefficients. In this section, we shall only briefly
survey these coefficients from an algebraic perspective, but we will return to them
later on as we get to enumerative combinatorics. Most of the claims in this section
are easily proved by computation or induction (and also found in many easily
accessible sources), so we will almost entirely omit their proofs. Much deeper
treatments of binomial coefficients are found in the book [GrKnPa94] (whose entire
Chapter 5 is devoted to binomial coefficients), in the book [Comtet74] (one of the
classics on enumerative combinatorics and binomial identities), in the recent book
[Spivey19], and in [Grinbe15, Chapter 3]. (Of these, I can recommend [GrKnPa94]
as a first introduction.)73 Another (somewhat silly but mathematically content-rich)
introduction to binomial coefficients is a recent booklet by McCleary [Mcclea17].
We begin by defining binomial coefficients.

73 See also the Wikipedia page for Pascal’s triangle for an overview of many properties.

December 25, 2021


Math 235 notes page 129

 
n
Definition 4.3.1. Let n and k be any two numbers. We define a number as
k
follows:

• If k ∈ N, then we set

n ( n − 1) ( n − 2) · · · ( n − k + 1)
 
n
= . (117)
k k!

/ N, then we set
• If k ∈  
n
= 0. (118)
k
 
n
We call a binomial coefficient, and we refer to it as “n choose k”. (We will
k
soon see what motivated this terminology.)

I believe this definition is the best at balancing


 generality and simplicity. There
n n!
are two simpler definitions (one that defines as , and another that
  k k! (n − k )!
n
defines as the number of k-element subsets of an n-element set) that work
k
only in certain cases (e.g., when n is a nonnegative integer)74 , and thus are less
suited as definitions; meanwhile, the only definitions more general than Definition
4.3.1 that I have seen require significant new concepts.

Warning 4.3.2. Definition 4.3.1 is pretty widespread: For example, it is followed


in [GrKnPa94], [Comtet74] and [Grinbe15]. But it is not an unquestioned stan-
dard across the literature. All definitions I am aware of are equivalent in the
“core region” of the binomial coefficients – that is, in the case when n ∈ N
and k ∈ {0, 1, . . . , n}. However, some definitions yield  values differing from
n
ours when n < 0. Many authors prefer to define only for n ∈ N, or
k
only for k ∈ N, or even only in the most restrictive case (when   n ∈ N and
n
k ∈ {0, 1, . . . , n}). Loehr, in [Loehr11], seems to avoid defining for negative
k
n at all, despite this case being rather useful.  
n n n
Some authors use notations like Ck or Ck or n Ck for .
  k  
n n
Do not confuse the binomial coefficient with the column vector .
k k
(Note the differences in horizontal spacing.)

74 We shall soon see that these definitions are equivalent to ours (in said cases).

December 25, 2021


Math 235 notes page 130

Example 4.3.3. Let us see some consequences of Definition 4.3.1.


(a) For any number n, we have
n ( n − 1) ( n − 2) · · · ( n − 0 + 1)
 
n
= (by (117), applied to k = 0)
0 0!
 
1 since n (n − 1) (n − 2) · · · (n − 0 + 1) = (empty product) = 1
=
1 and 0! = 1
= 1. (119)
(b) For any number n, we have
n ( n − 1) ( n − 2) · · · ( n − 1 + 1)
 
n
= (by (117), applied to k = 1)
1 1!
n
= (since n (n − 1) (n − 2) · · · (n − 1 + 1) = n and 1! = 1)
1
= n. (120)
(c) For any number n, we have
n ( n − 1) ( n − 2) · · · ( n − 2 + 1)
 
n
= (by (117), applied to k = 2)
2 2!
n ( n − 1)
= . (121)
2
(d) For any number n, we have
n ( n − 1) ( n − 2) n ( n − 1) ( n − 2)
 
n
= = (likewise) .
3 3! 6
(e) The equality (117) (applied to n = −1 and k = 5) yields
−1 (−1) (−1 − 1) (−1 − 2) · · · (−1 − 5 + 1)
 
(−1) (−2) (−3) (−4) (−5)
= =
5 5! 5!
(−1) (−2) (−3) (−4) (−5)
= = −1.
1·2·3·4·5
(f) More generally, for any k ∈ N, we have
−1 (−1) (−1 − 1) (−1 − 2) · · · (−1 − k + 1)
 
= (by (117))
k k!
(−1) (−2) · · · (−k) (−1) (−2) · · · (−k)
= =
k! 1·2·····k
k
= (−1) . (122)

(g) The equality (121) (applied to n = 2) yields
√  √ √ 
2 2 2−1
= .
2 2

December 25, 2021


Math 235 notes page 131


(h) The equality (118) (applied to n = 2 and k = 2) yields
  √
√2 = 0, / N.
since 2 ∈
2

Instead offurther  examples, let us see a table of the most important binomial
n
coefficients – namely those with n ∈ N and k ∈ {0, 1, . . . , n}. This table
k
is called Pascal’s triangle; here are its first 9 rows (i.e., the part that covers n ∈
{0, 1, . . . , 8}):
k =0
.
k =1
n=0 → 1 .
k =2
n=1 → 1 1 .
k =3
n=2 → 1 2 1 .
k =4
n=3 → 1 3 3 1 .
k =5
n=4 → 1 4 6 4 1 .
k =6
n=5 → 1 5 10 10 5 1 .
k =7
n=6 → 1 6 15 20 15 6 1 .
n=7 → 1 7 21 35 35 21 7 1

n=8 → 1 8 28 56 70 56 28 8 1

Why did we restrict ourselves only to  k∈ {0, 1, . . . , n} when making this table?
n
What about the binomial coefficients “left of Pascal’s triangle” – i.e., those
k
with k < 0  ? They
 are not shown because they are all 0 (by (118)). The binomial
n
coefficients “right of Pascal’s triangle” – i.e., those with k > n – are also 0, as
k
the following proposition shows:
 
n
Proposition 4.3.4. Let n ∈ N and k ∈ R be such that k > n. Then, = 0.
k

/ N,
Hints to the proof of Proposition 4.3.4. (See [19fco, Proposition 1.3.6].) For k ∈
this follows from (118). Thus, assume k ∈ N. Now, recall the old joke problem
“Simplify ( x − a) ( x − b) · · · ( x − z)”.

December 25, 2021


Math 235 notes page 132

/ N.
Warning 4.3.5. Proposition 4.3.4 does not usually hold for n ∈

 A more interesting question is what we can say about the binomial coefficients
n
“above Pascal’s triangle” – i.e., those with n < 0. It turns out that they are just
k
“mirror images” of the ones below (up to sign); namely, we have the following:

Proposition 4.3.6 (Upper negation formula). Let n ∈ R and k ∈ Z. Then,

−n k n+k−1
   
= (−1) . (123)
k k

Hints to the proof of Proposition 4.3.6. This is a simple computation using Definition
4.3.1. (See [19fco, Proposition 1.3.7] for details.)
Proposition 4.3.4 and Proposition 4.3.6 are the reasons why almost all tables of
binomial coefficients you will find in the literature show only  (parts of) Pascal’s
n
triangle. (Of course, there are also the binomial coefficients with non-integer
k
n, but it is not really clear how to tabulate them.)
Binomial coefficients tend to appear in almost all parts of mathematics (as coef-
ficients or as standalone values). Being able to identify them when one encounters
them is thus a useful skill. Myself, I know few numbers by heart, but the bino-
mial coefficients in the first six rows of Pascal’s triangle are among them (I never
deliberately memorized them; I just see them too often to forget). If you need any
further rows of Pascal’s triangle and have no computer handy, the easiest way to
construct them is using a surprising pattern in Pascal’s triangle: Every entry (ex-
cept for the 1 at the peak) is the sum of the two adjacent entries above it75 (for
example, 56 = 21 + 35). This pattern holds not only for the entries of Pascal’s
triangle, but more generally for all binomial coefficients:

Theorem 4.3.7 (Recurrence of the binomial coefficients). Let n ∈ R and k ∈ R.


Then,
n−1 n−1
     
n
= + .
k k−1 k

Hints to the proof of Theorem 4.3.7. Since there were two cases in Definition 4.3.1, we
must distinguish between three cases here: k ∈ {1, 2, 3, . . .}, k = 0 and k ∈ / N.
The firstcase is
 the interesting
 one (the latter two are trivial). In this first case,
n−1 n−1

rewrite and as fractions and add them by finding a common
k−1 k
denominator.
75 If there is only one adjacent entry above it (as it happens for the 1’s along the left and right sides
of Pascal’s triangle), then we treat the missing other entry as a 0 (after all, there should be a 0 at
its position; we just didn’t put it in the table).

December 25, 2021


Math 235 notes page 133

Theorem 4.3.7 is known as Pascal’s rule. It provides perhaps the quickest way to
compute Pascal’s triangle up to a given row; however, Definition 4.3.1 might still be
a better way to compute a specific entry (as long as one remembers not to multiply
the products out, since there will be a lot of cancellation visible in the fraction).
There is an even more explicit formula:

Theorem 4.3.8 (Factorial formula for the binomial coefficients). Let n ∈ N and
k ∈ N be such that k ≤ n. Then,
 
n n!
= .
k k! · (n − k )!

Hints to the proof of Theorem 4.3.8. Notice that

n (n − 1) (n − 2) · · · (n − k + 1) = n!/ (n − k )!.

(See [19fco, Theorem 1.3.9] for details.)

−3
   
1/3
Warning 4.3.9. Theorem 4.3.8 cannot be used to compute or or
  5 4
√π
; it only applies under the given assumptions (n ∈ N and k ∈ N and
2  
n
k ≤ n). (This is the reason why, unlike various authors, we do not define
k
through Theorem 4.3.8.)

Another immediately visible pattern exhibited by Pascal’s triangle is its symme-


try across a vertical axis:

Theorem 4.3.10 (Symmetry of the binomial coefficients). Let n ∈ N and k ∈ R.


Then,    
n n
= .
k n−k

Hints to the proof of Theorem 4.3.10. If k ∈ N and k ≤ n, then rewrite both sides
using Theorem 4.3.8. Otherwise, argue that both sides are 0. (See [19fco, Theorem
1.3.11] for details.)

Warning 4.3.11. Theorem 4.3.10 would be false without the requirement n ∈ N.


For example, n = −1 and k = 0 provides a counterexample.

An easy consequence of Theorem 4.3.10 is that


 
n
=1 for each n ∈ N. (124)
n

December 25, 2021


Math 235 notes page 134

Indeed, Theorem 4.3.10 (applied to k = n) yields


     
n n n
= = =1 (by (119))
n n−n 0
for each n ∈ N.
The following fact is one of the most important properties of binomial coeffi-
cients; it explains why they are often regarded as combinatorial in nature:

Theorem 4.3.12 (Combinatorial interpretation of the binomial coefficients). Let


n ∈ N and k ∈ R. Let S be an n-element set. Then,
 
n
= (the number of k-element subsets of S) .
k

Example 4.3.13. (a) Let n = 4 and k = 2 and S = {1, 2, 3, 4}. Then, the 2-element
subsets of S are {1, 
2},{1, 3}, {1, 4}, {2, 3}, {2, 4} and {3, 4}. The number of
4
these subsets is 6 = , which is exactly what Theorem 4.3.12 predicts.
2
(b) Now, let k = 5 instead (while n is still 4, and S is still {1, 2, 3, 4}). Then,
there are no 5-element subsets of S, since Sonly has 4 elements. Thus, the
4
number of these 5-element subsets is 0 = , which is exactly what Theorem
5
4.3.12 predicts.

Hints to the proof of Theorem 4.3.12. There is a fairly straightforward proof of Theo-
rem 4.3.12 by induction on n. In the induction step, pick an element s ∈ S and
classify the k-element subsets of S as “red” or “green” according to whether they
contain s or not (similarly to our above proof of Theorem 2.3.4). This proof can be
found in [19fco, proof of Theorem 1.3.12] or [Grinbe15, solution to Exercise 3.4].
An alternative proof can be given using enumerative combinatorics (see [LeLeMe16,
§15.5] or [19fco, §2.7]).
 
n
Warning 4.3.14. Theorem 4.3.12 says nothing about / N.
when n ∈
k

The following important fact is not obvious from Definition 4.3.1:

 4.3.15 (Integrality of the binomial coefficients). Let n ∈ Z and k ∈ Z.


Theorem
n
Then, ∈ Z.
k

Hints to the proof of Theorem 4.3.15. In the case n ∈ N, this can either be shown
by induction on n (using Theorem 4.3.7), or obtained immediately from Theorem
4.3.12. The general case n ∈ Z can be reduced to the case n ∈ N via Proposition
4.3.6 and (118). (See [19fco, proof of Theorem 1.3.16] for details.)

December 25, 2021


Math 235 notes page 135

The most famous property of binomial coefficients is the binomial theorem:

Theorem 4.3.16 (the binomial formula). Let x and y be any numbers. Let n ∈ N.
Then,
n  
n k n−k
( x + y) = ∑
n
x y .
k =0
k
 
n
This is why the are called the “binomial coefficients”.
k
Hints to the proof of Theorem 4.3.16. Either induct on n (see [19fco, proof of Theorem
1.3.24] for details), or argue combinatorially using Theorem 4.2.14 (best done after
familiarizing yourself with basic bijections).
Let us state two famous consequences of Theorem 4.3.16. The first one says that
the sum of all entries in the n-th row of Pascal’s triangle (where rows are counted
from 0) is 2n :
 
n n
Corollary 4.3.17. Let n ∈ N. Then, ∑ = 2n .
k =0 k

Hints to the proof of Corollary 4.3.17. Apply Theorem 4.3.16 to x = 1 and y = 1. (See
[19fco, Corollary 1.3.27] for details.)
The second consequence ([19fco, Proposition 1.3.28], [Spivey19, §3.4, Identity 12])
is a bit subtler:

Proposition 4.3.18. Let n ∈ N. Then,


n  
n
∑ (−1) k = [n = 0] .
k
(125)
k =0

Here, we are using the so-called Iverson bracket notation (which despite its trivial
definition is surprisingly useful):

Definition 4.3.19. If A is any logical statement, then we define an integer [A] ∈


{0, 1} by (
1, if A is true;
[A] =
0, if A is false.
For example, [2 + 2 = 4] = 1 but [2 + 2 = 5] = 0.
If A is any logical statement, then [A] is known as the truth value of A.

Hints to the proof of Proposition 4.3.18. Apply Theorem 4.3.16 to x = −1 and y = 1,


and recall what power of 0 is nonzero. (See [19fco, Proposition 1.3.28] for details.)

December 25, 2021


Math 235 notes page 136

We finish our first incursion into binomial coefficients with a formula that ex-
presses Fibonacci numbers as sums thereof:

Proposition 4.3.20. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Let n ∈ N.


Then, the Fibonacci number f n+1 is
n 
n−k n−0 n−1 n−2 n−n
        
f n +1 = ∑ = + + +···+ .
k =0
k 0 1 2 n

Note that roughly half the addends on theright 


hand side of Proposition 4.3.20
n−k
are 0 (indeed, Proposition 4.3.4 shows that = 0 for any k ∈ {0, 1, . . . , n}
k
satisfying k > n/2) and thus can be discarded; nevertheless it is easier to have the
sum end at k = n rather than figure out where exactly its nonzero addends stop.
Hints to the proof of Proposition 4.3.20. This is probably the hardest statement in this
section, which is not saying much. There is a proof by strong induction on n
(using Theorem 4.3.7); it is not very enlightening and somewhat laborious due
to the fiddling involved in making all the sums have the same upper limit. (See
[Vorobi02, §15] or [AndCri17, Problem 2.4] for a sketch of this proof, but notice that
both of these sources are sloppy with the summation limits.) We will state a more
general result (Proposition 4.9.18) later on, at which point we will give this proof
in full detail; Proposition 4.3.20 is merely a particular case of this latter result.
Alternatively, there is a combinatorial proof, which proceeds as follows: WLOG
assume that n ≥ 1 (else, just check it by hand). Let [n − 1] denote the set {1, 2, . . . , n − 1}.
Then, Theorem 2.3.4 yields that the number of all lacunar subsets of [n − 1] is f n+1 .
However,  for each k ∈ {0, 1, . . . , n}, the number of all lacunar k-element subsets of
n−k
[n − 1] is , as can easily be proved by induction on n (or even by a nicer,
k
combinatorial argument: see [19fco, Proposition 1.4.10]). Hence, the total number
n−k
 
n
of all lacunar subsets of [n − 1] is ∑ . Comparing these two results yields
k =0 k
the claim of Proposition 4.3.20. (See [19fco, §1.4.5, proof of Proposition 1.3.32] for
this proof.)

4.4. Recitation #3: Sums, products, binomial coefficients


Next comes an exercise in finite sums that is rather similar to Exercise 2.2.1:

Exercise 4.4.1. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Prove that each inte-
ger n ≥ 0 satisfies
f 1 + f 3 + f 5 + · · · + f 2n−1 = f 2n .

December 25, 2021


Math 235 notes page 137

Discussion of Exercise 4.4.1. This is easy to prove by induction on n, but let us try to
prove it by the telescope principle.
Let n ≥ 0 be an integer. For each integer i ≥ 1, we have f i+1 = f i + f i−1 (by the
recursive definition of the Fibonacci numbers) and therefore

f i = f i +1 − f i −1 . (126)

Thus, for each positive integer s, we have

f 2s−1 = f (2s−1)+1 − f (2s−1)−1 (by (126), applied to i = 2s − 1)


= f 2s − f 2(s−1) (127)

(since (2s − 1) + 1 = 2s and (2s − 1) − 1 = 2 (s − 1)). Now,


n n  
f 1 + f 3 + f 5 + · · · + f 2n−1 = ∑ f −1
|2s
= ∑ f 2s − f 2(s−1)
s =1 s =1
{z }
= f 2s − f 2(s−1)
(by (127))
= f 2n − f 2(1−1)
(by (74), applied to u = 1, v = n and as = f 2s )
 
= f 2n − 0 since f 2(1−1) = f 0 = 0
= f 2n .

This solves Exercise 4.4.1.


Exercise 4.4.1 has other solutions. For example, we may solve it (for n ≥ 1) by
noticing that

f1 + f3 + f5 + · · · + f −1
|{z} |{z} |{z} |2n
{z }
=1 = f2 + f1 = f4 + f3 = f 2n−2 + f 2n−3
= f1 + f2 = f3 + f4 = f 2n−3 + f 2n−2
= 1 + ( f 1 + f 2 ) + ( f 3 + f 4 ) + · · · + ( f 2n−3 + f 2n−2 )
| {z }
= f 1 + f 2 +···+ f 2n−2
= f (2n−2)+2 −1
(by Exercise 2.2.1, applied to 2n−2 instead of n)
= 1 + f (2n−2)+2 − 1 = f (2n−2)+2 = f 2n .

(The case n = 0 is easily checked manually.)


The next exercise appears, e.g., in [AndTet18, Introduction]:

n −1  k

Exercise 4.4.2. ”Simplify” ∏ 1+ a2 for a 6= 1 and n ∈ N. (The answer
k =0
should not contain any ∏ signs.)

December 25, 2021


Math 235 notes page 138

Discussion of Exercise 4.4.2. Let a be a number such that a 6= 1. Let n ∈ N. For each
k ∈ N, we have
k +1 k
 k 2
1− a2
|{z} a 2 ·2 = 1 − a 2
= 1 − |{z}
k  2
= a 2 ·2 = a2k
(since 2k+1 =2k ·2)
 k
 k

= 1 − a2 1 + a2 (128)

k
(by the classical formula 1 − b2 = (1 − b) (1 + b), applied to b = a2 ) and therefore
k +1
2k 1 − a2
1+a = k
. (129)
1 − a2
Now,
n −1 n −1 k +1
n s
  1 − a2 1 − a2
∏ 1+a 2k
= ∏ 1 − a2
k
= ∏ 2s −1
k =0 | {z } k =0 s =1 1 − a
k +1
1 − a2
= k
1 − a2
(by (129))

(here, we have substituted s − 1 for k in the product)


n
1 − a2
= 1−1
1 − a2 
s
by (109), applied to u = 1, v = n and as = a2
n
1 − a2  1−1 0

= since a2 = a2 = a1 = a .
1−a
So we found our answer:
n −1  n
 1 − a2
∏ 1+a 2k
=
1−a
. (130)
k =0

But wait – did you spot the subtle error?


k
The error is the following: We divided the equality (128) by 1 − a2 to get (129),
k k
but 1 − a2 can be zero. Namely, if a = −1, then 1 − a2 will be zero for every k > 0;
thus, in all these cases, we have divided by zero. Nevertheless, our final result (130)
holds even in these cases – it is only the proof that went wrong.
Fortunately, now that we know the equality (130), it is utterly straightforward to
prove it by induction on n (using (128) in the induction step).76 Thus, while the
76 Hereis this proof in detail:
Proof of (130): Forget that we fixed n. We shall prove (130) by induction on n.

December 25, 2021


Math 235 notes page 139

argument by which we originally arrived at (130) was flawed, we nevertheless were


able to put it to good use, since it helped us find the formula (130), which we were
then able to prove by a different (perfectly sound) argument.
This was a typical example of a phenomenon that is often observed in mathe-
matics (particularly in modern research): Results are often discovered by means of
reasoning that is not quite rigorous (to the point that it often sounds like quackery
or cannot be communicated at all); then, one is forced to come up with different
arguments to find valid proofs for the results. In our case, we did not have to look
far (in essence, the induction proof was just a restatement of the not-quite-correct
telescope argument avoiding unnecessary divisions, which helped it avoid division
by zero); but this sort of “parallel construction” of proofs can be quite a long and
difficult process.
The next exercises are about binomial coefficients:

(n−1)/2
 
n
Exercise 4.4.3. Show that ∑ = 2n−1 for any odd n ∈ N.
k =0 k

Induction base: We have


1−1  0 0
   1 − a2

k

k
1 + a2 = 1 + a2 = (empty product) = 1 =
k =0 k =0
1−a

0
1 − a2 1 − a1 1−a
(since = = = 1). In other words, (130) holds for n = 0.
1−a 1−a 1−a
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that (130) holds for n = m.
We must prove that (130) holds for n = m + 1.
Our induction hypothesis says that (130) holds for n = m; in other words, it says that
m −1  2m
2k = 1 − a .

∏ 1 + a
k =0 1−a
Now, (128) (applied to k = m) yields
m +1
 m
 m

1 − a2 = 1 − a2 1 + a2 . (131)

But
! m
m m −1 
     1 − a2  
∏ 2k
∏ 2k 2m m
1+a = 1+a · 1+a = · 1 + a2
k =0 k =0
1−a
| {z }
m
1 − a2
=
1−a
m +1
1  m
 m
 1  m +1
 1 − a2
= · 1 − a2 1 + a2 = · 1 − a2 = .
1−a | {z } 1−a 1−a
m +1
=1− a2
(by (131))

In other words, (130) holds for n = m + 1. This completes the induction step. Thus, (130) is
proved.

December 25, 2021


Math 235 notes page 140

Discussion of Exercise 4.4.3. Intuitively, the idea is clear from a look at Pascal’s tri-
angle: Pascal’s triangle is symmetric across the vertical axis (by Theorem 4.3.10).
Thus, if n ∈ N is odd, then the n-th row of Pascal’s triangle (i.e., the row that
begins with 1 and n) splits neatly into two equal halves (one half being to the left
of the vertical axis, and the other half being to the right of it), and therefore the
1
sum of the left half of this row is exactly of the sum of all entries in this row; but
2
the latter sum is 2n according to Corollary 4.3.17. Thus, the former sum is 2n−1 .
Here is a formal way to restate this argument: Let n ∈ N be odd. Thus, n =
2u + 1 for some u ∈ N. Consider this u. From n = 2u + 1, we obtain 2u = n − 1
andu =  (n − 1) /2 and u + 1 = n − u and 2u + 1 = n. Now, Corollary 4.3.17 yields
n n
∑ = 2n = 22u+1 (since n = 2u + 1), so that
k =0 k

n   2u+1  
n n
2 2u+1
= ∑ = ∑ (since n = 2u + 1)
k =0
k k =0
k
u   2u+1  
n n
= ∑ + ∑ (132)
k =0
k k = u +1
k

(here, we have split the sum at k = u; that is, we have applied (84) to 0, u and
2u + 1 instead of u, v and w). But
2u+1   n  
n n
∑ k = ∑ k (since u + 1 = n − u and 2u + 1 = n)
k = u +1 k=n−u
u  
n
= ∑
k =0
n−k
| {z  }
n
=
k
(by Theorem 4.3.10)
here, we have substituted n − k for k in the sum,
 
 since the map {0, 1, . . . , u} → {n − u, n − u + 1, . . . , n} 
that sends each k to n − k is a bijection
u  
n
= ∑ .
k =0
k

Hence, (132) becomes


u   2u+1   u   u   u  
n n n n n
2 2u+1
= ∑ + ∑ = ∑ +∑ = 2· ∑ .
k =0
k k = u +1
k k =0
k k =0
k k =0
k
| {z  }
u n
=∑
k =0 k

December 25, 2021


Math 235 notes page 141

Dividing both sides of this equality by 2, we find

u   (n−1)/2  
n n
2 2u
= ∑ = ∑ (since u = (n − 1) /2) .
k =0
k k =0
k

Hence,
(n−1)/2  
n
∑ k
= 22u = 2n−1 (since 2u = n − 1) .
k =0
This solves Exercise 4.4.3.

Exercise 4.4.4. Recall once again the Fibonacci sequence ( f 0 , f 1 , f 2 , . . .), which is
defined recursively by f 0 = 0, f 1 = 1, and

f n = f n −1 + f n −2 for all n ≥ 2. (133)

Now, let us define f n for negative integers n as well, by “applying (133) back-
wards”: This means that we set f n−2 = f n − f n−1 for all integers n ≤ 1. This
allows us to recursively compute f −1 , f −2 , f −3 , . . . (in this order). For example,

f −1 = f 1 − f 0 = 1 − 0 = 1;
f −2 = f 0 − f −1 = 0 − 1 = −1;
f −3 = f −1 − f −2 = 1 − (−1) = 2,

etc.
(a) Prove that f −n = (−1)n−1 f n for each n ∈ Z.
(b) Prove that f n+m+1 = f n f m + f n+1 f m+1 for all n ∈ Z and m ∈ Z.
(c) Prove that 7 f n = f n−4 + f n+4 for all n ∈ Z.
(d) Prove that if a, b ∈ Z satisfy a | b, then f a | f b .

Discussion of Exercise 4.4.4. Parts (a), (b) and (c) of Exercise 4.4.4 appear (with de-
tailed solutions) in [18f-mt1s, Exercise 4]; thus, we shall only sketch the arguments
here.
Because of our definition of the f n , the equation

f n = f n −1 + f n −2 (134)

holds for all n ∈ Z.


(a) First, prove (by strong induction on n) that

f −n = (−1)n−1 f n for each n ∈ N. (135)

Then, conclude that the equality f −n = (−1)n−1 f n holds for each n ∈ Z as well,
because:

• If n is nonnegative, then it follows from (135).

December 25, 2021


Math 235 notes page 142

• If n is negative, then (135) (applied to −n instead of n) yields f n = (−1)−n−1 f −n ;


but this quickly yields f −n = (−1)n−1 f n .
Thus, Exercise 4.4.4 (a) is solved.
An alternative solution for Exercise 4.4.4 (a) can be given by strong induction on
|n|. (Note that strong induction on n will not work, since n ranges over Z.) We
leave the details to the reader.
(b) First, we claim that
f n + m +1 = f n f m + f n +1 f m +1 for all n ∈ N and m ∈ Z. (136)
Indeed, (136) can be proved in the same way as we proved (11) for all nonnegative
integers n and m (see our “Second attempt at solving Exercise 2.2.3” above) – i.e.,
by induction on n. (The proof even becomes a bit simpler, since we no longer have
to treat the case m = 0 separately: It is no longer problematic that m − 1 may be
negative.)
Now, recall that we need to prove that f n+m+1 = f n f m + f n+1 f m+1 for all n ∈ Z
and m ∈ Z. So let us fix n ∈ Z and m ∈ Z. We must prove that f n+m+1 =
f n f m + f n+1 f m+1 . If n ∈ N, then this follows from (136). Hence, we WLOG assume
that n ∈ / N. Hence, n is negative, so that n ≤ −1 and therefore −1 − |{z} n ≥
≤−1
−1 − (−1) = 0. In other words, −1 − n ∈ N. Thus, (136) (applied to −1 − n and
−1 − m instead of n and m) yields
f (−1−n)+(−1−m)+1
= f 1− n f 1− m + f (−1−n)+1 f (−1−m)+1
|−{z } |−{z } | {z } | {z }
= f −(n+1) = f −(m+1) = f −n = f −m
=(−1)(n+1)−1 f n+1 =(−1)(m+1)−1 f m+1 =(−1)n−1 f n =(−1)m−1 f m
(by Exercise 4.4.4 (a), (by Exercise 4.4.4 (a), (by Exercise 4.4.4 (a)) (by Exercise 4.4.4 (a),
applied to n+1 applied to m+1 applied to m
instead of n) instead of n) instead of n)

= (−1)(n+1)−1 f n+1 · (−1)(m+1)−1 f m+1 + (−1)n−1 f n · (−1)m−1 f m


| {z } | {z } | {z } | {z }
=(−1)n =(−1)m =−(−1)n =−(−1)m
(−1)n f n+1 · (−1)m f m+1 + − (−1)n f n · − (−1)m f m
 
=
= (−1)n (−1)m ( f n+1 f m+1 + f n f m ) = (−1)n+m ( f n f m + f n+1 f m+1 ) .
| {z }| {z }
n+m = f n f m + f n +1 f m +1
=(−1)

Comparing this with


f (−1−n)+(−1−m)+1
= f −(n+m+1) (since (−1 − n) + (−1 − m) + 1 = − (n + m + 1))
= (−1)(n+m+1)−1 f n+m+1 (by Exercise 4.4.4 (a), applied to n + m + 1 instead of n)
| {z }
=(−1)n+m

= (−1)n+m f n+m+1 ,

December 25, 2021


Math 235 notes page 143

we obtain
(−1)n+m f n+m+1 = (−1)n+m ( f n f m + f n+1 f m+1 ) .
Dividing both sides of this equality by (−1)n+m , we obtain f n+m+1 = f n f m +
f n+1 f m+1 . This solves Exercise 4.4.4 (b).
An alternative solution to Exercise 4.4.4 (b) can be found in [18f-mt1s, Exercise
4]; it relies on two-sided induction (Theorem 3.1.9).
(c) This is just an exercise in applying the recursive equation of the Fibonacci
sequence over and over:77

f n −4 + f n +4 = f n −4 + f n +3 + f n +2
|{z} |{z} |{z}
(134) (134) (134)
= f n +3 + f n +2 = f n +2 + f n +1 = f n +1 + f n
= f n −4 + f n +2 + f n +1 + f n +1 + f n = f n −4 + f n +2 + 2 f n +1 + f n
|{z}
(134)
= f n +1 + f n
= f n −4 + f n +1 + f n + 2 f n +1 + f n = f n −4 + 2 f n + 3 f n +1
|{z}
(134)
= f n + f n −1
= f n −4 + 2 f n + 3 ( f n + f n −1 ) = f n −4 + 5 f n + 3 f n −1
|{z}
(134)
= f n −2 + f n −3
= f n −4 + 5 f n + 3 ( f n −2 + f n −3 ) = f n −4 + f n −3 + 5 f n + 3 f n −2 + 2 f n −3
| {z }
(134)
= f n −2
= f n −2 + 5 f n + 3 f n −2 + 2 f n −3 = 5 f n + 2 f n −2 + 2 ( f n −2 + f n −3 )
| {z }
(134)
= f n −1
= 5 f n + 2 f n −2 + 2 f n −1 = 5 f n + 2 ( f n −1 + f n −2 )
| {z }
(134)
= fn
= 5 fn + 2 fn = 7 fn.

Alternatively, Exercise 4.4.4 (c) can be obtained by applying Exercise 4.4.4 (b) to
m = −5 and again to m = 3, and then adding the resulting equalities together. (See
[18f-mt1s, Exercise 4] for the details.)
(d) Let a, b ∈ Z satisfy a | b. We must prove that f a | f b .
The numbers | a| and |b| belong to N (since a and b belong to Z). Furthermore,
Proposition 3.1.3 (a) yields | a| | |b| (since a | b). Hence, Exercise 3.2.2 (applied to | a|
and |b| instead of a and b) yields f |a| | f |b| .
It remains to derive f a | f b from this. But this is easy: Exercise 3.2.2 (a) (applied to
n = a) yields f −a = (−1) a−1 f a = ± f a . Thus, f |a| = ± f a 78 . Likewise, f |b| = ± f b ;

77 The (134) (134)


symbol “ = ” designates an equality that follows from (134). For example, f 5 = f 4 + f 3 .
78 Proof. We are in one of the following two cases:

December 25, 2021


Math 235 notes page 144

thus, f b = ± f |b| . Hence, f |b| | f b . Also, from f |a| = ± f a , we obtain f a | f |a| . Thus,
f a | f |a| | f |b| | f b . This solves Exercise 4.4.4 (d).

4.5. Homework set #2: More number theory and sums


This is a regular problem set. See Section 3.7 for details on grading.
This homework set covers the end of Chapter 3 and the above parts of Chapter
4. Some of the problems may also be unrelated.
Please solve at most 5 problems. (No points will be given for further solutions.)

Exercise 4.5.1. Let n ∈ N. Let a1 , a2 , . . . , an be n odd integers. Prove that

a1 a2 + a2 a3 + · · · + an−1 an + an a1 ≡ n mod 4.

Exercise 4.5.2. Let a and b be two coprime positive integers.


(a) Prove that there do not exist any positive integers x and y satisfying ab =
xa + yb.
(b) Prove that there do not exist any x, y ∈ N satisfying ab − a − b = xa + yb.

Exercise 4.5.3. Let n and m be two coprime positive integers. Let u ∈ Z. Prove
that
(un − 1) (um − 1) | (u − 1) (unm − 1) .

 n,m ∈ N satisfy
Exercise 4.5.4. Let  n > 0. Prove the following:
m n n−1
(a) We have = .
n m m −1
gcd (n, m) n
(b) We have ∈ Z.
n m

 n,
4.5.5.Let
Exercise  i and j be positive integers such that i < n and j < n. Prove
n n
that gcd , > 1.
i j

Case 1: We have a ≥ 0.
Case 2: We have a < 0.
Let us first consider Case 1. In this case, we have a ≥ 0. Thus, | a| = a, so that f | a| = f a = ± f a .
Hence, f | a| = ± f a is proved in Case 1.
Let us now consider Case 2. In this case, we have a < 0. Thus, | a| = − a, so that f | a| = f − a =
± f a . Hence, f |a| = ± f a is proved in Case 2.
We have now proved that f | a| = ± f a in each of the two Cases 1 and 2. Hence, f | a| = ± f a
always holds, qed.

December 25, 2021


Math 235 notes page 145

Exercise 4.5.6. Let n be a positive integer. We let φ (n) denote the number of all
i ∈ {1, 2, . . . , n} satisfying i ⊥ n. (For example, φ (12) = 4, because there are
exactly 4 numbers i ∈ {1, 2, . . . , 12} satisfying i ⊥ 12: namely, 1, 5, 7 and 11.)
(a) Prove that φ (n) is even if n > 2.
1
(b) Prove that the sum of all i ∈ {1, 2, . . . , n} satisfying i ⊥ n equals nφ (n) if
2
n > 1.
[Remark: The function φ : {1, 2, 3, . . .} → N that sends each positive integer n
to φ (n) is known as the Euler totient function (or the phi-function). Here is a table
of its first few values:

n 1 2 3 4 5 6 7 8 9 10 11 12 13
.
φ (n) 1 1 2 2 4 2 6 4 6 4 10 4 12

Can you spot any patterns?]

∞ fk
Exercise 4.5.7. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Find ∑ .
k =2 f k −1 f k +1

Exercise 4.5.8. (a) Prove that


n    
i n+1
∑ k = k+1 for each n ∈ N and k ∈ N.
i =0

(b) Prove that79


m
m n−1
   
k n
∑ (−1) k = (−1) m
for each n ∈ C and m ∈ N.
k =0

Exercise 4.5.9. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Prove that


n  
n
2 n −1
· fn = ∑ 5k for each n ∈ N.
k =0
2k + 1

Exercise 4.5.10. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. For this exercise,


we also set f −1 = 1.  
n
For any n ∈ N and k ∈ Z, define the rational number (a slight variation
k F

79 Readersunfamiliar with complex numbers can imagine that the symbol C is replaced by R here.
The solution doesn’t really depend on what kind of number n is.

December 25, 2021


Math 235 notes page 146

on the corresponding binomial coefficient) by



 
n  f n f n −1 · · · f n − k +1 ,

if n ≥ k ≥ 0;
= f k f k −1 · · · f 1
k F  0, otherwise.
   
n n
(a) Prove that = for any n ∈ N and k ∈ N.
k F n−k F
(b) Let n be a positive integer, and let k ∈ N be such that n ≥ k. Prove that

n−1 n−1
     
n
= f k +1 + f n − k −1 .
k F k F k−1 F
 
n
(c) Prove that ∈ N for any n ∈ N and k ∈ N.
k F

4.6. Guessing sequences


Our next topic are sequences. We begin with a sequence of puzzle-style exercises
in which a sequence is defined recursively and an explicit formula is asked for. Of
course, not every recursively defined sequence has an explicit formula, so these
sorts of exercises often are somewhat artificial. Yet the methods of solving them
can be instructive, and problems of this kind appear not just on mathematical
competitions but also in real research. Thus, we shall discuss a few such exercises
with solutions.
The first sequence we consider is a common generalization of arithmetic progres-
sions (i.e., sequences ( x0 , x1 , x2 , . . .) satisfying xn = xn−1 + d for all n ≥ 1, where
d is a given number) and geometric progressions (i.e., sequences ( x0 , x1 , x2 , . . .)
satisfying xn = qxn−1 for all n ≥ 1, where q is a given number):80

Exercise 4.6.1. Let q and d be two numbers. Let ( x0 , x1 , x2 , . . .) be a sequence of


numbers that satisfies the recursive equation

xn = qxn−1 + d for each n ≥ 1. (137)

Find an explicit formula for xn in terms of x0 , q and d.

80 As before, the word “number” means an integer, rational, real or complex number.

December 25, 2021


Math 235 notes page 147

Discussion of Exercise 4.6.1. We compute the first few entries of our sequence:

x0 = x0 ;
x1 = qx0 + d;
x2 = q x1 +d = q (qx0 + d) + d = q2 x0 + qd + d;
|{z}
=qx0 +d

x3 = q x0 + q2 d + qd + d;
3

x4 = q4 x0 + q3 d + q2 d + qd + d.

Thus, we are led to guessing the equation


 
x n = q n x 0 + q 0 + q 1 + · · · + q n −1 d (138)

for each n ∈ N. Once this equation is found, proving it by induction on n is


completely straightforward (hence left to the reader).
We can make (138) more explicit by getting rid of the “· · · ”, but the answer will
depend on the value of q: If q = 1, then (138) simplifies to xn = x0 + nd. On the
other hand, if q 6= 1, then (2) (applied to b = q) yields (q − 1) q0 + q1 + · · · + qn−1 =

qn − 1
qn − 1, so that we have q0 + q1 + · · · + qn−1 = , and therefore the equality
q−1
(138) rewrites as
qn − 1
x n = q n x0 + d. (139)
q−1

Here is a different sequence puzzle, which has appeared in the finals of the Nor-
wegian mathematical olympiad 1994-95 (problem 1a) and the British mathematical
olympiad 1996:

Exercise 4.6.2. Let ( a1 , a2 , a3 , . . .) be a sequence of numbers defined recursively


by a1 = 1 and

a1 + a2 + · · · + a n = n2 · a n for all n ≥ 2. (140)

Find an explicit formula for an .

Discussion of Exercise 4.6.2. Define a new sequence (b0 , b1 , b2 , . . .) by setting

bn = a 1 + a 2 + · · · + a n for each n ∈ N. (141)

Then, for each positive integer n, we have

bn − bn − 1 = ( a 1 + a 2 + · · · + a n ) + ( a 1 + a 2 + · · · + a n −1 )
|{z} |{z}
= a1 + a2 +···+ an = a1 + a2 +···+ an−1
= an . (142)

December 25, 2021


Math 235 notes page 148

Note also that b1 = a1 = 1.


Now, for each integer n ≥ 2, we have

bn = a 1 + a 2 + · · · + a n = n 2 · an (by (140))
|{z}
= bn − bn − 1
(by (142))

= n 2 · ( bn − bn − 1 ) = n 2 bn − n 2 bn − 1 ,

hence  
n 2 bn − 1 = n 2 bn − bn = n 2 − 1 bn = ( n − 1 ) ( n + 1 ) bn .
Solving this for bn , we find

n 2 bn − 1 n n
bn = = · · bn − 1 . (143)
( n − 1) ( n + 1) n−1 n+1

This is a recursive equation for the sequence (b0 , b1 , b2 , . . .) that is much easier
to work with than the original recursion (140) for the sequence ( a1 , a2 , a3 , . . .); in
particular, it relies only on one preceding value bn−1 rather than the n − 1 values
a1 , a2 , . . . , an−1 . This is why we introduced the sequence (b0 , b1 , b2 , . . .). The moral
of the story (so far – we haven’t solved the exercise yet!) is that if the sums a1 +
a2 + · · · + an appear in a recursive equation, it is worth introducing a new sequence
(b0 , b1 , b2 , . . .) defined by (141); then, these sums can be rewritten as bn , whereas
single entries an of the original sequence ( a1 , a2 , a3 , . . .) can be rewritten as bn − bn−1
(by (142)). This way, we trade finite sums for differences of two numbers; the latter
are usually easier to deal with than the former.81
Using (143), we can now easily compute the entries of the sequence (b0 , b1 , b2 , . . .),
starting with b1 :

b1 = 1;
2 2 2 2
b2 = · · b1 = · ;
1 3 |{z} 1 3
=1
3 3 3 3 2 2
b3 = · · b2 = · · · ;
2 4 |{z} 2 4 1 3
2 2
= ·
1 3
4 4 4 4 3 3 2 2
b4 = · · b3 = · · · · · ;
3 5 |{z} 3 5 2 4 1 3
3 3 2 2
= · · ·
2 4 1 3
....
81 Notealso that not only sums of the form a1 + a2 + · · · + an , but more generally any sums of the
form ai+1 + ai+2 + · · · + a j can be rewritten in a simpler form using the b1 , b2 , b3 , . . .. Indeed, we
have ai+1 + ai+2 + · · · + a j = b j − bi for all positive integers i and j satisfying i ≤ j.

December 25, 2021


Math 235 notes page 149

The general rule is that


m  
n n
bm = ∏ · for each integer m ≥ 1. (144)
n =2 n − 1 n + 1

(Of course, this formula is easily proved by induction on m, using (144).)


Now, for each integer m ≥ 1, we have
m  m  m 
n−1 s−1
  
n n n s
bm = ∏ · =∏ / =∏ /
n=2 | n − 1{zn + 1 } n =2 n + 1 n s =2 s + 1 s
n n−1
= /
n+1 n
 
m 1 s
= / by (109), applied to u = 2, v = m and as =
m+1 2 s+1
2m
= . (145)
m+1
It is easy to see that this equality holds for m = 0 as well (indeed, both bm and
2m
are 0 when m = 0). Hence, (145) holds for each m ∈ N.
m+1
Now, for each positive integer n, we have

an = bn − bn − 1 (by (142))
|{z} |{z}
2n 2 ( n − 1)
= =
n+1 n
(by (145)) (by (145))
2n 2 ( n − 1) 2
= − = .
n+1 n n ( n + 1)

Thus, the exercise is solved.82


The next sequence-guessing exercise is [Galvin20, §2.4, Exercise 2]:

Exercise 4.6.3. Define a sequence ( a1 , a2 , a3 , . . .) of rational numbers recursively


by
5
a1 = and an = a2n−1 − 2 for every n ≥ 2.
2
Find an explicit formula for an .

82 Try 2
checking that our explicit answer an = does indeed satisfy the recursion (140)! (The
n ( n + 1)
formula you should obtain is precisely (29).)

December 25, 2021


Math 235 notes page 150

Discussion of Exercise 4.6.3. Computing the first few entries of our sequence yields
5
a1 = = 2.5;
2
17
a2 = = 4.25;
4
257
a3 = ≈ 16.063;
16
66 049
a4 = ≈ 256.0;
256
....
The first thing that will catch your eye is the omnipresence of powers of 2 here
– both in the denominators (where they are not surprising due to the repeated
squaring in the construction of the sequence) and as approximate values. The
latter is a dead giveaway: It appears that an is very close to a power of 2, and the
difference between an and said power of 2 converges to 0 (rather fast) as n → ∞.
n −1
It is easily observed that the relevant power of 2 is 22 . Thus, we suspect that
n −1
a n ≈ 22 .
n −1
To get an exact formula for an , we take a look at the differences an − 22 (as it
is always a good idea to subtract the part we know to get a closer look at the part
we don’t):
5 0 1
a1 − 22 = −2 = ;
2 2
1 17 1
a2 − 22 = −4 = ;
4 4
2 257 1
a3 − 22 = − 16 = ;
16 16
....
n −1 1
These suggest that an − 22 = n −1
, and thus
22
n −1 1
a n = 22 n −1
+ for each n ≥ 1. (146)
22
Once this formula has been guessed, its proof is a straightforward induction on n
(which we leave to the reader, who can find it in [Galvin20, §2.4, Exercise 2]).
Could we have found this formula without staring at numbers? Yes, although
that would have required a more sophisticated trick: A contest mathematics con-
1
noisseur will recognize the “scent of x + ” in the recursive formula an = a2n−1 − 2.
x
What does this mean? The crucial observation is that if a number y has the form
1
x + for some number x 6= 0, then
x
1
y2 − 2 = x 2 + 2 (147)
x

December 25, 2021


Math 235 notes page 151

(check this!). Knowing this, when you see an expression of the form y2 − 2 any-
1 1
where, you may want to try rewriting the y as x + , so that y2 − 2 becomes x2 + 2 .
x x
In the case of the present problem, we thus suspect that there is a “secret” sequence
( x1 , x2 , x3 , . . .) of numbers with the property that
1
an = xn + for every n ≥ 1. (148)
xn
If this sequence exists, then the recursion an = a2n−1 − 2 can be rewritten as xn +
1 1
= xn2 −1 + 2 .
xn x n −1
Constructing such a “secret” sequence ( x1 , x2 , x3 , . . .) is easy: We find x1 by solv-
5 1
ing the equation = a1 = x1 + for x1 (this boils down to a quadratic equation,
2 x1
1
whose solutions are and 2); then we set xn = xn2 −1 for each n ≥ 2 (this is the
2
1 1
easiest way to satisfy the recursion xn + = xn2 −1 + 2 ; of course, we could
xn x n −1
1
have also set xn = 2 , but why complicate things?). This leads to
x n −1
 
1
x1 = 2 we could have just as well chosen ;
2
x 2 = 22 ;
 2
x3 = 22 = 24 ;
 2
x4 = 24 = 28 ;
...;
n −1
the general formula is easily seen to be xn = 22 . Hence, (148) rewrites as an =
n −1 1
22 + n−1 . Thus, we have discovered (146) again.
22
1
The rational expression x + is a sufficiently common occurrence in mathe-
x
matics that its properties are worth remembering (cf. the Wikipedia page on the
Joukowsky transform). The equality (147) is a close relative of the formula
cos (2ϕ) = 2 cos2 ϕ − 1
from trigonometry; indeed, using complex numbers, the latter formula can easily
be derived from (147) (by applying (147) to x = eiϕ and y = 2 cos ϕ).
The following sequence-guessing exercise was problem A3 on the Putnam con-
test 2004 (see [GelAnd17, §3.1.1, Example]):

December 25, 2021


Math 235 notes page 152

Exercise 4.6.4. Define a sequence ( a0 , a1 , a2 , . . .) of rational numbers recursively


by
a0 = a1 = a2 = 1
and
an an+3 − an+1 an+2 = n! for every n ∈ N. (149)
Prove that an is an integer for all n ∈ N.
 
an a n +1
(The original statement on the Putnam contest wrote det instead
a n +2 a n +3
of an an+3 − an+1 an+2 , but this clearly makes no difference.)
Discussion of Exercise 4.6.4. Let us compute the first few entries of our sequence. We
are given that a0 = a1 = a2 = 1. Now, in order to find a3 , we apply (149) to n = 0,
obtaining a0 a3 − a1 a2 = 0! = 1. Solving this for a3 (using a0 = a1 = a2 = 1) yields
a3 = 2. Next, in order to find a4 , we apply (149) to n = 1, obtaining a1 a4 − a2 a3 =
1! = 1. Solving this for a4 (using a1 = a2 = 1 and a3 = 2) yields a4 = 3. Going
further in the same vein, we find a5 = 8 and a6 = 15 and a7 = 48 and a8 = 105.
Do we see any pattern? Perhaps not yet. But with these entries being integers,
we can try to analyze them in a way only integers can be analyzed: by factoring
them into primes.83 The prime factorizations of the entries a3 , a4 , . . . , a8 are

a3 = 2, a4 = 3, a 5 = 23 , a6 = 3 · 5, a7 = 24 · 3, a8 = 3 · 5 · 7.

Now a pattern in the a4 , a6 , a8 meets the eye: It appears that

a2m = 1 · 3 · 5 · · · · · (2m − 1) for each m ∈ N. (150)


| {z }
the product of the first m
odd positive integers

The odd-indexed values a2m+1 are disguising somewhat better. Unlike the inte-
gers a2m , which are all odd, these are even (at least as far as we have computed
them). Moreover, they seem to be multiples of larger and larger powers of 2. More
a
precisely, a2m+1 appears to be a multiple of 2m ; thus, we can try to look at 2mm+1 in
2
order to pin down the other factor. We see that
a3 a5 a7 a9
= 1, = 2, = 6, = 24.
21 22 23 24
These look familiar – aren’t these the factorials? Thus, we are led to conjecturing
that
a2m+1 = 2m · m! = 2 · 4 · 6 · · · · · (2m) for each m ∈ N (151)
| {z }
the product of the first m
even positive integers

83 We won’t properly discuss prime factorization until Section 9.2, but for now let us take it for
granted.

December 25, 2021


Math 235 notes page 153

(where the last equality sign is an easy consequence of the definition of m! and
(107)). Another way to guess this formula (151) would have been to observe exper-
imentally that a3 | a5 | a7 | a9 and thus it is reasonable to look at the consecutive
a5 a7 a9
quotients , , . (The same reasoning could have been used to come up with
a3 a5 a7
(150), if we hadn’t thought of using prime factorization.)
At this point, the two formulas we have guessed – that is, (150) and (151) –
cover all entries of our sequence ( a0 , a1 , a2 , . . .); thus, we can try proving them
by induction. Note that proving any one of these two formulas alone would be
difficult: For example, if we tried to prove (150) by induction on m, then we could
not get much mileage out of our recursion (149), since it would require us to know
a2m−1 and a2m−3 , which would not be covered by (150). Likewise, if we tried to
prove (151) by induction on m, then we would need to know a2m and a2m−2 , which
(151) could not help us compute. However, (150) and (151) complement each other
so neatly that proving them together is a straightforward induction exercise. Let
us do this in detail just to drive this point home:

Claim 1: For each m ∈ N, the equalities (150) and (151) hold.

[Proof of Claim 1: We proceed by strong induction on m:


Induction step: Let k ∈ N. Assume (as the induction hypothesis) that the equalities (150)
and (151) hold for all m < k. We must prove that the equalities (150) and (151) hold for
m = k. In other words, we must prove that

a2k = 1 · 3 · 5 · · · · · (2k − 1) (152)

and
a2k+1 = 2 · 4 · 6 · · · · · (2k ) . (153)
If k ≤ 1, then this is straightforward. Thus, we WLOG assume that k > 1. Hence, 2k > 2,
so that 2k ≥ 3. Now, our induction hypothesis yields that the equalities (150) and (151)
hold for m = k − 2. In other words, we have

a2k−4 = 1 · 3 · 5 · · · · · (2k − 5)

and
a2k−3 = 2 · 4 · 6 · · · · · (2k − 4) . (154)
Also, our induction hypothesis yields that the equalities (150) and (151) hold for m = k − 1.
In other words, we have
a2k−2 = 1 · 3 · 5 · · · · · (2k − 3) (155)
and
a2k−1 = 2 · 4 · 6 · · · · · (2k − 2) . (156)
Now, (149) (applied to n = 2k − 3) yields

a2k−3 a2k − a2k−2 a2k−1 = (2k − 3)!,

December 25, 2021


Math 235 notes page 154

so that

a2k−3 a2k = (2k − 3)! + a −2 a −1


|2k
{z } |2k
{z }
=1·3·5·····(2k−3) =2·4·6·····(2k−2)
(by (155)) (by (156))

= (2k − 3)! + (1 · 3 · 5 · · · · · (2k − 3)) · (2 · 4 · 6 · · · · · (2k − 2))


| {z } | {z }
= ∏ i = ∏ i
i ∈{1,2,...,2k −2}; i ∈{1,2,...,2k−2};
i is odd i is even
   

= (2k − 3)! +  ∏ i ·  ∏ i  = (2k − 3)! + ∏ i


   
i ∈{1,2,...,2k −2}; i ∈{1,2,...,2k −2}; i ∈{1,2,...,2k −2}
i is odd i is even | {z }
| {z } =1·2·····(2k−2)
= ∏ i =(2k−2)!
i ∈{1,2,...,2k−2}
=(2k−2)·(2k−3)!
(by (110))

= (2k − 3)! + (2k − 2) · (2k − 3)!


= (1 + (2k − 2)) · (2k − 3)! = (2k − 1) · (2k − 3)!.
| {z }
=2k−1

Comparing this with

a −3 · (1 · 3 · 5 · · · · · (2k − 1))
|2k
{z } | {z }
=2·4·6·····(2k−4) =(1·3·5·····(2k−3))·(2k−1)
(by (154))

= (2 · 4 · 6 · · · · · (2k − 4)) · (1 · 3 · 5 · · · · · (2k − 3)) · (2k − 1)


| {z } | {z }
= ∏ i = ∏ i
i ∈{1,2,...,2k −3}; i ∈{1,2,...,2k −3};
i is even i is odd
   
!
= ∏ i ·  ∏ i  · (2k − 1) = ∏ i · (2k − 1)
   
i ∈{1,2,...,2k −3}; i ∈{1,2,...,2k −3}; i ∈{1,2,...,2k −3}
i is even i is odd | {z }
| {z } =1·2·····(2k−3)
= ∏ i =(2k−3)!
i ∈{1,2,...,2k −3}
(by (110))

= (2k − 3)! · (2k − 1) = (2k − 1) · (2k − 3)!,

we obtain
a2k−3 a2k = a2k−3 · (1 · 3 · 5 · · · · · (2k − 1)) .
We can cancel the factor a2k−3 from this equality (since a2k−3 = 2 · 4 · 6 · · · · · (2k − 4) 6= 0),
and thus find a2k = 1 · 3 · 5 · · · · · (2k − 1). This proves (152).
Furthermore, (149) (applied to n = 2k − 2) yields

a2k−2 a2k+1 − a2k−1 a2k = (2k − 2)!,

December 25, 2021


Math 235 notes page 155

so that

a2k−2 a2k+1 = (2k − 2)! + a −1 a2k


|2k
{z } |{z}
=2·4·6·····(2k−2) =1·3·5·····(2k−1)
(by (156)) (by (152))

= (2k − 2)! + (2 · 4 · 6 · · · · · (2k − 2)) · (1 · 3 · 5 · · · · · (2k − 1))


| {z } | {z }
= ∏ i = ∏ i
i ∈{1,2,...,2k −1}; i ∈{1,2,...,2k−1};
i is even i is odd
   

= (2k − 2)! +  ∏ i ·  ∏ i  = (2k − 2)! + ∏ i


   
i ∈{1,2,...,2k −1}; i ∈{1,2,...,2k −1}; i ∈{1,2,...,2k −1}
i is even i is odd | {z }
| {z } =1·2·····(2k−1)
= ∏ i =(2k−1)!
i ∈{1,2,...,2k−1}
=(2k−1)·(2k−2)!
(by (110))

= (2k − 2)! + (2k − 1) · (2k − 2)!


= (1 + (2k − 1)) · (2k − 2)! = 2k · (2k − 2)!.
| {z }
=2k

Comparing this with

a −2 · (2 · 4 · 6 · · · · · (2k))
|2k
{z } | {z }
=1·3·5·····(2k−3) =(2·4·6·····(2k−2))·(2k)
(by (155))

= (1 · 3 · 5 · · · · · (2k − 3)) · (2 · 4 · 6 · · · · · (2k − 2)) · (2k)


| {z } | {z }
= ∏ i = ∏ i
i ∈{1,2,...,2k −2}; i ∈{1,2,...,2k −2};
i is odd i is even
   
!
= ∏ i ·  ∏ i  · (2k ) = ∏ i · (2k)
   
i ∈{1,2,...,2k −2}; i ∈{1,2,...,2k −2}; i ∈{1,2,...,2k −2}
i is odd i is even | {z }
| {z } =1·2·····(2k−2)
= ∏ i =(2k−2)!
i ∈{1,2,...,2k−2}
(by (110))

= (2k − 2)! · (2k) = 2k · (2k − 2)!,

we obtain
a2k−2 a2k+1 = a2k−2 · (2 · 4 · 6 · · · · · (2k)) .
We can cancel the factor a2k−2 from this equality (since a2k−2 = 1 · 3 · 5 · · · · · (2k − 3) 6= 0),
and thus find a2k+1 = 2 · 4 · 6 · · · · · (2k ). This proves (153).
Thus, both (152) and (153) are proved. This completes the induction step. Thus, Claim 1
is proved.]
Obviously, Claim 1 entails that a2m and a2m+1 are integers for each m ∈ N.
Hence, an is an integer for each n ∈ N (since each n ∈ N has the form 2m or
2m + 1 for some m ∈ N). This solves Exercise 4.6.4.

December 25, 2021


Math 235 notes page 156

(2m)!
[Remark: Using Exercise 4.2.3, we could have rewritten (150) as a2m = .
2m m!
This would have made (150) shorter and a bit easier to work with, but it would
have obscured the fact that a2m is an integer.
We could have also combined the two formulas (150) and (151) into a single
formula
a n = ( n − 1) · ( n − 3) · ( n − 5) · · · · ,
where the product on the right hand side is understood to end at 1 if n is even and
at 2 if n is odd.]

4.7. Periodicity
4.7.1. Periodic sequences
Next, we shall discuss a property that some sequences have: periodicity. Here is a
way to define it:

Definition 4.7.1. Let u = (u0 , u1 , u2 , . . .) be an infinite sequence (of any kinds of


objects – e.g., of numbers).
(a) A positive integer d is said to be a period of u if every i ∈ N satisfies
ui = ui +d .
(b) The sequence u is said to be periodic if it has a period (i.e., if a period of u
exists).
(c) Let d be a positive integer. The sequence u is said to be d-periodic if d is a
period of u.

Example 4.7.2. Let u = (u0 , u1 , u2 , . . .) be an infinite sequence. Then, 1 is a period


of u if every i ∈ N satisfies ui = ui+1 (by Definition 4.7.1 (a)). In other words,
1 is a period of u if u0 = u1 = u2 = · · · . In other words, 1 is a period of u if
all entries of u are equal. Sequences whose all entries are equal are said to be
constant; thus, the 1-periodic sequences are precisely the constant sequences.
 
Example 4.7.3. Let u be the sequence (−1)0 , (−1)1 , (−1)2 , (−1)3 , . . . =
(1, −1, 1, −1, 1, −1, . . .).
Then, 2 is a period of u, since every i ∈ N satisfies (−1)i = (−1)i+2 . Thus, the
sequence u is 2-periodic and periodic.
On the other hand, 1 is not a period of u, because not every i ∈ N satisfies
(−1)i = (−1)i+1 . (Actually, no i ∈ N satisfies this.)

Example 4.7.4. Let u be the sequence 00 , 01 , 02 , 03 , . . . = (1, 0, 0, 0, . . .).




Then, u has no period. In fact, if d was a period of u, then every i ∈ N would


satisfy 0i = 0i+d ; but this cannot hold for i = 0 (because in this case, 0i = 00 = 1
but 0i+d = 0(something positive) = 0). Thus, u is not periodic.

December 25, 2021


Math 235 notes page 157

On the other hand, if we remove the first entry of u, then u becomes the
sequence (0, 0, 0, 0, . . .), which is periodic (and even 1-periodic). The sequence u
is therefore “periodic except for a few early entries”. Such sequences are called
eventually periodic, but we will not have much use for this word.

Example 4.7.5. Complex numbers give a simple√example of a 4-periodic


sequence: If i denotes the complex number −1, then the sequence
i0 , i1 , i2 , i3 , . . . = (1, i, −1, −i, 1, i, −1, −i, 1, i, −1, −i, . . .) is 4-periodic, since i4 =
1.

Example 4.7.6. Let n be a positive integer. The sequence

(0%n, 1%n, 2%n, 3%n, . . .)


= (0, 1, 2, . . . , n − 1, 0, 1, 2, . . . , n − 1, 0, 1, 2, . . . , n − 1, . . .)

is n-periodic. Indeed, every i ∈ N satisfies i%n = (i + n) %n.

Example 4.7.7. Let us define a sequence ( g0 , g1 , g2 , . . .) of integers recursively by

g0 = 0, g1 = 1, and gn = gn−1 − gn−2 for all n ≥ 2.

Note that this differs from the definition of the Fibonacci sequence only in a
single sign. Here is a table of the first few entries of this new sequence:

n 0 1 2 3 4 5 6 7 8 9 10 11 12
.
gn 0 1 1 0 −1 −1 0 1 1 0 −1 −1 0

What a difference a sign can make! We observe from the table that the sequence
( g0 , g1 , g2 , . . .) is 6-periodic (i.e., its entries repeat every 6 terms: that is, gi = gi+6
for each i ∈ N), and can be rewritten explicitly as

gn = [3 - n] (−1)n//3 for each n ∈ N

using the Iverson bracket notation (Definition 4.3.19). All of this can be proved
by a straightforward strong induction on n.

The following theorem gives basic properties of periods of sequences:

Theorem 4.7.8. Let u = (u0 , u1 , u2 , . . .) be an infinite sequence (of any kinds of


objects – e.g., of numbers). Then:
(a) If a and b are two periods of u, then a + b is a period of u.
(b) If a and b are two periods of u such that a > b, then a − b is a period of u.
(c) If a is a period of u, then na is a period of u for every positive integer n.
(d) If a and b are two periods of u, then gcd ( a, b) is a period of u.

December 25, 2021


Math 235 notes page 158

(e) If a is a period of u, and if p and q are two nonnegative integers satisfying


p ≡ q mod a, then u p = uq .

Proof of Theorem 4.7.8. (a) Let a and b be two periods of u. We must prove that a + b
is a period of u.
Recall that a is a period of u if and only if every i ∈ N satisfies ui = ui+a (by
Definition 4.7.1 (a)). Hence, every i ∈ N satisfies

ui = ui + a (157)

(since a is a period of u). The same argument (applied to b instead of a) shows that
every i ∈ N satisfies
ui = ui +b . (158)
Now, every i ∈ N satisfies

ui = ui + a (by (157))
= u(i+a)+b (by (158), applied to i + a instead of i )
= ui+(a+b) (since (i + a) + b = i + ( a + b)) .

But a + b is a period of u if and only if every i ∈ N satisfies ui = ui+(a+b) (by


Definition 4.7.1 (a)). Hence, a + b is a period of u (since every i ∈ N satisfies
ui = ui+(a+b) ). This proves Theorem 4.7.8 (a).
(b) Let a and b be two periods of u such that a > b. We must prove that a − b is
a period of u.
Every i ∈ N satisfies
ui = ui + a (159)
and
ui = ui +b . (160)
(Indeed, these two equalities are precisely the two equalities (157) and (158) that
were already proved in the proof of Theorem 4.7.8 (a) above.)
Now, let i ∈ N. Then, i + |{z}
a −b > i + b − b = i ≥ 0 (since i ∈ N), so that
>b
i + a − b ∈ N. Hence, applying (160) to i + a − b instead of i, we obtain ui+a−b =
u(i+a−b)+b = ui+a . Comparing this with (159), we obtain ui = ui+a−b = ui+(a−b) .
Forget that we fixed i. We thus have shown that every i ∈ N satisfies ui =
ui+(a−b) .
Now, notice that a − b > 0 (since a > b). Hence, a − b is a positive integer. Thus,
a − b is a period of u if and only if every i ∈ N satisfies ui = ui+(a−b) (by Definition
4.7.1 (a)). Hence, a − b is a period of u (since every i ∈ N satisfies ui = ui+(a−b) ).
This proves Theorem 4.7.8 (b).
(c) This is a straightforward induction on n, using Theorem 4.7.8 (a) in the in-
duction step.84
84 Here are the details:

December 25, 2021


Math 235 notes page 159

(d) Let a and b be two periods of u. Then, a and b are two positive integers (since
a period must be a positive integer by definition). Hence, Exercise 3.7.7 shows that
there exist positive integers x and y such that gcd ( a, b) = xa − yb. Consider these
x and y. Theorem 4.7.8 (c) (applied to n = x) yields that xa is a period of u. Also,
Theorem 4.7.8 (c) (applied to y and b instead of n and a) yields that yb is a period
of u.
Note that gcd ( a, b) is itself a positive integer (by Proposition 3.4.3 (b)). Hence,
gcd ( a, b) > 0, so that xa − yb = gcd ( a, b) > 0 and thus xa > yb. Therefore,
Theorem 4.7.8 (b) (applied to xa and yb instead of a and b) shows that xa − yb is a
period of u. In other words, gcd ( a, b) is a period of u (since gcd ( a, b) = xa − yb).
This proves Theorem 4.7.8 (d).
(e) Let a be a period of u, and let p and q are two nonnegative integers satisfying
p ≡ q mod a. We must prove that u p = uq .
From p ≡ q mod a, we obtain q ≡ p mod a (by Proposition 3.2.6 (c)). Hence, p and
q play symmetric roles in our situation (and, of course, also in the claim u p = uq
that we need to prove). Thus, we can WLOG assume that p ≥ q (since otherwise,
we can simply swap p with q). Assume this.
We must prove that u p = uq . If p = q, then this is obvious. Hence, for the rest of
this proof, we WLOG assume that p 6= q. Hence, p > q (since p 6= q and p ≥ q).
We have p ≡ q mod a. In other words, a | p − q. In other words, there exists an
integer c such that p − q = ac. Consider this c. We have ac = p − q > 0. Since a is
positive (because a is a period of u), we can divide this inequality by a, and thus
obtain c > 0. Hence, c is a positive integer. Thus, Theorem 4.7.8 (c) (applied to
n = c) shows that ca is a period of u.
However, ca is a period of u if and only if every i ∈ N satisfies ui = ui+ca (by
Definition 4.7.1 (a)). Thus, every i ∈ N satisfies ui = ui+ca (since ca is a period of
u). Applying this to i = q, we find uq = uq+ca = u p (since q + ca = p (because
ca = ac = p − q)). In other words, u p = uq . Hence, Theorem 4.7.8 (e) is proved.
As a consequence of Theorem 4.7.8, the periods of any given periodic sequence
have a rather simple structure:

Let a be a period of u. We must show that

na is a period of u (161)

for every positive integer n.


We shall prove (161) by induction on n:
Induction base: We know that a is a period of u. In other words, 1a is a period of u (since
1a = a). In other words, (161) holds for n = 1.
Induction step: Let m be a positive integer. Assume (as the induction hypothesis) that (161)
holds for n = m. We must prove that (161) holds for n = m + 1.
We have assumed that (161) holds for n = m. In other words, ma is a period of u. Hence,
Theorem 4.7.8 (a) (applied to b = ma) yields that a + ma is a period of u. In other words,
(m + 1) a is a period of u (since a + ma = (m + 1) a). In other words, (161) holds for n = m + 1.
This completes the induction step. Thus, (161) is proved. In other words, Theorem 4.7.8 (c) is
proved.

December 25, 2021


Math 235 notes page 160

Corollary 4.7.9. Let u be a periodic infinite sequence. Let m be the smallest


period of u (that is, the smallest element of the set {periods of u}). Then,

{periods of u} = {positive multiples of m} .

Proof of Corollary 4.7.9. Write the sequence u as u = (u0 , u1 , u2 , . . .).


The number m is a period of u, and thus is a positive integer. Hence, m > 0, so
that m 6= 0 and |m| = m.
We shall prove the following two claims separately:

Claim 1: We have {periods of u} ⊆ {positive multiples of m}.

Claim 2: We have {positive multiples of m} ⊆ {periods of u}.

[Proof of Claim 1: Let a ∈ {periods of u}. We will show that a ∈ {positive multiples of m}.
We have a ∈ {periods of u}. In other words, a is a period of u. Also, m is a period
of u. Hence, Theorem 4.7.8 (d) (applied to b = m) shows that gcd ( a, m) is a period
of u. Furthermore, Proposition 3.4.4 (f) (applied to b = m) yields gcd ( a, m) | a and
gcd ( a, m) | m. From the latter divisibility, we easily obtain gcd ( a, m) ≤ m 85 .
But m is the smallest period of u. Hence, every period b of u satisfies b ≥ m.
Applying this to b = gcd ( a, m), we obtain gcd ( a, m) ≥ m (since gcd ( a, m) is a
period of u). Combining this with gcd ( a, m) ≤ m, we find gcd ( a, m) = m. Hence,
m = gcd ( a, m) | a. In other words, a is a multiple of m. Since a is positive (because
a is a period of u), we thus conclude that a is a positive multiple of m. In other
words, a ∈ {positive multiples of m}.
Forget that we fixed a. We thus have shown that a ∈ {positive multiples of m} for
each a ∈ {periods of u}. In other words, {periods of u} ⊆ {positive multiples of m}.
This proves Claim 1.]
[Proof of Claim 2: Let a ∈ {positive multiples of m}. We will show that a ∈
{periods of u}.
We have a ∈ {positive multiples of m}. In other words, a is a positive multiple
of m. Hence, a is a multiple of m; in other words, there exists an integer c such that
a = mc. Consider this c.
We have mc = a > 0 (since a is positive). We can divide this inequality by m
(since m > 0), and thus find c > 0. Hence, c is a positive integer. Thus, Theorem
4.7.8 (c) (applied to m and c instead of a and n) yields that cm is a period of u.
In other words, cm ∈ {periods of u}. In view of cm = mc = a, this rewrites as
a ∈ {periods of u}.

85 Proof. We know that gcd ( a, m) is nonnegative (by Proposition 3.4.3 (a)), so that |gcd ( a, m)| =
gcd ( a, m).
But Proposition 3.1.3 (b) (applied to gcd ( a, m) and m instead of a and b) yields |gcd ( a, m)| ≤
|m| (since gcd ( a, m) | m and m 6= 0). In view of |gcd ( a, m)| = gcd ( a, m) and |m| = m, this
rewrites as gcd ( a, m) ≤ m.

December 25, 2021


Math 235 notes page 161

Forget that we fixed a. We thus have shown that a ∈ {periods of u} for each a ∈
{positive multiples of m}. In other words, {positive multiples of m} ⊆ {periods of u}.
This proves Claim 2.]
Combining Claim 1 with Claim 2, we obtain {periods of u} = {positive multiples of m}.
This proves Corollary 4.7.9.
Note that Theorem 4.7.8 and Corollary 4.7.9 rely substantially on the assumption
that the sequence (u0 , u1 , u2 , . . .) be infinite. A theory of periodic finite sequences
exists, but is less well-behaved. For example, the 6-tuple (0, 1, 0, 0, 1, 0) is 3-periodic
(in the obvious meaning of this word) and 5-periodic, but not gcd (3, 5)-periodic
(since its entries are not all equal); thus, the most natural analogue of Theorem
4.7.8 (d) for finite sequences does not hold. The same applies to Theorem 4.7.8 (b);
indeed, the 5-tuple (0, 0, 1, 0, 0) is 4-periodic and 3-periodic but not (4 − 3)-periodic.

4.7.2. Periodic functions on R and on R+


Infinite sequences can be viewed as functions from N: Namely, an infinite se-
quence (u0 , u1 , u2 , . . .) of real numbers can be identified with the function N → R
that sends each i ∈ N to ui . (Likewise for sequences of other objects.) Thus,
we can view infinite sequences as analogues of functions from R or from R+ =
{positive reals} or from other sets. Under this analogy, the i-th entry ui of a se-
quence u = (u0 , u1 , u2 , . . .) corresponds to the value u (i ) of a function u. The
analogue of Definition 4.7.1 takes the following form:
Definition 4.7.10. Let A be either the set R or the set R+ := {positive reals}.
Let S be any set. Let u : A → S be a function.
(a) A positive real d is said to be a period of u if every x ∈ A satisfies u ( x ) =
u ( x + d ).
(b) The function u is said to be periodic if it has a period (i.e., if a period of u
exists).
(c) Let d be a positive real. The function u is said to be d-periodic if d is a period
of u.
Example 4.7.11. The most famous examples of periodic functions are the trigono-
metric functions sin : R → R and cos : R → R. Both of these functions are
2π-periodic (i.e., have period 2π), since every x ∈ R satisfies sin x = sin ( x + 2π )
and cos x = cos ( x + 2π ).

Example 4.7.12. For each x ∈ R, the real x − b x c is known as the fractional part
of x; it satisfies 0 ≤ x − b x c < 1. (Some authors denote it by { x }, though this
notation clashes with the set builder notation.) Now, the function

R → R,
x 7→ x − b x c

is 1-periodic. (Check this!)

December 25, 2021


Math 235 notes page 162

Example 4.7.13. The delta function δ0 is the function R → R that sends each x ∈ R
to [ x = 0] (where we are using Definition 4.3.19). Thus, it sends 0 to 1, but sends
all nonzero reals to 0. It is easy to see that this function δ0 is not periodic.

The following is an analogue of Theorem 4.7.8 for functions (to the extent such
an analogue is possible):

Theorem 4.7.14. Let A be either the set R or the set R+ := {positive reals}. Let
S be any set. Let u : A → S be a function.
(a) If a and b are two periods of u, then a + b is a period of u.
(b) If a and b are two periods of u such that a > b, then a − b is a period of u.
(c) If a is a period of u, then na is a period of u for every positive integer n.
(d) If a and b are two positive integers that are periods of u, then gcd ( a, b) is
a period of u.
(e) If a is a period of u, and if p and q are two elements of A such that p − q is
an integer multiple of a, then u ( p) = u (q).

Here, an “integer multiple of a” means a number of the form ac for some c ∈ Z.


Proof of Theorem 4.7.14. Each part of Theorem 4.7.14 is an analogue of the corre-
sponding part of Theorem 4.7.8 (because the statement “p − q is an integer multi-
ple of a” is an analogue of “p ≡ q mod a”). Its proof is analogous to the proof of
Theorem 4.7.8 as well (check this!).
A useful property of a-periodic functions is that they are uniquely determined
by their values on any given half-open interval of length a. More precisely:

Proposition 4.7.15. Let A be either the set R or the set R+ := {positive reals}.
Let S be any set. Let a be a positive real. Let u : A → S and v : A → S be two
a-periodic functions. Let b ∈ A. Assume that

u (x) = v (x) for each x ∈ [b, b + a) . (162)

Then, u = v.

Proof of Proposition 4.7.15. Let y ∈ A. We shall show that u (y) = v (y).


We shall find an x ∈ [b, b + a) such that y − x is an integer multiple of a. Namely,
we set
y−b
 
x := y − a .
a
Then, it is straightforward to see that x ∈ [b, b + a) 86 . Thus, (162) shows that
u ( x ) = v ( x ).
y−b y−b y−b
 
86 Proof.
The chain of inequalities (1) (applied to instead of x) yields ≤ <
a a a
y−b
 
+ 1. We can multiply this chain of inequalities by a (since a is positive), and thus obtain
a

December 25, 2021


Math 235 notes page 163

y−b y−b
  
Furthermore, from x = y − a , we obtain y − x = a . Thus, y − x
a a
y−b
 
is an integer multiple of a (since is an integer). But the function u is a-
a
periodic; in other words, a is a period of u. Hence, Theorem 4.7.14 (e) (applied to
p = y and q = x) yields that u (y) = u ( x ) (since y − x is an integer multiple of a).
In other words, u ( x ) = u (y). The same argument (applied to v instead of u) yields
v ( x ) = v (y). Now, u (y) = u ( x ) = v ( x ) = v (y).
Forget that we fixed y. We thus have shown that u (y) = v (y) for each y ∈ A. In
other words, u = v. This proves Proposition 4.7.15.
An analogue of Proposition 4.7.15 exists for periodic sequences.

Proposition 4.7.16. Let a be a positive integer. Let u = (u0 , u1 , u2 , . . .) and v =


(v0 , v1 , v2 , . . .) be two a-periodic infinite sequences. Let b ∈ N. Assume that

ui = vi for each i ∈ {b, b + 1, . . . , b + a − 1} .

Then, u = v.

Proof of Proposition 4.7.16. Analogous to the proof of Proposition 4.7.15.


We can use Proposition 4.7.15 to give a simple new solution to Exercise 1.1.3:
1
Second solution to Exercise 1.1.3 (sketched). Forget that we fixed x. Set a = and
n
b = 0. Note that a is a positive real. Define a function u : R → R by setting
n −1  
k
u (x) = ∑ x+
n
− bnx c for each x ∈ R.
k =0

y−b y−b
    
a ≤ y−b < a + 1 . Now, combining
a a

y−b
 
x = y−a ≥ y − (y − b) = b
a
| {z }
≤y−b

with
y−b y−b
   
x= y −a y−b = +b − a
|{z} a | {z } a
=y−b+b y−b
% ! $
<a +1
a
y−b y−b
    
<a +1 +b−a = b + a,
a a

we obtain b ≤ x < b + a. In other words, x ∈ [b, b + a).

December 25, 2021


Math 235 notes page 164

We define another function v : R → R by setting

v (x) = 0 for each x ∈ R.

We shall now show the following three claims:

Claim 1: The function u is a-periodic.

Claim 2: The function v is a-periodic.

Claim 3: We have u ( x ) = v ( x ) for each x ∈ [b, b + a).

Once these three claims are proved, we will be able to apply Proposition 4.7.15
and conclude that u = v; this will easily yield the claim of Exercise 1.1.3. Let us
thus prove the three claims:
[Proof of Claim 1: We shall show that every x ∈ R satisfies u ( x ) = u ( x + a).
Indeed, let x ∈ R. We observe that

by + kc = byc + k for each y ∈ R and k ∈ Z. (163)

(This is a well-known property


 of floors;
 it is easy to prove.87 ) Now, recall that
1 1
a = . Hence, n ( x + a) = n x + = nx + 1. Thus,
n n

bn ( x + a)c = bnx + 1c = bnx c + 1 (164)

(by (163), applied to y = nx and k = 1). Furthermore, each k ∈ {0, 1, . . . , n − 1}


satisfies
k 1 k k+1
a + = x+ + = x+
x + |{z} . (165)
n n n n
1
=
n

87 It also appears (with y renamed as x) as Proposition A.2.3 in our first solution to Exercise 1.1.3.

December 25, 2021


Math 235 notes page 165

Hence,
n −1   n −1   n  
k k+1 k
∑ x+a+ n = ∑ x+ n = ∑ x+ n
k =0 | {z } k =0 k =1
k+1
$ %
= x+
n
(by (165))

(here, we have substituted k for k + 1 in the sum)


 
 
n  
k  0
= ∑ x+ n − x + 
 
k =0 | {z n}
| {z } =x
k  n
$ %
n −1
= ∑ x+ + x+
k =0 n n
 
 
n −1    
k n 
= ∑ x+

+ x +
  − bxc
k =0
n n
|{z}

=1
n −1  
k
= ∑ x+
n
+ b x + 1c − bxc
k =0
| {z }
=b x c+1
(by (163), applied to y= x and k=1)
n −1  
k
= ∑ x+ + bxc + 1 − bxc
k =0
n
n −1  
k
= ∑ x+ + 1. (166)
k =0
n

Now, the definition of u yields


n −1  
k
u ( x + a) = ∑ x + a + − bn ( x + a)c
n
|k=0
| {z }
{z } =bnx c+1
n −1
$
k
% (by (164))
= ∑ x+ +1
k =0 n
(by (166))
!
n −1   n −1  
k k
= ∑ x+
n
+ 1 − (bnx c + 1) = ∑ x +
n
− bnx c = u ( x )
k =0 k =0

(by the definition of u). In other words, u ( x ) = u ( x + a).


Now, forget that we fixed x. We thus have shown that every x ∈ R satisfies
u ( x ) = u ( x + a ).
However, a is a period of u if and only if every x ∈ R satisfies u ( x ) = u ( x + a)
(by Definition 4.7.10 (a)). Thus, a is a period of u (since every x ∈ R satisfies

December 25, 2021


Math 235 notes page 166

u ( x ) = u ( x + a)). In other words, the function u is a-periodic (by Definition 4.7.10


(c)). This proves Claim 1.]
[Proof of Claim 2: Each x ∈ R satisfies v ( x ) = 0 (by the definition of v) and
v ( x + a) = 0 (for the same reason) and thus v ( x ) = 0 = v ( x + a).
However, a is a period of v if and only if every x ∈ R satisfies v ( x ) = v ( x + a)
(by Definition 4.7.10 (a)). Thus, a is a period of v (since every x ∈ R satisfies
v ( x ) = v ( x + a)). In other words, the function v is a-periodic (by Definition 4.7.10
(c)). This proves Claim 2.]
[Proof of Claim 3: Let x ∈ [b, b + a). We must show that u ( x ) = v ( x ).
We observe the following: If y is a real such that 0 ≤ y < 1, then

byc = 0. (167)

(This follows almost immediately from the definition of byc; indeed, 0 ≤ y < 1
entails that the largest integer that is ≤ y is 0.)
We have x ∈ [b, b + a) = [0, 0 + a) (since b = 0). In other words, 0 ≤ x < 0 + a.
1
Hence, x < 0 + a = a = , so that nx < 1. Also, 0 ≤ nx (since 0 ≤ x). Thus,
n
0 ≤ nx < 1. Hence, (167) (applied to y = nx) yields

bnx c = 0. (168)

k
Next, let k ∈ {0, 1, . . . , n − 1}. Then, 0 ≤ k ≤ n − 1. We have |{z}
x + <
n
1 |{z}
< n−1
n ≤
n
(since k≤n−1)
1 n−1 k k
+ x +
= 1 and |{z} ≥ 0. Thus, 0 ≤ x + < 1. Hence, (167) (applied
n n n n
≥0 |{z}
≥0
(since k≥0)
k
to y = x + ) yields
n  
k
x+ = 0. (169)
n
Forget that we fixed k. We thus have proved (169) for each k ∈ {0, 1, . . . , n − 1}.
Now, the definition of u yields
n −1   n −1
k
u (x) = ∑ x + − bnx c = ∑ 0 −0 = 0.
n
k=0 | {z }
|k={z0 }
| {z }
=0
=0 (by (168)) =0
(by (169))

Comparing this with

v (x) = 0 (by the definition of v) ,

December 25, 2021


Math 235 notes page 167

we find u ( x ) = v ( x ). This proves Claim 3.]


Now, we can apply Proposition 4.7.15 to A = R and S = R (because of Claim 1,
Claim 2 and Claim 3). Hence, we obtain u = v. Now, for each x ∈ R, we have
n −1  
k
∑ x+
n
− bnx c = |{z}
u (x) (by the definition of u)
k =0 =v
= v (x) = 0 (by the definition of v) ,
n −1
 
k
so that ∑ x+ = bnx c. This solves Exercise 1.1.3 again.
k =0 n

4.8. Homework set #3: Sequences and more sums


This is a regular problem set. See Section 3.7 for details on grading.
This homework set covers the above parts of Chapter 4. Some of the problems
may be unrelated. Note that the problems are ordered by (approximate) topic, not
by difficulty!
Please solve at most 5 problems. (No points will be given for further solutions.)

Exercise 4.8.1. Let ( a0 , a1 , a2 , . . .) be a sequence of integers defined recursively by

a0 = 0, a1 = 1, and
a n = 1 + a n −1 a n −2 for each integer n ≥ 2.

Prove the following:


(a) For any k ∈ N and n ∈ N, we have ak+n ≡ ak mod an .
(b) If u, v ∈ N satisfy u | v, then au | av .
(c) For any n, m ∈ N, we have gcd ( an , am ) = agcd(n,m) .

Exercise 4.8.2. For any positive integer n, we let d (n) denote the number of all
positive divisors of n. (For example, d (6) = 4.)
Let n be a positive integer. Prove that
jnk jnk jnk
d (1) + d (2) + · · · + d ( n ) = + +···+ .
1 2 n

Exercise 4.8.3. Let n∈N.


n n
(a) Simplify ∑ k . (“Simplify” means “get rid of the ∑ sign”.)
k =0  k 
n 2n
(b) Simplify ∑ .
k =0 k

December 25, 2021


Math 235 notes page 168

Exercise 4.8.4. Let n ∈ N. Let x1 , x2 , . . . , xn be any numbers, and let y be a


further number. Let [n] denote the set {1, 2, . . . , n}.
(a) Prove that every m ∈ {0, 1, . . . , n − 1} satisfies
!m
∑ (−1)n−| I | y + ∑ xi = 0.
I ⊆[n] i∈ I

(b) Prove that


!n
∑ (−1)n−| I | y + ∑ xi = n!x1 x2 · · · xn .
I ⊆[n] i∈ I

[Remark: For n = 2, the statement of Exercise 4.8.4 (b) says that

(y + x1 + x2 )2 − (y + x1 )2 − (y + x2 )2 + y2 = 2!x1 x2 .

Note that (35) is the particular case of this equality for y = m + 1, x1 = 1 and
x2 = 2.]

Exercise 4.8.5. Let n ∈ N and x ∈ R \ {1, −1}. For each i ∈ N, set yi = 1 − xi .


Prove that
n −1
y n y n −1 · · · y n − k
∑ y k +1
= n.
k =0

Exercise 4.8.6. Define a sequence ( a0 , a1 , a2 , . . .) of integers recursively by

a0 = 0, a1 = 1, and
a n = n ( a n −1 + ( n − 1 ) a n −2 ) for each integer n ≥ 2.

Compute an explicitly (in terms of sequences we already know).

Exercise 4.8.7. Let a, b, u and v be four reals.


We define two sequences ( a0 , a1 , a2 , . . .) and (b0 , b1 , b2 , . . .) of reals recursively
by setting
a0 = a and b0 = b
and
an = uan−1 + vbn−1 and bn = ubn−1 + van−1
for each n ≥ 1.
Find explicit formulas for an and bn .

Recall that a sequence ( a0 , a1 , a2 , . . .) of reals is said to be weakly increasing if it


satisfies a0 ≤ a1 ≤ a2 ≤ · · · (that is, ai ≤ ai+1 for each i ∈ N). (Some authors call

December 25, 2021


Math 235 notes page 169

such sequences nondecreasing, but I find this terminology slightly counterintuitive;


in particular, “nondecreasing” is not the same as “not decreasing”.)

Exercise 4.8.8. Let ( a0 , a1 , a2 , . . .) be the unique weakly increasing sequence of


positive integers that contains each positive integer i exactly i times. Thus,

( a0 , a1 , a2 , . . .) = (1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, . . .) .

Prove that
1√
 
1
an = 8n + 1 + for each n ∈ N.
2 2

Exercise 4.8.9. Let a and b be two positive reals. Let f : R → R be an a-periodic


function. Let g : R → R be a b-periodic function. Consider the function f + g :
R → R (which sends each x ∈ R to ( f + g) ( x )).
(a) If a/b ∈ Q, then prove that f + g is again a periodic function.
(b) Show that f + g need not be periodic if a/b ∈/ Q. (Feel free to interpret this
either as “Find an example where f + g is not periodic for some pair of a and b
satisfying a/b ∈/ Q” or as “Find an example where f + g is not periodic for every
pair of a and b satisfying a/b ∈/ Q”.)

The following is a bonus problem: You can get points on it even if you solved 5
others. Be warned that it is rather hard.

Exercise 4.8.10. Let n ∈ Z and k ∈ Z. Prove that


n−1 n−1
           
n n+1 n n+1
gcd , , = gcd , , .
k−1 k+1 k k k−1 k+1

4.9. Linear recurrences


A wider and more interesting class of integers are the linearly recurrent sequences
(or, more precisely, sequences satisfying linear recurrences with constant coefficients).
This class contains the arithmetic progressions, the geometric progressions, the
Fibonacci sequence and some others. These sequences have an interesting yet man-
ageable theory; in particular, they can all be described by “explicit” formulas (sim-
ilar to Binet’s formula for Fibonacci numbers – i.e., Theorem 2.3.1) as long as one
is ready to accept the appearance of irrational numbers in these formulas. We shall
not prove these formulas in full generality here, but we shall fully analyze the
most commonly used particular case – that of the two-term recurrences (also known
as recurrences of second degree) – and say a few things about the general case. We
note that the explicit formula is not the be-all and end-all of linearly recurrent se-
quences; more can be said and proved, often independently of the explicit formula.

December 25, 2021


Math 235 notes page 170

(For example, we didn’t use Binet’s formula all that often in our study of Fibonacci
numbers!)
Some resources on linearly recurrent sequences are [Markus83], [BeDeQu11],
[Melian01] and [Ivanov08].

4.9.1. Two-term recurrences: definition and examples


We begin by studying sequences ( x0 , x1 , x2 , . . .) that satisfy two-term recurrences –
i.e., recurrent equations of the form xn = axn−1 + bxn−2 for all n ≥ 2, where a and
b are two fixed numbers.88 We begin by giving them a short name:89

Definition 4.9.1. Let a and b be two numbers. A sequence ( x0 , x1 , x2 , . . .) of


numbers will be called ( a, b)-recurrent90 if every n ≥ 2 satisfies

xn = axn−1 + bxn−2 . (170)

It is clear that an ( a, b)-recurrent sequence ( x0 , x1 , x2 , . . .) is uniquely determined


by the four numbers a, b, x0 and x1 , since the equality (170) can be used to compute
all entries of the sequence using these four numbers. Thus, if two ( a, b)-recurrent
sequences ( x0 , x1 , x2 , . . .) and (y0 , y1 , y2 , . . .) (for a given pair ( a, b)) agree in their
first two entries (that is, satisfy x0 = y0 and x1 = y1 ), then they are identical (that
is, xn = yn for each n ∈ N).
Here are some examples91 of ( a, b)-recurrent sequences for various pairs ( a, b):

Example 4.9.2. The Fibonacci sequence ( f 0 , f 1 , f 2 , . . .) = (0, 1, 1, 2, 3, 5, . . .) from


Definition 2.2.1 is (1, 1)-recurrent, since every n ≥ 2 satisfies f n = f n−1 + f n−2 =
1 f n −1 + 1 f n −2 .

Example 4.9.3. The Lucas sequence (`0 , `1 , `2 , . . .) is another famous (1, 1)-
recurrent sequence of integers. It is defined recursively by `0 = 2, `1 = 1, and
`n = `n−1 + `n−2 for all n ≥ 2. Its first terms are 2, 1, 3, 4, 7, 11, 18.

Example 4.9.4. A sequence ( x0 , x1 , x2 , . . .) is (2, −1)-recurrent if and only if every


n ≥ 2 satisfies xn = 2xn−1 − xn−2 . In other words, a sequence ( x0 , x1 , x2 , . . .) is
(2, −1)-recurrent if and only if every n ≥ 2 satisfies xn − xn−1 = xn−1 − xn−2 .

88 The name “two-term recurrences” refers to the two terms axn−1 and bxn−2 on the right hand side.
Some people prefer to also count the xn term on the left hand side, which makes these equations
“three-term recurrences” instead.
89 As before, “numbers” can mean integer, rational, real or complex numbers.
90 The name “( a, b )-recurrent” is not standard; I have picked it merely for the sake of brevity. A

more standard way to say “( a, b)-recurrent” would be “linearly recurrent with characteristic
polynomial x2 − ax − b”; this is related to the polynomial point of view that we might discuss
later on.
91 mostly taken from [Grinbe15, Chapter 4]

December 25, 2021


Math 235 notes page 171

In other words, a sequence ( x0 , x1 , x2 , . . .) is (2, −1)-recurrent if and only if x1 −


x0 = x2 − x1 = x3 − x2 = · · · . In other words, the (2, −1)-recurrent sequences
are precisely the arithmetic progressions.

Example 4.9.5. Geometric progressions are also ( a, b)-recurrent  for appropriate a


and b. Namely, any geometric progression u, uq, uq2 , uq3 , . . . is (q, 0)-recurrent,
since every n ≥ 2 satisfies uqn = q · uqn−1 + 0 · uqn−2 . However, not every (q, 0)-
recurrent sequence ( x0 , x1 , x2 , . . .) is a geometric progression (since the condition
xn = qxn−1 + 0xn−2 for all n ≥ 2 says nothing about x0 , and thus x0 can be
arbitrary).

Example 4.9.6. A sequence ( x0 , x1 , x2 , . . .) is (0, 1)-recurrent if and only if every


n ≥ 2 satisfies xn = xn−2 . In other words, a sequence ( x0 , x1 , x2 , . . .) is (0, 1)-
recurrent if and only if it has the form (u, v, u, v, u, v, . . .) for two numbers u and
v.

Example 4.9.7. A sequence ( x0 , x1 , x2 , . . .) is (1, 0)-recurrent if and only if every


n ≥ 2 satisfies xn = xn−1 . In other words, a sequence ( x0 , x1 , x2 , . . .) is (1, 0)-
recurrent if and only if it has the form (u, v, v, v, v, . . .) for two numbers u and
v. Notice that u is not required to be equal to v, because we never claimed that
xn = xn−1 holds for n = 1.

Example 4.9.8. A sequence ( x0 , x1 , x2 , . . .) is (1, −1)-recurrent if and only if every


n ≥ 2 satisfies xn = xn−1 − xn−2 . In Example 4.7.7, we have already seen an
example of such a sequence, and observed that it is 6-periodic. But this holds
more generally: Any (1, −1)-recurrent sequence ( x0 , x1 , x2 , . . .) is 6-periodic (i.e.,
it satisfies xn+6 = xn for every n ∈ N). This is because every n ∈ N satisfies

x n +6 = x n +5 − x n +4 = ( x n +4 − x n +3 ) − x n +4 = − x n +3
|{z} |{z}
= x n +4 − x n +3 = x n +2 − x n +1
 

= −  x n +2 − x n +1  = − ( x n +1 − x n − x n +1 ) = x n .
 
|{z}
= x n +1 − x n

We can describe the (1, −1)-recurrent sequences explicitly: A se-


quence ( x0 , x1 , x2 , . . .) is (1, −1)-recurrent if and only if it has the form
(u, v, v − u, −u, −v, u − v, . . .) (where the “. . .” stands for “repeat the preceding
6 values over and over” here) for two numbers u and v.

Example 4.9.9. The sequence (t0 , t1 , t2 , . . .) from Exercise 1.1.2 itself is not ( a, b)-
recurrent for any pair ( a, b); however, its two subsequences (t0 , t2 , t4 , t6 , . . .) and
(t1 , t3 , t5 , t7 , . . .) are (4, −1)-recurrent, since Exercise 1.1.2 (a) shows that t2n =
4t2(n−1) − t2(n−2) and t2n+1 = 4t2(n−1)+1 − t2(n−2)+1 for every n ≥ 2.

December 25, 2021


Math 235 notes page 172

Another family of examples of ( a, b)-recurrent sequences comes from trigonom-


etry:

Proposition 4.9.10. Let α be any angle. Then, the sequences

(sin (0α) , sin (1α) , sin (2α) , . . .) and (171)


(cos (0α) , cos (1α) , cos (2α) , . . .) (172)

are (2 cos α, −1)-recurrent. More generally, if α and β are two angles, then the
sequence
(sin ( β + 0α) , sin ( β + 1α) , sin ( β + 2α) , . . .) (173)
is (2 cos α, −1)-recurrent.

Proof of Proposition 4.9.10 (sketched). Let α and β be two angles. It suffices to show
that the sequence (sin ( β + 0α) , sin ( β + 1α) , sin ( β + 2α) , . . .) is (2 cos α, −1)-recurrent
(because the two sequences (171) and (172) are particular cases of this sequence for
π
β = 0 and β = , respectively). In other words, it suffices to show that
2
sin ( β + nα) = 2 cos α sin ( β + (n − 1) α) + (−1) sin ( β + (n − 2) α)

for every n ≥ 2. So let us fix n ≥ 2.


One of the well-known trigonometric identities states that
x+y x−y
sin x + sin y = 2 sin cos
2 2
for any two angles x and y. Applying this to x = β + nα and y = β + (n − 2) α, we
obtain

sin ( β + nα) + sin ( β + (n − 2) α)


( β + nα) + ( β + (n − 2) α) ( β + nα) − ( β + (n − 2) α)
= 2 sin cos
| 2
{z } | 2
{z }
= β+(n−1)α =α

= 2 sin ( β + (n − 1) α) cos α = 2 cos α sin ( β + (n − 1) α) .

Hence,

sin ( β + nα) = 2 cos α sin ( β + (n − 1) α) − sin ( β + (n − 2) α)


= 2 cos α sin ( β + (n − 1) α) + (−1) sin ( β + (n − 2) α) .

This proves Proposition 4.9.10.


Note that all three sequences in Proposition 4.9.10 are periodic when α is a ratio-
nal multiple of 2π (that is, when α = 2πr for some r ∈ Q). This provides an ample
source of periodic recurrent sequences (of any possible period).

December 25, 2021


Math 235 notes page 173

4.9.2. Two-term recurrences: Binet-like formulas


The following question now suggests itself:92

Exercise 4.9.1. Let a and b be two numbers. Let ( x0 , x1 , x2 , . . .) be an ( a, b)-


recurrent sequence. Is there an explicit formula for xn in terms of a, b, x0 and x1 ,
similar to Binet’s formula (Theorem 2.3.1) for Fibonacci numbers?

Discussion of Exercise 4.9.1. Let us first solve Exercise 4.9.1 in a “barbaric” way – by
experimenting and guessing. We will later see a more cultured way (or two) of
solving it.
We begin by taking a look at Binet’s formula, in order to get an idea of what we
should expect.
First, we observe that Binet’s formula involves the two irrational numbers ϕ
and ψ, even though the Fibonacci numbers are integers. Thus, we should expect
irrational numbers (specifically, square roots) to appear in our formula, even if a,
b, x0 and x1 are integers.
1 1
Binet’s formula said f n = √ ϕn − √ ψn . While it would be strange to expect
5 5
1
the same specific numbers √ , ϕ and ψ to appear in the general case, we can hope
5
that the overall form of the formula will be the same:

xn = γλn + δµn (174)

for four constants γ, δ, λ, µ. (Binet’s formula is an example of this form, with γ =


1 1
√ , δ = − √ , λ = ϕ and µ = ψ).
5 5
So we guess that there is an explicit formula of the form (174) for four constants
γ, δ, λ, µ. (“Constants” means “numbers not depending on n”.) We can now try to
find these four constants. (Of course, nothing guarantees us that they actually exist
– indeed, they don’t always do, as we will eventually see. But it can’t hurt to try!)
Our sequence ( x0 , x1 , x2 , . . .) is ( a, b)-recurrent; i.e., it satisfies the equation (170)
for each n ≥ 2. Let us rewrite this equation with the help of (174). Indeed, fix an
integer n ≥ 2. Then, (174) shows that xn = γλn + δµn and xn−1 = γλn−1 + δµn−1
and xn−2 = γλn−2 + δµn−2 . Thus, (170) rewrites as
   
γλn + δµn = a γλn−1 + δµn−1 + b γλn−2 + δµn−2 . (175)

92 Whenwe say “an ( a, b)-recurrent sequence”, we of course mean an ( a, b)-recurrent sequence of


numbers.

December 25, 2021


Math 235 notes page 174

Therefore,
    
0 = γλn + δµn − a γλn−1 + δµn−1 + b γλn−2 + δµn−2
   
n n −1 n −2 n n −1 n −2
= γλ − aγλ − bγλ + δµ − aδµ − bδµ
| {z } | {z }
=γ(λ2 − aλ−b)λn−2 =δ(µ2 − aµ−b)µn−2
  
= γ λ2 − aλ − b λn−2 + δ µ2 − aµ − b µn−2 . (176)

Now, forget that we fixed n. We thus have shown that the equality (176) must
hold for every integer n ≥ 2. Since the only “moving parts” in this equality are
the λn−2 and the µn−2 terms (in the sense that all the other terms are independent
of n), we sense an easy way to ensure that it holds: Namely, it will hold whenever
λ2 − aλ − b = 0 and µ2 − aµ − b = 0. Technically, this is not the only way to make
(176) hold; for example, the same would hold if γ = 0 and δ = 0. However, it is
clear that γ = 0 and δ = 0 can only work if the sequence ( x0 , x1 , x2 , . . .) consists of
zeros, while we are trying to study the general case. In the “typical” case, neither
γ nor δ will be 0, since otherwise the sequence ( x0 , x1 , x2 , . . .) would have to be a
geometric progression (by (174)).
So we need to pick λ and µ in such a way that λ2 − aλ − b = 0 and µ2 − aµ − b =
0. In other words, λ and µ must be roots of the quadratic equation X 2 − aX − b = 0.
As you know from high school(?), this quadratic equation has two complex roots
(counted with multiplicity93 ). It seems a good idea to let λ and µ be the two roots
of this equation.94 Explicitly, this means that
√ √
a + a2 + 4b a − a2 + 4b
λ= and µ= . (177)
2 2
(We could of course swap the roles of λ and µ, but this would not change anything.)
Note that λ and µ can fail to be real numbers, even if a and b are reals. (For example,
this will happen if a = b = −1.)
By defining λ and µ through (177), we have ensured that (176) holds for each
integer n ≥ 2. Thus, (175) holds for each integer n ≥ 2 as well (since (176) is equiv-
alent to (175)). In other words, the sequence γλ0 + δµ0 , γλ1 + δµ1 , γλ2 + δµ2 , . . .
is ( a, b)-recurrent. Hence, if the formula (174) holds for n = 0 and for n = 1, then it
also holds for all n ∈ N (because two ( a, b)-recurrent sequences that agree in their
first two entries must be identical). It thus remains to pick γ and δ in such a way
that the formula (174) holds for n = 0 and for n = 1. In other words, we must pick

93 This means that sometimes, the equation has only one root, but we should count it as two equal
roots. (This happens precisely when a2 + 4b = 0.)
94 Technically, we could of course let λ and µ be one and the same root. But this feels like wasting

a variable (and is indeed so); in fact, setting λ = µ in (174) would force ( x0 , x1 , x2 , . . .) to be a


geometric progression, which is not representative of the “typical” case. So it stands to reason
that we don’t take λ and µ to be one and the same root (unless there is only one root).

December 25, 2021


Math 235 notes page 175

γ and δ in such a way that (


x0 = γλ0 + δµ0 ;
(178)
x1 = γλ1 + δµ1 .
This is a system of two linear equations in the two unknowns γ and δ (since
x0 , x1 , λ, µ are known). Using Gaussian elimination or Cramer’s rule (or any other
method for solving systems of linear equations), we see that its solution is

x1 − µx0 λx0 − x1
γ= and δ= (179)
λ−µ λ−µ

when λ 6= µ. Note that λ 6= µ holds if and only if a2 + 4b 6= 0 (this follows easily


from (177)). If a2 + 4b = 0, then the system (178) has no solutions or infinitely
many solutions; let us ignore this case for now.
Thus, whenever a2 + 4b 6= 0, we have found four constants γ, δ, λ, µ that ensure
that (174) does indeed hold for each n ∈ N: Namely, λ and µ are given by (177),
whereas γ and δ are given by (179). It is easy to see that these four constants
γ, δ, λ, µ indeed work (i.e., that the formula (174) indeed holds for all n ∈ N when
these four constants are being used)95 .
We have thus obtained a partial answer to Exercise 4.9.1: We have found a for-
mula that works whenever a2 + 4b 6= 0. We will soon turn to the other case; but let
us say a few general words first. Our approach to finding a formula for xn had the
following structure: We guessed that there should be a formula of the form (174)
for four constants γ, δ, λ, µ. We could not guess the exact values of γ, δ, λ, µ, how-
ever, so we treated them as unknowns and solved for them. That is, we guessed
only the part of the answer that was easily guessable (viz., the structure of the for-
mula), and then used that guess to figure out the rest through analytic reasoning.
This kind of “incomplete guess” is called an ansatz (German word, plural ansätze)
and is particularly popular in mathematical physics, but contest problems also tend
to provide opportunities for ansätze to those who know to look out for them. Of
course, as with any kind of guess, an answer found using an ansatz needs to be
checked (i.e., proved); in our case, this was essentially trivial, because the reasoning
we made to find γ, δ, λ, µ was reversible. In other situations, this can be nontrivial
or even difficult – but knowing the answer is still a good step forward.
Let us now complete the solution of Exercise 4.9.1 by studying the case a2 + 4b =
0. Consider this case. In general, the system (178) may fail to have a solution, so our
ansatz (174) will not work here. Instead, we can use the condition a2 + 4b = 0 to
− a2
rewrite b as (thus eliminating one parameter from our problem), and compute
4

95 Indeed,we already explained that, due to our choice of λ and µ, if the formula (174) holds for
n = 0 and for n = 1, then it also holds for all n ∈ N. But our choice of γ and δ ensures that the
formula (174) does indeed hold for n = 0 and n = 1. Thus, this formula holds for all n ∈ N, as
desired.

December 25, 2021


Math 235 notes page 176

the first few entries of our sequence to look for a pattern:

x0 = x0 ;
x1 = x1 ;
− a2  a 
x2 = ax1 + |{z} b x0 = ax1 + x0 = a x1 − x0 ;
4 4
− a2
=
4
a  − a2
 

2 3 a
x3 = a x2 + |{z}b x1 = aa x1 − x0 + x1 = a x1 − x0 ;
|{z} 4 4 4 4

a 
− a 2
= a x1 − x0 =
4 4
x4 = a x3 + |{z}b x2
|{z} |{z}
3 a − a2 = a x − a x
!  
=a 2 x1 − x0 = 1 0
4 4 4 4
− a2 
   
2 3 a a  3 1 3a
= aa x1 − x0 + a x1 − x0 = a x1 − x0 ;
4 4 4 4 2 16
 
5 a
x5 = a4 x1 − x0 (we are now omitting the intermediate steps) ;
16 8
 
5 3 5a
x6 = a x1 − x0 .
16 64

The answer may not immediately stare at us from the equations, but again we can
make an ansatz: Namely, we expect to have

xn = an−1 (un x1 − vn ax0 ) for each n > 0, (180)


96 where un and vn are two rational numbers (dependent on n, but independent on
a, x0 and x1 ). Our goal is now to find these un and vn . Let us list the first few of
them:
 
3 1 5 3
(u1 , u2 , u3 , u4 , u5 , u6 ) = 1, 1, , , , ;
4 2 16 16
 
1 1 3 1 5
(v1 , v2 , v3 , v4 , v5 , v6 ) = 0, , , , , .
4 4 16 8 64

This suggests that both the ui and the vi are fractions whose denominators are
powers of 2. The exact denominators appear to oscillate, but it is noticeable that
the denominator of ui is never larger than 2i−1 , while that of vi is never larger than

96 We are saying “for each n > 0” instead of “for each n ∈ N” here, since an−1 is undefined when
n = 0 and a = 0. (In truth, we are being over-careful here; the a = 0 case is easy enough that we
can just leave it aside.)

December 25, 2021


Math 235 notes page 177

2i . Thus, we may want to look at 2i−1 ui and 2i vi , which will be integers:


 
20 u1 , 21 u2 , 22 u3 , 23 u4 , 24 u5 , 25 u6 = (1, 2, 3, 4, 5, 6) ;
 
1 2 3 4 5 6
2 v1 , 2 v2 , 2 v3 , 2 v4 , 2 v5 , 2 v6 = (0, 1, 2, 3, 4, 5) .

Voilà: now the pattern is impossible to miss.97 We guess that 2i−1 ui = i and
2i vi = i − 1. If this is true, then (180) becomes

n−1
 
n −1 n
xn = a x1 − n ax0 for each n > 0. (181)
2n −1 2

In other words,
1  n −1 n

xn = 2na x 1 − ( n − 1 ) a x 0 for each n > 0. (182)
2n
This is, so far, a guess. But clearly, if a formula like (182) is true, then it can be
proved by a straightforward strong induction on n. And this is indeed the case;
(182) is true, and its induction proof can be found in [Grinbe15, solution to Exercise
4.1]. Note that (182) holds for n = 0 as well, if we agree to understand nan−1 as 0
for n = 0 (even if an−1 may fail to be defined).
Thus, we have found explicit formulas for xn in both cases a2 + 4b 6= 0 and
2
a + 4b = 0. Exercise 4.9.1 is solved.
Combining our results obtained in the discussion of Exercise 4.9.1 above, we
obtain the following result (a “generalized Binet formula”):

Theorem 4.9.11. Let a and b be two numbers. Let ( x0 , x1 , x2 , . . .) be an ( a, b)-


recurrent sequence. Then:
(a) If a2 + 4b 6= 0, then every n ∈ N satisfies

xn = γλn + δµn , (183)

where we set
√ √
a+ a2 + 4b a− a2 + 4b
λ= and µ= (184)
2 2
and
x1 − µx0 λx0 − x1
γ= and δ= . (185)
λ−µ λ−µ
97 If you found the idea of considering 2i−1 ui and 2i vi somewhat far-fetched: there are other ways
to guess the same result. For example, after computing u7 and u9 , it becomes easy to notice that
the numerator ofui is i whenever i is odd. With this in mind, you will then be motivated to look
u1 u2 u3 u4
at the sequence , , , , . . . , which will quickly reveal itself to be the rather famous
1 2 3 4
( 1, 2, 4, 8, 16, . . . ) .

December 25, 2021


Math 235 notes page 178

(b) If a2 + 4b = 0, then every n ∈ N satisfies

1  n −1 n

xn = 2na x 1 − ( n − 1 ) a x 0
2n
(where we agree to understand nan−1 as 0 for n = 0).
It is easy to see that Theorem 2.3.1 is a particular case of Theorem 4.9.11 (a)
(obtained by setting a = 1 and b = 1 and xi = f i ). Likewise, we can compute
explicit formulas for other examples of ( a, b)-recurrent sequences:
Example 4.9.12. Consider the Lucas sequence (`0 , `1 , `2 , . . .) from Example 4.9.3.
This sequence is (1, 1)-recurrent; thus, Theorem 4.9.11 (a) (applied to a = 1 and
b = 1 and xi = `i ) yields that every n ∈ N satisfies `n = γλn + n
√δµ , where (as you

1+ 5 1− 5
can see by straightforward computations) we have λ = and µ =
2n 2
and γ = 1 and δ = 1. That is, every n ∈ N satisfies `n = ϕ + ψn , where ϕ and
ψ are as in Theorem 2.3.1.

Example 4.9.13. As we know from Example 4.9.4, a (2, −1)-recurrent sequence


is the same as an arithmetic progression. We can obtain an explicit formula for
any entry xn of such a sequence ( x0 , x1 , x2 , . . .) using Theorem 4.9.11 (b) (indeed,
this is a case where Theorem 4.9.11 (b) applies, since 22 + 4 (−1) = 0); but this
formula readily simplifies to the well-known xn = x0 + n ( x1 − x0 ).

Example 4.9.14. Let ( x0 , x1 , x2 , . . .) = (u, v, u, v, u, v, . . .) for two numbers u and


v. As we saw in Example 4.9.6, this is a (0, 1)-recurrent sequence. Thus, Theorem
4.9.11 (a) (applied to a = 0 and b = 1) yields that every n ∈ N satisfies xn =
u+v
γλn + δµn , where (again by computation) λ = 1 and µ = −1 and γ = and
2
u−v
δ= . That is, every n ∈ N satisfies
2
u+v n u−v u+v u−v
xn = ·1 + · (−1)n = + (−1)n · .
2 2 2 2
This is easy to check by hand.

Example 4.9.15. Let ( x0 , x1 , x2 , . . .) = (u, v, v, v, v, . . .) for two numbers u and v.


As we saw in Example 4.9.7, this is a (1, 0)-recurrent sequence. Thus, Theorem
4.9.11 (a) (applied to a = 1 and b = 0) yields that every n ∈ N satisfies xn =
γλn + δµn , where (again by computation) λ = 1 and µ = 0 and γ = v and
δ = u − v. That is, every n ∈ N satisfies

xn = v1n + (u − v) 0n = v + (u − v) 0n .

This is, of course, again true due to the way 0n behaves when n = 0 and when
n > 0.

December 25, 2021


Math 235 notes page 179

Example 4.9.16. Now, consider the (1, −1)-recurrent sequence ( x0 , x1 , x2 , . . .)


from Example 4.9.8. Here, Theorem 4.9.11 (a) (applied to a = 1 and b = −1)
yields that every n ∈ N satisfies xn = γλn + δµn , where (again by computation)
√ √
1 + −3 1 − −3
λ= and µ=
2 2
and
x1 − µx0 λx0 − x1
γ= and δ= .
λ−µ λ−µ
The numbers λ and µ here are complex – but they are more than that. If we plot
them on the Argand diagram (see [19s, §4.1.8] for details on this), we realize that
– together with 1, −1, −λ and −µ – they form the vertices of a regular hexagon
inscribed in the unit circle:

−µ λ

−1 0 1

−λ µ
.

Thus, due to the way multiplication of complex numbers corresponds to com-


position of rotations, the numbers λ and µ (as well as the other vertices 1, −1,
−λ and −µ) are 6-th roots of unity – i.e., they satisfy λ6 = 1 and µ6 = 1.
Hence, every n ∈ N satisfies λn+6 = λn and µn+6 = µn and therefore
γλn+6 + δµn+6 = γλn + δµn . Since xn+6 = γλn+6 + δµn+6 and xn = γλn + δµn ,
we can rewrite this as xn+6 = xn . This shows once again (but geometrically this
time) that the sequence ( x0 , x1 , x2 , . . .) is 6-periodic.

Example 4.9.17. Let α and β be two angles. Proposition 4.9.10 shows that the
sequence
(sin ( β + 0α) , sin ( β + 1α) , sin ( β + 2α) , . . .)
is (2 cos α, −1)-recurrent. Obviously, we already have an explicit formula for its
entries, but let us contrast it with what Theorem 4.9.11 (a) would yield. Namely,
Theorem 4.9.11 (a) (applied to a = 2 cos α and b = −1 and xn = sin ( β + nα))

December 25, 2021


Math 235 notes page 180

yields that sin ( β + nα) = γλn + δµn , where


q q
2 cos α + (2 cos α)2 − 4 2 cos α − (2 cos α)2 − 4
λ= and µ=
2 2
and
sin ( β + α) − µ sin β λ sin ( β + α) − sin β
γ= and δ= .
λ−µ λ−µ

(To be fully precise, Theorem 4.9.11 (a) only applies when (2 cos α)2 − 4 6= 0, that
is, when α isqnot a multiple of π; but the other case is easy.) We note that the
square root (2 cos α)2 − 4 is an imaginary number (since |2 cos α| ≤ 2 and thus

(2 cos α)2 − 4 ≤ 0) and can be rewritten as 2i |sin α|, where i = −1 (this follows
easily from (sin α)2 + (cos α)2 = 1). We assume that α ∈ (0, π ), so that we can
rewrite |sin α| as sin α (the other case is no harder). Then, our above formulas for
λ and µ become

λ = cos α + i sin α and µ = cos α − i sin α.

Anyone familiar with Euler’s formula will rewrite this as

λ = eiα and µ = e−iα .

The formula sin ( β + nα) = γλn + δµn can now be straightforwardly (if labori-
ously) derived from de Moivre’s formula.

4.9.3. Two-term recurrences: various properties


Various properties of the Fibonacci sequence can be generalized to arbitrary ( a, b)-
recurrent sequences. For example, here is how the Cassini identity (Exercise 2.2.2)
can be generalized:
Exercise 4.9.2. Let a and b be two numbers. Let ( x0 , x1 , x2 , . . .) be an ( a, b)-
recurrent sequence. Prove that
 
xn+1 xn−1 − xn2 = (−b)n−1 x2 x0 − x12 (186)

for any positive integer n.


Solution to Exercise 4.9.2. Let us prove (186) by induction on n:
Induction base: We have
 
2 2 1−1 2
x1+1 x1−1 − x1 = x2 x0 − x1 = (−b) x2 x0 − x1
|{z} |{z} |{z}
= x2 = x0 = x12

December 25, 2021


Math 235 notes page 181

(since (−b)1−1 x2 x0 − x12 = x2 x0 − x12 ). In other words, (186) holds for n = 0.



| {z }
=(−b)0 =1
Induction step: Let m be a positive integer. Assume (as the induction hypothesis)
that (186) holds for n = m. We must prove that (186) holds for n = m + 1.
The sequence ( x0 , x1 , x2 , . . .) is ( a, b)-recurrent. In other words, every n ≥ 2
satisfies xn = axn−1 + bxn−2 (by the definition of “( a, b)-recurrent”). Applying this
equality to n = m + 2, we obtain

xm+2 = ax(m+2)−1 + bx(m+2)−2 = axm+1 + bxm .

Also, applying the same equality xn = axn−1 + bxn−2 to n = m + 1, we obtain

xm+1 = ax(m+1)−1 + bx(m+1)−2 = axm + bxm−1 . (187)

We have assumed that (186) holds for n = m. In other words, we have


 
2
x m +1 x m −1 − x m = (−b)m−1 x2 x0 − x12 . (188)

Now,
2
x(m+1)+1 x(m+1)−1 − xm +1
2 2
= x +2 xm − xm +1 = ( axm+1 + bxm ) xm − xm+1
|m
{z }
= axm+1 +bxm
2 2 2
= axm+1 xm + bxm − xm +1 = bxm − xm+1 ( x − ax )
| m+1{z m}
=bxm−1
(by (187))
   
2 2 2
= bxm − xm+1 · bxm−1 = b xm − xm+1 xm−1 = (−b) xm+1 xm−1 − xm
| {z }
=(−b)m−1 ( x2 x0 − x12 )
(by (188))
   
m −1 (m+1)−1
= (−b) (−b) x2 x0 − x12 = (−b) x2 x0 − x12 .
| {z }
=(−b)m =(−b)(m+1)−1

In other words, (186) holds for n = m + 1. This completes the induction step. Thus,
Exercise 4.9.2 is solved by induction.
Alternatively, Exercise 4.9.2 can be solved in a straightforward way using Theo-
rem 4.9.11, provided that one is willing to get one’s hands dirty with the necessary
computations.
Next, let us generalize the addition formula for Fibonacci numbers (Exercise
2.2.3) to ( a, b)-recurrent sequences:

December 25, 2021


Math 235 notes page 182

Exercise 4.9.3. Let a and b be two numbers. Let ( x0 , x1 , x2 , . . .) and (y0 , y1 , y2 , . . .)


be two ( a, b)-recurrent sequences such that x0 = 0 and x1 = 1. Prove that

yn+m+1 = bxn ym + xn+1 ym+1

for any nonnegative integers n and m.

Note that Exercise 2.2.3 is the particular case of Exercise 4.9.3 for a = 1 and b = 1
and xi = f i and yi = f i . Indeed, the Fibonacci sequence satisfies f 0 = 0 and f 1 = 1,
so Exercise 4.9.3 can be applied to it.
Once you start generalizing, it is hard to stop. Thus, rather than solving Exercise
4.9.3 directly, let us generalize it even further (dropping the requirements x0 = 0
and x1 = 1) and solve the generalization instead:

Exercise 4.9.4. Let a and b be two numbers. Let ( x0 , x1 , x2 , . . .) and (y0 , y1 , y2 , . . .)


be two ( a, b)-recurrent sequences. Prove that

bx0 yn+m + x1 yn+m+1 = bxn ym + xn+1 ym+1 (189)

for any nonnegative integers n and m.

Solution to Exercise 4.9.4. Rather than try to adapt our above solution to Exercise
2.2.3 to our now-increased generality, we start from scratch and prove Exercise 4.9.4
by induction. (In this we follow [Grinbe15, Theorem 2.26], which is a particular case
of Exercise 4.9.4.)
Our goal is to prove that (189) holds for all nonnegative integers n and m.
We proceed by induction on n (without fixing m):
Induction base: For any nonnegative integer m, we have

bx0 y0+m + x1 y0+m+1 = bx0 ym + x0+1 ym+1 .


| {z } |{z} | {z }
=ym = x 0+1 = y m +1

In other words, (189) holds for n = 0 (and every nonnegative integer m).
Induction step: Let k ∈ N. Assume (as the induction hypothesis) that (189) holds
for n = k. We must now prove that (189) holds for n = k + 1.
We have assumed that (189) holds for n = k. In other words, we have

bx0 yk+m + x1 yk+m+1 = bxk ym + xk+1 ym+1 (190)

for every nonnegative integer m.


Let m be a nonnegative integer.
The sequence ( x0 , x1 , x2 , . . .) is ( a, b)-recurrent. In other words, every n ≥ 2
satisfies xn = axn−1 + bxn−2 (by the definition of “( a, b)-recurrent”). Applying this
equality to n = k + 2, we obtain

xk+2 = ax(k+2)−1 + bx(k+2)−2 = axk+1 + bxk . (191)

December 25, 2021


Math 235 notes page 183

The sequence (y0 , y1 , y2 , . . .) is ( a, b)-recurrent. In other words, every n ≥ 2


satisfies yn = ayn−1 + byn−2 (by the definition of “( a, b)-recurrent”). Applying this
equality to n = m + 2, we obtain
ym+2 = ay(m+2)−1 + by(m+2)−2 = aym+1 + bym . (192)
Now,
bxk+1 ym + x(k+1)+1 ym+1 = bxk+1 ym + ( axk+1 + bxk ) ym+1
| {z }
= x k +2
= axk+1 +bxk
(by (191))
= bxk+1 ym + axk+1 ym+1 + bxk ym+1
= bxk ym+1 + xk+1 ( aym+1 + bym )
| {z }
= y m +2
(by (192))
= bxk ym+1 + xk+1 ym+2 = bxk ym+1 + xk+1 y(m+1)+1 .
| {z }
=y(m+1)+1

On the other hand, applying (190) to m + 1 instead of m, we obtain


bx0 yk+(m+1) + x1 yk+(m+1)+1 = bxk ym+1 + xk+1 y(m+1)+1 .
Comparing these two equalities yields
bxk+1 ym + x(k+1)+1 ym+1 = bx0 yk+(m+1) + x1 yk+(m+1)+1 = bx0 y(k+1)+m + x1 y(k+1)+m+1
(since k + (m + 1) = (k + 1) + m). In other words,
bx0 y(k+1)+m + x1 y(k+1)+m+1 = bxk+1 ym + x(k+1)+1 ym+1 .
Forget that we fixed m. We thus have proved that
bx0 y(k+1)+m + x1 y(k+1)+m+1 = bxk+1 ym + x(k+1)+1 ym+1
for every nonnegative integer m. In other words, (189) holds for n = k + 1. This
completes the induction step. Thus, (189) is proved, so that Exercise 4.9.4 is solved.

Again, an alternative solution could have been given using Theorem 4.9.11.
As we said, Exercise 4.9.4 is a generalization of Exercise 4.9.3; thus, having solved
the former, we can now quickly obtain the latter.
Solution to Exercise 4.9.3. Let n and m be two nonnegative integers. Then, Exercise
4.9.4 yields
bx0 yn+m + x1 yn+m+1 = bxn ym + xn+1 ym+1 .
Comparing this with
b x0 yn+m + x1 yn+m+1 = b · 0yn+m +yn+m+1 = yn+m+1 ,
|{z} |{z} | {z }
=0 =1 =0
we obtain yn+m+1 = bxn ym + xn+1 ym+1 . This solves Exercise 4.9.3.

December 25, 2021


Math 235 notes page 184

Here is a generalization of Proposition 4.3.20 to ( a, b)-recurrent sequences:

Proposition 4.9.18. Let a and b be two numbers such that a 6= 0. Let


( x0 , x1 , x2 , . . .) be an ( a, b)-recurrent sequence with x0 = 0 and x1 = 1. Let
n ∈ {−1, 0, 1, . . .}. Then,
n 
n − k n−2k k

x n +1 = ∑ a b . (193)
k =0
k

Note that the “a 6= 0” condition in Proposition 4.9.18 is needed only to ensure


that the an−2k term does not become undefined when n − 2k is negative. In truth,
 which n − 2k is negative are irrel-
the addends on the right hand side of(193) in
n−k
evant, since the binomial coefficients in them vanish anyway; thus, we
k
could just as well change the upper limit of the sum from n to bn/2c and stop
worrying about what happens if a = 0. However, letting the sum range from 0 to
n makes for a slightly simpler formula and a simpler proof.
Proof of Proposition 4.9.18. We proceed by strong induction on n:
Induction step: Let m ∈ {−1, 0, 1, . . .}. Assume (as the induction hypothesis) that
Proposition 4.9.18 holds for n < m. We must prove that Proposition 4.9.18 holds
for n = m. In other words, we must prove that
m 
m − k m−2k k

x m +1 = ∑ a b . (194)
k =0
k

If m < 1, then this is easy to do directly98 . Thus, for the rest of this proof, we
WLOG assume that m ≥ 1. Hence, the numbers m − 1 and m − 2 both belong to
98 Proof.Assume that m < 1. We must prove that (194) holds.
We have m < 1. Thus, either m = −1 or m = 0 (since m ∈ {−1, 0, 1, . . .}). In other words, we
are in one of the following two cases:
Case 1: We have m = −1.
Case 2: We have m = 0.
Let us first consider Case 1. In this case, we have m = −1. Hence, m + 1 = 0, so that

xm+1 = x0 = 0.

Comparing this with


m  −1 
m − k m−2k k m − k m−2k k
 
∑ k
a b = ∑ k
a b (since m = −1)
k =0 k =0
= (empty sum) = 0,
m − k m−2k k
 
m
we obtain xm+1 = ∑ a b . Hence, we have shown that (194) holds in Case 1.
k =0 k
Let us now consider Case 2. In this case, we have m = 0. Hence, m + 1 = 1, so that

xm+1 = x1 = 1.

December 25, 2021


Math 235 notes page 185

{−1, 0, 1, . . .}. Also, m − 1 ≥ 0 (since m ≥ 1). Furthermore,


  m ≥ 1 > 0; therefore,
0
Proposition 4.3.4 (applied to n = 0 and k = m) yields = 0. (We’ll need this
m
later.)
We have assumed that Proposition 4.9.18 holds for n < m. Hence, Proposition
4.9.18 holds for n = m − 1 (since m − 1 ∈ {−1, 0, 1, . . .} and m − 1 < m). In other
words, we have
m −1 
m − 1 − k m−1−2k k

x(m−1)+1 = ∑ a b .
k =0
k
In view of (m − 1) + 1 = m, this rewrites as
m −1 
m − 1 − k m−1−2k k

xm = ∑ k
a b . (195)
k =0

We have assumed that Proposition 4.9.18 holds for n < m. Hence, Proposition
4.9.18 holds for n = m − 2 (since m − 2 ∈ {−1, 0, 1, . . .} and m − 2 < m). In other
words, we have
m −2 
m − 2 − k m−2−2k k

x(m−2)+1 = ∑ a b .
k =0
k
In view of (m − 2) + 1 = m − 1, this rewrites as
m −2 
m − 2 − k m−2−2k k

x m −1 = ∑ k
a b . (196)
k =0

The sequence ( x0 , x1 , x2 , . . .) is ( a, b)-recurrent. In other words, every n ≥ 2


satisfies xn = axn−1 + bxn−2 (by the definition of “( a, b)-recurrent”). Applying this
equality to n = m + 1, we obtain xm+1 = ax(m+1)−1 + bx(m+1)−2 = axm + bxm−1 .

Comparing this with

m 0 
m − k m−2k k 0 − k 0−2k k
  
∑ k
a b = ∑
k
a b (since m = 0)
k =0 k =0
0 − 0 0−2·0 0
 
= b = 1,
|a {z } |{z}
0
| {z } = a0 =1 =1
=1

m − k m−2k k
 
m
we obtain xm+1 = ∑ a b . Hence, we have shown that (194) holds in Case 2.
k =0 k
We have now shown that (194) holds in each of the two Cases 1 and 2. Thus, (194) always
holds (under our assumption that m < 1). Qed.

December 25, 2021


Math 235 notes page 186

Now, multiplying both sides of the equality (195) by a, we find


m −1 
m − 1 − k m−1−2k k m−1 m−1−k
  
axm = a ∑ k
a b = ∑
k
m−1−2k
|aa {z } bk
k =0 k =0 | {z } = a(m−1−2k)+1 = am−2k
m−k−1
=
k
(since m−1−k=m−k−1)
m −1 
m − k − 1 m−2k k

= ∑ k
a b . (197)
k =0

Furthermore, multiplying both sides of the equality (196) by b, we find


m −2 
m − 2 − k m−2−2k k m−2 m − 2 − k m−2−2k k
  
bxm−1 = b ∑ k
a b = ∑
k
a bb
k =0 k =0
m −1
m − 2 − ( k − 1)
 
= ∑ k−1 |a
m −2−2( k −1)
{z }
k −1
|bb{z }
k =1 m−2k k
|  {z  } (since m−2=−a2(k−1)=m−2k) =b
m−k−1
=
k−1
(since m−2−(k−1)=m−k−1)
(here, we have substituted k − 1 for k in the sum)
m −1 
m − k − 1 m−2k k

= ∑ a b .
k =1
k−1

Comparing this with


m −1 
m − k − 1 m−2k k

∑ k−1
a b
k =0
m −1 
m−0−1 m − k − 1 m−2k k
  
= a b + ∑
m −2·0 0
a b (since m − 1 ≥ 0)
0−1 k = 1
k−1
| {z }
=0
∈N)
(by (118), since 0−1/
m −1 
m − k − 1 m−2k k m−1 m − k − 1 m−2k k
  
= 0a m −2·0 0
| {z b} + ∑ k−1
a b = ∑
k−1
a b ,
=0 k =1 k =1

we obtain
m −1 
m − k − 1 m−2k k

bxm−1 = ∑ k−1
a b . (198)
k =0

December 25, 2021


Math 235 notes page 187

Now,

xm+1 = axm + bxm−1 = bxm−1 + axm


m −1 
m − k − 1 m−2k k m−1 m − k − 1 m−2k k
  
= ∑ a b + ∑ a b
k =0
k − 1 k =0
k
(by adding the equalities (198) and (197))
m−1 
m − k − 1 m−2k k m − k − 1 m−2k k
   
= ∑ a b + a b
k =0
k−1 k
m−1 
m−k−1 m−k−1
  
= ∑ + am−2k bk . (199)
k =0
k − 1 k

Comparing this with


m
m − k m−2k k m−1 m−k m − m m−2m m
     
∑ k
a b = ∑
k
a m−2k k
b +
m
a b
k =0 k =0 | {z  } |  {z }
m−k−1 m−k−1
 
0
= + = =0
k−1 k m
(by Theorem 4.3.7, applied to n=m−k)
m−1 
m−k−1 m−k−1
  
= ∑ + am−2k bk + 0a m−2m m
| {z b }
k =0
k − 1 k
=0
m−1 
m−k−1 m−k−1
  
= ∑ + am−2k bk ,
k =0
k − 1 k

we obtain
m
m − k m−2k k
 
x m +1 = ∑ k
a b .
k =0
In other words, Proposition 4.9.18 holds for n = m. This completes the induction
step. Thus, Proposition 4.9.18 is proved.
Proposition 4.9.18 is, in a way, an explicit formula for any entry of an ( a, b)-
recurrent sequence that begins with 0 and 1. Unlike the formulas in Theorem
4.9.11, it involves no irrational numbers; however, it involves a finite sum and
binomial coefficients. Its other disadvantage is that it only applies to a very specific
( a, b)-recurrent sequence (namely, the one starting with 0 and 1) rather than to
any arbitrary ( a, b)-recurrent sequence. This disadvantage, however, can easily be
amended: In fact, every ( a, b)-recurrent sequence can be expressed through the
very specific one that starts with 0 and 1. Namely, we have the following:

Proposition 4.9.19. Let a and b be two numbers. Let ( x0 , x1 , x2 , . . .) be an ( a, b)-


recurrent sequence with x0 = 0 and x1 = 1. Let (y0 , y1 , y2 , . . .) be an arbitrary
( a, b)-recurrent sequence. Then, yn+1 = by0 xn + y1 xn+1 for each n ∈ N.

December 25, 2021


Math 235 notes page 188

Proof of Proposition 4.9.19. Exercise 4.9.4 (applied to m = 0) yields


bx0 yn+0 + x1 yn+0+1 = bxn y0 + xn+1 y0+1 = bxn y0 + xn+1 y1 = by0 xn + y1 xn+1 .
|{z}
= y1

In view of
b x0 yn+0 + x1 yn+0+1 = b0yn+0 +yn+1 = yn+1 ,
|{z} |{z} | {z } | {z }
=0 =1 = y n +1 =0
this rewrites as yn+1 = by0 xn + y1 xn+1 . This proves Proposition 4.9.19.
Proposition 4.3.20 is a particular case of Proposition 4.9.18:
Proof of Proposition 4.3.20. We have n ∈ N ⊆ {−1, 0, 1, . . .} and 1 6= 0. The Fi-
bonacci sequence ( f 0 , f 1 , f 2 , . . .) is (1, 1)-recurrent (as we have already seen) and
satisfies f 0 = 0 and f 1 = 1. Hence, Proposition 4.9.18 (applied to a = 1, b = 1 and
xi = f i ) yields
n 
n − k n−2k k

f n +1 = ∑ 1| {z } |{z}1
k =0
k
=1 =1
n 
n−k n−0 n−1 n−2 n−n
        
= ∑ = + + +···+ .
k =0
k 0 1 2 n
This proves Proposition 4.3.20.
Another particular case of Proposition 4.9.18 is [Grinbe15, Exercise 4.4].
Yet another particular case of Proposition 4.9.18 is the following corollary, whose
connection to ( a, b)-recurrent sequences is not immediately visible:
Corollary 4.9.20. Let n ∈ {−1, 0, 1, . . .}. Then,
n
k n−k
 
n + 1 = ∑ (−1) 2n−2k .
k =0
k

Proof of Corollary 4.9.20. We have 2 6= 0. The sequence (0, 1, 2, 3, . . .) is (2, −1)-


recurrent99 and starts with the entries 0 = 0 and 1 = 1. Hence, Proposition 4.9.18
(applied to a = 2, b = −1 and xi = i) yields
n  n
n − k n−2k k n−k
  
n+1 = ∑ 2 (−1) = ∑ (−1)
k
2n−2k .
k =0 |
k k
 {z  } k =0
n − k n−2k
=(−1)k 2
k
This proves Corollary 4.9.20.
99 Indeed, this follows from the fact that this sequence is an arithmetic progression, but (as we saw
in Example 4.9.4) every arithmetic progression is (2, −1)-recurrent. Alternatively, you can check
it directly: Each integer n ≥ 2 satisfies n = 2 (n − 1) + (−1) (n − 2); but this is saying precisely
that the sequence (0, 1, 2, 3, . . .) is (2, −1)-recurrent (by the definition of “(2, −1)-recurrent”).

December 25, 2021


Math 235 notes page 189

4.9.4. Two-term recurrences: the matrix approach


For now, we have been approaching ( a, b)-recurrent sequences in an “entry-by-
entry” way. However, there are some more conceptual approaches. The simplest
one is the matrix approach. In essence, it says that instead of considering single
entries xi of an ( a, b)-recurrent sequence ( x0 , x1 , x2 , . . .), it is better to consider pairs
( xi , xi+1 ) of two consecutive
  entries. Better yet, we can encode these pairs ( xi , xi+1 )
xi
as column vectors . Here is what we gain when doing this:
x i +1

 4.9.21. Let a and b be any two numbers. Let A be the 2 × 2-matrix


Proposition

0 1
.
b a
Let ( x0 , x1 , x2 , . . .) be an ( a, b)-recurrent
 sequence of numbers. For each i ∈ N,

xi
define a column vector vi by vi = . Then:
x i +1
(a) We have Avi = vi+1 for each i ∈ N.
(b) We have An vi = vi+n for each i ∈ N and n ∈ N.

Proposition 4.9.21 shows what is so nice about the vectors vi as opposed to the
single entries xi : We cannot compute an entry xi+1 from knowing xi alone (we
need xi−1 as well), but we can compute a vector vi+1 from knowing vi alone (by
Proposition 4.9.21 (a)). Furthermore, Proposition 4.9.21 (b) (applied to i = 0) says
that An v0 = vn for each n ∈ N; this lets us quickly compute vn (and thus xn ) if we
can quickly compute An . Fortunately, powers of matrices can be computed quickly
(exponentiation by squaring does the trick). This yields one of the quickest ways
to exactly compute any entry of an ( a, b)-recurrent sequence.100
The proof of Proposition 4.9.21 is rather easy:
 
xi
Proof of Proposition 4.9.21. (a) Let i ∈ N. The definition of vi yields vi = .
x i +1
 
x i +1
The definition of vi+1 yields vi+1 = .
x i +2
The sequence ( x0 , x1 , x2 , . . .) is ( a, b)-recurrent. In other words, every n ≥ 2
satisfies xn = axn−1 + bxn−2 (by the definition of “( a, b)-recurrent”). Applying this
 to n= i + 2, we obtain xi+2 = axi+1 + bxi = bxi + axi+1 . Now, recall
equality  that

0 1 xi
A= (by the definition of A). Multiplying this equality by vi = ,
b a x i +1
we find
      
0 1 xi 0xi + 1xi+1 x i +1
Avi = = =
b a x i +1 bxi + axi+1 bxi + axi+1

100 Thisphenomenon, where it is easier to work with a “bundle” of several entries of a sequence
(or values of a function) instead of a single entry (or value), is omnipresent in mathematics and
computer science.

December 25, 2021


Math 235 notes page 190

(since 0xi + 1xi+1 = xi+1 ). Comparing this with


   
x i +1 x i +1
v i +1 = = (since xi+2 = bxi + axi+1 ) ,
x i +2 bxi + axi+1

we obtain Avi = vi+1 . This proves Proposition 4.9.21 (a).


(b) Fix i ∈ N. We must show that

A n vi = vi +n (200)

for each n ∈ N. We show this by induction on n:


Induction base: We use the notation I2 for the 2 × 2 identity matrix. Then, A0 = I2 .
A0 vi = I2 vi = vi = vi+0 (since i = i + 0). In other words, our claim (200)
Thus, |{z}
= I2
holds for n = 0.
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that (200) holds
for n = m. We must prove that (200) holds for n = m + 1. In other words, we must
prove that Am+1 vi = vi+m+1 .
We have assumed that (200) holds for n = m. In other words, Am vi = vi+m . Now,
m +1 m
|A{z } vi = A |A{zv}i = Avi+m = vi+m+1
= AAm = vi +m

(by Proposition 4.9.21 (a), applied to i + m instead of i). In other words, (200) holds
for n = m + 1. This completes the induction step. Thus, (200) is proved. In other
words, Proposition 4.9.21 (b) is proved.
As an illustration of how useful Proposition 4.9.21 is, let us use it to solve Exercise
4.9.2 again:
Second solution to Exercise 4.9.2 (sketched). If u and v are two column vectors of size
2, then (u | v) shall denote the 2 × 2-matrix whose columns are u and v (from left
to right). It is well-known (see, e.g., [Heffer20, Chapter Three, Section IV, Lemma
3.7]) that any 2 × 2-matrix B and any two column vectors u and v of size 2 satisfy

B (u | v) = ( Bu | Bv) . (201)

For each i ∈ N, let Vi be the 2 × 2-matrix (vi | vi+1 ). Thus, explicitly,


 
x i x i +1
Vi = (202)
x i +1 x i +2
   
xi x i +1
(since the definitions of vi and vi+1 yield vi = and vi+1 = ).
x i +1 x i +2
Therefore, the determinant of Vi is
 
x i x i +1
det (Vi ) = det = xi xi+2 − xi2+1 (203)
x i +1 x i +2

December 25, 2021


Math 235 notes page 191

for each i ∈ N.
It is well-known (see, e.g., [Grinbe15, Theorem 6.23]) that any n ∈ N and any
two n × n-matrices A and B satisfy
det ( AB) = det A · det B. (204)
(In the current solution, we shall only use this equality in the case n = 2; in this
case it can be proved by straightforward computation.)
An easy consequence of (204) is the following formula (see, e.g., [Grinbe15,
Corollary 6.25 (b)]): If n ∈ N, and if B is an n × n-matrix, then
 
det Bk = (det B)k (205)

for any k ∈ N. (This follows by induction on k.)


 Now, let n be a positive integer. Thus, n − 1 ∈ N. Let A be the 2 × 2-matrix
0 1
. Then, Proposition 4.9.21 (b) (applied to n − 1 and 0 instead of n and i)
b a
yields An−1 v0 = v0+n−1 = vn−1 . Also, Proposition 4.9.21 (b) (applied to n − 1 and
1 instead of n and i) yields An−1 v1 = v1+n−1 = vn . But the definition of V0 yields
V0 = (v0 | v1 ). Hence,
 
An−1 V0 = An−1 (v0 | v1 ) = An−1 v0 | An−1 v1
|{z}
=(v0 |v1 )
 
by (201), applied to B = An−1 , u = v0 and v = v1
 
n −1 n −1
= ( v n −1 | v n ) since A v0 = vn−1 and A v1 = v n
= Vn−1 (since Vn−1 was defined as (vn−1 | vn )) .
Hence,  
n −1
det A V0 = det (Vn−1 ) = xn−1 xn+1 − xn2
(by (203), applied to i = n − 1). Therefore,
xn−1 xn+1 − xn2
   
= det An−1 V0 = det An−1 det (V0 )
| {z } | {z }
= x0 x2 − x12
=(det A)n−1
(by (203), applied to i =0)
(by (205), applied to n=2, B= A and k=n−1)
 
by (204), applied to 2, An−1 and V0 instead of n, A and B
 
n −1 2
= (det A) · x0 x2 − x1 . (206)
   
0 1 0 1
But A = and thus det A = det = 0a − 1b = −b. Hence, (206)
b a b a
rewrites as xn−1 xn+1 − xn2 = (−b)n−1 · x0 x2 − x12 . In other words, xn+1 xn−1 − xn2 =


(−b)n−1 x2 x0 − x12 . This solves Exercise 4.9.2 again.




December 25, 2021


Math 235 notes page 192

Another application of Proposition 4.9.21 is a second proof of Theorem 4.9.11


(recall that the first proof was sketched in our discussion of Exercise 4.9.1):
 
0 1
Second proof of Theorem 4.9.11 (sketched). Let A be the 2 × 2-matrix . Propo-
b a
sition 4.9.21 (b) (applied to i = 0) yields that each n ∈ N satisfies
 
n xn
A v 0 = v 0+ n = v n = (207)
x n +1

(by the definition of vn ). We thus obtain an explicit formula for vn if we have an


explicit formula for An .
How can we find an explicit formula for An ? In linear algebra, the powers of
a matrix are easiest to compute by diagonalizing the matrix. Indeed, if we can
diagonalize the matrix A as A = TDT −1 (with T invertible and D diagonal), then

An = TD n T −1 for every n ∈ N. (208)

(If you don’t know this, you can easily prove it by induction on n.) For a diagonal
matrix D, computing its powers D n is a trivial task (it suffices to take each diagonal
entry of D to the n-th power). Thus, in order to compute An , it will suffice to
diagonalize A.
Not every square matrix can be diagonalized; however, over the complex num-
bers, “most” matrices can be101 . Diagonalizing a matrix is particularly easy for
a 2 × 2-matrix like A, since it only requires solving a quadratic (as opposed to a
higher-degree) equation. Let me omit the details and merely state the result:

• If a2 + 4b 6= 0, then A can be diagonalized as A = TDT −1 , where we define


two complex numbers λ and µ as in (184) and set
   
λ 0 1 1
D = diag (λ, µ) = and T= .
0 µ λ µ

(The appearance of the numbers λ and µ should not be surprising: They are
the two eigenvalues of A.)

• If a2 + 4b = 0, then A cannot be diagonalized.

Let us first draw some conclusions in the case a2 + 4b 6= 0, and then discuss what
can be done in the case a2 + 4b = 0.
Assume that a2 + 4b 6= 0. Then, we have just found a way to diagonalize A.
Namely, we have defined two complex numbers λ and µ as in (184), and we have
set    
λ 0 1 1
D = diag (λ, µ) = and T= .
0 µ λ µ
101 Theword “most” here can be interpreted in many ways, most of which are correct :)
We will soon see what it means in our specific case.

December 25, 2021


Math 235 notes page 193

Then, A = TDT −1 . Thus, for each n ∈ N, we have


An = TD n T −1 (by (208))
  n   −1     
1 1 λ 0 1 1 1 1 λ 0
= since T = and D =
λ µ 0 µ λ µ λ µ 0 µ
  n   −1   n  n 
1 1 λ 0 1 1 λ 0 λ 0
= since =
λ µ 0 µn λ µ 0 µ 0 µn
 
λµn − λn µ λn − µn
 λ−µ λ−µ 
=
 
n
λ −µ n n
λλ − µµ  n 
−λµ

λ−µ λ−µ

(by straightforward matrix computations). Hence,


 
λµn − λn µ λn − µn
λ−µ λ−µ  
 x0

n
A v0 = 

λn − µn λλn − µµn  x1

−λµ

λ−µ λ−µ
λµn − λn µ λn − µn
 
x0 + x1 
= λ−µ λ−µ . (209)

Here, the asterisk ∗ in the bottom row means “we don’t care what the value here
is” (we will see why in a moment). Comparing this with (207), we obtain
λµn − λn µ λn − µn
 
 
xn x0 + x1 
= λ−µ λ−µ .
x n +1

Comparing the top entries of the vectors on both sides of this equality, we find
λµn − λn µ λn − µn x − µx0 n λx0 − x1 n
xn = x0 + x1 = 1 λ + µ = γλn + δµn ,
λ−µ λ−µ λ−µ λ−µ
where γ and δ are as in (185). So we have recovered the formula (183) and thus
reproved Theorem 4.9.11 (a). Note that this approach to finding an explicit formula
for xn was entirely self-motivated (assuming that you know about diagonaliza-
tion of matrices); unlike our first approach above, it did not rely on us reverse-
engineering the Binet formula (which came out of clear skies).
Let us now consider the case when a2 + 4b = 0. In this case, the matrix A cannot
be diagonalized. The closest thing to a diagonalization in such a case is the Jordan
normal form (see, e.g., [Heffer20, Chapter Five, Section IV]). Again omitting the
details, a computation shows that the Jordan normal form of A is

A = T JT −1 ,

December 25, 2021


Math 235 notes page 194

where
a
 
0 1 0
!
T= a and J= 2 a .
 
1 1
2 2
− a2
(The computation is best done by rewriting b as right away, thus getting rid of
4 n
the dependent parameter b.) In order to compute A , we thus need to know how
to compute J n . Fortunately, there is a formula for this:
n 
dn
 
d 0 0
= (210)
u d ndn−1 u dn

for any numbers d and u and any n ∈ N (where we agree to interpret ndn−1 as 0
when n = 0). This formula (210) is a particular case of a general rule for taking
powers of Jordan blocks, but it also can easily be proved directly102 . Now, from
A = T JT −1 , we obtain

A n = T J n T −1 (by (208), applied to J instead of D )

for each n ∈ N. Recalling how T and J were defined, and using (210) to compute
J n , we thus get an explicit expression for An , which we can then turn into an explicit
expression for xn in the same way as we did in the case a2 + 4b 6= 0 above. Thus
we recover Theorem 4.9.11 (b).

4.9.5. Recitation #4: Two-term recurrences


Here are two more exercises on ( a, b)-recurrent sequences:

Exercise 4.9.5. Define a sequence ( a0 , a1 , a2 , . . .) of integers recursively by setting


a0 = 2 and a1 = 1 and an = an−1 + 2an−2 for each n ≥ 2.
Find an explicit formula for an .

Discussion of Exercise 4.9.5. The most systematic approach to this is by using Theo-
rem 4.9.11. Indeed, the sequence ( a0 , a1 , a2 , . . .) is (1, 2)-recurrent (due to the equal-
ity an = an−1 + 2an−2 that holds for each n ≥ 2). Since 12 + 4 · 2 = 9 6= 0, we can
thus apply Theorem 4.9.11 (a) to a = 1 and b = 2 and xi = ai . We thus conclude
that every n ∈ N satisfies
an = γλn + δµn , (211)
where we set
√ √
1+ 12 + 4 · 1 1− 12 + 4 · 1
λ= and µ= (212)
2 2

102 With our induction experience, we can prove it in our sleep.

December 25, 2021


Math 235 notes page 195

and
a1 − µa0 λa0 − a1
γ= and δ= . (213)
λ−µ λ−µ
The equalities (212) yield
√ √
1 + 12 + 4 · 1 1+ 9 1+3
λ= = = =2 and
√2 2√ 2
2
1− 1 +4·1 1− 9 1−3
µ= = = = −1.
2 2 2
Hence, (213) yields
a1 − µa0 1 − (−1) · 2
γ= = (since λ = 2 and µ = −1 and a0 = 2 and a1 = 1)
λ−µ 2 − (−1)
=1
and (by a similar computation) δ = 1. Thus, (211) shows that every n ∈ N satisfies
δ µn = λn + µn = 2n + (−1)n
an = γ λn + |{z}
|{z}
=1 =1

(since λ = 2 and µ = −1). This solves Exercise 4.9.5.


Here are two alternative ways to get the formula an = 2n + (−1)n :
• One can simply compute the first few entries of the sequence ( a0 , a1 , a2 , . . .)
and observe that they each differ by 1 from the respective powers of 2. The
formula an = 2n + (−1)n is then easily guessed and just as easily proved (by
strong induction on n).
• Here is a more sophisticated approach: Rewrite the recursive relation an =
an−1 + 2an−2 as an + an−1 = 2 ( an−1 + an−2 ) (indeed, adding an−1 to both sides
of an = an−1 + 2an−2 yields an + an−1 = 2an−1 + 2an−2 = 2 ( an−1 + an−2 )). We
can rewrite the latter equation as bn−1 = 2bn−2 , where we define an auxiliary
sequence (b0 , b1 , b2 , . . .) by bm := am + am+1 . So we have bn−1 = 2bn−2 for
each n ≥ 2; equivalently, bm = 2bm−1 for each m ≥ 1. In other words, each
entry of the sequence (b0 , b1 , b2 , . . .) equals twice the preceding entry. In other
words, the sequence (b0 , b1 , b2 , . . .) is a geometric progression with ratio 2.
Thus, bm = 2m b0 for each m ∈ N. In view of b0 = a0 + a1 = 2 + 1 = 3,
|{z} |{z}
=2 =1
this rewrites as bm = 2m · 3 for each m ∈ N.
Now, how do we recover the an from the bm ? Experiments with small entries
suggest (and a simple argument using the telescope principle proves) that
an = bn−1 − bn−2 + bn−3 − bn−4 ± · · · ± b0 ± (− a0 ) .
(The last two ± signs are + signs if n is odd, and − signs if n is even.) Plug-
ging our formula bm = 2m · 3 into this equality, and summing the resulting
geometric sum, we eventually obtain an = 2n + (−1)n .

December 25, 2021


Math 235 notes page 196


1+ 5
Exercise 4.9.6. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Let ϕ = .
  2
1 1
(a) Prove that f n = √ ϕn + for each n ∈ N.
5 2
(b) Prove that ϕn = f n−1 + f n ϕ for each positive integer n.

Discussion
  of Exercise 4.9.6. (a) First, we observe that if u is a real number, then
1
u+ is the result of “rounding” u to the nearest integer (where a possible tie is
2
resolved in favor of the larger integer103 ). Thus, we have the following:

1 1
Claim 1: Let u ∈ R. Let v ∈ Z be such that v − ≤ u < v + . Then,
  2 2
1
u+ = v.
2

[Proof of Claim 1: For the sake of completeness, let us give a formal proof of this. Let
1 1 1 1
x = u + . Adding to all sides of the inequality chain v − ≤ u < v + , we obtain v ≤
2 2 2 2
1 1 1 1 1 1
u + < v + + . In other words, v ≤ x < v + 1 (since u + = x and v + + = v + 1).
2 2 2 2 2 2
Thus, the integer v is ≤ x (since v ≤ x), but the next integer v + 1 is no longer ≤ x (since
x < v + 1). Hence, the largest integer that is ≤ x is v. In other words, b x c is v (since b x c
was
 defined
 as the largest integer that is ≤ x). In other words, b x c = v. This rewrites as
1 1
u+ = v (since x = u + ). This proves Claim 1.]
2 2

1− 5
Now, let us apply this. Set ψ = . Then, ψ ≈ −0.618, so that |ψ| ≤ 1.
2
1 1
Let n ∈ N. Then, Theorem 2.3.1 yields f n = √ ϕn − √ ψn , so that
5 5
1 1
√ ϕn = f n + √ ψn . (214)
5 5
1 1 1 1
However, |ψn | = |ψ|n ≤ 1 (since |ψ| ≤ 1), so that √ ψn = √ |ψn | ≤ √ < . In
5 5 |{z} 5 2
 ≤1

1 1 1
other words, the number √ ψn lies in the open interval − , ; in other words,
5 2 2

103 For 1
example, = 0.5 is rounded to 1, not to 0.
2

December 25, 2021


Math 235 notes page 197

1 1 1
− < √ ψn < . Hence, (214) entails
2 5 2
1 1 1
√ ϕn = f n + √ ψn < f n +
5 5 2
| {z }
1
<
2
and  
1 n 1 n 1 1
√ ϕ = fn + √ ψ > fn + − = fn − .
5 5 2 2
| {z }
1
>−
2
1 1 1
Combining the latter two inequalities, we find f n − < √ ϕn < f n + . Hence,
2  5  2
1 n 1 n 1
Claim 1 (applied to u = √ ϕ and v = f n ) yields that √ ϕ + = f n (since
5 5 2
f n ∈ Z). This solves Exercise 4.9.6 (a).
(b) We apply induction on n:
Induction base: We have ϕ1 = f 0 + f 1 ϕ (since f 0 + f 1 ϕ = 0 + 1ϕ = ϕ = ϕ1 ).
|{z} |{z}
=0 =1
In other words, Exercise 4.9.6 (b) holds for n = 1.
Induction step: Let m be a positive integer. Assume (as the induction hypothesis)
that Exercise 4.9.6 (b) holds for n = m. We must prove that Exercise 4.9.6 (b) holds
for n = m + 1. In other words, we must prove that ϕm+1 = f m + f m+1 ϕ.
We have ϕ2 = ϕ + 1. (This is easily seen by calculation using the definition of ϕ.)
Also, the recursive definition of the Fibonacci sequence yields f m+1 = f m + f m−1 =
f m −1 + f m .
Our induction hypothesis says that Exercise 4.9.6 (b) holds for n = m. In other
words, we have ϕm = f m−1 + f m ϕ. Now,
ϕ m +1 = ϕm ϕ = ( f m −1 + f m ϕ ) ϕ = f m −1 ϕ + f m ϕ 2 = f m −1 ϕ + f m ( ϕ + 1 )
|{z} |{z}
= f m −1 + f m ϕ = ϕ +1
= f m−1 ϕ + f m ϕ + f m = ( f m−1 + f m ) ϕ + f m = f m+1 ϕ + f m = f m + f m+1 ϕ.
| {z }
= f m +1

In other words, Exercise 4.9.6 (b) holds for n = m + 1. This completes the induction
step. Thus, Exercise 4.9.6 (b) is solved.

4.9.6. Two-term recurrences: arithmetical properties


Generalizing is a muscle worth training, so let us generalize a few more properties
of Fibonacci numbers to ( a, b)-recurrent sequences. The next exercise generalizes
Exercise 3.2.2 (note that we are using (u, v) instead of ( a, b) in order to avoid as-
signing double duty to the letters a and b):

December 25, 2021


Math 235 notes page 198

Exercise 4.9.7. Let u and v be two integers. Let ( x0 , x1 , x2 , . . .) be an (u, v)-


recurrent sequence of integers with x0 = 0 and x1 = 1.
Show that all a, b ∈ N satisfying a | b satisfy x a | xb .

Solution to Exercise 4.9.7. We essentially repeat our above solution to Exercise 3.2.2,
with the obvious changes made at every step where they are necessary.
Fix a ∈ N. We must prove that for each b ∈ N, the following statement holds:
if a | b, then x a | xb . (215)
We shall prove (215) by strong induction on b:
Induction step: Let k ∈ N. Assume (as the induction hypothesis) that (215) holds
for all b < k. We must prove that (215) holds for b = k. In other words, we must
prove that
if a | k, then x a | xk .
So let us assume that a | k. We must then prove that x a | xk .
If k = 0, then this is clearly true (since we have xk = x0 = 0 in this case, and since
x a | 0 is true104 ). Thus, for the rest of this proof, we WLOG assume that k 6= 0.
Hence, k ≥ 1 (since k ∈ N).
It is fairly easy to see (from a | k and k ≥ 1 and a ∈ N) that a ≥ 1 and k − a ∈ N
and k − a < k and a | k − a 105 . From a ≥ 1, we obtain a − 1 ∈ N.
Our induction hypothesis says that (215) holds for all b < k. In other words,
for each b ∈ N satisfying b < k, the statement (215) holds. We can apply this to
b = k − a (since k − a ∈ N and k − a < k), and thus conclude that the statement
(215) holds for b = k − a. In other words, if a | k − a, then x a | xk−a . Thus, x a | xk−a
(since we know that a | k − a). In other words, xk−a ≡ 0 mod x a . Note also that
x a ≡ 0 mod x a (since every integer n satisfies n ≡ 0 mod n).
But Exercise 4.9.3 (applied to u, v and xi instead of a, b and yi ) shows that
xn+m+1 = vxn xm + xn+1 xm+1
for any nonnegative integers n and m. We can apply this to n = a − 1 and m = k − a
(since a − 1 ∈ N and k − a ∈ N); thus, we obtain
x(a−1)+(k−a)+1 = vx a−1 xk−a + x(a−1)+1 x(k−a)+1 .

In view of ( a − 1) + (k − a) + 1 = k and ( a − 1) + 1 = a, this rewrites as


xk = vx a−1 xk−a + x a x(k−a)+1 .
Hence,
xk = vx a−1 xk− a + x a x(k−a)+1 ≡ vx a−1 · 0 + 0 · x(k−a)+1 = 0 mod x a ,
|{z} |{z}
≡0 mod x a ≡0 mod x a

104 because any integer divides 0


105 These statements can be proved in the same way as they were proved in the respective part of the
solution to Exercise 3.2.2.

December 25, 2021


Math 235 notes page 199

and thus x a | xk . This is precisely what we wanted to show. Thus, we have proved
that (215) holds for b = k. This completes the induction step. Thus, Exercise 4.9.7
is solved.
Exercise 4.9.7 also appears in [Grinbe15, Theorem 2.26 (c)] (with different nota-
tions). Note that the x1 = 1 condition is not actually necessary for the claim to hold
(see Exercise 4.10.2 below); it was merely convenient for our proof. The x0 = 0
condition, on the other hand, is “more or less necessary” (i.e., if x0 6= 0, then the
claim of Exercise 4.9.7 holds only in a few exceptional cases106 ).
Next, let us generalize Exercise 3.5.2:

Exercise 4.9.8. Let u and v be two integers satisfying u ⊥ v. Let ( x0 , x1 , x2 , . . .)


be an (u, v)-recurrent sequence of integers with x1 = 1.
Prove that xn ⊥ xn+1 for each n ∈ N.

Discussion of Exercise 4.9.8. Let us try to imitate the solution to Exercise 3.5.2. Thus,
we use induction on n.
Induction base: Exercise 3.5.1 (a) (applied to a = x0 ) yields 1 ⊥ x0 . According to
Proposition 3.5.4, this entails x0 ⊥ 1. In other words, x0 ⊥ x1 (since x1 = 1). In
other words, Exercise 4.9.8 holds for n = 0.
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that Exercise
4.9.8 holds for n = m. We must prove that Exercise 4.9.8 holds for n = m + 1. In
other words, we must prove that xm+1 ⊥ xm+2 .
Our induction hypothesis says that Exercise 4.9.8 holds for n = m. In other
words, we have xm ⊥ xm+1 . According to Proposition 3.5.4 (applied to a = xm
and b = xm+1 ), this entails xm+1 ⊥ xm . In other words, gcd ( xm+1 , xm ) = 1 (by the
definition of “coprime”). But the sequence ( x0 , x1 , x2 , . . .) is (u, v)-recurrent; thus,
xm+2 = uxm+1 + vxm . Hence,

gcd ( xm+1 , xm+2 ) = gcd ( xm+1 , uxm+1 + vxm ) = gcd ( xm+1 , vxm )
(by Proposition 3.4.4 (c), applied to a = xm+1 and b = vxm ) .

It would be nice if we knew that xm+1 ⊥ vxm , since that would yield gcd ( xm+1 , vxm ) =
1 and we could proceed. Unfortunately, we only know that xm+1 ⊥ xm , which is
weaker. What should we do?
Theorem 3.5.10 suggests a way we could try to prove xm+1 ⊥ vxm . Namely, if
we know that v ⊥ xm+1 and xm ⊥ xm+1 , then an application of Theorem 3.5.10
would yield vxm ⊥ xm+1 , and therefore xm+1 ⊥ vxm (by Proposition 3.5.4). The two
necessary ingredients for this argument to work are v ⊥ xm+1 and xm ⊥ xm+1 . We
already know that xm ⊥ xm+1 , but how do we get v ⊥ xm+1 ?
The way out of this predicament turns out to be a highly important strategy that
can be useful wherever induction is in play. Namely, we insert “v ⊥ xm+1 ” into our
induction hypothesis! This means that, instead of proving the claim “xn ⊥ xn+1 ”,

106 such as when u + v = 1 and x0 = x1 = x2 = x3 = · · ·

December 25, 2021


Math 235 notes page 200

we prove the stronger claim “xn ⊥ xn+1 and v ⊥ xn+1 ”. This may look more
difficult (after all, we now have to prove two statements rather than one), but in
practice it may turn out to be more doable, as the extra strength of our claim makes
the induction hypothesis stronger as well (after all, the induction hypothesis now
also contains two statements rather than one). Thus, in the induction step, we have
both more work and more to work with.
What happens if we insert v ⊥ xn+1 into our claim? In the base case, we just have
to show (additionally) that v ⊥ x1 , which is easy (since x1 = 1). In the induction
step, we have to show (additionally) that v ⊥ xm+2 , but we can use v ⊥ xm+1
(which is now part of the induction hypothesis).
So how do we show that v ⊥ xm+2 in the induction step? We compute

gcd (v, xm+2 ) = gcd (v, xm v + uxm+1 )


(since xm+2 = uxm+1 + vxm = xm v + uxm+1 )
= gcd (v, uxm+1 )
 
by Proposition 3.4.4 (c), applied to v, uxm+1 and xm
instead of a, b and u
= 1,

where the last equality sign follows from noticing that v ⊥ uxm+1 (which, in turn,
follows from v ⊥ u and v ⊥ xm+1 using Theorem 3.5.10). So we get v ⊥ xm+2 , and
we win: Our stronger claim “xn ⊥ xn+1 and v ⊥ xn+1 ” has turned out to be easier
to prove than the original claim “xn ⊥ xn+1 ”.
For the sake of clarity, let me distill the above discussion into a detailed solution
to Exercise 4.9.8:
Solution to Exercise 4.9.8 (final copy). We claim that each n ∈ N satisfies

x n ⊥ x n +1 and v ⊥ x n +1 . (216)

[Proof of (216): We shall prove (216) by induction on n:


Induction base: Exercise 3.5.1 (a) (applied to a = x0 ) yields 1 ⊥ x0 . According to
Proposition 3.5.4 (applied to a = 1 and b = x0 ), this entails x0 ⊥ 1. In other words,
x0 ⊥ x1 (since x1 = 1). The same argument (applied to v instead of x0 ) yields
v ⊥ x1 . We have now shown that x0 ⊥ x1 and v ⊥ x1 . In other words, (216) holds
for n = 0.
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that (216) holds
for n = m. We must prove that (216) holds for n = m + 1. In other words, we must
prove that xm+1 ⊥ xm+2 and v ⊥ xm+2 .
Our induction hypothesis says that (216) holds for n = m. In other words, we
have xm ⊥ xm+1 and v ⊥ xm+1 . Proposition 3.5.4 (applied to a = v and b = xm+1 )
shows that xm+1 ⊥ v (since v ⊥ xm+1 ).
Theorem 3.5.10 (applied to a = v, b = xm and c = xm+1 ) yields vxm ⊥ xm+1
(since v ⊥ xm+1 and xm ⊥ xm+1 ). Hence, xm+1 ⊥ vxm (by Proposition 3.5.4, applied

December 25, 2021


Math 235 notes page 201

to a = vxm and b = xm+1 ). In other words, gcd ( xm+1 , vxm ) = 1 (by the definition
of “coprime”).
But the sequence ( x0 , x1 , x2 , . . .) is (u, v)-recurrent; in other words, every n ≥ 2
satisfies xn = uxn−1 + vxn−2 (by the definition of “(u, v)-recurrent”). Applying this
to n = m + 2, we obtain xm+2 = ux(m+2)−1 + vx(m+2)−2 = uxm+1 + vxm . Hence,

gcd ( xm+1 , xm+2 ) = gcd ( xm+1 , uxm+1 + vxm ) = gcd ( xm+1 , vxm )
(by Proposition 3.4.4 (c), applied to a = xm+1 and b = vxm )
= 1.

In other words, xm+1 ⊥ xm+2 .


Furthermore, we have u ⊥ v and xm+1 ⊥ v. Hence, Theorem 3.5.10 (applied to
a = u, b = xm+1 and c = v) yields uxm+1 ⊥ v. Hence, v ⊥ uxm+1 (by Proposition
3.5.4, applied to a = uxm+1 and b = v). In other words, gcd (v, uxm+1 ) = 1.
Now, xm+2 = uxm+1 + vxm = xm v + uxm+1 , so that

gcd (v, xm+2 ) = gcd (v, xm v + uxm+1 ) = gcd (v, uxm+1 )


 
by Proposition 3.4.4 (c), applied to v, uxm+1 and xm
instead of a, b and u
= 1.

In other words, v ⊥ xm+2 .


Now, we have shown that xm+1 ⊥ xm+2 and v ⊥ xm+2 . In other words, (216)
holds for n = m + 1. This completes the induction step; thus, (216) is proved.]
The claim of Exercise 4.9.8 is part of (216). Thus, Exercise 4.9.8 is solved (since
(216) is proved).
The technique we used to solve Exercise 4.9.8 above is known as strengthening
the induction hypothesis. The underlying phenomenon is that induction proofs often
become simpler (or even doable in the first place) when the claim being proved is
strengthened (by adding additional statements to it, or in another way). For a more
classical example, try proving the inequality

1 1 1
+ + · · · + <2 for all n ∈ N. (217)
12 22 n2
It is unclear how to prove this by induction on n, since the space between the
left and the right hand sides keeps shrinking as n grows. However, the stronger
inequality
1 1 1 1
+ + · · · + ≤ 2 − for all n ∈ N (218)
12 22 n2 n
can easily be proved by induction on n. (This example has been taken from https:
//mathoverflow.net/a/40688 , where other instances of this phenomenon can also
be found.)

December 25, 2021


Math 235 notes page 202

I occasionally think of induction proofs as long travels. If the distance is long


enough, one has to take provisions along, even though they encumber the back-
pack. Extra statements in the claim (like the v ⊥ xn+1 part of (216) in the solution
2
above, or like the in (218)) are like such provisions. The art is to find the “right”
n
provisions, whose usefulness on the journey makes up for their weight. Inciden-
tally, when strengthening the induction hypothesis, we also gain a stronger result
in the end; unlike most kinds of provisions, they don’t get consumed during the
journey.
An astute reader will have noticed that we have already done something similar
in our solution to Exercise 4.6.4: We proved the two equalities (150) and (151)
together, rather than proving each of them separately. Each of them assisted the
other in the induction step. Thus, the best way to prove (150) by induction (actually
the only way I know) is to combine it with the extra claim (151).

4.9.7. Two-term recurrences: odds and ends


Let us give a few more remarks about ( a, b)-recurrent sequences before moving on.

The vector space of ( a, b)-recurrent sequences. First, while we have used matri-
ces to study ( a, b)-recurrent sequences in Subsection 4.9.4, there is yet another way
in which linear algebra shines light on ( a, b)-recurrent sequences. Namely, for any
two fixed numbers a and b, the ( a, b)-recurrent sequences form a 2-dimensional
vector subspace of the vector space of all sequences. More precisely:

Proposition 4.9.22. Let K be one of the fields Q, R and C. Fix two numbers a, b ∈
K. Let Reca,b denote the set of all ( a, b)-recurrent sequences ( x0 , x1 , x2 , . . .) ∈
K∞ . Consider K∞ (that is, the set of all infinite sequences of elements of K)
as an (infinite-dimensional) K-vector space, with addition and scaling defined
entrywise107 . Then, Reca,b is a 2-dimensional vector subspace of K∞ .

Proof of Proposition 4.9.22 (sketched). Since Proposition 4.9.22 is nowhere near essen-
tial to what we are planning to do, we shall be on the terse side. First of all, we
claim that Reca,b is a vector subspace of K∞ . In order to prove this, we need to
show the following three facts:
107 This means that addition is defined by

( x0 , x1 , x2 , . . . ) + ( y0 , y1 , y2 , . . . ) = ( x0 + y0 , x1 + y1 , x2 + y2 , . . . )
for all ( x0 , x1 , x2 , . . .) , (y0 , y1 , y2 , . . .) ∈ K∞ ,

and that scaling is defined by

λ ( x0 , x1 , x2 , . . .) = (λx0 , λx1 , λx2 , . . .) for all ( x0 , x1 , x2 , . . .) ∈ K∞ .

(In other words, sequences are considered as row vectors of infinite size.) The zero vector of this
vector space is the sequence (0, 0, 0, . . .).

December 25, 2021


Math 235 notes page 203

1. We have (0, 0, 0, . . .) ∈ Reca,b .


2. If ( x0 , x1 , x2 , . . .) ∈ Reca,b and (y0 , y1 , y2 , . . .) ∈ Reca,b , then ( x0 , x1 , x2 , . . .) +
(y0 , y1 , y2 , . . .) ∈ Reca,b .
3. If ( x0 , x1 , x2 , . . .) ∈ Reca,b and λ ∈ K, then λ ( x0 , x1 , x2 , . . .) ∈ Reca,b .

All three of these facts are straightforward to verify108 . Thus, we have shown that
Reca,b is a vector subspace of K∞ . It remains to prove that Reca,b is 2-dimensional.
We shall achieve this by constructing a basis (s, t) of Reca,b .
Indeed, we define a sequence s = (s0 , s1 , s2 , . . .) ∈ K∞ recursively by setting
s0 = 0, s1 = 1 and sn = asn−1 + bsn−2 for each n ≥ 2. Thus, the sequence s is
( a, b)-recurrent.
Furthermore, we define a sequence t = (t0 , t1 , t2 , . . .) ∈ K∞ recursively by setting
t0 = 1, t1 = 0 and tn = atn−1 + btn−2 for each n ≥ 2. Thus, the sequence t is
( a, b)-recurrent.
The two sequences s and t are ( a, b)-recurrent, thus belong to Reca,b . Further-
more, any K-linear combination λs + µt (with λ, µ ∈ K) starts with the two entries
λ s0 +µ t0 = λ · 0 + µ · 1 = µ and λ s1 +µ t1 = λ · 1 + µ · 0 = λ, and thus
|{z} |{z} |{z} |{z}
=0 =1 =1 =0
cannot equal the zero sequence (0, 0, 0, . . .) unless both λ and µ are 0. In other
words, the sequences s and t are K-linearly independent.
Moreover, we claim that s and t span Reca,b . Indeed, every sequence x =
( x0 , x1 , x2 , . . .) ∈ Reca,b can be written as a K-linear combination of s and t as
follows:
x = x1 s + x0 t. (219)
[Proof of (219): Let x = ( x0 , x1 , x2 , . . .) ∈ Reca,b . We must prove (219). Since both s
and t belong to Reca,b , the linear combination x1 s + x0 t also belongs to Reca,b (since
Reca,b is a vector subspace of K∞ ). In other words, x1 s + x0 t is an ( a, b)-recurrent
sequence.
108 Justin case, let me show the proof of fact 2:
Let ( x0 , x1 , x2 , . . .) ∈ Reca,b and (y0 , y1 , y2 , . . .) ∈ Reca,b . We must show that ( x0 , x1 , x2 , . . .) +
(y0 , y1 , y2 , . . .) ∈ Reca,b .
We have ( x0 , x1 , x2 , . . .) ∈ Reca,b . In other words, the sequence ( x0 , x1 , x2 , . . .) is ( a, b)-recurrent
(since Reca,b is the set of all ( a, b)-recurrent sequences). In other words, every n ≥ 2 satisfies
xn = axn−1 + bxn−2 . Likewise, every n ≥ 2 satisfies yn = ayn−1 + byn−2 . Hence, every n ≥ 2
satisfies

xn + yn = axn−1 + bxn−2 + ayn−1 + byn−2


|{z} |{z}
= axn−1 +bxn−2 = ayn−1 +byn−2
= a ( x n −1 + y n −1 ) + b ( x n −2 + y n −2 ) .
In other words, the sequence ( x0 + y0 , x1 + y1 , x2 + y2 , . . .) is ( a, b)-recurrent (by the definition
of “( a, b)-recurrent”). In other words, the sequence ( x0 , x1 , x2 , . . .) + (y0 , y1 , y2 , . . .) is ( a, b)-
recurrent (since ( x0 , x1 , x2 , . . .) + (y0 , y1 , y2 , . . .) was defined to be ( x0 + y0 , x1 + y1 , x2 + y2 , . . .)).
In other words, ( x0 , x1 , x2 , . . .) + (y0 , y1 , y2 , . . .) ∈ Reca,b (since Reca,b is the set of all ( a, b)-
recurrent sequences). This proves fact 2. The proofs of facts 1 and 3 are similar.

December 25, 2021


Math 235 notes page 204

Now, recall that an ( a, b)-recurrent sequence is uniquely determined by its first


two entries (since its recursive equation allows all other entries to be computed in
terms of these first two). Hence, if two ( a, b)-recurrent sequences agree in their first
two entries, then these two sequences must be identical. Thus, in order to prove that
x = x1 s + x0 t, it suffices to show that the sequences x and x1 s + x0 t agree in their
first two entries (since both sequences x and x1 s + x0 t are ( a, b)-recurrent). But this
is easy: The 0-th entry of x1 s + x0 t is x1 s0 + x0 t0 = x1 · 0 + x0 · 1 = x0 , which
|{z} |{z}
=0 =1
is precisely the 0-th entry of x. The 1-st entry of x1 s + x0 t is x1 s1 + x0 t1 =
|{z} |{z}
=1 =0
x1 · 1 + x0 · 0 = x1 , which is precisely the 1-st entry of x. Thus, the two sequences
x and x1 s + x0 t agree in their first two entries, and hence are identical (as we just
explained). In other words, x = x1 s + x0 t. This proves (219).]
Now we have shown that the two elements s and t of Reca,b span Reca,b and
are K-linearly independent. In other words, (s, t) is a basis of the K-vector space
Reca,b . Hence, the K-vector space Reca,b has a basis consisting of 2 vectors, and
therefore is 2-dimensional. Proposition 4.9.22 is now proved.

The Chebyshev polynomials. We have so far been studying ( a, b)-recurrent se-


quences of numbers; but we could apply (most of) the same reasoning to ( a, b)-
recurrent sequences of polynomials or other objects that can be added and multi-
plied. (In particular, a and b can themselves be polynomials.) The most important
example of such sequences is a sequence of polynomials known as the Chebyshev
polynomials of the second kind:
Example 4.9.23. Consider polynomials in a single variable x with integer coef-
ficients. Define a sequence ( T0 , T1 , T2 , . . .) of such polynomials recursively by
setting

T0 ( x ) = 1, T1 ( x ) = x, and
Tn ( x ) = 2xTn−1 ( x ) − Tn−2 ( x ) for each n ≥ 2.

The polynomials T0 , T1 , T2 , . . . in this sequence are called Chebyshev polynomials


of the first kind. They have several properties (useful in approximation theory as
well as in number theory); the most well-known one is the fact that

cos (nα) = Tn (cos α) for any angle α. (220)

(Thus, the polynomial Tn is the answer to the rather natural question “how can
we express cos (nα) through cos α without using arc-cosines?”. It is easy to prove
(220) by induction on n.)
The definition of the Chebyshev polynomials Tn shows that the sequence
( T0 , T1 , T2 , . . .) is (2x, −1)-recurrent (where we have extended the concept of
“( a, b)-recurrent” to sequences of polynomials in the obvious way). We can now
apply most of what we know about ( a, b)-recurrent sequences to this sequence

December 25, 2021


Math 235 notes page 205

( T0 , T1 , T2 , . . .). For example, Exercise 4.9.4 (applied to a = 2x and b = −1 and


xi = Ti and yi = Ti ) yields that

(−1) T0 ( x ) · Tn+m ( x ) + T1 ( x ) · Tn+m+1 ( x ) = (−1) Tn ( x ) · Tm ( x ) + Tn+1 ( x ) · Tm+1 ( x )

for any nonnegative integers n and m. In view of T0 ( x ) = 1 and T1 ( x ) = x, this


rewrites as

− Tn+m ( x ) + xTn+m+1 ( x ) = − Tn ( x ) · Tm ( x ) + Tn+1 ( x ) · Tm+1 ( x ) .

More advanced properties of ( a, b)-recurrent sequences lead to more advanced


properties of the polynomials Tn .
The Chebyshev polynomials of the second kind form another (2x, −1)-recurrent
sequence (U0 , U1 , U2 , . . .), which starts with U0 ( x ) = 1 and U1 ( x ) = 2x.
We refer to the Wikipedia page for an overview of the major properties of
Chebyshev polynomials, to [ChaSed97, Chapter 22] for an introduction, and to
the book [Rivlin90] for an in-depth treatment.

4.9.8. k-term recurrences


In the definition of an ( a, b)-recurrent sequence, the equality (170) expresses an
entry xn of the sequence in terms of the preceding two entries xn−1 and xn−2 .
Nothing speaks against generalizing this definition to more than two parameters
and, correspondingly, more than two preceding entries:

Definition 4.9.24. Let k ∈ N. Let a1 , a2 , . . . , ak be any k numbers. A sequence


( x0 , x1 , x2 , . . .) of numbers will be called ( a1 , a2 , . . . , ak )-recurrent if every n ≥ k
satisfies
x n = a 1 x n −1 + a 2 x n −2 + · · · + a k x n − k . (221)

Clearly, Definition 4.9.1 is a particular case of Definition 4.9.24. Here are some
other particular cases:

• Here is the case k = 1 of Definition 4.9.24: If a is a single number, then an


( a)-recurrent sequence is the same as a geometric progression with ratio a.
• The Padovan sequence is the sequence ( p0 , p1 , p2 , . . .) of integers defined recur-
sively by setting

p0 = 1, p1 = 1, p2 = 1, and
p n = p n −2 + p n −3 for each n ≥ 3.

This sequence is obviously (0, 1, 1)-recurrent. The Perrin sequence is also (0, 1, 1)-
recurrent but has starting values 3, 0 and 2 (in this order). For the properties
of these two sequences, we refer to their Wikipedia articles.

December 25, 2021


Math 235 notes page 206

• The sequence 01 , 12 , 22 , 32 , . . . is (3, −3, 1)-recurrent, since a straightforward




computation shows that

n2 = 3 ( n − 1)2 − 3 ( n − 2)2 + ( n − 3)2 for each n ≥ 3.

We will generalize this in an exercise below (Exercise 5.4.2 (e)).

• The sequence (t0 , t1 , t2 , . . .) in Exercise 1.1.2 is (0, 4, 0, −1)-recurrent. Indeed,


this is precisely the claim of Exercise 1.1.2 (a).

• If ( x0 , x1 , x2 , . . .) isan ( a, b)-recurrent sequence (for some numbers a and b),


2 2 2 2 2 3

then x0 , x1 , x2 , . . . is an a + b, b a + b , −b -recurrent sequence. This is
not hard to check by direct computation109 . Similar results hold for ( a1 , a2 , . . . , ak )-
recurrent sequences, but they get messier as k grows, and require linear alge-
bra to properly state and prove.

• If ( x0 , x1 , x2 , . . .) is an ( a, b)-recurrent sequence (for some numbers a and b),


and if (y0 , y1 , y2 , . . .) is a (c, d)-recurrent sequence (for some numbers c and
d), then ( x0 + y0 , x1 + y1 , x2 + y2 , . . .) is an ( a + c, b + d − ac, − ad − bc, −bd)-
recurrent sequence, whereas ( x0y0 , x1 y1 , x2 y2 , . . .) is an
ac, a2 d + c2 b + 2bd, abcd, −b2 d2 -recurrent sequence. Both of these claims can
be checked by (laborious yet fairly straightforward) computation; however,
lurking behind them are certain properties of polynomials and matrices that
are best understood from a linear-algebraic viewpoint. (This would also allow
us to generalize them to ( a1 , a2 , . . . , ak )-recurrent sequences.)

Theorem 4.9.11 can be generalized to ( a1 , a2 , . . . , ak )-recurrent sequences, although


it is a judgment call whether the result counts as an “explicit formula”:

109 Indeed,you need to check that xn2 = a2 + b xn2 −1 + a2 + b bxn2 −2 − b3 xn2 −3 for each n ≥ 3. But
 

this can be done by expressing xn and xn−1 through xn−2 and xn−3 (via xn−1 = axn−2 + bxn−3
and xn = a x n −1 +bxn−2 = a ( axn−2 + bxn−3 ) + bxn−2 ) and expanding both sides.
|{z}
= axn−2 +bxn−3

December 25, 2021


Math 235 notes page 207

Theorem 4.9.25. Let k ∈ N. Let a1 , a2 , . . . , ak be any k numbers. Let p ( X ) be


the polynomial X k − a1 X k−1 − a2 X k−2 − · · · − ak X k−k . Let λ1 , λ2 , . . . , λh be all
the distinct complex roots of p ( X ). For each i ∈ {1, 2, . . . , h}, let mi be the
multiplicity of the root λi of p ( X ).
Let ( x0 , x1 , x2 , . . .) be an ( a1 , a2 , . . . , ak )-recurrent sequence. Then, there exist
constants γi,j for all i ∈ {1, 2, . . . , h} and j ∈ {0, 1, . . . , mi − 1} with the property
that each n ∈ N satisfies
h m i −1
xn = ∑ ∑ γi,j n j λin . (222)
i =1 j =0

In other words, there exist polynomials δi ( X ) of degree < mi for all i ∈


{1, 2, . . . , h} with the property that each n ∈ N satisfies
h
xn = ∑ δi (n) λin . (223)
i =1

(Here, we agree that the zero polynomial has degree < mi , whatever mi is.)
Thus, in particular, if all roots of p ( X ) are distinct (i.e., we have h = k, and the
multiplicities mi are all equal to 1), then each n ∈ N satisfies

xn = γ1,0 λ1n + γ2,0 λ2n + · · · + γk,0 λnk . (224)

We shall not dwell on the proof of Theorem 4.9.25, nor on its uses. Proofs of The-
orem 4.9.25 can be found in [Melian01, Theorem 1] and in [Ivanov08, Theorem 2].
The proof in [Melian01, Theorem 1] is essentially a straightforward generalization
of our above second proof of Theorem 4.9.11 in Subsection 4.9.4; it relies on the
k × k-matrix  
0 1 0 ··· 0
 0
 0 1 ··· 0  
 .. .
.. .
.. . .
. . .. 
 .  (225)
 
 0 0 0 ··· 1 
a k a k −1 a k −2 · · · a 1
(a generalization of the matrix A from Proposition 4.9.21) and its Jordan normal
form110 . The generalization of Proposition 4.9.21 to ( a1 , a2 , . . . , ak )-recurrent se-
quences is easily stated and proved, and this generalization provides a way to
study ( a1 , a2 , . . . , ak )-recurrent sequences via matrix algebra. Unlike the particular
case k = 2 (in which case explicit computations are a viable method), it is this ma-
trix approach that bears the most fruits in the general case. For example, here is a
neat folklore result whose only proof I know uses the matrix approach:

110 Tobe more precise, the matrix used in [Melian01, Theorem 1] is obtained from the above matrix
by a 180◦ -rotation; but this is just a matter of relabeling rows and columns.

December 25, 2021


Math 235 notes page 208

Proposition 4.9.26. Let d ∈ N and k ∈ N. Let a1 , a2 , . . . , ak be any k num-


bers. Then, there exist k numbers b1 , b2 , . . . , bk with the following property:
If ( x0 , x1 , x2 , . . .) is any  ( a1 , a2 , . . . , ak )-recurrent sequence, then the sequence
x p+0d , x p+1d , x p+2d , . . . is (b1 , b2 , . . . , bk )-recurrent for each p ∈ N.

Note that these k numbers b1 , b2 , . . . , bk depend neither on the sequence ( x0 , x1 , x2 , . . .)


nor on the integer p; they are determined by d, k and a1 , a2 , . . . , ak alone. For exam-
ple, for k = 2 and d = 2, this is saying that if ( x0 , x1 , x2 , . . .) is any ( a1 , a2 )-recurrent
sequence, then both sequences ( x0 , x2 , x4 , . . .) and ( x1 , x3 , x5 , . . .) are (b1 , b2 )-recurrent.
In the particular case k = 2, Proposition 4.9.26 can be proved by elementary means
(see [Grinbe15, solution to Exercise 4.2 (c)]); but in the general case, the only proof
I know uses the matrix (225) and the Cayley–Hamilton theorem. (See [Grinbe19b,
Theorem 1] for this proof.)

4.10. Homework set #4: More sequences


This is a regular problem set. See Section 3.7 for details on grading.
This homework set covers the above parts of Chapter 4. Some of the problems
may be unrelated.
Please solve at most 5 problems. (No points will be given for further solutions.)

Exercise 4.10.1. Let u be a positive integer. Let k ∈ N. Define a sequence


( a0 , a1 , a2 , . . .) of integers by setting
 
n
an = %u for each n ∈ N.
k

Show that this sequence ( a0 , a1 , a2 , . . .) is uk!-periodic.

The next exercise generalizes Exercise 4.9.7:

Exercise 4.10.2. Let u and v be two integers. Let ( x0 , x1 , x2 , . . .) be a (u, v)-


recurrent sequence of integers with x0 = 0.
Show that all a, b ∈ N satisfying a | b satisfy x a | xb .

Exercise 4.10.3. Generalize Exercise 4.9.2 further, to a claim about two ( a, b)-
recurrent sequences ( x0 , x1 , x2 , . . .) and (y0 , y1 , y2 , . . .).
[Hint: The left hand side will be xn+1 yn−1 − xn yn .]

Exercise 4.10.4. Let a be any number. Let ( x0 , x1 , x2 , . . .) and (y0 , y1 , y2 , . . .) be two


( a, 1)-recurrent sequences of numbers with x0 = 0. (We don’t require anything
of y0 .) Let n, m ∈ N satisfy n ≥ m. Prove that

xn−m yn+m = xn yn − (−1)n+m xm ym .

December 25, 2021


Math 235 notes page 209

The next exercise is about generalizing Exercise 3.7.2 and Exercise 3.4.1 (b):

Exercise 4.10.5. Let u and v be two integers such that u ⊥ v. Let ( x0 , x1 , x2 , . . .)


be a (u, v)-recurrent sequence of integers with x0 = 0 and x1 = 1. Show that all
a, b ∈ N satisfy gcd ( x a , xb ) = xgcd(a,b) .

Exercise
√ √ Let n ∈√N. Prove that there exists some m ∈ N such that
4.10.6.
n
2 − 1 = m + 1 − m.

Exercise 4.10.7. A sequence ( a0 , a1 , a2 , . . .) of numbers is defined recursively by


a0 = −1 and a1 = 0 and an = a2n−1 − n2 an−2 − 1 for all n ≥ 2. Find a100 .

j √ n k
Exercise 4.10.8. Let n ∈ N. Prove that 1+ 2 is even if and only if n is
odd.

Exercise 4.10.9. Let m and k be two positive integers such that m | k + 1. Define
a sequence ( a0 , a1 , a2 , . . .) of positive integers recursively by

a0 = 1, a1 = 1, a2 = m and
k + a n −1 a n −2
an = for each n ≥ 3.
a n −3

Prove that an is an integer for each n ∈ N.


[Hint: Prove that each of the two subsequences ( a0 , a2 , a4 , a6 , . . .) and
( a1 , a3 , a5 , a7 , . . .) is ( a, b)-recurrent for some integers a and b.]

Exercise 4.10.10. Let ( a, a + d, a + 2d, a + 3d, . . .) be any (infinite) arithmetic


progression with d 6= 0. Prove that this arithmetic progression contains
an infinite geometric progression as a subsequence (i.e., there is an infinite
strictly increasing sequence (i0 , i1 , i2 , . . .) of nonnegative integers such that
a
( a + i0 d, a + i1 d, a + i2 d, . . .) is a geometric progression) if and only if ∈ Q.
d

4.11. More integer sequences


Exercise 1.1.2 (b), Exercise 4.6.4 and Exercise 4.10.9 are three instances of a com-
mon type of problem: Given a sequence of numbers defined recursively, to prove
that all entries of the sequence are integers. (Usually this is not obvious from the
definition, since the definition involves division or even taking roots.) This type
of problem has recently become popular; famous examples are the Somos sequences
and various variants thereof. See [Gale98, Chapters 1 and 4] and [Grinbe15, §2.9]
for a few examples of such problems. There is also a theory that unifies some (but

December 25, 2021


Math 235 notes page 210

not all) instances of this “unexpected integrality” phenomenon, but properly un-
derstanding this theory goes beyond these notes. (See [AlCuHu16] for a large part
of this theory. For more, google “cluster algebras” and “Laurent phenomenon”.)
In this short section, we shall see more examples of such problems.

4.11.1. Propp’s tn tn−k = 1 + tn−1 tn−2 ...tn−k+1 recurrence


Let us generalize the sequence (t0 , t1 , t2 , . . .) from Exercise 1.1.2:

Exercise 4.11.1. Fix a positive integer k ≥ 2. Define a sequence (t0 , t1 , t2 , . . .) of


positive rational numbers recursively by setting

tn = 1 for each n < k (226)

and
1 + t n −1 t n −2 · · · t n − k +1
tn = for each n ≥ k. (227)
tn−k
1 + t k −1 t k −2 · · · t 1 1+1·1·····1
(For example, tk = = = 2 and likewise tk+1 =
t0 1
3.)
Prove that tn is a positive integer for each integer n ≥ 0.

Let us see what this means for small values of k:

Example 4.11.1. Set k = 3 in Exercise 4.11.1. Then, t0 = t1 = t2 = 1 and

1 + t n −1 t n −2
tn = for each n ≥ 3
t n −3

1 + t n −1 t n −2
(since the right hand side of (227) becomes ). Hence, the sequence
t n −3
(t0 , t1 , t2 , . . .) is precisely the sequence (t0 , t1 , t2 , . . .) from Exercise 1.1.2. Thus,
the claim of Exercise 4.11.1 in the case k = 3 is precisely the claim of Exercise
1.1.2 (b).
Let us make a table of the first few entries of the sequence (t0 , t1 , t2 , . . .) (for
k = 3):

n 0 1 2 3 4 5 6 7 8 9 10 11 12 13
.
tn 1 1 1 2 3 7 11 26 41 97 153 362 571 1351

This sequence is sequence A005246 in the OEIS, and is (0, 4, 0, −1)-recurrent (as
we know from Exercise 1.1.2 (a)).

December 25, 2021


Math 235 notes page 211

Example 4.11.2. Set k = 2 in Exercise 4.11.1. Then, t0 = t1 = 1 and

1 + t n −1
tn = for each n ≥ 2. (228)
t n −2

Let us make a table of the first few entries of the sequence (t0 , t1 , t2 , . . .):

n 0 1 2 3 4 5 6 7 8 9 10 11 12
.
tn 1 1 2 3 2 1 1 2 3 2 1 1 2

This reveals that the sequence (t0 , t1 , t2 , . . .) is 5-periodic (with values 1, 1, 2, 3, 2


repeating over and over). This can be proved by a straightforward computation
(just use (228) four times to show that tn = tn+5 ). Despite its trivial nature, this
sequence appears in the OEIS (as sequence A076839).

Example 4.11.3. Set k = 4 in Exercise 4.11.1. Then, t0 = t1 = t2 = t3 = 1 and

1 + t n −1 t n −2 t n −3
tn = for each n ≥ 4.
t n −4

Let us make a table of the first few entries of the sequence (t0 , t1 , t2 , . . .):

n 0 1 2 3 4 5 6 7 8 9 10 11
.
tn 1 1 1 1 2 3 7 43 452 45351 125920291 60027819184831

The rapid growth of the tn (after a slow start for n ≤ 7) strikes the eye.
Actually, the sequence grows at least doubly exponentially111 , whence it is
not ( a1 , a2 , . . . , am )-recurrent for any positive integer m and any numbers
a1 , a2 , . . . , am (because Theorem 4.9.25 shows that any ( a1 , a2 , . . . , am )-recurrent
sequence grows at most exponentially). The sequence (t0 , t1 , t2 , . . .) is A051786
in the OEIS.

Rather than solving Exercise 4.11.1 directly, let us generalize it even further:

111 To make this more precise: It is not hard to prove that tn ≥ 2 f n−3 for each n ≥ 3 (where
( f 0 , f 1 , f 2 , . . .) is the Fibonacci sequence). Since the Fibonacci sequence grows exponentially,
we thus conclude that tn grows at least doubly exponentially.
The inequality tn ≥ 2 f n−3 can be proved by induction on n. Here is an outline: The first step is
to show (by strong induction) that tn ≥ tn−1 for each positive integer n. The next step is to show
that tn ≥ tn−1 tn−2 for each integer n ≥ 2. Once this is done, tn ≥ 2 f n−3 can be proved by strong
induction (the induction step is arguing that tm ≥ tm−1 tm−2 ≥ 2 f m−4 2 f m−5 = 2 f m−4 + f m−5 =
|{z} |{z}
≥2 f m −4 ≥2 f m −5
2 f m−3 ).

December 25, 2021


Math 235 notes page 212

Exercise 4.11.2. Fix a positive integer k ≥ 2. Fix k − 1 positive integers


p1 , p2 , . . . , pk−1 . Define a sequence (t0 , t1 , t2 , . . .) of positive rational numbers
recursively by setting
tn = 1 for each n < k (229)
and p p p
1 + tn1−1 tn2−2 · · · tnk−−k1+1
tn = for each n ≥ k. (230)
tn−k
1p 2p p
k −1
1 + tk− 1 t k −2 · · · t 1 1 + 1 p 1 1 p 2 · · · 1 p k −1
(For example, tk = = = 2 and likewise
t0 1
tk+1 = 1 + 2 p1 .)
Prove that tn is a positive integer for each integer n ≥ 0.

Example 4.11.4. Exercise 4.11.1 is the particular case of Exercise 4.11.2 when all
the integers p1 , p2 , . . . , pk−1 equal 1. (Indeed, the equality (230) turns into (227)
in this case.)

Example 4.11.5. Let us illustrate why it is important that the integers


p1 , p2 , . . . , pk−1 in Exercise 4.11.2 are positive. Indeed, let us pick k = 4, p1 = 1,
p2 = 1 and p3 = 0 (so p3 is not positive but merely nonnegative). Then, the
sequence (t0 , t1 , t2 , . . .) satisfies t0 = t1 = t2 = t3 = 1 and

1 + t n −1 t n −2
tn = for each n ≥ 4.
t n −4

Let us make a table of the first few entries of the sequence (t0 , t1 , t2 , . . .):

n 0 1 2 3 4 5 6 7 8 9
155 1706 .
tn 1 1 1 1 2 3 7 22
2 3

We see that t8 and t9 are not positive integers. So the claim of Exercise 4.11.2
does not hold in this case.
Solution to Exercise 4.11.2. For each integer n ≥ k, we have
p p p
tn tn−k = 1 + tn1−1 tn2−2 · · · tnk−−k1+1 . (231)
(Indeed, this follows by multiplying both sides of the equality (230) by tn−k .)
We must prove that
tn is a positive integer (232)
for each integer n ≥ 0.
We shall prove (232) by strong induction on n:
Induction step: Let m ≥ 0 be an integer. Assume (as the induction hypothesis)
that (232) holds for n < m. We must prove that (232) holds for n = m. In other

December 25, 2021


Math 235 notes page 213

words, we must prove that tm is a positive integer. It clearly suffices to show that
tm is an integer (since we already know that tm is positive).
Hence, our goal is to prove that tm is an integer. If m < k, then this is clearly
true112 . Thus, for the rest of this proof, we WLOG assume that we don’t have
m < k. Hence, m ≥ k. Thus, (230) (applied to n = m) yields
p p −1 p
1 + tm1−1 tm2−2 · · · tmk− k +1
tm = . (233)
tm−k
We have assumed that (232) holds for n < m. In other words, tn is a positive
integer for each n < m. In other words, t0 , t1 , . . . , tm−1 are positive integers. In
other words, the numbers tm−1 , tm−2 , tm−3 , . . . , t0 are positive integers. This will
allow us to do modular arithmetic with these numbers (i.e., to state congruences
between these numbers).
Recall that our goal is to prove that tm is an integer. If m − k < k, then this can
easily be done113 . Hence, for the rest of this proof, we WLOG assume that we don’t
have m − k < k. Thus, m − k ≥ k.
Let r = m − k. Then, r = m − k ≥ k ≥ 0, so that r ∈ N. Hence, (231) (applied to
n = r) yields
p p p
tr tr−k = 1 + tr−1 1 tr−2 2 · · · tr−k−k1+1 (234)
(since r ≥ k). Note that the numbers tr , tr−1 , tr−2 , . . . , tr−k are among the numbers
t m −1 , t m −2 , t m −3 , . . . , t 0 114 , and thus are integers115 . Thus, all the numbers that

occur on either side of (234) are integers. Therefore,


p p p
tr | tr tr−k = 1 + tr−1 1 tr−2 2 · · · tr−k−k1+1 (by (234))
p p p
= tr−1 1 tr−2 2 · · · tr−k−k1+1 − (−1) .
In other words,
p p p
tr−1 1 tr−2 2 · · · tr−k−k1+1 ≡ −1 mod tr .
In other words,
p p p
− 1 ≡ tr−1 1 tr−2 2 · · · tr−k−k1+1 mod tr . (235)
112 Indeed, if m < k, then tm = 1 (by (229), applied to n = m), and thus tm is an integer (since 1 is an
integer).
113 Proof. Assume that m − k < k. Note that m − k ∈ N (since m ≥ k). Hence, (229) (applied to

n = m − k) yields tm−k = 1 (since m − k < k). Now, (233) becomes


p p p−1 p p p
−1
1 + tm1−1 tm2−2 · · · tmk− k +1 1 + tm1−1 tm2−2 · · · tmk− k +1
tm = = (since tm−k = 1)
tm−k 1
p p p
= 1 + tm1−1 tm2−2 · · · tmk−−1k+1 .
The right hand side of this equality is an integer (since tm−1 , tm−2 , tm−3 , . . . , t0 are integers).
Therefore, so is the left hand side. In other words, tm is an integer. Hence, we have shown that
tm is an integer under the assumption that m − k < k. Qed.
114 because r = m − k ≤ m − 1 and r − k ≥ k − k = 0
|{z} |{z}
≥2≥1 ≥k
115 since the numbers tm−1 , tm−2 , tm−3 , . . . , t0 are integers

December 25, 2021


Math 235 notes page 214

Also, the numbers tm−1 , tm−2 , . . . , tm−k+1 are among the numbers tm−1 , tm−2 , tm−3 , . . . , t0
116 ,
and thus are integers117 . Hence,
p p p
− tm1−1 tm2−2 · · · tmk−−1k+1
 
p p −1 p
= (−1) tm1−1 tm2−2 · · · tmk− k +1
| {z }
p p p
≡tr−1 1 tr−2 2 ···tr−k−k+1 1 mod tr
(by (235))
! !
   k −1 k −1
∏ tr−i i ∏ tmi−i
p p p p p p p p
≡ tr−1 1 tr−2 2 · · · tr−k−k1+1 tm1−1 tm2−2 · · · tmk−−1k+1 =
| {z }| {z } i =1 i =1
k −1 p k −1 p
= ∏ tr−i i = ∏ tmi−i
i =1 i =1
k −1 k −1
∏ tr−i i tmi−i = ∏ (tr−i tm−i ) pi mod tr .
p p 
= (236)
i =1 | {z } i =1
=(tr−i tm−i ) pi

On the other hand, we claim that

tr−i tm−i ≡ 1 mod tr (237)

for each i ∈ {1, 2, . . . , k − 1}.


[Proof of (237): Let i ∈ {1, 2, . . . , k − 1}. Then, 1 ≤ i ≤ k − 1, so that m − |{z}
i ≥
≤ k −1≤ k
m − k ≥ k ≥ 0. We now know that m − i ≥ k, so that we can apply (231) to
n = m − i. We thus find
p −1 p p
tm−i tm−i−k = 1 + tm1−i−1 tm2−i−2 · · · tmk− i − k +1 .

In other words,
p p −1 p
tm1−i−1 tm2−i−2 · · · tmk− i −k+1 = tm−i tm−i −k − 1. (238)

The numbers tm−i , tm−i−1 , . . . , tm−i−k are among the numbers tm−1 , tm−2 , tm−3 , . . . , t0
118 ,
and thus are integers119 . Thus, all the numbers that occur on either side of
(238) are integers. Let us now set j = k − i. Then, j = k − i ∈ {1, 2, . . . , k − 1}
pj
(since i ∈ {1, 2, . . . , k − 1}). Hence, tm−i− j is one of the factors in the product
p p −1 p k −1 pj p p p
tm1−i−1 tm2−i−2 · · · tmk− 1 2
i −k+1 . Therefore, tm−i − j | tm−i −1 tm−i −2 · · · tm−i −k+1 (since the

116 since m − k +1 = r + 1 ≥ r ≥ 0
| {z }
=r
117 sincethe numbers tm−1 , tm−2 , tm−3 , . . . , t0 are integers
118 because m − i ≤ m − 1 and m − i − k ≥ k − k = 0
|{z} | {z }
≥1 ≥k
119 since the numbers tm−1 , tm−2 , tm−3 , . . . , t0 are integers

December 25, 2021


Math 235 notes page 215

numbers tm−i , tm−i−1 , . . . , tm−i−k are integers). Moreover, p j is a positive integer120 ;


pj
thus, tm−i− j | tm−i− j . Hence,
pj p p −1 p
tm−i− j | tm−i− j | tm1−i−1 tm2−i−2 · · · tmk− i − k +1 = t m − i t m − i − k − 1 (by (238))
!
= t m −i tr −i − 1 since m − i − k = m − }k −i = r − i
| {z
=r
= tr−i tm−i − 1.
In other words, tr−i tm−i ≡ 1 mod tm−i− j . In view of m − i − j = m − i − (k − i ) =
|{z}
= k −i
m − k = r, this rewrites as tr−i tm−i ≡ 1 mod tr . This proves (237).]
Now, each i ∈ {1, 2, . . . , k − 1} satisfies tr−i tm−i ≡ 1 mod tr (by (237)) and there-
fore
 
pi pi by Proposition 3.2.7, applied to tr−i tm−i , 1, tr and pi
( tr −i t m −i ) ≡ 1
instead of a, b, n and k
= 1 mod tr . (239)
Hence, (236) becomes121
k −1 k −1
∏ (|tr−i t{zm−i ) p}i ≡ ∏ 1 = 1 mod tr .
p p p
−tm1−1 tm2−2 · · · tmk−−1k+1 ≡
i =1 i =1
≡1 mod tr
(by (239))
p−1 p p
In other words, 1 ≡ −tm1−1 tm2−2 · · · tmk− k+1 mod tr . In other words,
 
p p p −1 p1 p2 p k −1
tr | 1 − −tm1−1 tm2−2 · · · tmk− k +1 = 1 + t m −1 t m −2 · · · t m − k +1 . (240)

The number tr is among the numbers tm−1 , tm−2 , tm−3 , . . . , t0 122 , and thus is a
positive integer123 , hence is nonzero. Thus, from (240), we conclude that
p p p
−1
1 + tm1−1 tm2−2 · · · tmk− k +1
∈ Z.
tr
In view of r = m − k, this rewrites as
p p p
−1
1 + tm1−1 tm2−2 · · · tmk− k +1
∈ Z.
tm−k
In view of (233), this rewrites as tm ∈ Z. In other words, tm is an integer. As we
know, this is sufficient to complete the induction step. Thus, the induction step is
complete, and (232) is proved. This solves Exercise 4.11.2.
120 sincep1 , p2 , . . . , pk−1 are positive integers
121 Inthe following computation, we use (41) to multiply several congruences modulo tr .
122 because r = m − k ≤ m − 1 and r ≥ k ≥ 0
|{z}
≥2≥1
123 since the numbers tm−1 , tm−2 , tm−3 , . . . , t0 are positive integers

December 25, 2021


Math 235 notes page 216

Thus, we have solved Exercise 4.11.1 as well (since Exercise 4.11.1 is the particular
case of Exercise 4.11.2 when all of p1 , p2 , . . . , pk−1 equal 1). This yields a new
solution to Exercise 1.1.2 (b) (since the claim of Exercise 4.11.1 in the case k = 3 is
precisely the claim of Exercise 1.1.2 (b)).

4.11.2. The Somos sequences


Here is another problem of the “unexpected integrality” type ([Negut05, Chapter
2, Exercise 25], [Wemyss14, Theorem 2.6]):

Exercise 4.11.3. Define a sequence ( a0 , a1 , a2 , . . .) of positive rational numbers


recursively by setting
an = 1 for each n < 5 (241)
and
a n −1 a n −4 + a n −2 a n −3
an = for each n ≥ 5. (242)
a n −5
a4 a1 + a3 a2 1·1+1·1
(For example, a5 = = = 2 and likewise a6 = 3.)
a0 1
Prove that an is a positive integer for each integer n ≥ 0.

The sequence ( a0 , a1 , a2 , . . .) in Exercise 4.11.3 is known as the Somos-5 sequence;


it is sequence A006721 in the OEIS. Here is a table of its first few entries:

n 0 1 2 3 4 5 6 7 8 9 10 11
.
an 1 1 1 1 1 2 3 5 11 37 83 274

The growth rate of this sequence is faster than exponential124 ; thus, the sequence is
not (b1 , b2 , . . . , bk )-recurrent (for any b1 , b2 , . . . , bk ).
Here is a similar sequence ([Malouf92, Theorem 1]):

Exercise 4.11.4. Define a sequence ( a0 , a1 , a2 , . . .) of positive rational numbers


recursively by setting
an = 1 for each n < 4
and
an−1 an−3 + a2n−2
an = for each n ≥ 4.
a n −4
Prove that an is a positive integer for each integer n ≥ 0.

 2
124 Infact, using Landau’s Big-O notation, we have an = O qn for a constant q ≈ 1.0728. See
[Brown20] for a proof.

December 25, 2021


Math 235 notes page 217

The sequence ( a0 , a1 , a2 , . . .) in Exercise 4.11.4 is known as the Somos-4 sequence;


it is sequence A006720 in the OEIS. Here is a table of its first few entries:

n 0 1 2 3 4 5 6 7 8 9 10 11
.
an 1 1 1 1 2 3 7 23 59 314 1529 8209

At this point, it should be clear (both from their names and from their definitions)
that the Somos-4 and Somos-5 sequences are part of a sequence of sequences:

Definition 4.11.6. Let k ≥ 2 be an integer. The Somos-k sequence is the sequence


( a0 , a1 , a2 , . . .) of positive rational numbers defined recursively by setting

an = 1 for each n < k

and
an−1 an−k+1 + an−2 an−k+2 + · · · + an−bk/2c an−k+bk/2c
an =
an−k
bk/2c
∑ a n −i a n − k +i
i =1
= for each n ≥ k.
an−k

It is easy to see that the Somos-2 and Somos-3 sequences are just the constant
sequence (1, 1, 1, . . .). We have seen the Somos-4 and Somos-5 sequences. Sur-
prisingly, all entries of the Somos-k sequences for all k ∈ {2, 3, . . . , 7} are integers.
However, the magic stops at k = 7: The 17-th entry of the Somos-8 sequence is not
an integer.
There is much to say about the Somos-k sequences, as well as other sequences
with similar definitions and properties (we will in fact see some of them later on).
Good starting points are the Wikipedia page for “Somos sequence” and Jim Propp’s
“Somos Sequences Site”. As mentioned above, [Gale98, Chapters 1 and 4] gives an
introduction with a few of the simplest proofs. Similar sequences can be found in
[FomZel02], [AlCuHu16] and [Russel16, Chapters 5–6]. Most of these sequences
have connections to combinatorics (in particular, the Somos-k sequences for all
k ∈ {4, 5, 6, 7} are known to enumerate perfect matchings in certain graphs); also,
the Somos-k sequences are related to elliptic curves (see, e.g., [Poorte04], or – for a
particularly short connection – the solution to Fifth Day problem 1 in [Zagier96]).
The Somos-4 and Somos-5 sequences have nontrivial divisibility properties as well
([Kamp15]).
We shall not dwell on these wide and fertile grounds; however, we shall state
(without proof) two theorems that generalize the integrality of the Somos-k se-
quences for k ∈ {4, 5, 6, 7}. The first generalizes the integrality of the Somos-4 and
Somos-5 sequences:

December 25, 2021


Math 235 notes page 218

Theorem 4.11.7. Let k ≥ 2 be an integer. Let i and j be two elements of


{1, 2, . . . , k − 1}. Let w and z be two positive integers. Define a sequence
( a0 , a1 , a2 , . . .) of positive rational numbers recursively by setting

an = 1 for each n < k

and
wan−i an−k+i + zan− j an−k+ j
an = for each n ≥ k. (243)
an−k
Then, an is a positive integer for each integer n ≥ 0.

Exercise 4.11.4 (that is, the integrality of the Somos-4 sequence) is the particular
case of Theorem 4.11.7 for k = 4, i = 1, j = 2, w = 1 and z = 1. Exercise 4.11.3 (that
is, the integrality of the Somos-5 sequence) is the particular case of Theorem 4.11.7
for k = 5, i = 1, j = 2, w = 1 and z = 1.
Note that the only reason why we required w and z to be positive in Theorem
4.11.7 is to ensure that all of a0 , a1 , a2 , . . . are positive; this prevents the denomi-
nator an−k in (243) from becoming zero. If an−k 6= 0 can be guaranteed in some
other way, then we can drop the requirement that w and z be positive (although, of
course, the claim must be changed: an will not generally be a positive integer, but
merely an integer). The “grown-up” version of Theorem 4.11.7 does not deal with
a sequence of integers at all; instead, it considers w and z as indeterminates, so
all of a0 , a1 , a2 , . . . are rational functions in these two indeterminates w and z (with
integer coefficients). The claim is then that these rational functions a0 , a1 , a2 , . . . are
actually polynomials with nonnegative integer coefficients. This has been proved
combinatorially (meaning that these polynomials an have been described explicitly,
as sums over matchings in certain graphs!) in [BMPrWe09, Theorem 11]. An alter-
native algebraic proof (using the algebra of Laurent polynomials) has been given
in [FomZel02, Example 1.7].
The next theorem generalizes the integrality of the Somos-6 and Somos-7 se-
quences:

Theorem 4.11.8. Let i, j and ` be three distinct positive integers. Let k = i + j + `.


Let u, v and w be three positive integers. Define a sequence ( a0 , a1 , a2 , . . .) of
positive rational numbers recursively by setting

an = 1 for each n < k

and
uan−i an−k+i + van− j an−k+ j + wan−` an−k+`
an = for each n ≥ k.
an−k

Then, an is a positive integer for each integer n ≥ 0.

The integrality of the Somos-6 sequence is the particular case of Theorem 4.11.8

December 25, 2021


Math 235 notes page 219

for k = 6, i = 1, j = 2, ` = 3, u = 1, v = 1 and w = 1. The integrality of the


Somos-7 sequence is the particular case of Theorem 4.11.8 for k = 7, i = 1, j = 2,
` = 4, u = 1, v = 1 and w = 1.
Theorem 4.11.8 is known as the Gale-Robinson sequence theorem; it has been proved
combinatorially in [CarSpe04, Theorem 6], and algebraically in [FomZel02, Exam-
ple 1.3]. Again, u, v and w are best considered as indeterminates rather than fixed
positive integers; the resulting rational functions an are polynomials having explicit
combinatorial interpretations.

4.11.3. Odds and ends


Exercise 4.11.4 can be generalized in yet another direction: by putting exponents
on the an−i ’s (just as in Exercise 4.11.2). Indeed, we have the following ([Gale98,
Chapter 1, (8)]):

Exercise 4.11.5. Fix three positive integers p, q and r. Define a sequence


( a0 , a1 , a2 , . . .) of positive rational numbers recursively by setting

an = 1 for each n < 4

and p q
a a + arn−2
a n = n −1 n −3 for each n ≥ 4. (244)
a n −4
Prove that an is a positive integer for each integer n ≥ 0.

However, this generalization cannot be merged with the w and z from Theorem
4.11.7. To wit, if we replace (244) by

3an−1 an−3 + an−2


an = for each n ≥ 4,
a n −4

then a8 = 10337/2 will fail to be an integer. On the other hand, the recurrence
an−1 an−3 + zan−2
an = for each n ≥ 4
a n −4

appears to produce integers an for each z ∈ N and each n ∈ N. (Is there a proof?)
This area still offers many challenges and surprises. Let me mention a counterex-
ample and a few open problems:

Example 4.11.9. Define a sequence ( a0 , a1 , a2 , . . .) of positive rational numbers


recursively by setting a0 = 1 and

1 + a20 + a21 + · · · + a2n−1


an = for each n ≥ 1. (245)
n

December 25, 2021


Math 235 notes page 220

This is known as Göbel’s sequence (see also OEIS sequence A003504, which is
the same sequence shifted by an entry). It may appear that all its entries are
integers; but this is not so! The smallest n for which an is not an integer is 43; the
corresponding an = a43 has about a billion digits before the decimal point. (See
[Zagier96, Fifth Day, problem 3] for a more detailed discussion of this sequence;
note, however, that it is defined starting with a1 = 2 rather than a0 = 1 there.)
Note that the recurrence relation (245) can be replaced by

(n − 1) an−1 + a2n−1
an = for each n ≥ 1.
n

Question 4.11.10. (MathOverflow questions #248604 and #323963:) Define a se-


quence ( a0 , a1 , a2 , . . .) of positive rational numbers recursively by setting

an = 1 for each n < 4

and
( a n −1 + 1 ) ( a n −2 + 1 ) ( a n −3 + 1 )
an = for each n ≥ 4.
a n −4
This is sequence A276123 in the OEIS. Is an an integer for each n ∈ N ? It
has been shown by mercio (math.stackexchange #1906097) that each an is a “2-
integer” (i.e., it becomes an integer when multiplied with a sufficiently large
power of 2), but it is not clear whether the power of 2 can be dispensed with.
More generally, we can fix an integer k ≥ 2, and define a sequence
( 0 , a1 , a2 , . . .) of positive rational numbers recursively by setting
a

an = 1 for each n < k

and
( a n −1 + 1 ) ( a n −2 + 1 ) · · · ( a n − k +1 + 1 )
an = for each n ≥ k.
an−k

The above sequence is obtained for k = 4. For each k ≥ 2, one can ask whether
all the an are integers. The cases k = 2 and k = 3 have been resolved in the
positive (i.e., it is known that each an is an integer when k ∈ {2, 3}). The case
k = 5 is also open (MathOverflow question #323963). For each k > 5, the answer
is negative (viz., a2k is not an integer).

Here are three similar questions (all found by the same Michael Somos who the
Somos-k sequences originate with125 ) that have been answered in the positive:

125 See math.stackexchange question #3586309.

December 25, 2021


Math 235 notes page 221

Exercise 4.11.6. Define a sequence ( x0 , x1 , x2 , . . .) of positive rational numbers


recursively by setting
xn = 1 for each n < 6, (246)
and
x n −3 ( x n −1 + x n −5 )
xn = for each n ≥ 6. (247)
x n −6
(a) Prove that xn + xn−4 + xn−8 = 6xn−3 xn−4 xn−5 for each n ≥ 8.
(b) Prove that xn an integer for each n ∈ N.
Here is a table of the first few entries of this sequence:

n 0 1 2 3 4 5 6 7 8 9 10 11
.
xn 1 1 1 1 1 1 2 3 4 10 33 140

Exercise 4.11.7. Define a sequence ( a0 , a1 , a2 , . . .) of positive rational numbers


recursively by setting

a0 = 2, a1 = 1, a2 = 1, a3 = 1, (248)

and
( a n −1 + a n −2 ) ( a n −2 + a n −3 )
an = for each n ≥ 4. (249)
a n −4
This is sequence A248049 in the OEIS.
(a) Prove that an an integer for each n ∈ N.
(b) Prove that an = xn+2 xn+1 xn xn−1 for each n ≥ 1, where ( x0 , x1 , x2 , . . .) is the
sequence defined in Exercise 4.11.6.
Here is a table of the first few entries of this sequence:

n 0 1 2 3 4 5 6 7 8 9 10 11
.
an 2 1 1 1 2 6 24 240 3960 184800 33033000 26125799700

Exercise 4.11.8. Define a sequence (b0 , b1 , b2 , . . .) of positive rational numbers


recursively by setting
b0 = 1, b1 = 1, b2 = 1, b3 = 1, (250)
and
bn − 2 ( bn − 1 + bn − 3 )
bn = for each n ≥ 4. (251)
bn − 4
This is sequence A078918 in the OEIS.
(a) Prove that bn an integer for each n ∈ N.
(b) Prove that bn = xn+2 xn for each n ≥ 0, where ( x0 , x1 , x2 , . . .) is the sequence
defined in Exercise 4.11.6.
(c) Prove that an = bn bn−1 for each n ≥ 1, where ( a0 , a1 , a2 , . . .) is the sequence
defined in Exercise 4.11.7.

December 25, 2021


Math 235 notes page 222

Here is a table of the first few entries of this sequence:

n 0 1 2 3 4 5 6 7 8 9 10 11
.
bn 1 1 1 1 2 3 8 30 132 1400 23595 1107260

Solutions to Exercises 4.11.6, 4.11.7 and Exercise 4.11.8 can be found in Section
A.5.

December 25, 2021


Math 235 notes page 223

5. The Extremal Principle


This chapter is devoted to one of the simplest tricks in mathematics: When you
have a bunch of objects, look at the smallest or the largest among them. This is
known as the Extremal Principle, since the word “extremal” includes both “small-
est” and “largest”. This principle is far from a universal strategy that can be ap-
plied mechanically; in particular, figuring out the exact meaning of “smallest” and
“largest” is often a delicate and creative matter. For example, if you have a bunch
of finite sets of integers, which one is the smallest? The one of smallest size?126
The one whose smallest element is the smallest? The one whose sum of elements
is the smallest? The answer depends on what you are trying to achieve. When
applying the Extremal Principle, it is often necessary to cycle through several pos-
sible meanings of “smallest” (or “largest”) before finding one that helps solve the
problem.

5.1. Existence theorems


Before we see the Extremal Principle applied, let me recall some theorems that
guarantee the existence of extremal (i.e., minimal or maximal) objects. These the-
orems are all fairly basic and will mostly be used without proof; nevertheless it is
worth recalling them at least once.

Theorem 5.1.1. Let S be a nonempty finite set of real numbers. Then, S has a
minimum and a maximum.

Proof of Theorem 5.1.1. Proposition 2.1.2 shows that S has a maximum127 . The same
argument (mutatis mutandis128 ) shows that S has a minimum. This proves Theo-
rem 5.1.1.
The word “nonempty” in Theorem 5.1.1 is clearly necessary: The empty set has
neither a minimum nor a maximum. The  word “finite”, too, cannot simply be
1 1 1
dropped (for example, the set , , , . . . has no minimum); but there are many
1 2 3
infinite sets that nevertheless have minima or maxima. For example, the following
holds ([Grinbe15, Theorem 2.44]):

126 We are saying “The one” here, but of course there can be several ones. For example, among the
three sets {1, 2}, {1, 3} and {0, 1, 2}, the first two have the smallest size.
127 To be more precise, Proposition 2.1.2 shows this under the assumption that S is a set of integers,

while we are here only assuming that S is a set of real numbers. However, the proof is the same
in either case.
128 Once again, the words “mutatis mutandis” mean “once the things that need to be changed have

been changed”. The things that need to be changed here are the following: The “≥” sign needs
to be flipped (i.e., replaced by a “≤” sign); the word “maximum” needs to be replaced by
“minimum”.

December 25, 2021


Math 235 notes page 224

Theorem 5.1.2. Let S be a nonempty set of nonnegative integers. Then, S has a


minimum.

Of course, S will not usually have a maximum in this situation; for example, N
itself has no maximum.
Note that we have used Theorem 5.1.2 in Definition 3.6.2 (when arguing that the
smallest positive common multiple of k nonzero integers is well-defined). We have
also tacitly used Theorem 5.1.2 in Corollary 4.7.9 (in the corollary itself, not in the
proof), when defining m as the smallest period of u. Indeed, the existence of “the
smallest period of u” follows from the fact that the set {periods of u} has a smallest
element (i.e., a minimum); but this is a particular case of Theorem 5.1.2.
Theorem 5.1.2 can be generalized: For a set of integers, the existence of a lower
bound guarantees the existence of a minimum, while the existence of an upper bound
guarantees the existence of a maximum. Let us recall what lower and upper bounds
are:

Definition 5.1.3. Let S be a set of real numbers. Let a be a real number.


(a) We say that a is a lower bound for S if and only if every s ∈ S satisfies a ≤ s.
(b) We say that a is an upper bound for S if and only if every s ∈ S satisfies
a ≥ s.

 For example, 0 and any negative real number are lower bounds for the set
1 1 1
, , , . . . , whereas 1 and any larger number are upper bounds for this set. No
1 2 3
positive real is a lower bound for this set, because if a is a positive real, then
 there

1 1
exists a positive integer n such that < a (for example, we can take n = + 1 ).
n a
Now, here is the promised generalization of Theorem 5.1.2:

Theorem 5.1.4. Let S be a nonempty set of integers. Then:


(a) If S has a lower bound, then S has a minimum.
(b) If S has an upper bound, then S has a maximum.

Note that the word “integers” in Theorem 5.1.4 is important. Even with ratio-
nal 
numbers, the  theorem would fail; for example, as we have seen above, the
1 1 1
set , , , . . . has a lower bound but no minimum. (And likewise, the set
 1 2 3 
1 1 1
− , − , − , . . . has an upper bound but no maximum.)
1 2 3
For the sake of completeness, let us give a proof of Theorem 5.1.4:

Proof of Theorem 5.1.4. (a) Assume that S has a lower bound. Let a be this lower bound.
Thus, a is a lower bound of S. In other words, every s ∈ S satisfies

a≤s (252)

December 25, 2021


Math 235 notes page 225

(by the definition of a “lower bound”).


There exists some t ∈ S (since t is nonempty). Consider this t. Applying (252) to s = t,
we obtain a ≤ t.
Let H denote the set of all integers z satisfying a ≤ z ≤ t. Then, the set H is finite (since
there are only finitely many integers between a and t). Note that t is an integer z satisfying
a ≤ z ≤ t (since t is an integer129 and since a ≤ t ≤ t). In other words, t ∈ H (since H is the
set of all such integers z).
Define a set T of real numbers by T = S ∩ H. Then, the set T is a subset of H (since
T = S ∩ H ⊆ H), and thus is finite (since the set H is finite). Moreover, t ∈ T 130 . Hence,
the set T is nonempty. Now, we know that T is a nonempty finite set of real numbers.
Therefore, Theorem 5.1.1 (applied to T instead of S) yields that T has a minimum and a
maximum. In particular, this shows that T has a minimum. Let m be this minimum. By
the definition of a “minimum”, this means that m ∈ T and that we have

m ≤ u for all u ∈ T. (253)

Applying (253) to u = t, we find m ≤ t (since t ∈ T).


Now, it is easy to see that m ∈ S (since m ∈ T = S ∩ H ⊆ S) and that we have m ≤ u for
all u ∈ S 131 . In other words, m is a minimum of S (by the definition of a “minimum”).
Therefore, the set S has a minimum. This proves Theorem 5.1.4 (a).
(b) The same argument that we just used to prove Theorem 5.1.4 (a) can be reused
(mutatis mutandis) to prove Theorem 5.1.4 (b). (“Mutatis mutandis” here means replacing
“minimum” by “maximum” and “lower bound” by “upper bound”, as well as flipping all
inequality signs.)

Theorem 5.1.2 is a particular case of Theorem 5.1.4 (a), since any set of nonnega-
tive integers has a lower bound (namely, 0).
We note in passing that some things can be said about infinite sets of real num-
bers, even if neither Theorem 5.1.1 nor Theorem 5.1.4 apply to them. Namely, we
can define two “weaker” versions of minima and maxima:

Definition 5.1.5. Let S be a set of real numbers.


(a) An infimum (or greatest lower bound) of S means a maximum of the set of all
lower bounds of S. That is, it means a lower bound a of S with the property that
every lower bound b of S satisfies a ≥ b. An infimum of S is unique if it exists,
and is denoted by inf S.

129 because t ∈ S (and since S is a set of integers)


130 Proof. We have t ∈ S and t ∈ H. Thus, t ∈ S ∩ H. In other words, t ∈ T (since T = S ∩ H).
131 Proof. Let u ∈ S. We must show that m ≤ u. Indeed, assume the contrary. Thus, m > u, so that

u < m ≤ t. Also, u ∈ S and thus a ≤ u (by (252), applied to s = u). Also, u is an integer (since
u ∈ S, but S is a set of integers). Hence, u is an integer and satisfies a ≤ u ≤ t (since u < t). In
other words, u is an integer z satisfying a ≤ z ≤ t. In other words, u ∈ H (since H is the set of
all such integers z).
Combining u ∈ S with u ∈ H, we obtain u ∈ S ∩ H = T. Hence, (253) shows that m ≤ u. But
this contradicts m > u. This contradiction shows that our assumption was false. Hence, m ≤ u
is proved.

December 25, 2021


Math 235 notes page 226

(b) A supremum (or least upper bound) of S means a minimum of the set of all
upper bounds of S. That is, it means an upper bound a of S with the property
that every upper bound b of S satisfies a ≤ b. A supremum of S is unique if it
exists, and is denoted by sup S.

If a set S of real numbers has a minimum, then this minimum


 is also
 an infimum
1 1 1
of S; but the converse is not true. For example, the set , , , . . . has infimum
1 2 3
0 but no minimum. Similar claims hold for maxima and suprema. See [Swanso20,
Example 2.7.3] for various examples of infima and suprema. Now, the following
weakening of Theorem 5.1.4 holds for sets of reals:

Theorem 5.1.6. Let S be a nonempty set of reals. Then:


(a) If S has a lower bound, then S has an infimum. This infimum is a minimum
of S if and only if it belongs to S.
(b) If S has an upper bound, then S has a supremum. This supremum is a
maximum of S if and only if it belongs to S.

Theorem 5.1.6 is one of the most fundamental results in analysis. We refer to


[Swanso20, Theorem 3.8.5] for its proof (more precisely, for the proofs of the first
sentences of parts (a) and (b); but the second sentences are easy exercises).
An infimum is a weaker concept than a minimum, and often less useful. Thus,
one sometimes wants stronger results that guarantee the existence of minima and
maxima rather than merely infima and suprema. Topology can sometimes provide
such results; in particular, the following holds:132

Theorem 5.1.7. Let S be a nonempty set of reals that is closed with respect to the
topology on R. Then:
(a) If S has a lower bound, then S has a minimum.
(b) If S has an upper bound, then S has a maximum.

The proof of Theorem 5.1.7 is implicit in [Swanso20, proof of Theorem 5.2.2].

5.2. Applications
5.2.1. Writing numbers as sums of powers of 2
We shall now see various uses of the Extremal Principle. We begin with a well-
known result:

Theorem 5.2.1. Let n ∈ N. Then, there is a unique finite subset T of N such that
n = ∑ 2t .
t∈ T

132 We refer to [Swanso20, §3.13] for the definition of the topology on R.

December 25, 2021


Math 235 notes page 227

In words, Theorem 5.2.1 is saying that each n ∈ N can be written in a unique


way as a sum of (finitely many) distinct powers of 2 (where “powers of 2” means
numbers of the form 2t with t ∈ N). Here, of course, “in a unique way” means
that the set of powers of 2 being added is unique (so we aren’t counting 23 + 26
and 26 + 23 as two different ways). Here are some examples:

Example 5.2.2. If n = 12, then n = 22 + 23 = ∑ 2t .


t∈{2,3}
If n = 23, then n = 20 + 21 + 22 + 24 = ∑ 2t .
t∈{0,1,2,4}
If n = 0, then n = (empty sum) = ∑ 2t .
t ∈∅

The reader will probably have noticed that Theorem 5.2.1 is just the existence
and uniqueness of the base-2 representation of n in disguise. Indeed, if the base-2
representation of an n ∈ N is

n = bk · 2k + bk−1 · 2k−1 + · · · + b0 · 20

(with b0 , b1 , . . . , bk ∈ {0, 1}), then

n= ∑ 2t , where T = {i ∈ {0, 1, . . . , k } | bi = 1} .
t∈ T

(And conversely, if we have a finite subset T of N such that n = ∑ 2t , then we can


t∈ T
easily obtain a base-2 representation of n from it.) Thus, we don’t have a pressing
need to prove Theorem 5.2.1. Nevertheless, let us do so, since the proof illustrates
the Extremal Principle rather nicely.
We split Theorem 5.2.1 into two pieces: the existence and the uniqueness. While
it is possible to prove them together, I prefer shorter proofs, even if some of the
work will end up duplicated. The existence part of Theorem 5.2.1 is the following
proposition:

Proposition 5.2.3. Let n ∈ N. Then, there exists a finite subset T of N such that
n = ∑ 2t .
t∈ T

The uniqueness part of Theorem 5.2.1 is the following proposition:

Proposition 5.2.4. Let n ∈ N. Let T and T 0 be two finite subsets of N such that
n = ∑ 2t and n = ∑ 2t . Then, T = T 0 .
t∈ T t∈ T 0

Proof of Proposition 5.2.3. We shall prove Proposition 5.2.3 by strong induction on n:


Induction step: Let m ∈ N. Assume (as the induction hypothesis) that Proposition
5.2.3 holds for n < m. We must prove that Proposition 5.2.3 holds for n = m.

December 25, 2021


Math 235 notes page 228

In other words, we must prove that there exists a finite subset T of N such that
m = ∑ 2t .
t∈ T
If m = 0, then this is obvious133 . Thus, for the rest of this proof, we WLOG
assume that m 6= 0. Hence, m ≥ 1.
It is easy to see that m < 2m 134 . Hence, there exists at least one p ∈ N such that
m < 2 p (for example, p = m works). In other words, the set { p ∈ N | m < 2 p } is
nonempty. Hence, Theorem 5.1.2 shows that this set has a minimum (since it is a
set of nonnegative integers). In other words, there is a smallest p ∈ N satisfying
m < 2 p . Let q be this smallest p.
Thus, q itself is a p ∈ N satisfying m < 2 p . In other words, q ∈ N and m < 2q .
Hence, 2q > m ≥ 1, so that q > 0. Therefore, q − 1 ∈ N. If we had m < 2q−1 , then
q − 1 would therefore be a p ∈ N satisfying m < 2 p ; but this would contradict the
fact that q is the smallest such p. Hence, we cannot have m < 2q−1 . In other words,
we have m ≥ 2q−1 .
Hence, m − 2q−1 ∈ N. Also, m − 2q−1 < m (since 2q−1 > 0). Thus, Proposition
5.2.3 holds for n = m − 2q−1 (since we assumed that Proposition 5.2.3 holds for n <
m). In other words, there exists a finite subset T of N such that m − 2q−1 = ∑ 2t .
t∈ T
Consider this T, and denote it by T0 . Hence, T0 is a finite subset of N such that
m − 2q −1 = ∑ 2t .
t∈ T0
Now, from m − 2q−1 = ∑ 2t , we obtain
t∈ T0

m = 2q −1 + ∑ 2t . (254)
t∈ T0

It is not hard to see that q − 1 ∈


/ T0 135 . Hence, ∑ 2t = 2q −1 + ∑ 2t .
t∈ T0 ∪{q−1} t∈ T0
Comparing this with (254), we find m = ∑ 2t . Thus, there exists a finite
t∈ T0 ∪{q−1}

133 Proof. Assume that m = 0. Then, the empty set ∅ is a finite subset of N and satisfies ∑ 2t =
t ∈∅
(empty sum) = 0 and thus m = 0 = ∑ 2t . Hence, there exists a finite subset T of N such that
t ∈∅
m = ∑ 2t (namely, T = ∅). Thus, we have proved our claim under the assumption that m = 0.
t∈ T
134 Thequickest way to see this is to apply (5) to n = m and conclude that 20 + 21 + · · · + 2m−1 =
2 − 1 < 2m , so that 2m > |{z}
m 21 + · · · + 2| m{z−}1 ≥ 1 + 1 + · · · + 1 = m, and thus m < 2m .
20 + |{z}
| {z }
≥1 ≥1 ≥1 m times
135 Proof. Assume the contrary. Thus, q − 1 ∈ T0 . Hence, 2q−1 is an addend of the sum ∑ 2t . Since
t∈ T0
all addends of this sum are nonnegative, we thus conclude that ∑ 2t ≥ 2q−1 (because a sum of
t∈ T0
nonnegative reals is always ≥ to each of its addends). Hence, m − 2q−1 = ∑ 2t ≥ 2q−1 , so that
t∈ T0
m ≥ 2q−1 + 2q−1 = 2 · 2q−1 = 2q . But this contradicts m < 2q . This contradiction shows that our
assumption was false. Qed.

December 25, 2021


Math 235 notes page 229

subset T of N such that m = ∑ 2t (namely, T = T0 ∪ {q − 1}). This completes the


t∈ T
induction step. Thus, Proposition 5.2.3 is proved by strong induction.
Proof of Proposition 5.2.4. We shall prove Proposition 5.2.4 by strong induction on n:
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that Proposition
5.2.4 holds for n < m. We must prove that Proposition 5.2.4 holds for n = m.
We have assumed that Proposition 5.2.4 holds for n < m. In other words, the
following claim holds:

Claim 1: Let n ∈ N satisfy n < m. Let T and T 0 be two finite subsets of


N such that n = ∑ 2t and n = ∑ 2t . Then, T = T 0 .
t∈ T t∈ T 0

Now, let us prove that Proposition 5.2.4 holds for n = m. Let T and T 0 be two
finite subsets of N such that m = ∑ 2t and m = ∑ 2t . We shall show that T = T 0 .
t∈ T t∈ T 0
If m = 0, then this is easy to prove136 .
Thus, for the rest of this proof, we WLOG
assume that m 6= 0.
If we had T = ∅, then we would have ∑ 2t = ∑ 2t = (empty sum) = 0, which
t∈ T t ∈∅
would contradict ∑ 2t = m 6= 0. Hence, we cannot have T = ∅. Thus, the set
t∈ T
T is nonempty. Hence, T is a nonempty finite set of integers. Therefore, Theorem
5.1.1 (applied to S = T) shows that T has a minimum and a maximum. Thus, in
particular, T has a maximum. Similarly, T 0 has a maximum. Consider these two
maxima max T and max ( T 0 ).
We shall show that max T ≤ max ( T 0 ). Indeed, assume the contrary. Thus,
max T > max ( T 0 ). The number max T is an element of T (by the definition of a
maximum); therefore, 2max T is an addend of the sum ∑ 2t . Since all addends of
t∈ T
this sum are nonnegative integers, we thus conclude that

∑ 2t ≥ 2max T (255)
t∈ T

(since a sum of nonnegative integers is always ≥ to any addend of this sum). On


the other hand, each element s of the set T 0 satisfies s ≤ max ( T 0 ) (by the defini-
tion of max ( T 0 )) and therefore s ≤ max ( T 0 ) < max T (since max T > max ( T 0 ))
and therefore s ∈ {0, 1, . . . , max T − 1} (since s ∈ T 0 ⊆ N). In other words,

136 Proof. Assume that m = 0. Then, 0 = m = ∑ 2t . Hence, ∑ 2t = 0. In other words, the sum
t∈ T t∈ T
∑ 2t is 0. But all addends of the sum ∑ 2t are positive. Thus, if this sum was nonempty,
t∈ T t∈ T
then it would be positive (because a nonempty sum of positive reals is positive), which would
contradict the fact that this sum is 0. Hence, this sum must be empty. In other words, T = ∅.
The same argument (applied to T 0 instead of T) yields T 0 = ∅. Hence, T = ∅ = T 0 . Thus, we
have proved that T = T 0 under the assumption that m = 0.

December 25, 2021


Math 235 notes page 230

T 0 ⊆ {0, 1, . . . , max T − 1}. Hence, the sum ∑ 2t is a subsum137 of the sum


t∈ T 0
∑ 2t . Since all addends of the latter sum are nonnegative, we thus
t∈{0,1,...,max T −1}
conclude that ∑ 2t ≤ ∑ 2t (since a subsum of a sum of nonnegative
t∈ T 0 t∈{0,1,...,max T −1}
reals is always ≤ to the whole sum). Hence,

m= ∑ 0 2t ≤ ∑ 2t = 20 + 21 + · · · + 2max T −1
t∈ T t∈{0,1,...,max T −1}
max T
=2 −1 (by (5), applied to n = max T )
max T
<2 .

This contradicts
m= ∑ 2t ≥ 2max T (by (255)) .
t∈ T

This contradiction shows that our assumption was wrong. Hence, max T ≤ max ( T 0 )
is proved. The same argument (with the roles of T and T 0 interchanged) yields
max ( T 0 ) ≤ max T. Combining these two inequalities, we obtain max T = max ( T 0 ).
Set g = max T; thus, g = max T ∈ T and g = max T = max ( T 0 ) ∈ T 0 .
Define an integer n ∈ N by n = ∑ 2t . Then,
t∈ T \{ g}

m= ∑ 2t = 2 g + ∑ 2t (since g ∈ T )
t∈ T t∈ T \{ g}
| {z }
=n
= 2g + n,

so that n = m − 2g < m (since 2g > 0). Also, from n = m − 2g , we obtain

2 g + n = m = ∑ 2t = 2 g + ∑ 2t since g ∈ T 0 .

t∈ T 0 t∈ T 0 \{ g}

Subtracting 2g from both sides of this equality, we find n = ∑ 2t .


t∈ T 0 \{ g}
Now, we know that n ∈ N satisfies n < m. Furthermore, T \ { g} and T 0 \ { g} are
two finite subsets of N satisfying n = ∑ 2t and n = ∑ 2t . Hence, Claim 1
t∈ T \{ g} t∈ T 0 \{ g}
(applied to T \ { g} and T0 \ { g} instead of T and T0) yields T \ { g} = T 0 \ { g}. But
g ∈ T and thus

T = ( T \ { g}) ∪ { g} = T 0 \ { g} ∪ { g} = T 0 since g ∈ T 0 .
 
| {z }
= T 0 \{ g}

137 A subsum of a sum ∑ as means a sum of the form ∑ as , where S0 is a subset of S.


s∈S s∈S0

December 25, 2021


Math 235 notes page 231

Forget that we fixed T and T 0 . We thus have shown that if T and T 0 are two
finite subsets of N such that m = ∑ 2t and m = ∑ 2t , then T = T 0 . In other
t∈ T t∈ T 0
words, Proposition 5.2.4 holds for n = m. This completes the induction step; thus,
Proposition 5.2.4 is proved.
Proof of Theorem 5.2.1. Proposition 5.2.3 shows that there exists a finite subset T of
N such that n = ∑ 2t . Proposition 5.2.4 then shows that such a T is unique.
t∈ T
Theorem 5.2.1 is thus proved.
The reader will have an opportunity to make a similar argument in Exercise 5.4.6
below.

5.2.2. Students in a lecture


Our next application of the extremal principle is [Grinbe08, Exercise 3.11] (slightly
generalized):

Exercise 5.2.1. Let n be a positive integer. A lecture is attended by n students.


Each student enters the classroom once and leaves it once (and does not come
back). We know that among any three (distinct) students, there are at least two
that are together in the room at some moment. The lecturer wants to make
an announcement that every student will hear. Prove that the lecturer can pick
two moments at which to make the announcement so that each student will
hear it. (We assume that the announcement takes no time – i.e., if a student
leaves at the same moment that another student enters, the lecturer can make
the announcement at this moment and both students will hear it.)

Before we solve this exercise, let us formalize it mathematically. We do so by


labelling the n students 1, 2, . . . , n, and by encoding the times that student i is
present in the classroom as a closed interval Ii on the real axis. We denote the two
moments at which the announcement is made by a and b. Thus, Exercise 5.2.1 takes
the following shape:

Exercise 5.2.2. Let n be a positive integer. Let I1 , I2 , . . . , In be n nonempty finite


closed intervals on the real axis. Assume that for any three distinct elements
i, j, k ∈ {1, 2, . . . , n}, at least two of the three intervals Ii , Ij , Ik intersect138 . Prove
that there exist two reals a and b such that each of the intervals I1 , I2 , . . . , In
contains at least one of a and b.

138 Two sets U and V are said to intersect if and only if U ∩ V 6= ∅. Note that two intervals [ a, b] and
[b, c] always intersect, even though the intersection is a singleton set.

December 25, 2021


Math 235 notes page 232

Solution to Exercise 5.2.2. Write each interval Im as [ am , bm ] for two reals am and bm .
Let

a = max { am | m ∈ {1, 2, . . . , n}} and


b = min {bm | m ∈ {1, 2, . . . , n}} .
139 (Thus, in the language of Exercise 5.2.1, the number a is the moment at which
the last student to enter enters; likewise, b is the moment at which the first student
to leave leaves.)
We shall show that a and b have the required property – i.e., that each of the
intervals I1 , I2 , . . . , In contains at least one of a and b.
Indeed, assume the contrary. Thus, there is a p ∈ {1, 2, . . . , n} such that the
interval I p contains neither a nor b. Consider this p.
The interval
 I pcontains neither a nor b. That is, we have a ∈ / I p and b ∈/ I p . Recall
that I p = a p , b p (since Im = [ am , bm ] for each m ∈ {1, 2, . . . , n}). Thus, a p ≤ b p
(since the interval I p is nonempty).
But we have a = max { am | m ∈ {1, 2, . . . , n}} and therefore a ≥ am for each
m ∈ {1, 2, . . . , n} (by the definition of a maximum). Applying this to m = p, we
obtain a ≥ a p . Likewise, from b = min {bm | m ∈ {1, 2, . . . , n}}, we obtain  b ≤ b p .
We have a ≥ a p . If we had a ≤ b p , then we would thus have a ∈ a p , b p = I p ,
which would contradict a ∈ / I p . Hence, we cannot have a ≤ b p . In other words, we
have a > b p .  
We have b ≤ b p . If we had b ≥ a p , then we would thus have b ∈ a p , b p = I p ,
which would contradict b ∈ / I p . Hence, we cannot have b ≥ a p . In other words, we
have b < a p .
However, we also have a = max { am | m ∈ {1, 2, . . . , n}} ∈ { am | m ∈ {1, 2, . . . , n}}
(since the maximum of a set is always an element of that set). In other words, there
exists some m ∈ {1, 2, . . . , n} such that a = am . Consider this m, and denote it by u.
Thus, u ∈ {1, 2, . . . , n} such that a = au . Similarly, we can find a v ∈ {1, 2, . . . , n}
such that b = bv .
Recall that Im = [ am , bm ] for each m ∈ {1, 2, . . . , n}. Hence, Iu = [ au , bu ] and
Iv = [ av , bv ].  
Now, bu = b < a p . Hence, the intervals [ au , bu ] and a p , bp do not intersect (since
the interval [ au , bu ] ends at bu , whereas the interval a p , bp begins  at a p ).
Also, a > b p , so that b p < a = av. Hence, the intervals a p , b p and [ av , bv ] do not
intersect (since the interval a p , b p ends at b p , whereas the interval [ av , bv ] begins
at av ).
Finally, bu < a p ≤ b p < av . Hence, the intervals [ au , bu ] and [ av , bv ] do not
intersect (since the interval [ au , bu ] ends at bu , whereas the interval [ av , bv ] begins at
av ).
Combining the results of the previous   three paragraphs, we conclude that no
two of the three intervals [ au , bu ] , a p , b p , [ av , bv ] intersect. In other words,
 no two
of the three intervals Iu , I p , Iv intersect (since Iu = [ au , bu ] and I p = a p , b p and
139 These maximum and minimum exist because of Theorem 5.1.1.

December 25, 2021


Math 235 notes page 233

Iv = [ av , bv ]). This shows that u, p and v are distinct (since otherwise, two of the
three intervals Iu , I p , Iv would be equal, and thus would intersect140 ).
But we assumed that for any three distinct elements i, j, k ∈ {1, 2, . . . , n}, at least
two of the three intervals Ii , Ij , Ik intersect. Applying this to i = u, j = p and
k = v, we conclude that at least two of the three intervals Iu , I p , Iv intersect. But
this contradicts the fact that no two of the three intervals Iu , I p , Iv intersect. This
contradiction shows that our assumption was false. Hence, we have shown that
each of the intervals I1 , I2 , . . . , In contains at least one of a and b. This solves Exercise
5.2.2.
Does this mean we have solved Exercise 5.2.1? It looks like it does, but there is a
minor wrinkle. Exercise 5.2.1 does not just claim that there exist two moments such
that each student is present in the classroom at least at one of them. It also claims
that the lecturer can pick these two moments. This is a slightly stronger claim, as
the lecturer might not know in advance when the students will enter or leave the
classroom until they have done so (and by then, it might be too late to make the
announcements). Thus, the lecturer needs to work with incomplete information (or
at least Exercise 5.2.1 allows for such an interpretation).
To some extent, our solution to Exercise 5.2.2 above works even with this in-
complete information. Indeed, the numbers a and b we defined can be computed
“on the fly” if the lecturer knows how many students she has (i.e., the number n)
and pays attention to their comings and goings. The number a is the moment at
which the last student enters the classroom (so the head count is complete), and
the number b is the moment at which the first student leaves the classroom. At
both of these moments, the lecturer (if she keeps a head count and pays attention
to students leaving) can immediately make the announcement.
But what if the lecturer does not know n? Without knowing how many students
there are in total, how to tell when the last one has entered? The way Exercise 5.2.1
is stated, it is not clear whether this is a situation to be considered141 , but we can
choose to do so anyway. Can the lecturer find a and b independently of the number
of students? Yes – but this needs a different choice of a and b. See Exercise 5.4.7
below for this. See also Exercise 5.4.8 for a generalization of Exercise 5.2.2.

5.2.3. Matching n points to n points with no intersection


The next exercise comes from the realm of combinatorial geometry (see, e.g., [Engel98,
Chapter 3, Example E4] or [Grinbe08, Aufgabe 3.8] for somewhat weaker versions
of it):

Exercise 5.2.3. Let n ∈ N. Let F1 , F2 , . . . , Fn be n distinct points in the plane. Let


W1 , W2 , . . . , Wn be n further distinct points in the plane. Assume that no four

140 since
these intervals are nonempty
141 Theoriginal wording in [Grinbe08, Exercise 3.11] uses n = 100, so this situation needs not be
addressed.

December 25, 2021


Math 235 notes page 234

of the 2n points F1 , F2 , . . . , Fn , W1 , W2 , . . . , Wn are collinear (i.e., lie on a common


line). Let [n] = {1, 2, . . . , n}. Prove that there exists a bijection σ : [n] → [n] such
that no two of the n segments142 F1 Wσ(1) , F2 Wσ(2) , . . . , Fn Wσ(n) intersect.

Exercise 5.2.3 is commonly worded as a road planning problem: The points


F1 , F2 , . . . , Fn are the positions of n farms, while the points W1 , W2 , . . . , Wn are the
positions of n wells. The exercise then claims that there is a way to connect each
farm to a well by a straight-line road in such a way that no two roads intersect. (It
is understood that different farms should be connected to different wells.)
We note that Exercise 5.2.3 would still hold if we replaced “plane” by “space” or
even “d-dimensional space” for any d ≥ 1; we have just stated it on the plane for
reasons of familiarity. (Even the solution we will give below would still apply in
d-dimensional space for any d ≥ 1.)
Before we solve Exercise 5.2.3, let us illustrate it on a small example.

142 Theword “segment” mens “line segment”. Two sets U and V are said to intersect if and only if
U ∩ V 6= ∅. Thus, two line segments intersect even if they just have an endpoint in common (or
an endpoint of one lies on the other).

December 25, 2021


Math 235 notes page 235

Example 5.2.5. Let n = 3. Let F1 , F2 , F3 , W1 , W2 , W3 be the following six points on


the plane:
F2 F3

F1 W1

W2 W3

(Looks familiar?) There are six bijections σ : [n] → [n]; let us draw the n segments
F1 Wσ(1) , F2 Wσ(2) , . . . , Fn Wσ(n) for each of them:

F2 F3 F2 F3

F1 W1 F1 W1

W2 W3 W2 W3

F2 F3 F2 F3

F1 W1 F1 W1

W2 W3 W2 W3

F2 F3 F2 F3

F1 W1 F1 W1

W2 W3 W2 W3

The third bijection (i.e., the first one in the second row of the table) has
the property required in the problem (viz., that no two of the n segments
F1 Wσ(1) , F2 Wσ(2) , . . . , Fn Wσ(n) intersect).

December 25, 2021


Math 235 notes page 236

Solution to Exercise 5.2.3 (sketched). For any bijection σ : [n] → [n], we define the
road length r (σ) by

r (σ) = F1 Wσ(1) + F2 Wσ(2) + · · · + Fn Wσ(n) ∈ R.

(Visually speaking, this is the total length of road that needs to be paved if we
choose to connect the farms F1 , F2 , . . . , Fn to the wells Wσ(1) , Wσ(2) , . . . , Wσ(n) , re-
spectively.)
The set {bijections σ : [n] → [n]} is clearly nonempty and finite143 . Thus, the set
{r (σ) | σ : [n] → [n] is a bijection} also is nonempty and finite. Hence, this set
has a minimum element144 . In other words, there exists a bijection σ : [n] → [n] for
which r (σ) is minimum (among all such bijections). Consider this σ. (If there are
several σ that all give the same minimum value of r (σ), then we just pick any of
them.) Note that any bijection σ0 : [n] → [n] satisfies

r (σ) ≤ r σ0

(256)

(since σ was chosen in such a way that r (σ ) is minimum). (Intuitively, the bijection
σ is an assignment of wells to farms that minimizes the total road length.)
We shall now show that no two of the n segments F1 Wσ(1) , F2 Wσ(2) , . . . , Fn Wσ(n)
intersect. Indeed, assume the contrary. Thus, there exist two distinct elements
i, j ∈ [n] such that the two segments Fi Wσ(i) and Fj Wσ( j) intersect. Consider these
i, j. The segments Fi Wσ(i) and Fj Wσ( j) intersect. The situation is illustrated in the
following picture (which also suggests the next step):

Wσ( j)

Fi
Wσ(i)

Fj
.

We have i 6= j (since i, j are distinct) and thus σ (i ) 6= σ ( j) (since σ is a bijec-


tion). Recall that no four of the 2n points F1 , F2 , . . . , Fn , W1 , W2 , . . . , Wn are collinear.
Hence, the four points Fi , Fj , Wσ(i) , Wσ( j) are not collinear (since i 6= j and σ (i ) 6=
σ ( j)). Moreover, from i 6= j, we obtain Fi 6= Fj (since the n points F1 , F2 , . . . , Fn
143 Indeed, anyone familiar with basic combinatorics (or abstract algebra) will recognize this set as
the n-th symmetric group Sn , and will know that it has size n!. (See, e.g., Theorem 7.4.1 or [19fco,
Theorem 1.7.2] for the proof of the latter fact.) But even if we don’t know this, we can easily see
that this set is nonempty and finite. Indeed, it is nonempty (since the identity map id[n] : [n] →
[n] belongs to this set) and finite (since it is a subset of the finite set {maps [n] → [n]}).
144 by Theorem 5.1.1

December 25, 2021


Math 235 notes page 237

are distinct). Also, from σ (i ) 6= σ ( j), we obtain Wσ(i) 6= Wσ( j) (since the n points
W1 , W2 , . . . , Wn are distinct).
Now, we claim that

Fi Wσ( j) + Fj Wσ(i) < Fi Wσ(i) + Fj Wσ( j) . (257)

This appears rather obvious from a look at the above picture, but a rigorous proof
takes some work. We thus outsource this work into a lemma (Lemma 5.2.6 below).
The inequality (257) follows from Lemma 5.2.6, applied to X = Fi , Y = Wσ(i) ,
Z = Fj and W = Wσ( j) (since Fi 6= Fj and Wσ(i) 6= Wσ( j) , and since the points
X, Z, Y, W are not collinear, and since the segments Fi Wσ(i) and Fj Wσ( j) intersect).
Now, what do we gain from the inequality (257)? Intuitively, it is telling us that
if we replace the roads Fi Wσ(i) and Fj Wσ( j) by Fi Wσ( j) and Fj Wσ(i) (that is, if we
reconnect the wells Wσ(i) and Wσ( j) , which we originally connected to the farms Fj
and Fi , to the farms Fj and Fi instead), then the total road length decreases. This
observation is helpful, since it contradicts the fact that our original road connections
were chosen to minimize the road length. So let us formalize this: We define a new
map σ0 : [n] → [n] by setting

σ (k ) , if k 6= i and k 6= j;

0
σ (k ) = σ ( j) , if k = i; for each k ∈ [n] .

σ (i ) , if k = j

That is, the map σ0 is obtained from σ by swapping the values at i and j. It is clear
that this map σ0 is a bijection (since σ was a bijection, and we obtained σ0 from σ
by swapping two values). Consequently, (256) yields r (σ ) ≤ r (σ0 ). However, the
definition of r (σ ) yields

r (σ ) = F1 Wσ(1) + F2 Wσ(2) + · · · + Fn Wσ(n) = ∑ Fk Wσ(k)


k∈[n]

= Fi Wσ(i) + Fj Wσ( j) + ∑ Fk Wσ(k) (258)


k∈[n];
k6=i and k6= j

(here we have split off the addends for k = i and for k = j from the sum). The same

December 25, 2021


Math 235 notes page 238

argument (applied to σ0 instead of σ) yields

r σ0 = ∑

Fi Wσ0 (i) + Fj Wσ0 ( j) + Fk Wσ0 (k)
| {z } | {z } k∈[n]; | {z }
=| Fi Wσ( j) | =| Fj Wσ(i) | k6=i and k6= j =| Fk Wσ(k) |
(since σ0 (i )=σ( j)) (since σ0 ( j)=σ (i )) (since σ0 (k)=σ(k)
(because k6=i and k6= j))

= Fi Wσ( j) + Fj Wσ(i) + ∑ Fk Wσ(k)


| {z } k∈[n];
<| Fi Wσ(i) |+| Fj Wσ( j) | k6=i and k 6= j
(by (257))

< Fi Wσ(i) + Fj Wσ( j) + ∑ Fk Wσ(k) = r (σ) (by (258)) .


k∈[n];
k6=i and k6= j

This contradicts r (σ ) ≤ r (σ0 ). This contradiction shows that our assumption was
wrong. Hence, no two of the n segments F1 Wσ(1) , F2 Wσ(2) , . . . , Fn Wσ(n) intersect.
Thus, Exercise 5.2.3 is solved, except that we still owe a proof of the following
lemma:

Lemma 5.2.6. Let X, Y, Z, W be four points in the plane. Assume that X 6= Z and
Y 6= W. Assume furthermore that

the points X, Z, Y, W are not collinear. (259)

Assume that the segments XY and ZW intersect. Then,

| XW | + | ZY | < | XY | + | ZW | .

Proof of Lemma 5.2.6. The segments XY and ZW intersect, i.e., have some point Q
in common. Consider this point Q. We illustrate this situation with a picture, albeit
we don’t harbor any illusions about its generality:

X Q
Y

Z .

Recall the triangle inequality, which says that any triangle ABC satisfies | AC | <
| AB| + | BC |. This inequality holds even when the triangle ABC is degenerate (i.e.,

December 25, 2021


Math 235 notes page 239

when the three points A, B, C are collinear), as long as we replace the “<” sign by
a “≤” sign. In other words, any three points A, B, C in the plane satisfy
| AC | ≤ | AB| + | BC | . (260)
Applying this to A = X, B = Q and C = W, we obtain
| XW | ≤ | XQ| + | QW | . (261)
The same argument (applied to Z and Y instead of X and W) yields
| ZY | ≤ | ZQ| + | QY | . (262)
However, the point Q lies on the segment XY, and thus satisfies | XQ| + | QY | =
| XY |. The same argument (applied to Z and W instead of X and Y) yields | ZQ| +
| QW | = | ZW |.
Now, adding the two inequalities (261) and (262) together, we find
| XW | + | ZY | ≤ (| XQ| + | QW |) + (| ZQ| + | QY |)
= | XQ| + | QY | + | ZQ| + | QW |
| {z } | {z }
=| XY | =| ZW |
= | XY | + | ZW | . (263)
This is almost the inequality | XW | + | ZY | < | XY | + | ZW | that we need to prove.
But only “almost”. In fact, the inequality in (263) has a “≤” sign, while we want to
prove the same inequality with a “<” sign. In other words, we want to prove that
the inequality (263) cannot be an equality.
We assume the contrary. That is, we assume that the inequality (263) is an equal-
ity. Thus, we have
| XW | + | ZY | = | XY | + | ZW |
= (| XQ| + | QW |) + (| ZQ| + | QY |) (264)
(since we have previously shown that (| XQ| + | QW |) + (| ZQ| + | QY |) = | XY | +
| ZW |).
We notice the following basic fact: If a, b, c, d are four real numbers satisfying
a ≤ b and c ≤ d and a + c = b + d, then a = b and c = d 145 . We can apply this to
a = | XW | and b = | XQ| + | QW | and c = | ZY | and d = | ZQ| + | QY | (because the
three relations (261), (262) and (264) are saying precisely that these four numbers
a, b, c, d satisfy a ≤ b and c ≤ d and a + c = b + d). As a result, we conclude that
| XW | = | XQ| + | QW | (265)
145 Proof.
Let a, b, c, d be four real numbers satisfying a ≤ b and c ≤ d and a + c = b + d. Then,
a +c ≤ b + c and b + |{z}
b + d = |{z} c ≤ b + d. Combining these two inequalities, we find
≤b ≤d
b + d = b + c. Hence, d = c, so that c = d. Now, a + c = b + |{z}
d = b + c, so that a = b. Hence,
=c
we have proved that a = b and c = d, qed.

December 25, 2021


Math 235 notes page 240

and
| ZY | = | ZQ| + | QY | . (266)
Now, we recall the triangle inequality in its original form. It says that if three
points A, B, C form a nondegenerate triangle (i.e., are not collinear), then | AC | <
| AB| + | BC |. Hence, the contrapositive holds: If three points A, B, C satisfy | AC | =
| AB| + | BC |, then they are collinear. A bit of thought reveals an even stronger
conclusion: If three points A, B, C satisfy | AC | = | AB| + | BC |, then B lies on the
segment AC. Applying this to A = X, B = Q and C = W, we conclude that Q lies
on the segment XW (since we have | XW | = | XQ| + | QW |). The same argument (ap-
plied to Z and Y instead of X and W) yields that Q lies on the segment ZY. Hence,
in total, we know that the point Q lies on the four segments XY, XW, ZY, ZW.
It is now tempting to conclude right away that this forces all four points X, Z, Y, W
are collinear. In truth, this is not totally obvious yet, since some of the segments
XY, XW, ZY, ZW may be degenerate, or the point Q might be an endpoint of some
of them. Thus, we proceed more cautiously.
We claim that we have Q = X or Q = Y. Indeed, assume the contrary. Thus,
Q 6= X and Q 6= Y. Thus, the lines QX and QY are well-defined. These two lines
QX and QY are furthermore equal (since Q lies on the segment XY), so we can
call them the “line QXY”. This line QXY contains the points X and Y, thus also
the point W (since Q lies on the segment XW) and the point Z (since Q lies on the
segment ZY); thus, it contains all four points X, Z, Y, W. Hence, these four points
X, Z, Y, W are collinear. But this contradicts (259). This contradiction shows that
our assumption was false.
Hence, we have shown that Q = X or Q = Y. Similarly, we can see that Q = Z
or Q = W. Hence, we are in one of the following two cases:
Case 1: We have Q = Z.
Case 2: We have Q = W.
Let us first consider Case 1. In this case, we have Q = Z. Hence, Q = Z 6= X
(since X 6= Z). But recall that we have Q = X or Q = Y. Hence, we must have
Q = Y (since Q 6= X). But Q lies on the segment XW. In other words, Z and
Y lie on the segment XW (since Q = Z and Q = Y). This shows that the four
points X, Z, Y, W are collinear. But this contradicts (259). Thus, we have found a
contradiction in Case 1.
Let us next consider Case 2. In this case, we have Q = W. Hence, Q = W 6= Y
(since Y 6= W). But recall that we have Q = X or Q = Y. Hence, we must have
Q = X (since Q 6= Y). But Q lies on the segment ZY. In other words, W and
X lie on the segment ZY (since Q = W and Q = X). This shows that the four
points X, Z, Y, W are collinear. But this contradicts (259). Thus, we have found a
contradiction in Case 2.
We have now found a contradiction in each of the Cases 1 and 2. Hence, we
always obtain a contradiction. Thus, our assumption was wrong. This means
we have shown that the inequality (263) cannot be an equality. Hence, the “≤”
sign in this inequality can be replaced by a “<” sign. In other words, we have
| XW | + | ZY | < | XY | + | ZW |. This proves Lemma 5.2.6.

December 25, 2021


Math 235 notes page 241

5.2.4. The round track puzzle


The next exercise is a classic (e.g., [Engel98, Exercise 3.15], [Engel98, Exercise
8.2], https://math.stackexchange.com/questions/2338579/ just to mention three
sources):

Exercise 5.2.4. Let n be a positive integer. Consider a circular track with n gas
stations on it. Consider a car. Assume that, taken together, the n gas stations
have just enough gas for the car to complete the entire track. Prove that at least
one of these n gas stations has the property that if the car starts at this gas station
with an initially empty gas tank, then it can traverse the entire track without ever
running out of gas, provided that it refuels at every gas station it comes across
(including the one at which it starts).
(It is understood that the car’s tank is large enough to fit all the gas it can get.
It is also understood that the track is one-way, so the car can only move in one
direction. It is also understood that the use of gas is proportional to the length
of road covered – i.e., independent of speed and acceleration.)

Example 5.2.7. The following picture shows an example for n = 5:

E
0.3
(0.1)
0.2

D (0.2) (0.2) A
0.1 0.1
(0.4) (0.1)
C B

0.3

Here, the 5 gas stations are called A, B, C, D, E; the amount of gas available from
each gas station is written in parentheses beside the station; and the length of
road between two consecutive gas stations is written on the corresponding piece
of track. The measures of gas and road length are normalized in such a way that
the total length of the track is 1, and the total amount of gas in all stations is 1.
We understand that the car can only go clockwise around the track.
In this example, we see that if a car with an empty tank were to start at A,
then it would not be able to traverse the entire track. Indeed, it would first refuel
at A; this would put 0.2 units of gas in its tank; it would then use 0.1 units of
gas to get to B; then it would refuel at B; then it would have 0.2 − 0.1 + 0.1 = 0.2
units of gas in its tank; but it would then run out of gas between B and C.

December 25, 2021


Math 235 notes page 242

On the other hand, if a car with an empty tank were to start at C, then it would
be able to traverse the entire track; here is a plot of the gas in its tank over the
entire journey:

C D E A B C

(with the horizontal axis standing for road length covered, while the vertical axis
stands for the gas in the car’s tank). (The labels C, D, E, A, B, C at the bottom
mark the points at which the car is at a gas station.) Note that this is a “sawtooth
function” plot, in which the vertical segments correspond to refuelling and the
downward slopes correspond to gas being burned along the road.

Solution to Exercise 5.2.4 (sketched). Imagine a new car that starts somewhere on the
track with enough gas to go through the entire track. We call this the ghost car.
Now, let the ghost car go around the track146 , refueling at each gas station (even
though it does not actually need this extra gas).
For example, in Example 5.2.7, if the ghost car starts at gas station A, then here

146 We assume that the ghost car uses gas at the same rate as the original car.

December 25, 2021


Math 235 notes page 243

is the plot of the gas in its tank:

A B C D E A
.

Clearly, the ghost car never runs out of gas (since it had enough even before re-
fuelling); but there will be a point in its journey where its gas level is minimum.
More precisely, there will be a gas station at which the ghost car’s gas level (before
refuelling) is minimum; let us pick such a gas station and call it P. Thus, the ghost
car’s gas level at P is ≤ to its gas level at any other gas station, and thus also ≤ to
its gas level at any point on the road (because its gas level only declines between
gas stations). In the example above, P = C.
After the ghost car has completed its loop around the track, it is back at the same
station it started, and with the same amount of gas in its tank (since the total gas
it has spent during the loop was precisely the amount it collected from the gas
stations). At that point, we refill all gas stations (with the same amount of gas that
they initially had) and we let the ghost car keep going around the circle (again
collecting gas at the stations). Thus, the ghost car makes another loop. This second
loop is an exact repetition of its previous loop (i.e., at each point, the ghost car has
the same gas level on its second loop as it did on its first loop), because the ghost
car started with the same gas level as initially and the gas stations had the same
amount of gas as initially. Thus, if we plot the gas level in the car, the part of the
plot that corresponds to the second loop is just a horizontally shifted copy of the

December 25, 2021


Math 235 notes page 244

part corresponding to the first loop:

A B C D E A B C D E A
.

Thus, the minimum gas level (over both loops of the ghost car) is still achieved at
station P. In other words, the ghost car never has less gas in its tank than it does at
station P (before refuelling).
Now, let us start our original car (not the ghost car) from station P. We claim that
it will complete the entire track without running out of gas. Indeed, the following
picture shows (again in our above example) both the gas level of the ghost car (in

December 25, 2021


Math 235 notes page 245

grey) and the gas level of the original car (in blue):

A B C D E A B C D E A
.

We see that the gas level plot of the original car is just a copy of a piece of the
gas level plot of the ghost car, shifted downwards so it starts on the horizontal
axis. Indeed, the original car makes the same journey as the ghost car from P to P,
except that the original car starts with an empty tank whereas the ghost car starts
with some gas.
But recall that the ghost car never has less gas in its tank than it does at station
P. In other words, the gas level plot of the ghost car never goes below the level
at station P. Therefore, the gas level plot of the original car never goes below the
horizontal axis147 . In other words, the original car (on its journey from P to P)
never runs out of gas. This is precisely what we wanted to show. Thus, Exercise
5.2.4 is solved.

5.2.5. n cowboys, n bullets


Here is another classic exercise (essentially [Engel98, Chapter 3, Exercise 7 (a)]),
which illustrates how the Extremal Principle can be applied during an induction
step:

Exercise 5.2.5. Let n ≥ 1 be an odd integer. Consider n cowboys, each standing


at some point in space.

147 sincethe gas level plot of the original car is just a copy of a piece of the gas level plot of the ghost
car, shifted downwards so it starts on the horizontal axis

December 25, 2021


Math 235 notes page 246

At high noon, each cowboy shoots his nearest neighbor, provided that he has
a unique nearest neighbor. (If his nearest neighbor does not exist148 or is not
unique, then he shoots no one.)
Prove that at least one cowboy does not get shot.

Example 5.2.8. Let n = 7, and consider seven cowboys A, B, C, D, E, F, G placed


in the plane as follows:

B
F E G

Then, the following picture shows the paths of the bullets:

B
F E G

(where an arrow from I to J means that I shoots J). (Note that cowboy E shoots
no one, since he has two nearest neighbors F and G.) Thus, cowboys C, D, F and
G do not get shot.

Solution to Exercise 5.2.5. We proceed by strong induction on n:


Induction step: Let m ≥ 1 be an odd integer. Assume (as the induction hypothesis)
that Exercise 5.2.5 holds for n < m. We must prove that Exercise 5.2.5 holds for
n = m.
Thus, let m ≥ 1 be an odd integer. Consider m cowboys, each standing at some
point in space. At high noon, each cowboy shoots his nearest neighbor, provided

148 Of course, this happens precisely when n = 1.

December 25, 2021


Math 235 notes page 247

that he has a unique nearest neighbor. We must prove that at least one cowboy
does not get shot.
Indeed, if m = 1, then there is only one cowboy, and he has no nearest neighbor
and thus does not shoot anyone. Thus, if m = 1, then the lone cowboy does not
got shot. Hence, we are done if m = 1. Thus, for the rest of this proof, we WLOG
assume that m 6= 1. Hence, m > 1 (since m ≥ 1), and thus m ≥ 3 (since m is odd).
Consequently, m − 2 ≥ 1. Also, the integer m − 2 is odd (since m is odd).
Moreover, m ≥ 3 ≥ 2. Thus, there exists at least one pair ( A, B) of two distinct
cowboys A and B. Let us pick a pair ( A, B) of two distinct cowboys A and B with
minimum distance | AB|. Then, B is a nearest neighbor of A, so that A shoots either
B or no one (depending on whether B is the only nearest neighbor of A). Likewise,
B shoots either A or no one.
Now, let us consider the m − 2 cowboys distinct from A and B. We call these
m − 2 cowboys lucky (because they might get to live a bit longer than A and B).
The two cowboys A and B do not shoot any lucky cowboy (since A shoots either B
or no one, and since B shoots either A or no one).
Now, we know that m − 2 ≥ 1 is an odd integer satisfying m − 2 < m. Hence,
our induction hypothesis yields that Exercise 5.2.5 holds for n = m − 2. Therefore,
we can apply Exercise 5.2.5 to the m − 2 lucky cowboys. We thus conclude that if
the two cowboys A and B did not exist (i.e., if the only cowboys around were the
lucky ones), then at least one lucky cowboy would not get shot. In other words, if
the two cowboys A and B did not exist, then there would be a lucky cowboy C that
would not get shot. Consider this C.
Now, we claim that C does not get shot even in our original setup (i.e., even when
A and B do exist). Indeed, assume the contrary. Thus, there is a cowboy D that
shoots C. Then, D must be a lucky cowboy (since A and B do not shoot any lucky
cowboy, and hence do not shoot C), and C must be his unique nearest neighbor
(since any cowboy shoots his unique nearest neighbor). But this entails that D
would shoot C even if A and B did not exist (because its unique nearest neighbor
would not change when the two unrelated cowboys A and B are removed, unless
this neighbor was one of A and B); but this is impossible, since we know that C
would not get shot if A and B did not exist. This contradiction shows that our
assumption was wrong.
Hence, we have showed that C does not get shot even in our original setup.
Therefore, at least one cowboy does not get shot.
We have thus proved that Exercise 5.2.5 holds for n = m. This completes the
induction step, so Exercise 5.2.5 is solved.
Another example of the Extremal Principle used in an induction is found in the
solution of Exercise 3.7.9.

5.2.6. The three chess clubs problem


The following problem ([Engel98, Exercise 3.44], [Negut05, Chapter 3, problem 27])
requires a fairly subtle application of the extremal principle:

December 25, 2021


Math 235 notes page 248

Exercise 5.2.6. Let n be a positive integer. Consider three chess clubs, each of
which has n players. Assume that no two players in the same club have played
against each other, but each player has played against at least n + 1 other players.
Prove that there exist three players a, b and c that have mutually played against
each other (that is, a has played against b, and b has played against c, and c has
played against a).

Example 5.2.9. Let us take n = 3, and consider the following constellation:

a3 b3 c3

b2
a2 c2

a1 b1 c1

Here, the nodes are the players; the oval blobs are the three clubs; and the con-
necting lines show who has played against whom (viz., two players are con-
nected by a line segment if and only if they have played against each other). We
thus see that a2 , b3 and c3 have mutually played against each other.

Solution to Exercise 5.2.6. If a is any player, then we define the score of a to be the
maximum number of players from a single club that a has played against. (For
example, if A, B and C are the three clubs, and if a player a has played against 0
players from club A and against 6 players from club B and against 4 players from
club C, then the score of a is 6.)
It is easy to see that the score of any player is positive149 . (Actually, it is at least
n+1
, but we won’t need this.)
2
The three clubs have 3n players altogether. Among these 3n players, let a be the
player with maximum score. Let k be the score of a. Thus, a has played against k
players from some club (by the definition of a score). Let B be this club, and let A

149 Proof.Let a be a player. We must show that the score of a is positive.


We assumed that each player has played against at least n + 1 other players. Hence, a has
played against at least n + 1 other players. Thus, a has played against at least one other player
(since n + 1 ≥ 1). Hence, in particular, a has played against at least one player from a single
club.
But the score of a was defined as the maximum number of players from a single club that a
has played against. Hence, this score is at least 1 (since a has played against at least one player
from a single club), and thus is positive. Hence we have shown that the score of a is positive.
Qed.

December 25, 2021


Math 235 notes page 249

be the club that contains a. It is clear that A 6= B 150 . Thus, A and B are two of
the three clubs. Let C be the remaining club.
Player a belongs to club A, and thus has played against no one from club A (since
no two players in the same club have played against each other). Furthermore,
player a has played against k players from club B. But we also know that player
a has played against at least n + 1 other players in total151 . Hence, we can easily
see that player a must have played against at least one player c from club C 152 .
Consider this c.
Recall that a is a player with maximum score. Since the score of a is k, this entails
that the maximum score of a player is k. Therefore, the score of c is at most k.
Thus, player c has played against at most k players from club A (because otherwise,
c would have played against more than k players from club A, and therefore the
score of c would be greater than k). Therefore, player c must have played against
at least n + 1 − k players from club B 153 .
Now, let X be the set of all players from club B that player a has played against.
Then, | X | = k (since a has played against k players from club B).
Also, let Z be the set of all players from club B that player c has played against.
Then, | Z | ≥ n + 1 − k (since player c must have played against at least n + 1 − k
150 Proof. Assume the contrary. Thus, A = B. Hence, B is the club that contains a (since A is the
club that contains a). Thus, a has played against no players from club B (since no two players in
the same club have played against each other). But we recall that player a has played against k
players from club B. Comparing the previous two sentences, we conclude that k = 0. However, k
is the score of A and therefore positive (since the score of any player is positive). This contradicts
k = 0. This contradiction shows that our assumption was wrong. Qed.
151 because each player has played against at least n + 1 other players
152 Proof. Assume the contrary. Thus, player a has played against no one from club C. We further

know that a has played against no one from club A. Recall hat player a has played against at
least n + 1 other players in total. All these at least n + 1 players must belong to club B (since
player a has played against no one from club C and against no one from club A). Thus, club B
must have at least n + 1 players. But this contradicts the fact that club B has only n players (since
any club has exactly n players). This contradiction shows that our assumption was wrong. Qed.
153 Proof. Assume the contrary. Thus, player c has played against fewer than n + 1 − k players from

club B. In other words,

(the number of players from club B that c has played against) < n + 1 − k.

Moreover, player c has played against at most k players from club A (as we have already seen);
in other words,

(the number of players from club A that c has played against) ≤ k.

Finally, player c belongs to club C, and thus cannot have played against anyone from club C
(because no two players in the same club have played against each other). Hence,

(the number of players from club C that c has played against) = 0.

Now, recall that each player has played against at least n + 1 other players. Hence, c has played
against at least n + 1 other players. In other words,

(the number of players that c has played against) ≥ n + 1.

December 25, 2021


Math 235 notes page 250

players from club B).


Consider the club B as a set of players; thus, | B| = n (since each club has exactly
n players). The sets X and Z are subsets of B (since they consist of players from club
B); therefore, their union X ∪ Z is a subset of B as well. Hence, | X ∪ Z | ≤ | B| = n.
If the sets X and Z were disjoint, then they would satisfy

|X ∪ Z| = |X | + |Z| (by (27), applied to P = X and Q = Z )


|{z} |{z}
=k ≥ n +1− k
≥ k + (n + 1 − k) = n + 1 > n,
which would contradict | X ∪ Z | ≤ n. Thus, the sets X and Z cannot be disjoint. In
other words, there exists some b ∈ X ∩ Z.
Now, b ∈ X ∩ Z ⊆ X; in other words, b is a player from club B that player a has
played against (by the definition of X). Also, b ∈ X ∩ Z ⊆ Z; in other words, b is a
player from club B that player c has played against (by the definition of Z).
We now know that player a has played against player c, and we know that both
players a and c have played against b. Therefore, the three players a, b and c have
mutually played against each other. This shows that there exist three players that
have mutually played against each other. This solves Exercise 5.2.6.
It is worth highlighting a certain part of the above argument: namely, the part
where we argued that the sets X and Z cannot be disjoint because they have too
many elements among them (that is, | X | + | Z | ≥ n + 1). This is a relative of what
is called the pigeonhole principle, which we shall discuss in the next chapter.
(A few years ago I unsuccessfully tried to generalize Exercise 5.2.6 to four chess
clubs. See https://mathoverflow.net/questions/247079 for details.)

5.3. Infinite descent


Infinite descent is a problem solving technique that is closely related to both induc-
tion and the extremal principle (and, in fact, can easily be restated as either of the
two). We motivate it with an example that is perhaps too simple:
Thus,

n + 1 ≤ (the number of players that c has played against)


= (the number of players from club A that c has played against)
| {z }
≤k
+ (the number of players from club B that c has played against)
| {z }
< n +1− k
+ (the number of players from club C that c has played against)
| {z }
=0
(since each player belongs to exactly one of the clubs A, B and C )
< k + (n + 1 − k) + 0 = n + 1.
This is absurd. This contradiction shows that our assumption was wrong, qed.

December 25, 2021


Math 235 notes page 251


Exercise 5.3.1. Prove that / Q.
3∈
There are many simple ways to solve Exercise 5.3.1. In particular, Corollary
√ 3.5.13
could be used to obtain an easy contradiction from an assumption of 3 ∈ Q.
However, let us forget for a moment about Corollary 3.5.13, and discover a more
complicated solution to Exercise 5.3.1 that illustrates how infinite descent works.

Discussion of Exercise 5.3.1. Assume the contrary. Thus, 3 ∈ Q. In √ other words,
there exists a pair ( a, b) of integers a and b satisfying b 6= 0 and 3 = a/b. We
shall call such a pair a solution.154 Thus, by our assumption, there exists a solution.
a and b are integers satisfying b 6= 0 and
√ Consider any solution ( a, b). Thus,

3 = a/b. Squaring the equality 3 = a/b, we obtain 3 = ( a/b)2 = a2 /b2 , so that
a2 = 3b2 .
Now, let us analyze the parity of b (that is, whether b is even or odd). Assume
first that b is odd. Hence, Exercise 3.3.3 (b) (applied to u = b) yields b2 ≡ 1 mod 4.
Hence, a2 = 3 |{z} b2 ≡ 3 · 1 = 3 mod 4. But if a was odd, then we would have
≡1 mod 4
a2 ≡ 1 mod 4 (by Exercise 3.3.3 (b), applied to u = a), which would entail 1 ≡ a2 ≡
3 mod 4, which would in turn contradict 1 6≡ 3 mod 4. Hence, a cannot be odd.
Thus, a is even. Hence, a2 ≡ 0 mod 4 (by Exercise 3.3.3 (a), applied to u = a), so
that 0 ≡ a2 ≡ 3 mod 4, which contradicts 0 6≡ 3 mod 4. This contradiction shows
that our assumption (that b is odd) was false. Hence, b is not odd. In other words,
b is even.
Hence, b2 ≡ 0 mod 4 (by Exercise 3.3.3 (a), applied to u = b). If a was odd,
then we would have a2 ≡ 1 mod 4 (by Exercise 3.3.3 (b), applied to u = a), which
b2 ≡ 3 · 0 = 0 mod 4, which would in turn contradict
would entail 1 ≡ a2 = 3 |{z}
≡0 mod 4
1 6≡ 0 mod 4. Thus, a cannot be odd. Hence, a must be even.
We have now shown that both a and b are even. In √ other words, a/2 and b/2
are integers. Furthermore,√ b/2 6 = 0 (since b 6 = 0) and 3 = ( a/2) / (b/2) (since
( a/2) / (b/2) = a/b = 3). Therefore, the pair ( a/2, b/2) is a solution again (by
the definition of a “solution”).
Let us see what we have achieved. We have not obtained the contradiction that
we were hoping for. However, proceeding from our original (assumed) solution
( a, b), we have found a new solution ( a/2, b/2). This new solution is “smaller”
than ( a, b) in various regards: For example, |b/2| < |b| (since b 6= 0). Let us define
the weight of a solution ( a, b) to be the nonnegative integer |b|. Thus, the new
solution ( a/2, b/2) has smaller weight than ( a, b) (since b 6= 0 and thus |b/2| < |b|).
Hence, we have proved the following observation:
Observation 1: If ( a, b) is any solution, then there exists a solution of
smaller weight than ( a, b).
154 The word “solution” here has been chosen in analogy to “solution of an equation”, not to “solu-
tion of a problem”. In particular, Exercise 5.3.1 will be solved once we have shown that there is
no solution.

December 25, 2021


Math 235 notes page 252

It turns out that this observation is almost as good as a contradiction. Here are
three ways to complete the solution of Exercise 5.3.1 using Observation 1:

• First way: We have assumed that there exists a solution. Consider such a
solution, and call it ( a0 , b0 ).
Observation 1 (applied to ( a, b) = ( a0 , b0 )) thus yields that there exists a
solution of smaller weight than ( a0 , b0 ). Consider such a solution, and call
it ( a1 , b1 ).
Observation 1 (applied to ( a, b) = ( a1 , b1 )) thus yields that there exists a
solution of smaller weight than ( a1 , b1 ). Consider such a solution, and call
it ( a2 , b2 ).
Clearly, this argument (in which we apply Observation 1 to construct a new
solution from an old one) can be applied over and over. Thus, we obtain an
infinite sequence of solutions ( a0 , b0 ) , ( a1 , b1 ) , ( a2 , b2 ) , . . ., each of which has
smaller weight than the previous one. Thus, the weights of these solutions
form an infinite strictly decreasing sequence. In other words, if we denote
the weight of the solution ( ai , bi ) by wi , then the sequence (w0 , w1 , w2 , . . .) is
strictly decreasing.
However, the weight of a solution is a nonnegative integer. Thus, w0 , w1 , w2 , . . .
are nonnegative integers; therefore, (w0 , w1 , w2 , . . .) is a strictly decreasing se-
quence of nonnegative integers. But there is no strictly decreasing sequence
of nonnegative integers (in fact, if (k0 , k1 , k2 , . . .) is any strictly decreasing se-
quence of integers, then it is easy to see that k i will be negative for any i > k0 ).
The preceding two sentences contradict each other; thus we have found the
contradiction we wanted.

• Second way: We recall the Extremal Principle, and pick a solution ( a, b) of


smallest possible weight. This can be done, since the set of weights of all
solutions is a nonempty set of nonnegative integers155 and therefore has a
minimum156 . Now, Observation 1 yields that there exists a solution of smaller
weight than ( a, b). But this contradicts the fact that the solution ( a, b) has the
smallest possible weight. This gives us the contradiction we were looking for.

• Third way: Finally, we can also finish our argument by induction. Namely, we
use strong induction to prove the following claim: For each n ∈ N,

there exists no solution with weight n. (267)

[Proof of (267): We proceed by strong induction on n:


Induction step: Let m ∈ N. Assume (as the induction hypothesis) that (267)
holds for n < m. We must prove that (267) holds for n = m.
155 It is nonempty because we have assumed that there exists a solution.
156 by Theorem 5.1.2

December 25, 2021


Math 235 notes page 253

Indeed, let ( a, b) be a solution with weight m. Thus, Observation 1 yields


that there exists a solution of smaller weight than ( a, b). In other words, there
exists a solution of weight < m (since the weight of ( a, b) is m). Let ( a0 , b0 ) be
this latter solution, and let q be its weight. Thus, q is a nonnegative integer
(since the weight of any solution is a nonnegative integer). That is, q ∈ N.
Also, q < m (since q is the weight of the solution ( a, b), which has weight
< m). Our induction hypothesis says that (267) holds for n < m. Thus, (267)
holds for n = q (since q < m). In other words, there exists no solution with
weight q. But this contradicts the fact that the solution ( a0 , b0 ) has weight q.
Forget that we fixed ( a, b). We thus have found a contradiction for each solu-
tion ( a, b) with weight m. Hence, there exists no solution with weight m. In
other words, (267) holds for n = m. This completes the induction step. Thus,
(267) is proved.]
Now, having proved (267), we easily see that there exists no solution whatso-
ever. (Indeed, if there was a solution, then it would have weight n for some
n ∈ N; but this would then contradict (267).) This contradicts our assumption
that there is a solution. Thus, again, we have found a contradiction.

Thus, we have finished the solution of Exercise 5.3.1 in three different ways. It is
fairly clear that these three ways formalize the same intuition: that a nonnegative
integer cannot keep getting decreased indefinitely (without eventually falling be-
low 0), and therefore a method to decrease the weight of a solution (no matter how
small it originally was) gives a guarantee that no solutions can exist. This principle
is known as the principle of Infinite Descent, and is often ascribed to Fermat even
though it was known to the ancient Greeks. Note that our arguments (in all three
ways) crucially rely on the fact that the weight of a solution was a nonnegative in-
teger. If it was merely an integer or a nonnegative rational number, then we could
not conclude much from Observation 1, since an infinite sequence of integers (or
of nonnegative rational numbers) could decrease indefinitely.
Here is a more sophisticated example for the Infinite Descent technique (Putnam
1973 problem B1):

Exercise 5.3.2. Let n ∈ N. Assume that a1 , a2 , . . . , a2n+1 are 2n + 1 integers with


the following property:

Splitting property: If any of the 2n + 1 numbers a1 , a2 , . . . , a2n+1 is re-


moved, then the remaining 2n numbers can be split into two equinu-
merous heaps with equal sum. (“Equinumerous” means that each
heap contains exactly n numbers.)

Prove that all 2n + 1 numbers a1 , a2 , . . . , a2n+1 are equal.

December 25, 2021


Math 235 notes page 254

Example 5.3.1. Let n = 1, so that 2n + 1 = 3. Then, in Exercise 5.3.2, we have


three integers a1 , a2 , a3 . The splitting property boils down to requiring that a2 =
a3 and a3 = a1 and a1 = a2 (because if one of the 3 numbers a1 , a2 , a3 is removed,
then the remaining 2 numbers can only be split into two equinumerous heaps in
one way – up to the order of the heaps). Thus, for n = 1, Exercise 5.3.2 says that
if a2 = a3 and a3 = a1 and a1 = a2 , then all 3 numbers a1 , a2 , a3 are equal. This is
obvious.

Example 5.3.2. Let n = 2, so that 2n + 1 = 5. Then, in Exercise 5.3.2, we have


five integers a1 , a2 , a3 , a4 , a5 . The splitting property requires that if any of these
five integers is removed, then the remaining four integers can be split into two
equinumerous heaps with equal sum. For instance, if a2 is removed, then the
remaining four integers a1 , a3 , a4 , a5 should satisfy a1 + a3 = a4 + a5 or a1 + a4 =
a3 + a5 or a1 + a5 = a3 + a4 . Again, Exercise 5.3.2 is saying that if the splitting
property is satisfied (not just for a2 , but also for each of the other numbers), then
all 5 numbers a1 , a2 , a3 , a4 , a5 are equal. This time, there is no quick way to see
this; there are too many ways in which the splitting property may be satisfied.

Example 5.3.3. Here is a non-example. Set n = 2 (so that 2n + 1 = 5) and

a1 = 1, a2 = 2, a3 = 3, a4 = 4, a5 = 5.

Then, the splitting property holds for removing a1 : Indeed, after removing a1 ,
we can split the remaining four numbers a2 , a3 , a4 , a5 into the two equinumerous
heaps a2 , a5 and a3 , a4 with equal sums (a2 + a5 = a3 + a4 ). Likewise, the splitting
property holds for removing a3 (since a1 + a5 = a2 + a4 ) and for removing a5
(since a1 + a4 = a2 + a3 ), but not for removing a2 or a4 .

Solution to Exercise 5.3.2 (sketched). Some notations first.


A solution will mean an (2n + 1)-tuple ( a1 , a2 , . . . , a2n+1 ) of integers that has the
splitting property.
A solution ( a1 , a2 , . . . , a2n+1 ) will be called flat if all 2n + 1 numbers a1 , a2 , . . . , a2n+1
are equal. Thus, our goal is to show that every solution is flat. In other words, our
goal is to show that there is no non-flat solution.
A solution ( a1 , a2 , . . . , a2n+1 ) will be called nonnegative if all 2n + 1 numbers
a1 , a2 , . . . , a2n+1 are nonnegative.
First, we observe the following:

Observation 1: If there exists a non-flat solution, then there exists a non-


negative non-flat solution.

[Proof of Observation 1: Assume that there exists a non-flat solution ( a1 , a2 , . . . , a2n+1 ).


Set b = min { a1 , a2 , . . . , a2n+1 }. Then, all 2n + 1 integers a1 , a2 , . . . , a2n+1 are ≥ b;
hence, all 2n + 1 differences a1 − b, a2 − b, . . . , a2n+1 − b are nonnegative. More-
over, it is easy to see that the (2n + 1)-tuple ( a1 − b, a2 − b, . . . , a2n+1 − b) is still

December 25, 2021


Math 235 notes page 255

a solution (indeed, subtracting b from all 2n + 1 numbers does not invalidate the
splitting property157 ) and still non-flat (since a1 − b = a2 − b = · · · = a2n+1 − b
would imply a1 = a2 = · · · = a2n+1 , which would contradict the assumption that
( a1 , a2 , . . . , a2n+1 ) is non-flat). Thus, this (2n + 1)-tuple ( a1 − b, a2 − b, . . . , a2n+1 − b)
is a nonnegative non-flat solution. Hence, there exists a nonnegative non-flat solu-
tion. This proves Observation 1.]
Thanks to Observation 1, we don’t need to bother with negative integers if we
don’t want to. This will come useful later.
Next, let us study the parity of the integers in a solution:

Observation 2: If ( a1 , a2 , . . . , a2n+1 ) is a solution, then the 2n + 1 integers


a1 , a2 , . . . , a2n+1 all have the same parity (i.e., are either all even or all
odd).

[Proof of Observation 2: Let ( a1 , a2 , . . . , a2n+1 ) be a solution. Let t = a1 + a2 + · · · +


a2n+1 be the sum of all its entries.
The splitting property shows that if the integer a2n+1 is removed, then the re-
maining 2n numbers can be split into two equinumerous heaps with equal sum.
In other words, the 2n numbers a1 , a2 , . . . , a2n can be split into two equinumerous
heaps with equal sum. Let s be the sum of either heap. Then, s is an integer (since
a1 , a2 , . . . , a2n are integers). But the sum a1 + a2 + · · · + a2n of all the 2n numbers
a1 , a2 , . . . , a2n must be s + s (since these 2n numbers can be split into two heaps,
each of which has sum s). Thus,

a1 + a2 + · · · + a2n = s + s = 2s ≡ 0 mod 2 (since s is an integer) .

Hence,

t = a1 + a2 + · · · + a2n+1 = ( a1 + a2 + · · · + a2n ) + a2n+1 ≡ a2n+1 mod 2,


| {z }
≡0 mod 2

so that a2n+1 ≡ t mod 2.


Thus, by removing a2n+1 and applying the splitting property, we have obtained
a2n+1 ≡ t mod 2. But we can apply the same argument to any of our 2n + 1 integers
a1 , a2 , . . . , a2n+1 in place of a2n+1 . Thus, we find that ai ≡ t mod 2 for each i ∈
{1, 2, . . . , 2n + 1}. As a consequence,

• if t is even, then all of a1 , a2 , . . . , a2n+1 are even;

• if t is odd, then all of a1 , a2 , . . . , a2n+1 are odd.

157 For example, in the case 2n + 1 = 5, if we had a2 + a3 = a1 + a4 , then after subtraction of b we


still have ( a2 − b) + ( a3 − b) = ( a1 − b) + ( a4 − b). Here it is important that the two heaps in the
splitting property were required to be equinumerous!

December 25, 2021


Math 235 notes page 256

Thus, a1 , a2 , . . . , a2n+1 all have the same parity. This proves Observation 2.]
Now, Observation 2 helps us transform non-flat solutions into smaller non-flat
solutions with an appropriate meaning of “smaller”. To be more precise, we con-
sider nonnegative solutions. If ( a1 , a2 , . . . , a2n+1 ) is a nonnegative solution, then the
weight of this solution is defined to be the nonnegative integer a1 + a2 + · · · + a2n+1 .
Now we claim:

Observation 3: If ( a1 , a2 , . . . , a2n+1 ) is a nonnegative non-flat solution,


then there exists a nonnegative non-flat solution with smaller weight
than ( a1 , a2 , . . . , a2n+1 ).

[Proof of Observation 3: Let ( a1 , a2 , . . . , a2n+1 ) be a nonnegative non-flat solution.


Then, Observation 2 yields that a1 , a2 , . . . , a2n+1 all have the same parity. In other
words, the numbers a1 , a2 , . . . , a2n+1 are either all even or all odd. Now, we con-
struct a new nonnegative non-flat solution (b1 , b2 , . . . , b2n+1 ) as follows:

• If a1 , a2 , . . . , a2n+1 are all even, then we set


a a a 
(b1 , b2 , . . . , b2n+1 ) = 1 , 2 , . . . , 2n+1 .
2 2 2

• If a1 , a2 , . . . , a2n+1 are all odd, then we set


a1 − 1 a2 − 1 a2n+1 − 1
 
(b1 , b2 , . . . , b2n+1 ) = , ,..., .
2 2 2

It is easy to check that (in either case) (b1 , b2 , . . . , b2n+1 ) is a nonnegative non-flat
solution with smaller weight than ( a1 , a2 , . . . , a2n+1 ). 158 Thus, there exists a non-
negative non-flat solution with smaller weight than ( a1 , a2 , . . . , a2n+1 ). This proves
Observation 3.]
Now, all we need is to reap our rewards. By the Principle of Infinite Descent,
Observation 3 entails that there exists no nonnegative non-flat solution. Hence, by
Observation 1, we conclude that there exists no non-flat solution either. In other
words, any solution is flat. Exercise 5.3.2 is solved.
There are some variants of this solution; in particular, it is possible to avoid
Observation 1, at the expense of a more complicated notion of weight159 and a
more complicated proof of (the analogue of) Observation 3.
Can we replace the “integers” in Exercise 5.3.2 by some more general types of
numbers? Let’s first try rational numbers:

158 Note that the weight of (b1 , b2 , . . . , b2n+1 ) is indeed smaller (and not just smaller-or-equal) than
the weight of ( a1 , a2 , . . . , a2n+1 ), because a1 , a2 , . . . , a2n+1 cannot all be 0 (since ( a1 , a2 , . . . , a2n+1 )
is non-flat).
159 Indeed, the way we defined the weight of a solution ( a , a , . . . , a
1 2 2n+1 ), it would not be nonnega-
tive in general if we don’t require ( a1 , a2 , . . . , a2n+1 ) to be nonnegative. Thus, we would have to
fix this – e.g., by redefining this weight as | a1 | + | a2 | + · · · + | a2n+1 | instead.

December 25, 2021


Math 235 notes page 257

Exercise 5.3.3. Let n ∈ N. Assume that a1 , a2 , . . . , a2n+1 are 2n + 1 rational num-


bers with the following property:

Splitting property: If any of the 2n + 1 numbers a1 , a2 , . . . , a2n+1 is re-


moved, then the remaining 2n numbers can be split into two equinu-
merous heaps with equal sum. (“Equinumerous” means that each
heap contains exactly n numbers.)

Prove that all 2n + 1 numbers a1 , a2 , . . . , a2n+1 are equal.


Solution to Exercise 5.3.3 (sketched). The numbers a1 , a2 , . . . , a2n+1 are rational. Thus,
there exists a positive integer d such that all the 2n + 1 products da1 , da2 , . . . , da2n+1
are integers. (Such a d is called a common denominator of a1 , a2 , . . . , a2n+1 .) Consider
such a d.
We assumed that the splitting property holds for our 2n + 1 numbers a1 , a2 , . . . , a2n+1 ;
thus, it also holds for the 2n + 1 numbers da1 , da2 , . . . , da2n+1 . (For example, in the
case 2n + 1 = 5, if we had a2 + a3 = a1 + a4 , then upon multiplication by d we get
da2 + da3 = da1 + da4 .) Hence, we can apply Exercise 5.3.2 to the 2n + 1 integers
da1 , da2 , . . . , da2n+1 instead of a1 , a2 , . . . , a2n+1 . Thus, we conclude that all 2n + 1
numbers da1 , da2 , . . . , da2n+1 are equal. Hence, all 2n + 1 numbers a1 , a2 , . . . , a2n+1
are equal as well (since d 6= 0). This solves Exercise 5.3.3.
Can we go further and replace the integers in Exercise 5.3.2 by real numbers?
Yes, as the following shows:
Exercise 5.3.4. Let n ∈ N. Assume that a1 , a2 , . . . , a2n+1 are 2n + 1 real numbers
with the following property:

Splitting property: If any of the 2n + 1 numbers a1 , a2 , . . . , a2n+1 is re-


moved, then the remaining 2n numbers can be split into two equinu-
merous heaps with equal sum. (“Equinumerous” means that each
heap contains exactly n numbers.)

Prove that all 2n + 1 numbers a1 , a2 , . . . , a2n+1 are equal.


We are not going to solve Exercise 5.3.4 now; but we may come back to it
later when discussing the use of linear algebra. (Two solutions can be found in
[GelAnd17, Problem 300].)

5.4. Homework set #5: More sequences and the extremal


principle
This is a regular problem set. See Section 3.7 for details on grading.
This homework set covers the above parts of Chapter 4 and Chapter 5. Some of
the problems may be unrelated.
Please solve at most 5 problems. (No points will be given for further solutions.)

December 25, 2021


Math 235 notes page 258

 
( a + 1) n
Exercise 5.4.1. Let n ∈ N and a ∈ N. Prove that an + 1 | .
n
In the following exercise, we shall consider polynomials in a single variable x.
The coefficients of these polynomials can be any kinds of numbers (rational, real
or complex). Recall that a polynomial has degree ≤ m (for some integer m) if and
m
only if it can be written as a sum ∑ ci xi with some constants c0 , c1 , . . . , cm . If m < 0,
i =0
then the only polynomial that has degree ≤ m is the zero polynomial 0 (since the
m
sum ∑ ci xi is an empty sum when m < 0).
i =0
If P = P ( x ) is a polynomial, then ∆P shall denote the polynomial defined by
(∆P) ( x ) = P ( x ) − P ( x − 1) .
For example, if P ( x ) = x3 , then (∆P) ( x ) = P ( x ) − P ( x − 1) = x3 − ( x − 1)3 =
3x2 − 3x + 1.
If P is a polynomial, and if n ∈ N, then ∆n P shall denote the polynomial
∆ (∆ (· · · (∆P) · · · )) with n copies of ∆ in front of the P. (Formally speaking, this
means that ∆n P is defined recursively by setting ∆0 P = P and ∆n P = ∆ ∆n−1 P
for each n ≥ 1.)
Exercise 5.4.2. Let m ∈ Z. Let P be a polynomial in a single variable x. Assume
that P has degree ≤ m. Prove the following:
(a) The polynomial ∆P has degree ≤ m − 1.
(b) The polynomial ∆n P has degree ≤ m − n for each n ∈ N.
(c) For each n ∈ N, we have
n  
k n
(∆ P) ( x ) = ∑ (−1)
n
P ( x − k) .
k =0
k

(d) For each n ∈ N satisfying n > m, we have


n  
k n
∑ (−1) k P (x − k) = 0.
k =0

(e) Assume that m ≥ 0. The sequence ( P (0) , P (1), P (2) , . . .) is


m+1
(d1 , d2 , . . . , dm+1 )-recurrent, where we set di = (−1)i−1 for each i ∈
i
{1, 2, . . . , m + 1}.

Exercise 5.4.3. Let a, b, c ∈ N be such that c ≤ b and a ≤ b. Simplify


 
a
b
k
∑ b .
k=c
k

December 25, 2021


Math 235 notes page 259

Exercise 5.4.4. Let q ∈ R and s ∈ R. Define a sequence ( a0 , a1 , a2 , . . .) of reals


recursively by

a0 = s, and
an = an−1 (qan−1 + 2) for each integer n ≥ 1.

Find an explicit formula for an .

Exercise 5.4.5. Define a sequence ( a1 , a2 , a3 , . . .) of integers recursively by

a1 = 1, a2 = 1, a3 = 3, and
a2n−1 − a2n−2
an = for each integer n ≥ 4.
a n −3

Compute an explicitly (in terms of sequences we already know).

The next exercise is a “Fibonacci analogue” of Theorem 5.2.1; it uses the notion
of a lacunar subset (defined in Definition 2.3.3).

Exercise 5.4.6. Let n ∈ N. Let N2 denote the set {2, 3, 4, . . .}. Prove that there is
a unique lacunar finite subset T of N2 such that n = ∑ f t .
t∈ T
(For example, 28 = f 3 + f 5 + f 8 = ∑ f t .)
t∈{3,5,8}

Exercise 5.4.7. Solve Exercise 5.2.1 if n is not known to the lecturer. That is, find
a way to construct the moments a and b in Exercise 5.2.1 in such a way that the
lecturer will know that these moments have arrived the very time they arrive
(rather than only in hindsight).

The following exercise generalizes Exercise 5.2.2:

Exercise 5.4.8. Let n and k be positive integers with k ≥ 2. Let I1 , I2 , . . . , In be n


nonempty finite closed intervals on the real axis. Assume that for any k distinct
elements i1 , i2 , . . . , ik ∈ {1, 2, . . . , n}, at least two of the k intervals Ii1 , Ii2 , . . . , Iik
intersect. Prove that there exist k − 1 reals a1 , a2 , . . . , ak−1 such that each of the
intervals I1 , I2 , . . . , In contains at least one of a1 , a2 , . . . , ak−1 .

Exercise 5.4.9. Let n be a positive integer. Let ( x0 , x1 , x2 , . . .) be an n-periodic


sequence of reals such that x0 + x1 + · · · + xn−1 = 0. Prove that there exists some
k ∈ {0, 1, . . . , n − 1} such that every m ≥ k satisfies xk + xk+1 + · · · + xm ≥ 0.

December 25, 2021


Math 235 notes page 260

Exercise 5.4.10. A golden pair will mean a pair ( x, y) of nonnegative integers


such that x2 − xy − y2 = 1. For example, (3, 2) is a golden pair, since
32 − 3 · 2 − 22 = |−1| = 1. Prove the following:
(a) If ( x, y) is a golden pair such that ( x, y) 6= (0, 1), then x − y ≥ 0.
(b) If ( x, y) is a golden pair such that ( x, y) 6= (0, 1), then (y, x − y) is a golden
pair.
(c) If ( x, y) is a golden pair such that ( x, y) 6= (1, 0), then y > 0.
(d) Find an explicit formula for all golden pairs different from (0, 1).
[Remark: The word “golden” in “golden pair” refers to the resemblance of
the equality x2 − xy − y2 = 1 to the equation ϕ2 − ϕ − 1 = 0 satisfied by the
golden ratio ϕ ≈ 1.618. Dividing the equation x2 − xy − y2 = 1 by y2 yields
 2
x x 1 x
− − 1 = 2 , which is a way of saying that is a close rational approx-
y y y y
imation to ϕ.]

December 25, 2021


Math 235 notes page 261

6. The Pigeonhole Principle


Next, we shall explore the pigeonhole principle (also known as the box principle
or Dirichlet’s principle) and its consequences. Most textbooks on problem solv-
ing devote a chapter or at least a section to it; examples are [Engel98, Chapter
4], [GelAnd17, §1.3], [Zeitz17, §3.3], [Grinbe08, Kapitel 2], [Carl17, Kapitel 3],
[Galvin20, Week 2] and [Macgil17]. The pigeonhole principle is generally con-
sidered to be a part of combinatorics; thus, it tends to be explored in texts on
combinatorics as well (e.g., [Bona17, Chapter 1], [Liu85, §4.8], [Bruald09, Chapter
3]).

6.1. The principles


The words “pigeonhole principle” typically refer to one of several related theorems
which we shall explore in this section. As usual, the theorems are simple; the art is
to find a way to apply them to a given problem.

6.1.1. The Pigeonhole Principle for Injections


We begin with the best-known “pigeonhole principle”. It is saying that if more
than n pigeons are distributed into n pigeonholes (for a given n ∈ N), then at least
two pigeons must be in the same pigeonhole. This formulation is what gave this
principle its common name160 ; however, we prefer a more formal way of stating
it:161

Theorem 6.1.1. Let U and V be two finite sets such that |U | > |V |. Let f : U → V
be any map. Then, f cannot be injective.

Indeed, our previous informal statement about pigeons is precisely Theorem


6.1.1 (applied to U = {pigeons} and V = {pigeonholes} and to f being the map
that sends each pigeon to its pigeonhole).
Here is the contrapositive of Theorem 6.1.1:

Theorem 6.1.2. Let U and V be two finite sets. Let f : U → V be an injective


map. Then, |U | ≤ |V |.

In terms of pigeons and pigeonholes, this is saying that any injective distribution
of pigeons into pigeonholes (where “injective” means “no two pigeons sharing a
hole”) requires at least as many pigeonholes as pigeons.
Most of the time, the words “pigeonhole principle” refer to one of Theorems 6.1.1
and 6.1.2. The next theorems in this section are closely related but less commonly
used.
160 The variant name “box principle” likewise results from stating the principle in terms of pearls
and boxes (instead of pigeons and pigeonholes).
161 We will give proofs of these theorems (or references to such proofs) later.

December 25, 2021


Math 235 notes page 262

The “equality case” of Theorem 6.1.2 is also interesting: If we have equally many
pigeons and pigeonholes, then any injective distribution of pigeons into pigeon-
holes must be surjective as well (i.e., each pigeonhole is inhabited), and thus must
be bijective. Let us state this formally, too:

Theorem 6.1.3. Let U and V be two finite sets. Let f : U → V be an injective


map. Assume that |U | = |V |. Then, f is bijective.

A few words about the proofs: Theorem 6.1.3 follows immediately from [Grinbe15,
Lemma 1.5]. Theorem 6.1.1 is an easy consequence of [Grinbe15, Lemma 1.5] as well162 .
Theorem 6.1.2 is just the contrapositive of Theorem 6.1.1. All three theorems are basic facts
about finite sets and can be used without proof on any contest.
A warning about infinite sets: Theorem 6.1.3 fails badly when U and V are
allowed to be infinite. For example, the map N → N, i 7→ i + 1 is injective, but not
bijective.163
For future use, let us restate Theorem 6.1.1 in more explicit terms:

Corollary 6.1.4. Let n, m ∈ N satisfy m > n. Let V be an n-element set.


Let a1 , a2 , . . . , am be m elements of V. Then, at least two of these m elements
a1 , a2 , . . . , am must be equal.

Proof of Corollary 6.1.4. We have |V | = n (since V is an n-element set). Let f : {1, 2, . . . , m} →


V be the map that sends each i ∈ {1, 2, . . . , m} to ai . Then, Theorem 6.1.1 (applied to
U = {1, 2, . . . , m}) shows that this map f cannot be injective (since |{1, 2, . . . , m}| = m >
n = |V |). In other words, there exist two distinct elements i and j of {1, 2, . . . , m} such that
f (i ) = f ( j). In other words, there exist two distinct elements i and j of {1, 2, . . . , m} such
that ai = a j (since the definition of f yields f (i ) = ai and f ( j) = a j ). In other words, at
least two of the m elements a1 , a2 , . . . , am must be equal. This proves Corollary 6.1.4.

162 Proof.Let U and V be two finite sets such that |U | > |V |. Let f : U → V be any map. Assume
that f is injective. Then, [Grinbe15, Lemma 1.5] yields the logical equivalence

( f is injective) ⇐⇒ ( f is bijective) .

Hence, f is bijective (since f is injective). Thus, f is a bijection. Hence, there exists a bijection
from U to V (namely, f ). This yields |U | = |V |, which contradicts |U | > |V |. This contradiction
shows that our assumption (that f is injective) was wrong. Hence, f cannot be injective. This
proves Theorem 6.1.1.
163 Compare “Hilbert’s Hotel” for various phenomena like this. (Hilbert seemed to prefer humans

to pigeons in his thought experiments.)

December 25, 2021


Math 235 notes page 263

6.1.2. The Pigeonhole Principle for “Multi-injections”


The pigeonhole principle can be generalized. Namely, if more than kn pigeons
are distributed into n pigeonholes (for given n, k ∈ N), then at least k + 1 pigeons
must be in the same pigeonhole. Let us restate this as a contrapositive: If we have
n pigeonholes and each pigeonhole fits only k pigeons, then we cannot distribute
more than kn pigeons into these holes. Let us restate this formally:

Theorem 6.1.5. Let U and V be two finite sets. Let k ∈ N. Let f : U → V be a


map. Assume that each v ∈ V satisfies

(the number of all u ∈ U such that f (u) = v) ≤ k. (268)

Then, |U | ≤ k |V |.

Proof of Theorem 6.1.5. We have ∑ 1 = |U | · 1 = |U |, so that


s ∈U

|U | = ∑1= ∑ ∑ 1 (by (92), applied to S = U and W = V and as = 1)


s ∈U w∈V s∈U;
f (s)=w

= ∑ ∑ 1
v ∈V u∈U;
f (u)=v
| {z }
=(the number of all u∈U such that f (u)=v)·1
=(the number of all u∈U such that f (u)=v)
≤k
(by (268))

(here, we have renamed the summation indices w and s as v and u)


≤ ∑ k = |V | · k = k |V | .
v ∈V

This proves Theorem 6.1.5.

The contrapositive of Theorem 6.1.5 says the following:

Theorem 6.1.6. Let U and V be two finite sets. Let k ∈ N. Let f : U → V be a


map. Assume that |U | > k |V |. Then, there exists a v ∈ V such that

(the number of all u ∈ U such that f (u) = v) > k.

Theorem 6.1.5, too, is known as the “pigeonhole principle”. There is again an


equality case statement, whose proof we leave to the reader:

Exercise 6.1.1. Let U and V be two finite sets. Let k ∈ N. Let f : U → V be a


map. Assume that each v ∈ V satisfies (268). Assume that |U | = k |V |. Then, the
inequality (268) is an equality for each v ∈ V.

December 25, 2021


Math 235 notes page 264

6.1.3. The Dual Pigeonhole Principle for Surjections


The “dual pigeonhole principle” (my own name) says that if fewer than n pigeons
are distributed into n pigeonholes (for a given n ∈ N), then at least one pigeonhole
is empty. Formally speaking:

Theorem 6.1.7. Let U and V be two finite sets such that |U | < |V |. Let f : U → V
be any map. Then, f cannot be surjective.

Here is the contrapositive of Theorem 6.1.7:


Theorem 6.1.8. Let U and V be two finite sets. Let f : U → V be a surjective
map. Then, |U | ≥ |V |.

In terms of pigeons and pigeonholes, this is saying that any surjective distribu-
tion of pigeons into pigeonholes (where “surjective” means “no hole stays empty”)
requires at least as many pigeons as pigeonholes.
Again, the “equality case” is interesting: If we have equally many pigeons and
pigeonholes, then any surjective distribution of pigeons into pigeonholes must be
injective as well (i.e., no two pigeons share a hole). In formal terms, this is saying
the following:
Theorem 6.1.9. Let U and V be two finite sets. Let f : U → V be a surjective
map. Assume that |U | = |V |. Then, f is bijective.

A few words about the proofs: Theorem 6.1.9 follows immediately from [Grinbe15,
Lemma 1.4]. Theorem 6.1.7 is an easy consequence of [Grinbe15, Lemma 1.4] as well164 .
Theorem 6.1.8 is just the contrapositive of Theorem 6.1.7. Again, these are basic results that
need no proof in real mathematics.
Again, Theorem 6.1.9 fails when U and V are allowed to be infinite. For example,
the map N → N, i 7→ i//2 is surjective, but not bijective.

6.2. Applications
6.2.1. Simple applications
There are many ways in which the pigeonhole principle (in its various forms) can
be used. Let us first collect some simple examples (before moving on to more
sophisticated ones):
164 Proof.Let U and V be two finite sets such that |U | < |V |. Let f : U → V be any map. Assume
that f is surjective. Then, [Grinbe15, Lemma 1.4] yields the logical equivalence
( f is surjective) ⇐⇒ ( f is bijective) .
Hence, f is bijective (since f is surjective). Thus, f is a bijection. Hence, there exists a bijection
from U to V (namely, f ). This yields |U | = |V |, which contradicts |U | < |V |. This contradiction
shows that our assumption (that f is surjective) was wrong. Hence, f cannot be surjective. This
proves Theorem 6.1.7.

December 25, 2021


Math 235 notes page 265

• Among any 13 persons, there are two that are born in the same month.
This follows from Theorem 6.1.1 (applied to U = {the 13 persons} and V =
{the 12 months} and to f being the map that sends each person to their birth
month). Or, to say this in less formal terms: This follows from the pigeonhole
principle, where the “pigeons” are the 13 persons and the “pigeonholes” are
the 12 months.

• There are two people alive right now with the exact same number of hairs on
their heads.
Indeed, we can safely assume that any human has at most 5 000 000 hairs on
their head (in fact, the typical number of hairs on a human head is around
100 000), but the world population is far larger (over 7 billion). Thus, we can
apply Theorem 6.1.1 to U = {humans alive right now} and V = {0, 1, . . . , 5 000 000}
and to f being the map that sends each person to their number of hairs.
(Alternatively, it suffices to find two baldies.)
I have stolen this example from [Galvin20, Week 2], but in fact it is one of the
oldest examples of the Pigeonhole Principle; it appeared in a 1622 book by
Jean Leurechon (see [RitHee13]).

• If 26 mosquitoes are hanging from a 1 m ×1 m-sized rectangular window, and


you have a 20 cm ×20 cm-sized rectangular flyswatter, then you can hit (at
least) two mosquitoes with one strike of the flyswatter (if you are fast enough).
Indeed, we can subdivide the window into 25 flyswatter-sized squares as
follows:

and then the pigeonhole principle (i.e., Theorem 6.1.1) will ensure that at least
one of these 25 squares will contain at least 2 mosquitoes.

• Consider a triangle ABC, and a straight line ` in its plane. Assume that `
contains none of the vertices A, B and C. Then, the line ` cannot cut more
than two sides of the triangle ABC.
Indeed, if ` cuts a segment XY without passing through either of its endpoints
X and Y, then the two points X and Y must lie on different sides165 of the line
`. But the line ` has only two sides, and therefore the pigeonhole principle
(i.e., Theorem 6.1.1) guarantees that at least two vertices of the triangle ABC
will lie on one side of `; therefore, the side connecting these two vertices
cannot be cut by `.
165 formally speaking: half-planes

December 25, 2021


Math 235 notes page 266

• Among any 25 persons, there are three that are born in the same month.
This follows by applying Theorem 6.1.6 to k = 2 and U = {the 25 persons}
and V = {the 12 months}, because these two sets U and V satisfy |U | > 2 |V |.

• If n is a positive integer, and if x1 , x2 , . . . , xn+1 are n + 1 integers, then at least


two of these n + 1 integers x1 , x2 , . . . , xn+1 are congruent modulo n.
Indeed, the remainders x1 %n, x2 %n, . . . , xn+1 %n are n + 1 elements of the
n-element set {0, 1, . . . , n − 1}; thus, Corollary 6.1.4 (applied to m = n + 1 and
V = {0, 1, . . . , n − 1} and ai = xi %n) shows that at least two of these n + 1
elements x1 %n, x2 %n, . . . , xn+1 %n must be equal; but this entails that the
corresponding two of the integers x1 , x2 , . . . , xn+1 are congruent modulo n (by
Proposition 3.3.4).

• If n + 1 distinct numbers are selected from the set {1, 2, . . . , 2n} (for some
positive integer n), then some two of these n + 1 numbers sum to 2n + 1. 166
Indeed, define the “pigeons” to be our n + 1 selected numbers. Define the
“pigeonholes” to be the n two-element sets

{1, 2n} , {2, 2n − 1} , {3, 2n − 2} , . . . , {n, n + 1}

(that is, the two-element sets {i, 2n + 1 − i } for all i ∈ {1, 2, . . . , n}). These n
two-element sets are disjoint and together cover the whole set {1, 2, . . . , 2n}.
Thus, each of our n + 1 selected numbers lies in precisely one of these n two-
element sets. In other words, each of our n + 1 “pigeons” lies in precisely
one “pigeonhole”. By the Pigeonhole Principle (Theorem 6.1.1), this entails
that two of our “pigeons” share a “pigeonhole” – i.e., that two of our n + 1
selected numbers lie in the same two-element set. Since the selected numbers
are distinct, this means that these two numbers must be the two elements of
the two-element set they lie in; therefore, they sum to 2n + 1.

• You have 10 pairs of shoes: 5 pairs of black shoes and 5 pairs of yellow shoes.
You pick k shoes at random. How high must k be so you can be sure that
among the shoes you pick, there will be at least one matching pair (i.e., one
left and one right shoe of the same color)?
The answer is that k must be at least 11. Indeed, k ≤ 10 is insufficient, since
picking k ≤ 10 shoes may leave you with k left shoes. On the other hand,
picking 11 shoes will suffice, because the Pigeonhole Principle (Theorem 6.1.5)
guarantees that among these 11 shoes there will be at least 6 of the same color,
and (by assumption) these 6 shoes cannot all be left or all be right (since there
are only 5 left shoes of each color, and only 5 right shoes of each color).

166 For
example, for n = 5, if we select the 6 numbers 1, 3, 4, 5, 7, 9 from the set {1, 2, . . . , 10}, then
some two of these 6 numbers (namely, 4 and 7) sum to 11.

December 25, 2021


Math 235 notes page 267

More such examples can be found, e.g., in [Macgil17, Notes on the Pigeonhole
Principle].
We have also seen an application of the Pigeonhole Principle (specifically, of
Corollary 6.1.4) in the solution to Exercise 1.1.9. The third solution to Exercise 3.7.1
can also be viewed as a use of the Pigeonhole Principle (indeed, regard the elements
of the k-lacunar subset S as pigeons, and regard the q + 1 intervals I0 , I1 , . . . , Iq as
pigeonholes).
Here is another simple consequence of the pigeonhole principles:

Corollary 6.2.1. Let U and V be two finite sets such that |U | ≤ |V |. Let f : U → V
and g : V → U be two maps such that f ◦ g = idV . Then, the maps f and g are
mutually inverse.

Note that Corollary 6.2.1 fails if the condition |U | ≤ |V | is removed167 , and also
fails if U and V are allowed to be infinite168 .
Proof of Corollary 6.2.1. The assumption f ◦ g = idV shows that the map f is surjec-
tive169 . Hence, Theorem 6.1.8 shows that |U | ≥ |V |. Combining this with |U | ≤ |V |,
we obtain |U | = |V |. Thus, Theorem 6.1.9 yields that f is bijective. In other words,
f is invertible (since a map is bijective if and only if it is invertible). Hence, the
inverse map f −1 exists. Now, from f ◦ g = idV , we conclude that f −1 = g (because
comparing f −1 ◦ f ◦ g = idU ◦ g = g with f −1 ◦ f ◦ g = f −1 ◦ idV = f −1 results in
| {z } |{z}
=idU =idV
f −1 = g). Thus, the maps f and g are mutually inverse. This proves Corollary
6.2.1.
Note that, just as we have proved Corollary 6.2.1 using Theorems 6.1.8 and 6.1.9,
we can also prove Corollary 6.2.1 using Theorems 6.1.2 and 6.1.3 instead (by ap-
plying the latter theorems to V, U and g instead of U, V and f ). The details of this
alternative proof are left to the reader.

6.2.2. Handshakes
A slightly less obvious application of the pigeonhole principle is the following
exercise ([Grinbe08, Aufgabe 2.10] or [Engel98, Exercise 4.13]):

167 For example, if U = {0, 1, 2, 3} and V = {0, 1} and f (u) = u//2 and g (v) = 2v, then f ◦ g = idV ,
but the maps f and g are not mutually inverse.
168 For example, if U = N and V = N and f ( u ) = u//2 and g ( v ) = 2v, then f ◦ g = id , but the
V
maps f and g are not mutually inverse.
169 Proof. Let v ∈ V. Then, from f ◦ g = id , we obtain ( f ◦ g ) ( v ) = id ( v ), so that v = id ( v ) =
V V V
( f ◦ g) (v) = f ( g (v)). Hence, v is a value of the map f (namely, the value of f on g (v)).
Forget that we fixed v. We thus have shown that each v ∈ V is a value of the map f . In other
words, the map f is surjective.

December 25, 2021


Math 235 notes page 268

Exercise 6.2.1. Let n ≥ 2 be an integer. At a conference long ago, n scientists have


met; some of them have exchanged handshakes among each other170 . Prove that
two of these n scientists have shaken the same number of hands during the
conference. (We assume that any pair of scientists shakes hands at most once.
We also assume that no one shakes their own hands.)

Example 6.2.2. Let n = 6, and consider the following situation:

E A

F
C

D B .

Here, A, B, C, D, E, F are the 6 scientists, and a line segment connects any pair of
scientists that has exchanged a handshake. Thus, scientist A has shaken 2 hands;
B has shaken 3 hands; C has shaken 5 hands; D has shaken 2 hands; etc.. Thus,
A and D have shaken the same number of hands.
Example 6.2.3. The two assumptions in Exercise 6.2.1 (that any pair shakes hands
at most once, and that no one shakes their own hands) are important. If a
scientist is allowed to shake hands with themselves, then a counterexample can
be obtained even for n = 2 (imagine two scientists, one of whom shakes their
own hands while the other doesn’t), independently of whether we count a “self-
handshake” as one or two hands being shaken. If a pair of scientists is allowed
to shake hands multiple times, then a counterexample can be found for n = 3
(imagine three scientists A, B and C, where A shakes hands with B once and
with C twice). The language of graph theory will later give us faster ways to
state such assumptions (in particular, we will be able to model the n scientists as
a loopless simple graph).
Solution to Exercise 6.2.1. Assume the contrary. Thus, any two distinct scientists
have shaken different numbers of hands.
Let U be the set of our n scientists. Let V be the set {0, 1, . . . , n − 1}. Thus, both
U and V are n-element sets; hence, |U | = |V |. From n ≥ 2, we obtain n − 1 6= 0
and 0 ∈ V and n − 1 ∈ V.
170 Forreaders from the future: Handshakes were a form of greeting popular until 2020. A hand-
shake involves two people, each of whom shakes exactly one hand of the other. Thus, when
person a shakes person b’s hands, person b also shakes person a’s hands.

December 25, 2021


Math 235 notes page 269

Define a map f : U → V as follows: For each scientist s ∈ U, we let f (s) be the


number of hands that s has shaken. This is well-defined, because s has shaken at
most n − 1 hands171 and thus we have f (s) ∈ {0, 1, . . . , n − 1} = V.
We have assumed that any two distinct scientists have shaken different numbers
of hands. In other words, if s and t are two distinct scientists, then f (s) 6= f (t). In
other words, the map f is injective. Hence, Theorem 6.1.3 yields that f is bijective
(since |U | = |V |). Thus, in particular, f is surjective. Hence, there exists a scientist
a ∈ U such that f ( a) = n − 1 (since n − 1 ∈ V), and there exists a scientist b ∈ U
such that f (b) = 0 (since 0 ∈ V). Consider these a and b. Note that a 6= b (since
f ( a) = n − 1 6= 0 = f (b)).
The scientist a has shaken n − 1 hands (since f ( a) = n − 1). Thus, a must have
shaken everyone’s hands (except for a themselves), because there are only n − 1
hands in total for a to possibly shake. Hence, in particular, a must have shaken
the hands of b (since a 6= b). Thus, b must have shaken the hands of a. But from
f (b) = 0, we see that b has shaken no hands at all. The previous two sentences
contradict each other. This contradiction shows that our assumption was false.
Hence, Exercise 6.2.1 is solved.

6.2.3. Back to Bezout


Let us next solve Exercise 3.7.7 again, this time using the pigeonhole principle. We
begin with the particular case in which a ⊥ b ([Engel98, Chapter 4, Example E5]):
Exercise 6.2.2. Let a and b be two positive integers such that a ⊥ b. Prove that
there exist positive integers x and y such that 1 = xa − yb.

Solution to Exercise 6.2.2. Let U = {2, 3, . . . , b + 1} and V = {0, 1, . . . , b − 1}. Both


U and V are b-element sets; thus, |U | = |V |.
Let f : U → V be the map that sends each u ∈ U to the remainder (ua) %b. (This
is well-defined, since each u ∈ U satisfies (ua) %b ∈ {0, 1, . . . , b − 1} = V.)
We shall now show the following:
Claim 1: The map f is injective.
[Proof of Claim 1: Let u1 and u2 be two distinct elements of U. We shall show that
f ( u1 ) 6 = f ( u2 ).
Indeed, assume the contrary. Thus, f (u1 ) = f (u2 ), so that f (u2 ) = f (u1 ).
We WLOG assume that u1 ≤ u2 (since otherwise, we can simply swap u1 with u2 ).
Hence, u1 < u2 (since u1 and u2 are distinct), so that u2 − u1 > 0. Thus, u2 − u1 6= 0.
From u1 ∈ U = {2, 3, . . . , b + 1}, we obtain u1 ≥ 2. From u2 ∈ U = {2, 3, . . . , b + 1},
we obtain u2 ≤ b + 1. Hence,
u2 − u1 ≤ (b + 1) − 2 = b − 1 < b.
|{z} |{z}
≤ b +1 ≥2
171 Herewe use our assumptions that any pair of scientists shakes hands at most once, and that no
one shakes their own hands.

December 25, 2021


Math 235 notes page 270

The definition of f yields f (u1 ) = (u1 a) %b and f (u2 ) = (u2 a) %b. Hence,
(u2 a) %b = f (u2 ) = f (u1 ) = (u1 a) %b. But Proposition 3.3.4 (applied to u2 a, u1 a
and b instead of u, v and n) yields that u2 a ≡ u1 a mod b if and only if (u2 a) %b =
(u1 a) %b. Hence, we have u2 a ≡ u1 a mod b (since we have (u2 a) %b = (u1 a) %b).
Thus, au2 = u2 a ≡ u1 a = au1 mod b. Therefore, Lemma 3.5.11 (applied to u2 , u1
and b instead of b, c and n) yields u2 ≡ u1 mod b (since a ⊥ b). In other words,
b | u2 − u1 . Hence, Proposition 3.1.3 (b) (applied to b and u2 − u1 instead of a and
b) yields |b| ≤ |u2 − u1 | = u2 − u1 (since u2 − u1 > 0). Hence, u2 − u1 ≥ |b| = b
(since b > 0). This contradicts u2 − u1 < b.
This contradiction shows that our assumption was false. Hence, f (u1 ) 6= f (u2 )
is proved.
Now, forget that we fixed u1 and u2 . We thus have shown that f (u1 ) 6= f (u2 ) for
any two distinct elements u1 and u2 of U. In other words, the map f is injective.
This proves Claim 1.]
Claim 1 says that f is injective. Thus, Theorem 6.1.3 yields that f is bijective
(since |U | = |V |). Therefore, f is surjective. Hence, there exists some u ∈ U such
that f (u) = 1%b (since 1%b ∈ {0, 1, . . . , b − 1} = V). Consider this u. (Note that
1%b = 1 whenever b > 1; but I don’t want to make an exception for the case b = 1.)
The definition of f yields f (u) = (ua) %b. Hence, (ua) %b = f (u) = 1%b.
But Proposition 3.3.4 (applied to ua, 1 and b instead of u, v and n) yields that
ua ≡ 1 mod b if and only if (ua) %b = 1%b. Hence, we have ua ≡ 1 mod b (since
we have (ua) %b = 1%b). In other words, b | ua − 1. In other words, there exists
some integer v such that ua − 1 = bv. Consider this v. From ua − 1 = bv, we obtain
1 = ua − bv = ua − vb.
We have u ∈ U = {2, 3, . . . , b + 1}; thus, u is a positive integer. Furthermore, it
is easy to see that v is a positive integer172 . Thus, u and v are two positive integers
and satisfy 1 = ua − vb. Therefore, there exist positive integers x and y such that
1 = xa − yb (namely, x = u and y = v). This solves Exercise 6.2.2.
It is now easy to reduce Exercise 3.7.7 to Exercise 6.2.2:
Second solution to Exercise 3.7.7. Both numbers a and b are positive and thus nonzero;
hence, ( a, b) 6= (0, 0). Let g = gcd ( a, b). Thus, Proposition 3.5.12 yields that g > 0
a b a b
and ⊥ . In particular, the numbers and are integers. Moreover, these
g g g g
a b
integers and are positive (since a, b and g are positive). Hence, Exercise 6.2.2
g g
a b
(applied to and instead of a and b) shows that there exist positive integers x
g g
a b
and y such that 1 = x · − y · . Consider these x and y, and denote them by u
g g
172 Proof.From u ∈ U = {2, 3, . . . , b + 1}, we obtain u ≥ 2 > 1. Multiplying this inequality by a,
we obtain ua > 1a (since a is positive). Hence, ua > 1a = a ≥ 1 (since a is a positive integer).
However, ua − 1 = bv, so that bv = ua − 1 > 0 (since ua > 1). We can divide this equality by b
(since b is positive), and obtain v > 0. Hence, v is a positive integer (since v is an integer).

December 25, 2021


Math 235 notes page 271

a b
and v. Thus, u and v are two positive integers and satisfy 1 = u · − v · . Hence,
g g
a b 1
1 = u· − v · = (ua − vb), so that g = ua − vb. In view of g = gcd ( a, b),
g g g
this rewrites as gcd ( a, b) = ua − vb. Hence, there exist positive integers x and y
such that gcd ( a, b) = xa − yb (namely, x = u and y = v). This solves Exercise 3.7.7
again.

6.2.4. An endofunction of a finite set


An endofunction of a set X means a map from X to X. While we will not use this
notation, its very existence suggests that there is something to say about these kinds
of maps. Here is a first example:
Example 6.2.4. Let X = {0, 1, . . . , 11}. Define a map f : X → X by setting
 
f (i ) = i3 + 3i + 1 %12 for each i ∈ X.
 
For example, f (5) = 53 + 3 · 5 + 1 %12 = 141%12 = 9. The following diagram
| {z }
=141
shows all elements of X (as nodes) and how the map f acts on them (by drawing
an arrow from each node i ∈ X to the node f (i )):

4 3 11

0 2 10 1

9 5

8 6
.

We observe on this diagram that if we start at any node and follow the arrows,
we will eventually get stuck in a cycle (i.e., we will start walking around in circles).
This observation holds in general whenever X is a finite set and f : X → X is a
map (although the cycles in which we get stuck might be 1-node cycles – i.e., we
may run into a fixed point). Here is a somewhat stronger statement:173
173 If X is a set, and if f : X → X is a map, then the notation f n (for n ∈ N) denotes the n-fold

December 25, 2021


Math 235 notes page 272

Theorem 6.2.5. Let X be a finite set. Let n = | X |. Let f : X → X be a map. Let


x ∈ X. Then:
(a) There exist two integers i and j with 0 ≤ i < j ≤ n and f i ( x ) = f j ( x ).
(b) Let i and j be two integers with0 ≤ i < j and f i ( x ) = f j ( x ). Then, the
sequence f i ( x ) , f i+1 ( x ) , f i+2 ( x ) , . . . is ( j − i )-periodic.

Here is an illustration of this behavior (showing only an element x ∈ X and its


images f 0 ( x ) , f 1 ( x ) , f 2 ( x ) , . . . under repeated application of f ):

f 0 (x) f 1 (x) f 2 (x) f 3 (x)

f 6 (x) f 4 (x)

f 5 (x)

(this shows a case when f 3 ( x ) = f 7 ( x ), so that the i and j in Theorem 6.2.5 can be
chosen to be 3 and 7). This kind of picture is known as a rho to number theorists (in
honor of the Greek letter rho, which it vaguely resembles) or as a lollipop to graph
theorists. Note that we can have i = 0 (in which the picture consists just of a cycle
with no “running-in”) or j = i + 1 (in which case the cycle is just a single node with
an arrow directly to itself).
Proof of Theorem 6.2.5. (a) Consider the n + 1 elements f 0 ( x ) , f 1 ( x ) , . . . , f n ( x ) of
the n-element set X. Corollary 6.1.4 (applied to m = n + 1, V = X and ai = f i−1 ( x ))
yields that at least two of these n + 1 elements f 0 ( x ) , f 1 ( x ) , . . . , f n ( x ) must be
equal (since n + 1 > n). In other words, there exist two integers i and j with
0 ≤ i < j ≤ n and f i ( x ) = f j ( x ). This proves Theorem 6.2.5 (a).
(b) Let d = j − i. Then, d = j − i > 0 (since i < j); thus, d is a positive in-
teger (since i < j). Let us denote the sequence f i ( x ) , f i+1 ( x ) , f i+2 ( x ) , . . . by
(u0 , u1 , u2 , . . .). Thus,

uk = f i +k ( x ) for each k ∈ N. (269)

We shall now prove that every k ∈ N satisfies uk = uk+d .

composition f ◦ f ◦ · · · ◦ f : X → X. In particular, f 0 = idX and f n = f ◦ f n−1 = f n−1 ◦ f for


| {z }
n times
each positive integer n.

December 25, 2021


Math 235 notes page 273

Indeed, let k ∈ N. Set ` = k + d. Then, ` = k + |{z}


d > k ≥ 0, so that ` ∈ N.
>0
d = k + j − i, we obtain k + j = i + `.
Also, from ` = k + |{z}
= j −i
It is well-known that f p ◦ f q = f p+q for any p, q ∈ N. Applying this to p = k
and q = i, we obtain f k ◦ f i = f k+i . Hence, f k ◦ f i ( x ) = f k+i ( x ). But (269) yields
uk = f i+k ( x ) = f k+i ( x ) (since i + k = k + i). Comparing these two equalities, we
obtain uk = f k ◦ f i ( x ) = f k f i ( x ) .
Recall again that f p ◦ f q = f p+q for any p, q ∈ N. Applying this to p = k and
q = j, we obtain f k ◦ f j = f k+ j . Hence, f k ◦ f j ( x ) = f k+ j ( x ) = f i+` ( x ) (since
k + j = i + `). But (269) (applied to ` instead of k) yields u` = f i+` ( x ). Comparing
these two equalities, we obtain u` = f k ◦ f j ( x ) = f k f j ( x ) .
Now, recall that
 
    
k i k j k j
uk = f  f ( x ) = f f ( x ) = u` since u` = f f ( x )

| {z }
= f j (x)
= uk+d (since ` = k + d) .

Forget that we fixed k. We thus have proved that every k ∈ N satisfies uk = uk+d .
However, d is a positive integer; thus, we know (from Definition 4.7.1 (a)) that d is a
period of the sequence (u0 , u1 , u2 , . . .) if and only if every k ∈ N satisfies uk = uk+d .
Therefore, d is a period of the sequence (u0 , u1 , u2 , . . .) (since every k ∈ N satisfies
uk = uk+d ). In other words, the sequence (u0 , u1 , u2 , . . .) is d-periodic (by Definition
4.7.1 (c)). In other words, the sequence f i ( x ) , f i+1 ( x ) , f i+2 ( x ) , . . . is ( j − i )-
periodic (since (u0 , u1 , u2 , . . .) = f i ( x ) , f i+1 ( x ) , f i+2 ( x ) , . . . and d = j − i). This


proves Theorem 6.2.5 (b).


Some of the most interesting endofunctions are the bijective ones. They are
known as permutations:174

Definition 6.2.6. Let X be a set. A permutation of X means a bijective map f :


X → X.

The identity map idX : X → X of a set X is always a permutation of X. Here is


another example of a permutation:

Example 6.2.7. Let X = {0, 1, . . . , 9}. Let f : X → X be the map that sends the
elements 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 to 7, 5, 4, 3, 2, 6, 0, 1, 9, 8, respectively. The following

174 This
is only one of two commonly used meanings of the word “permutation”; see (e.g.) [Grinbe15,
Remark 5.4] or the Wikipedia page for the distinction. In a nutshell, the second meaning of “per-
mutation” is a list that contains each element of a set exactly once. In order to avoid confusion,
we shall not use this second meaning.

December 25, 2021


Math 235 notes page 274

diagram shows all elements of X (as nodes) and how the map f acts on them (by
drawing an arrow from each node i ∈ X to the node f (i )):

5 9 8

1 6

7 0 2 4
.

Note that our map f here is a permutation of X; thus, any node has exactly one
arrow arriving at it.

The behavior seen in this diagram is a simpler particular case of that seen in
Example 6.2.4: Every node is part of a cycle (rather than merely being connected to
a cycle via some arrows). We can formalize this as follows:

Theorem 6.2.8. Let X be a finite set. Let n = | X |. Let f : X → X be a permutation


of X. Let x ∈ X. Then:
(a) There exists a k ∈ {1, 2, . . . , n} such that f k ( x ) = x.
(b) Let k ∈ {1, 2, . . . , n} be such that f k ( x ) = x. Then, the sequence
f 0 ( x ) , f 1 ( x ) , f 2 ( x ) , . . . is k-periodic.

Proof of Theorem 6.2.8. (a) Theorem 6.2.5 (a) shows that there exist two integers i
and j with 0 ≤ i < j ≤ n and f i ( x ) = f j ( x ). Consider these i and j. Let d = j − i.
Then, d = j − i > 0 (since i < j) and i + d = j (since d = j − i).
It is well-known that f p ◦ f q = f p+q for any p, q ∈ N. Applying this to p = i and
q = d, we obtain f i ◦ f d = f i+d = f j (since i + d = j). Hence, f j = f i ◦ f d , so that
f j ( x ) = f i ◦ f d ( x ) = f i f d ( x ) . Therefore, f i ( x ) = f j ( x ) = f i f d ( x ) , so that
f i f d ( x ) = f i ( x ).


The map f is a permutation, thus bijective (by the definition of a permutation).


Hence, its power f i = f ◦ f ◦ · · · ◦ f is bijective as well (since a composition of
| {z }
i times
bijective maps is always bijective). Thus, in particular, this map f i is injective.
In other words, if u and v are two elements of X satisfying f i (u) = f i (v), then
u = v. Applying this to u = f d ( x ) and v = x, we conclude that f d ( x ) = x (since

December 25, 2021


Math 235 notes page 275

f i f d (x) = f i ( x )). Moreover, combining d =



j − i ≤ n − 0 = n with
|{z} |{z}
≤n ≥0
d > 0, we obtain d ∈ {1, 2, . . . , n}. Hence, there exists a k ∈ {1, 2, . . . , n} such that
f k ( x ) = x (namely, k = d). This proves Theorem 6.2.8 (a).
(b) We have 0 ≤ 0 < k and f 0 ( x ) = idX ( x ) = x = f k ( x ) (since f k ( x ) = x).
|{z}
=idX
Hence, Theorem 6.2.5 (b) (applied to i = 0 and j = k) yields that the sequence
0 0 + 1 0 + 2

f (x) , f (x) , f ( x ), . . . is (k − 0)-periodic. In other words, the sequence
0 1 2
f ( x ) , f ( x ) , f ( x ) , . . . is k-periodic (since
f 0 ( x ) , f 0+1 ( x ) , f 0+2 ( x ) , . . . = f 0 ( x ) , f 1 ( x ) , f 2 ( x ) , . . . and k − 0 = k). This
 

proves Theorem 6.2.8 (b).


For an endofunction of a finite set X to be a permutation, it suffices to be injective
or surjective:

Corollary 6.2.9. Let X be a finite set. Let f : X → X be a map. Then:


(a) If f is injective, then f is a permutation of X.
(b) If f is surjective, then f is a permutation of X.

Proof of Corollary 6.2.9. (a) Assume that f is injective. Hence, Theorem 6.1.3 (ap-
plied to U = X and V = X) yields that f is bijective (since | X | = | X |). In other
words, f is a permutation of X. This proves Corollary 6.2.9 (a).
(b) Assume that f is surjective. Hence, Theorem 6.1.9 (applied to U = X and
V = X) yields that f is bijective (since | X | = | X |). In other words, f is a permutation
of X. This proves Corollary 6.2.9 (b).
We also note that any composition of two permutations of a set X is again a
permutation of X (since a composition of two bijections is always a bijection). Fur-
thermore, the inverse of any permutation of a set X is again a permutation of X
(since the inverse of a bijection is always a bijection). If you are familiar with the
notion of a group, you will thus recognize the set of all permutations of a given set
X to be a group (known as the symmetric group on X).
More can be said about endofunctions. Even the “rho” (or “lollipop”) of an
element bears some surprises:

Theorem 6.2.10. Let X be a finite set. Let n = | X |. Let f : X → X be a map. Let


x ∈ X. Then, there exists some k ∈ {1, 2, . . . , n} such that f k ( x ) = f 2k ( x ).

For instance, in Example 6.2.4, we have f 3 (4) = f 2·3 (4).


Theorem 6.2.10 is often known as the tortoise-and-hare theorem. (Imagine a tortoise
and a hare starting at the node x on a diagram like the one we drew in Example
6.2.4. Both animals walk along the arrows. Each second, the tortoise makes a
single step forward while the hare makes two. Theorem 6.2.10 then says that the
tortoise and the hare will meet again after at most n seconds. This is used in Floyd’s
tortoise-and-hare algorithm for cycle detection.)

December 25, 2021


Math 235 notes page 276

See Exercise 6.3.3 for a generalization of Theorem 6.2.10 (allowing both the tor-
toise and the hare to start with leads).

6.2.5. Periodicity of linear recurrences modulo m


Exercise 3.3.6 and Exercise 3.7.6 show that the Fibonacci numbers f 0 , f 1 , f 2 , . . . have
a periodic behavior modulo 2 and modulo 5. To wit, Exercise 3.3.6 shows that the
sequence ( f 0 %2, f 1 %2, f 2 %2, . . .) is 3-periodic, whereas Exercise 3.7.6 shows (fairly
easily) that the sequence ( f 0 %5, f 1 %5, f 2 %5, . . .) is 20-periodic (indeed, each n ∈ N
satisfies f n%5 ≡ f (n+20)%5 mod 5 and 3n//5 ≡ 3(n+20)//5 mod 5). These are parts
of a pattern: For any positive integer m, the sequence ( f 0 %m, f 1 %m, f 2 %m, . . .) is
k-periodic for some k ∈ 1, 2, . . . , m2 . More generally, we can extend this to ( a, b)-


recurrent sequences whenever b ⊥ m:

Exercise 6.2.3. Let m be a positive integer. Let a and b be integers such that
b ⊥ m. Let ( x0 , x1 , x2 , . . .) be any ( a, b)-recurrent sequence of integers.
 Prove that
the sequence ( x0 %m, x1 %m, x2 %m, . . .) is k-periodic for some k ∈ 1, 2, . . . , m2 .

Solution to Exercise 6.2.3 (sketched). The matrix approach from Proposition 4.9.21 (a)
will be useful here again – even though we don’t really need matrices but can
simply work with pairs of numbers. Recall that the idea behind this approach was
that, even though an entry xn of our sequence cannot be directly obtained from the
previous entry xn−1 , each pair ( xn , xn+1 ) of two consecutive entries can be obtained
easily from the preceding such pair ( xn−1 , xn ). It turns out that the same holds for
the remainders x0 %m, x1 %m, x2 %m, . . .: Namely, each pair ( xn %m, xn+1 %m) can be
obtained from the preceding such pair ( xn−1 %m, xn %m) (we shall soon see how).
First, let us introduce some notations.
Let M be the m-element set {0, 1, . . . , m − 1}. Thus, | M × M| = | M | · | M| =
| M|2 = m2 (since | M| = m).
For each integer z, let − →z denote the remainder z%m. Thus, every integer z
satisfies −→z = z%m ∈ {0, 1, . . . , m − 1} = M and


z = z%m ≡ z mod m (270)

(by Proposition 3.3.2 (a), applied to u = z and n = m).


Define a map f : M × M → M × M by
 −−−−→
f (( p, q)) = q, aq + bp for each ( p, q) ∈ M × M.
 −−−−→
This is well-defined, since each ( p, q) ∈ M × M satisfies q, aq + bp ∈ M × M
−−−−→
(because q ∈ M and aq + bp = ( aq + bp) %m ∈ {0, 1, . . . , m − 1} = M).
Let ω be the pair − →
x ,−

x ∈ M × M.
0 1
Now, we claim the following:

December 25, 2021


Math 235 notes page 277

Claim 1: The map f is bijective (thus a permutation of the set M × M).


Claim 2: We have f − →
x ,−x−→ = − x−→, −
x−→ for each i ∈ N.
 
i i +1 i +1 i +2

Claim 3: We have −

xi , −
x−→
i +1 = f ( ω ) for each i ∈ N.
i

Proving these three claims will be an exercise (Exercise 6.3.6 below). Assume
that they are proved for now. Now, we can apply Theorem 6.2.8 (a) to X = M × M,
n = m2 and x = ω. This yields that there exists a k ∈ 1, 2, . . . , m2 such that
f k (ω ) = ω. Consider this k. Applying Theorem 6.2.8 (b) to X = M × M,  n =
m2 and x = ω, we conclude that the sequence f 0 (ω ) , f 1 (ω ) , f 2 (ω ) , . . . is k-
periodic. In other words, k is a period of this sequence. In other words, every
i ∈ N satisfies
f i (ω ) = f i +k (ω ) (271)
(by the definition of a period).
Now, let i ∈ N. Then, Claim 3 yields − →
xi , −
x−
i
→ = f i (ω ). Also, Claim 3 (applied
+1
to i + k instead of i) yields − x−→, − x −−→ = f i+k (ω ). Hence,
i + k i + k +1


xi , −
x−→  i i +k
i +1 = f ( ω ) = f (ω ) (by (271))
− −→ − −− → −
−→ − −− →
 
i +k
 
= x i + k , x i + k +1 since xi+k , xi+k+1 = f (ω ) .

In other words, − →
xi = −x− → −−→ −−−→ −
→ −−→
i +k and xi +1 = xi +k+1 . Thus, in particular, xi = xi +k .
Forget that we fixed i. We thus have shown that every i ∈ N satisfies − →xi =

x− →. In other words, k is a period of the sequence − →
x , −

x , −

x , . . . (since k is a
i +k 0 1 2

→ −
→ −

positive integer). In other words, the sequence x0 , x1 , x2 , . . . is k-periodic. In
other words, the sequence ( x0 %m, x1 %m, x2 %m,  . . .) is k-periodic (since − →
xi = xi %m
for each i ∈ N). Thus, we have found a k ∈ 1, 2, . . . , m such that the sequence
2

( x0 %m, x1 %m, x2 %m, . . .) is k-periodic. This solves Exercise 6.2.3.


The condition b ⊥ m in Exercise 6.2.3 is important. For example, if ( x0 , x1 , x2 , . . .)
is the (1, 2)-recurrent sequence with starting values x0 = 0 and x1 = 1, then the
sequence ( x0 %2, x1 %2, x2 %2, . . .) = (0, 1, 1, 1, . . .) is not periodic at all. This does
not mean that the claim of Exercise 6.2.3 will never hold when b is not coprime
to m, but the precise conditions under which it can be ensured are nontrivial to
ascertain.

6.2.6. The eventual image of an endofunction


We recall that if X and Y are two sets, and if f : X → Y is a map, and if U is a
subset of X, then the set f (U ) is defined by
f (U ) = { f ( u ) | u ∈ U } . (272)
This set f (U ) is a subset of Y, and is called the image of U under f . In particular,
f ( X ) is called the image of f .
When f is an endofunction of a set X, we can now consider the images f i ( X ) for
all i ∈ N.

December 25, 2021


Math 235 notes page 278

Example 6.2.11. Let X = {0, 1, . . . , 11}. Define a map f : X → X by setting


 
f (i ) = i3 + 2i + 1 %12 for each i ∈ X.

The following diagram shows all elements of X (as nodes) and how the map f
acts on them (by drawing an arrow from each node i ∈ X to the node f (i )):

8 1 2 0

11 5 3

7 4 6

10 9
.

We have

f 0 ( X ) = X = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} ,


f 1 ( X ) = f ( X ) = {0, 1, 2, 4, 5, 6, 8, 9} ,
f 2 ( X ) = {1, 2, 4, 5, 6, 9} , and
f i ( X ) = {1, 2, 4, 5, 6, 9} = f 2 ( X ) for all i ≥ 2.

The pattern we might be seeing here is that the sets f i ( X ) get smaller and smaller
as i gets larger, until they eventually stop changing at all. This and more is claimed
in the following proposition:

Proposition 6.2.12. Let X be a finite set. Let n = | X |. Let f : X → X be a map.


Then:
(a) We have f 0 ( X ) ⊇ f 1 ( X ) ⊇ f 2 ( X ) ⊇ · · · .
(b) If some i ∈ N satisfies f i ( X ) = f i+1 ( X ), then f i ( X ) = f k ( X ) for each
integer k ≥ i.
(c) We have f n ( X ) = f k ( X ) for each integer k ≥ n.

December 25, 2021


Math 235 notes page 279

(d) The map f n ( X ) → f n ( X ) , x 7→ f ( x ) is well-defined and is a permutation


of f n ( X ).

The set f n ( X ) in Proposition 6.2.12 is called the eventual image of the map f (since
each element of X eventually ends up in f n ( X ) if we apply f to it often enough).
Proof of Proposition 6.2.12. (a) We need to show that f i ( X ) ⊇ f i+1 ( X ) for each i ∈
N.
Indeed, let i ∈ N. Fix some p ∈ f i+1 ( X ). Thus,
 p = f i+1 ( x ) for some x ∈ X.

Consider this x. Now, p = f i+1 ( x ) = f i  f ( x ) ∈ f i ( X ).


| {z }
∈X
Forget that we fixed p. We thus have shown that p ∈ f i ( X ) for each p ∈ f i+1 ( X ).
In other words, f i+1 ( X ) ⊆ f i ( X ). In other words, f i ( X ) ⊇ f i+1 ( X ).
Now, forget that we fixed i. We thus have shown that f i ( X ) ⊇ f i+1 ( X ) for each
i ∈ N. In other words, f 0 ( X ) ⊇ f 1 ( X ) ⊇ f 2 ( X ) ⊇ · · · . This proves Proposition
6.2.12 (a).
(b) Let i ∈ N satisfy f i ( X ) = f i+1 ( X ). We must show that

f i (X) = f k (X) for each integer k ≥ i. (273)

[Proof of (273): We shall prove (273) by induction on k:


Induction base: We have f i ( X ) = f i ( X ). In other words, (273) holds for k = i.
Induction step: Let m ≥ i be an integer. Assume (as the induction hypothesis)
that (273) holds for k = m. We must show that (273) holds for k = m + 1. In other
words, we must show that f i ( X ) = f m+1 ( X ).
We have assumed that (273) holds for k = m. In other words, we have f i ( X ) =
f m ( X ).
Proposition 6.2.12 (a) yields f 0 ( X ) ⊇ f 1 ( X ) ⊇ f 2 ( X ) ⊇ · · · . Thus, f m ( X ) ⊇
f m+1 ( X ). We shall now show that f m ( X ) ⊆ f m+1 ( X ).
Set j = m − i. Then, j = m − i ∈ N (since m ≥ i) and m = j + i (since j = m − i).
Now, let p ∈ f m ( X ). Then, p = f m ( x ) for some x ∈ X. Consider this x. From
m = j + i, we obtain f m = f j+i = f j ◦ f i . Thus, p = f m ( x ) = f j ◦ f i ( x ) =
|{z}
= f j◦ f i
f j f i ( x ) . But f i ( x ) ∈ f i ( X ) = f i+1 ( X ); in other words, there exists some y ∈ X


such that f i ( x ) = f i+1 (y). Consider this y. Now,


 
   
i +1 i +1
j i
p = f  f (x)  = f f j
(y) = f ◦ f j
(y) = f j+(i+1) (y) = f m+1 (y)

| {z } | {z }
=f i +1
(y)
= f j+(i+1)

(since j + (i + 1) = j + i +1 = m + 1). Thus, p = f m+1 (y) ∈ f m+1 ( X ) (since y ∈ X).


|{z}
=m

December 25, 2021


Math 235 notes page 280

Forget that we fixed p. We thus have shown that p ∈ f m+1 ( X ) for each p ∈
f m ( X ). In other words, f m ( X ) ⊆ f m+1 ( X ). Combining this with f m ( X ) ⊇
f m+1 ( X ), we obtain f m ( X ) = f m+1 ( X ). Thus, f i ( X ) = f m ( X ) = f m+1 ( X ). This
completes the induction step. Thus, (273) is proved by induction.]
Having proved (273), we have proved Proposition 6.2.12 (b).
(c) Note that f 0 = idX , so that f 0 ( X ) = idX ( X ) = X. Hence, f 0 ( X ) = | X | = n.
We shall first show that there exists some i ∈ {0, 1, . . . , n} such that f i ( X ) =
f i +1 ( X ).
Indeed, assume the contrary. Thus, each i ∈ {0, 1, . . . , n} satisfies

f i ( X ) 6 = f i +1 ( X ) . (274)

Now, let i ∈ {0, 1, . . . , n}. Then, Proposition 6.2.12 (a) yields f 0 ( X ) ⊇ f 1 ( X ) ⊇


f 2 ( X ) ⊇ · · · . Thus, f i ( X ) ⊇ f i+1 ( X ). In other words, f i+1 ( X ) is a subset of
f i ( X ). Moreover, this subset is proper, because (274) shows that f i ( X ) 6= f i+1 ( X ).
It is a well-known fact that if U is a proper subset of a finite set V, then |U | < |V |.
Applying this to U = f i+1 ( X ) and V = f i ( X ), we obtain f i+1 ( X ) < f i ( X )
(since f i+1 ( X ) is a proper subset of the finite set f i ( X )). This entails f i+1 ( X ) ≤
f i ( X ) − 1 (since f i+1 ( X ) and f i ( X ) are integers). In other words, f i+1 ( X ) −
f i ( X ) ≤ −1.
Now, forget that we fixed i. We thus have proved the inequality f i+1 ( X ) −
f i ( X ) ≤ −1 for each i ∈ {0, 1, . . . , n}. Summing these inequalities over all i ∈
{0, 1, . . . , n}, we obtain
n   n
∑ f i +1 i
(X) − f (X) ≤ ∑ (−1) = (n + 1) · (−1) = − (n + 1) < −n.
i =0 i =0

But this contradicts


n  
∑ f i +1
( X ) − f i
( X ) = f n +1 ( X ) − f 0 ( X )
i =0 | {z } | {z }
≥0 =n
!
by Corollary 4.1.17,
applied to u = 0 and v = n and ai = f i ( X )
≥ 0 − n = −n.

This contradiction shows that our assumption was false.


Hence, we have shown that there exists some i ∈ {0, 1, . . . , n} such that f i ( X ) =
i +
f 1 ( X ). Consider this i.
Now, i ≤ n (since i ∈ {0, 1, . . . , n}), so that n ≥ i. Thus, Proposition 6.2.12 (b)
(applied to k = n) yields f i ( X ) = f n ( X ).
Now, let k ≥ n be an integer. Then, k ≥ n ≥ i. Hence, Proposition 6.2.12
(b) yields f i ( X ) = f k ( X ). Hence, f k ( X ) = f i ( X ) = f n ( X ). In other words,
f n ( X ) = f k ( X ). This proves Proposition 6.2.12 (c).

December 25, 2021


Math 235 notes page 281

(d) Let x ∈ f n ( X ). Thus, x = f n (y) for some y ∈ X. Consider this y. From


x = f n (y), we obtain
 

f ( x ) = f ( f n (y)) = ( f ◦ f n ) (y) = ( f n ◦ f ) (y) = f n  f (y) ∈ f n ( X ) .


| {z } | {z }
= f n +1 = f n ◦ f ∈X

Forget that we fixed x. We thus have proved that f ( x ) ∈ f n ( X ) for each x ∈


f n ( X ). Hence, the map f n ( X ) → f n ( X ) , x 7→ f ( x ) is well-defined. It remains to
prove that this map is a permutation of f n ( X ).
Let us denote this map by g. We must thus show that g is a permutation of
f n ( X ).
Indeed, we shall show that this map g is surjective. To wit, let z ∈ f n ( X ).
Proposition 6.2.12 (c) (applied to k = n + 1) yields f n ( X ) = f n+1 ( X ) (since n + 1 ≥
n). Hence, z ∈ f n ( X ) = f n+1 ( X ). In other words, there exists a w ∈ X such that
z = f n+1 (w). Consider this w. Now,

z = f n+1 (w) = ( f ◦ f n ) (w) = f ( f n (w)) . (275)


|{z}
=f◦fn

But f n (w) ∈ f n ( X ) (since w ∈ X). Hence, g ( f n (w)) is well-defined (since g


is a map defined on f n ( X )). The definition of g yields g ( f n (w)) = f ( f n (w)).
Comparing this with (275), we obtain z = g ( f n (w)). Therefore, z lies in the image
of g.
Forget that we fixed z. We thus have shown that each z ∈ f n ( X ) lies in the image
of g. Hence, the image of g is the entire set f n ( X ). In other words, the map g is
surjective.
Now, the set f n ( X ) is finite; the map g : f n ( X ) → f n ( X ) is surjective. Hence,
Corollary 6.2.9 (b) (applied to f n ( X ) and g instead of X and f ) shows that g is a
permutation of f n ( X ). This completes our proof of Proposition 6.2.12 (d).

6.3. Homework set #6: Extremal and pigeonhole principles


This is a regular problem set. See Section 3.7 for details on grading.
This homework set covers the above parts of Chapter 4 and Chapter 5. Some of
the problems may be unrelated.
Please solve at most 5 problems. (No points will be given for further solutions.)

Exercise 6.3.1. Let n be a positive integer. Consider a round-robin tournament


in which n players participate. (“Round-robin” means that each pair of distinct
players play exactly one match against one another.) No match ends with a draw.
A player a is said to have directly owned a player b if a has won the match
against b.
A player a is said to have indirectly owned a player b if there exists a player c
such that a has won a match against c and c has won a match against b.

December 25, 2021


Math 235 notes page 282

Prove that there exists a player who has (directly or indirectly) owned all other
players.
[Example: Consider a tournament between 5 players A, B, C, D, E encoded by
the following diagram:

D C

(where an arrow from player p to player q means that p has won the match
against q). Then, player A has directly owned players B and C and indirectly
owned players D (via C) and E (via B). Actually, every player other than C has
directly or indirectly owned all other players.]

The following exercise is a slight generalization of Exercise 5.3.2:

Exercise 6.3.2. Let n ∈ N. Assume that a1 , a2 , . . . , a2n+1 are 2n + 1 integers with


the following property:

Weaker splitting property: If any of the first 2n numbers a1 , a2 , . . . , a2n is


removed (from our 2n + 1 numbers a1 , a2 , . . . , a2n+1 ), then the remain-
ing 2n numbers (including a2n+1 ) can be split into two equinumerous
heaps with equal sum. (“Equinumerous” means that each heap con-
tains exactly n numbers.)

Prove that all 2n + 1 numbers a1 , a2 , . . . , a2n+1 are equal.

The following exercise generalizes Theorem 6.2.10:

Exercise 6.3.3. Let X be a finite set. Let n = | X |. Let f : X → X be a map. Let


x ∈ X. Let p, q ∈ N. Prove that there exists some k ∈ {1, 2, . . . , n} such that
f k+ p ( x ) = f 2k+q ( x ).

(Theorem 6.2.10 is the particular case of Exercise 6.3.3 for p = 0 and q = 0.)

Exercise 6.3.4. Let X be a finite nonempty set. Let n = | X |. Let f : X → X be a


map. Prove that f n ( X ) = f n−1 ( X ).

December 25, 2021


Math 235 notes page 283

Exercise 6.3.5. Let X be a set. Let f : X → X be a map. Prove the following:


(a) If some x ∈ X and k ∈ N satisfy f k ( x ) = f 2k ( x ), then f ik ( x ) = f k ( x ) for
every positive integer i.
Now, assume that X is finite, and let n = | X |. Then:
(b) We have f n! = f 2n! .
(c) If f is a permutation of X, then f n! = idX .

Exercise 6.3.6. Complete the above solution to Exercise 6.2.3 by proving Claims
1, 2 and 3.

Exercise 6.3.7. Improve Exercise 6.2.3 as follows:


Let m > 1 be an integer. Let a and b be integers such that b ⊥ m.
Let ( x0 , x1 , x2 , . . .) be any ( a, b)-recurrent sequence.
 Prove that the sequence
( x0 %m, x1 %m, x2 %m, . . .) is k-periodic for some k ∈ 1, 2, . . . , m2 − 1 .

Exercise 6.3.8. Let n ≥ 3 be an integer. Let a1 , a2 , . . . , an−1 be any n − 1 inte-


gers. Assume that n - a1 − a2 . Prove that there exists a nonempty subset I of
{1, 2, . . . , n − 1} such that
n | ∑ ai .
i∈ I

The following exercise uses a (very) slight bit of analysis:


Exercise 6.3.9. For every x ∈ R, we define the fractional part frac x of x to be the
number x − b x c. Note that 0 ≤ frac x < 1 for each x ∈ R. Prove the following:
(a) For each x ∈ R and each positive integer n, there exists a positive integer m
1 n−1
such that frac (mx ) is either < or > . (The words “either/or” are meant
n n
1 n−1
non-exclusively here; i.e., it is allowed for frac (mx ) to be both < and >
n n
at the same time. Of course, this will only happen for n = 1.)
(b) For each x ∈ R and each positive integer n, there exists a positive integer
1
m such that frac (mx ) < .
n
(c) For each x ∈ R and each positive real ε, there exists a positive integer m
such that frac (mx ) < ε.
(d) For any positive real ε and any real z, there exists a positive integer m such
that 0 ≤ sin (mz) < ε.
[Hint: For part (a), subdivide the half-open interval [0, 1) into n intervals

n−1 n
     
0 1 1 2
, , , , ..., , ,
n n n n n n

and argue that two of the numbers frac (0x ) , frac (1x ) , . . . , frac (nx ) must lie in
one of these n intervals. If these are frac (ix ) and frac ( jx ) (with i < j), then what
can you say about frac ( jx − ix ) ?

December 25, 2021


Math 235 notes page 284

For part (b), use part (a) as a stepping stone. If p is a positive integer satisfying
n−1 1
frac ( px ) > , then find a q > p such that frac (qx ) is either < or >
n n
frac ( px ) (again using part (a)).]
 
1 1 1
Exercise 6.3.10. Let R = , , , . . . . Find the smallest positive real ε such that
1 2 3
the entire set R can be covered with 5 closed intervals of length ε each.

December 25, 2021


Math 235 notes page 285

7. Mostly Enumerative Combinatorics


We now come to the topic of enumerative combinatorics – the art of finding the car-
dinalities of finite sets (and some related quantities, like sums over finite sets), also
known as “counting”. We have seen some examples of this already – e.g., in Theo-
  which states that the number of k-element subsets of a fixed n-element
rem 4.3.12,
n
set is . We will now see some more, even though we will merely scratch the
k
surface.
For readers wishing to dive deeper, there is a lot to read. Several books have been
written about enumerative combinatorics, such as Stanley’s quasi-encyclopedic
two-volume treatise [Stanle11] and [Stanle01] (with hundreds of problems). Some
introductions to this subject are [Aigner07], [AndFen04], [Bogart17], [Bona17], [Wagner05],
[Wagner08], [Galvin17], [Harju11], [Mazur10] and (my favorite, due to its read-
ability and comprehensiveness) [Loehr11]. A bigger list of texts can be found at
https://math.stackexchange.com/questions/1454339 . Engel’s book also has a
chapter on enumerative combinatorics [Engel98, Chapter 5]. Finally, [19fco] (work
in progress) aims to be a (probably over-)rigorous introduction with all detail one
might want to see.

7.1. The basic principles


Let us first state the basic principles of counting that underlie most of the proofs in
enumerative combinatorics:

Theorem 7.1.1 (Bijection principle). Let X and Y be two sets. Then, | X | = |Y | if


and only if there exists a bijection from X to Y.

Theorem 7.1.2 (Sum rule). If S1 , S2 , . . . , Sk are k disjoint finite sets, then the set
S1 ∪ S2 ∪ · · · ∪ Sk is finite and satisfies

| S1 ∪ S2 ∪ · · · ∪ S k | = | S1 | + | S2 | + · · · + | S k | . (276)

(Note that “disjoint” means “pairwise disjoint”; i.e., the k sets S1 , S2 , . . . , Sk are
said to be disjoint if and only if every two distinct elements i and j of {1, 2, . . . , k}
satisfy Si ∩ S j = ∅.)

Remark 7.1.3. A weaker version of Theorem 7.1.2 holds even if we don’t require
S1 , S2 , . . . , Sk to be disjoint: If S1 , S2 , . . . , Sk are any k finite sets, then the set
S1 ∪ S2 ∪ · · · ∪ Sk is finite and satisfies

| S1 ∪ S2 ∪ · · · ∪ S k | ≤ | S1 | + | S2 | + · · · + | S k | . (277)

This inequality (277) becomes an equality if and only if the k sets S1 , S2 , . . . , Sk


are disjoint.

December 25, 2021


Math 235 notes page 286

Theorem 7.1.4 (Product rule). If A1 , A2 , . . . , An are finite sets, then the set A1 ×
A2 × · · · × An is finite and satisfies

| A1 × A2 × · · · × A n | = | A1 | · | A2 | · · · · · | A n | . (278)

Remark 7.1.5. The set A1 × A2 × · · · × An in Theorem 7.1.4 is the Cartesian product


of the n sets A1 , A2 , . . . , An ; it is defined to be the set of all n-tuples ( a1 , a2 , . . . , an )
with

a1 ∈ A1 and a2 ∈ A2 and ··· and an ∈ An .

If n = 0, then this Cartesian product A1 × A2 × · · · × An is (by convention) a


one-element set, consisting only of the 0-tuple (). This latter 0-tuple () is also
known as the empty list.

Theorem 7.1.6 (Power rule). If A is a finite set, and if n ∈ N, then the set An is
finite and satisfies
| An | = | A|n . (279)

Remark 7.1.7. The set An in Theorem 7.1.6 is defined as the Cartesian product
|A × A ×
{z· · · × A}; it is known as the n-th Cartesian power of A. It consists of the
n times
n-tuples ( a1 , a2 , . . . , an ) whose entries all belong to A.

Theorem 7.1.8 (Difference rule). If A is a finite set, and if B is a subset of A, then


the set A \ B is finite and satisfies

| A \ B| = | A| − | B| . (280)

All the above theorems are basic facts and can be used without proof.175

175 For
the sake of completeness, here are some references to their proofs (except for Theorem 7.1.1,
which is truly fundamental and even used to define the size of a set by some authors):

• Theorem 7.1.2 is [Loehr11, 1.2]. It can easily be derived from Theorem 2.3.6 by induction
on n. (Theorem 2.3.6, on the other hand, can be proved, e.g., by induction on | Q|; but the
details boil down to how the size of a set is defined.)
• Remark 7.1.3 can also be proved by induction on k, using the fact that | P ∪ Q| ≤ | P| + | Q|
for any two finite sets P and Q. (The latter fact, in turn, can be shown by induction on
| Q|.)
• Theorem 7.1.4 is [Loehr11, 1.5]. It can be proved by induction on n, using the fact that
| P × Q| = | P| · | Q| for any two finite sets P and Q. The latter fact can be obtained from
Theorem 7.1.2 as follows: If we denote the elements of P by p1 , p2 , . . . , pk (where k = | P|),

December 25, 2021


Math 235 notes page 287

7.2. Notations
The following two conventions will be used throughout Chapter 7:

Convention 7.2.1. If n ∈ N, then [n] shall mean the n-element set {1, 2, . . . , n}.
(Thus, in particular, [1] = {1} and [0] = {} = ∅.)

This convention might appear to clash with the Iverson bracket notation for truth
values (Definition 4.3.19); but in practice, there is never a chance of confusion.
(Convention 7.2.1 only defines [n] when n is a number, whereas Definition 4.3.19
only defines [A] when A is a logical statement.)

Convention 7.2.2. The symbol “#” shall mean the word “number” (or “the num-
ber”). For example, “# of subsets of {1, 2, 3}” means “the number of subsets of
{1, 2, 3}”.

Example 7.2.3. We have [7] = {1, 2, 3, 4, 5, 6, 7} and thus

{the odd numbers in [7]} = {1, 3, 5, 7} .

Hence,
(# of odd numbers in [7]) = 4.

7.3. Elementary examples


We shall now solve some elementary counting problems to illustrate the use of the
above theorems.

7.3.1. Subsets
We have already seen (in Theorem 4.3.12) how many k-element subsets a given
n-element set has. Now, let us count all subsets (of all possible sizes) of a given
n-element set:

then P × Q is the union of the k disjoint sets

{ p1 } × Q, { p2 } × Q, ..., { pk } × Q,

each of which has size | Q| (by Theorem 7.1.1). The details are left to the reader.
• Theorem 7.1.6 follows by applying Theorem 7.1.4 to Ai = A.
• Theorem 7.1.8 is [Loehr11, 1.3] and [19fco, Theorem 1.4.7 (a)]. It is an easy consequence
of Theorem 2.3.6.

December 25, 2021


Math 235 notes page 288

Theorem 7.3.1. Let n ∈ N. Let S be an n-element set. Then,

(# of subsets of S) = 2n .

Proof of Theorem 7.3.1 (sketched). We shall only give a brief outline; see [19fco, Theo-
rem 1.4.1] for details. (More precisely, the proof we are sketching here is the Third
proof of [19fco, Theorem 1.4.1]; it appears in [19fco, §1.5.3]. Two other proofs are
given in [19fco, solution to Exercise 1.4.1] and [19fco, §1.4.2].)
We denote the n elements of S by s1 , s2 , . . . , sn (in some order).
If I is any subset of S, then the n-tuple176

([s1 ∈ I ] , [s2 ∈ I ] , . . . , [sn ∈ I ]) ∈ {0, 1}n


“encodes” the set I: Indeed, we can read I off this n-tuple, since the i-th entry of
this n-tuple tells us whether si lies in I or not. Thus, the map

f : {subsets of S} → {0, 1}n ,


I 7→ ([s1 ∈ I ] , [s2 ∈ I ] , . . . , [sn ∈ I ])

is injective. This map f is also surjective, because any n-tuple ( a1 , a2 , . . . , an ) ∈


{0, 1}n is taken as a value by f . (In fact, if ( a1 , a2 , . . . , an ) ∈ {0, 1}n is any n-tuple,
then ( a1 , a2 , . . . , an ) = f ( I ), where I is the subset {si | i ∈ [n] satisfying ai = 1} of
S.)
Thus, the map f is bijective (since it is surjective and injective). In other words,
f is a bijection. Hence, there exists a bijection from {subsets of S} to {0, 1}n . The
bijection principle (Theorem 7.1.1) therefore yields

|{subsets of S}| = {0, 1}n = |{0, 1}|n (by (279))


= 2n (since |{0, 1}| = 2) .
In other words, (# of subsets of S) = 2n . This proves Theorem 7.3.1.

7.3.2. Integer compositions


Next, we will count some objects called compositions (or, to be more precise, integer
compositions). These have nothing to do with compositions of maps; they are tuples
of positive integers:177

Definition 7.3.2. (a) A composition (or, to be more precise, an integer composition)


means a tuple of positive integers.
(b) Let n ∈ N. A composition of n means a tuple of positive integers whose
sum is n.

176 See Definition 4.3.19 for the meaning of the square brackets.
177 Recall that a tuple means a finite ordered list (of any kind of objects).

December 25, 2021


Math 235 notes page 289

Example 7.3.3. (a) The tuple (3, 1, 1, 4) is a composition. It is a composition of 9,


since 3 + 1 + 1 + 4 = 9.
(b) The tuple (3, 0, 1, 4) is not a composition, since 0 is not a positive integer.
(c) The compositions of 3 are

(3) , (2, 1) , (1, 2) , (1, 1, 1) .

Note that (2, 1) and (1, 2) are not the same composition, since tuples are ordered.

Theorem 7.3.4. Let n ∈ N. Then,


(
2n −1 , if n ≥ 1;
(# of compositions of n) =
1, if n = 0.

Proof of Theorem 7.3.4 (sketched). We shall outline the proof; the details can be found
in [19fco-hw0s, Exercise 1 (b)].
The case n = 0 is easy (the only composition of 0 is the 0-tuple ()). Thus, for the
rest of this proof, we WLOG assume that n 6= 0. Hence, n ≥ 1. We thus need to
show that (# of compositions of n) = 2n−1 . Inspired by the bijection principle, we
thus would like to define a bijection
{compositions of n} → {subsets of [n − 1]} ,
where (as we recall from Convention 7.2.1) we have [n − 1] = {1, 2, . . . , n − 1}.
Indeed, once we have found such a bijection, we can apply the bijection principle
to obtain
|{compositions of n}| = |{subsets of [n − 1]}|
= (# of subsets of [n − 1]) = 2n−1
(by Theorem 7.3.1 (applied to [n − 1] and n − 1 instead of S and n), since [n − 1] is
an (n − 1)-element set), so that
(# of compositions of n) = |{compositions of n}| = 2n−1 .
This will clearly prove Theorem 7.3.4. Thus, in order to complete this proof, all that
remains to be done is to find a bijection {compositions of n} → {subsets of [n − 1]}.
How do we do this? If a = ( a1 , a2 , . . . , ak ) is a composition of n, then consider
the set
C ( a) := { a1 + a2 + · · · + ai | i ∈ {1, 2, . . . , k − 1}}
= { a1 ,
a1 + a2 ,
a1 + a2 + a3 ,
...,
a 1 + a 2 + · · · + a k −1 } .

December 25, 2021


Math 235 notes page 290

This set C ( a) consists of all partial sums of the tuple a (not counting the empty sum
0, and also not counting the full sum a1 + a2 + · · · + ak ). Since a = ( a1 , a2 , . . . , ak )
is a composition of n, the entries a1 , a2 , . . . , ak are positive integers and their sum
is a1 + a2 + · · · + ak = n; hence, all their partial sums a1 + a2 + · · · + ai for i ∈
{1, 2, . . . , k − 1} are larger than 0 and smaller than n. In other words, all these
partial sums belong to the set {1, 2, . . . , n − 1} = [n − 1]. That is, C ( a) is a subset
of [n − 1] (since C ( a) is the set of these partial sums).
Thus, for each composition a of n, we have defined a subset C ( a) of [n − 1]. We
thus obtain a map

C : {compositions of n} → {subsets of [n − 1]} ,


a 7→ C ( a) .

For example, if n = 7 and a = (3, 1, 2, 1), then C ( a) = {3, 3 + 1, 3 + 1 + 2} =


{3, 4, 6}.
Now, we claim that this map C is a bijection. Indeed, its inverse map C −1 can
be constructed rather easily: If I is any subset of [n − 1], then the elements of I
subdivide the interval [0, n] into several blocks; the lengths of these blocks (from
left to right) form a composition of n (since they are positive integers summing to
n), and this composition is precisely C −1 ( I ). For example, if n = 7 and I = {3, 4, 6},
then the elements of I subdivide the interval [0, n] = [0, 7] into 4 blocks as follows:

3 1 2 1

0 3 4 6 7

(where the lengths of the blocks are shown in blue, and where the red vertical
lines separate the blocks), and the lengths of these 4 blocks are 3, 1, 2, 1 (from left to
right), so that C −1 ( I ) = (3, 1, 2, 1). Proving that this construction really defines an
inverse map to C is straightforward and left to the reader (see [19fco-hw0s, solution
to Exercise 1 (b)], where it is done rigorously and with no reference to pictures).
Thus, the map C : {compositions of n} → {subsets of [n − 1]} is a bijection.
So we have found a bijection {compositions of n} → {subsets of [n − 1]}. As we
explained above, this completes the proof of Theorem 7.3.4.

7.3.3. Maps
Let us next count maps (i.e., functions) between two sets.

Definition 7.3.5. Let A and B be two sets. Then, B A shall mean the set of all
maps from A to B.

December 25, 2021


Math 235 notes page 291

Theorem 7.3.6. Let A and B be two finite sets. Then, the set B A is finite, and
satisfies
B A = | B || A| . (281)

The equality (281) can be rewritten as


(# of maps from A to B) = | B|| A| . (282)
Proof of Theorem 7.3.6 (sketched). This is an outline of the proof; see [19fco, proof of
Theorem 1.5.7] for details.
Let us denote the elements of A by a1 , a2 , . . . , an (in any order). Thus, | A| = n.
Now, any map f : A → B is uniquely determined by the n-tuple
( f ( a1 ) , f ( a2 ) , . . . , f ( an )) ∈ Bn (which is simply its list of values). Conversely, any
n-tuple (b1 , b2 , . . . , bn ) ∈ Bn can be obtained as the list ( f ( a1 ) , f ( a2 ) , . . . , f ( an )) of
values of some map f : A → B. Thus, we have a bijection
B A → Bn ,
f 7→ ( f ( a1 ) , f ( a2 ) , . . . , f ( an ))
(since B A is the set of all maps from A to B). Hence, the bijection principle yields

B A = | Bn | = | B|n (by the power rule)


= | B || A| (since n = | A|) .
This proves Theorem 7.3.6.
The next problem is similar to Putnam 1985 problem A1:178
Exercise 7.3.1. Let n ∈ N. Find the # of all triples ( A, B, C ) of subsets of [n]
satisfying A ∩ B ∩ C = ∅.
Discussion of Exercise 7.3.1. The condition A ∩ B ∩ C = ∅ says that no element be-
longs to A, B and C at the same time.
Let us construct a triple ( A, B, C ) of subsets of [n] satisfying A ∩ B ∩ C = ∅. It
may appear natural to do this by first choosing A, then choosing B, then choosing
C. But this is not a good way to count these triples, as the number of options for C
depends on the choices of A and B. We thus take a different way. We construct a
triple ( A, B, C ) of subsets of [n] satisfying A ∩ B ∩ C = ∅ as follows:
• We decide which of the three sets A, B, C will contain 1. There are 7 options179
for this decision; namely, the options are “only A”, “only B”, “only C”, “both
A and B”, “both A and C”, “both B and C” and “none of A, B and C”. (The
option “all three of A, B and C” is unavailable, since this would contradict
A ∩ B ∩ C = ∅.)
178 Recallthat [n] = {1, 2, . . . , n} for n ∈ N.
179 What we call “option” here is often called “choice” in the literature. See Convention 7.3.7 below
for a discussion of this concept.

December 25, 2021


Math 235 notes page 292

• We decide which of the three sets A, B, C will contain 2. Again, there are 7
options for this decision.

• We decide which of the three sets A, B, C will contain 3. Again, there are 7
options for this decision.

• And so on, until we have placed each of the n elements 1, 2, . . . , n of [n] in the
sets A, B, C (or, rather, in whichever of these sets A, B, C we want to place it
in).

Altogether, we thus make n decisions, and each time there are 7 available options.
Thus, the total # of possibilities (for the triple ( A, B, C ) we are constructing) is
7| · 7 ·{z· · · · 7} = 7n . So the # of all triples ( A, B, C ) of subsets of [n] satisfying A ∩ B ∩
n times
C = ∅ is 7n .
This wasn’t very rigorous: what exactly is a “decision”, what is an “option”,
what is a “possibility”, and why are we multiplying the 7’s? The answer is that
our informal argument above was informal code for an application of the bijection
principle. Here is an outline of how to formalize it: Define the map

{triples ( A, B, C ) of subsets of [n] satisfying A ∩ B ∩ C = ∅} → {1, 2, . . . , 7}n ,


( A, B, C ) 7→ (u1 , u2 , . . . , un ) ,

where



 1, if i ∈
/ A and i ∈
/ B and i ∈
/ C;
∈ ∈ ∈



 2, if i A and i / B and i / C;

3, if i ∈
/ A and i ∈ B and i ∈
/ C;



ui = 4, if i ∈
/ A and i ∈
/ B and i ∈ C; for each i ∈ [n]

5, if i ∈ A and i ∈ B and i ∈
/ C;








 6, if i ∈ A and i ∈
/ B and i ∈ C;
∈ ∈ ∈C

7, if i / A and i B and i

(so that ui essentially encodes which of the sets A, B, C contain i). It is not hard to
see that this map is a bijection. Thus, the bijection principle entails

|{triples ( A, B, C ) of subsets of [n] satisfying A ∩ B ∩ C = ∅}|


= {1, 2, . . . , 7}n = |{1, 2, . . . , 7}|n (by the power rule)
= 7n .

Thus, we recover our answer to Exercise 7.3.1 with a formal proof.


For the future, let me clarify my use of certain words:

December 25, 2021


Math 235 notes page 293

Convention 7.3.7. (a) I am using the three words “decision”, “option” and “pos-
sibility” for what most authors (including Loehr in [Loehr11]) call “choice”. In
my opinion, using the word “choice” for all three concepts is misleading, as they
are not the same. Let me illustrate the differences on an example:
Imagine you are about to buy a car. You get to choose its color (“black”, “grey”
or “red”) and its body style (“sedan”, “minivan” or “convertible”). All pairs of
a color and a body style are available. Thus:

• you make 2 decisions (namely, the color and the body style);

• you have 3 options in your first decision (namely, “black”, “grey” and
“red”);

• you have 3 options in your second decision (namely, “sedan”, “minivan”


and “convertible”);

• you have a total of 9 possibilities (namely, “black sedan”, “black minivan”,


“black convertible”, “grey sedan”, etc.).

The general rule is that you are choosing between a number of options in each
decision; and the total combination of options you have chosen after you made
all decisions is a possibility.
By avoiding the word “choice”, I am also eliminating the source of confusion
that the standard idioms “You have one choice” and “You have no choice” cause.
(In my terminology, these would translate as “You have one decision, which
allows for at least 2 options” and “You have 1 option”.) I hope the pedantry will
pay off as we get to more complicated proofs where any bit of clarity will be
helpful.
(b) Assume you are making several decisions (as in the example above, where
you are buying a car). The decisions are said to be independent if the set of
options you get to choose from in one decision does not depend on the options
you have chosen in the others. Otherwise, they are dependent. For example,
in the above example, the two decisions were independent; however, if a red
sedan becomes unavailable, then they become dependent, since choosing “red”
in the first decision makes the “sedan” option in the second decision unavailable.
(The decision-making process in our above discussion of Exercise 7.3.1 was an
example where we had n independent decisions, each allowing for 7 options.)

7.3.4. Injective maps


Counting all maps between two given sets was easy. What about injective maps?

Theorem 7.3.8. Let m, n ∈ N. Let A be an m-element set. Let B be an n-element

December 25, 2021


Math 235 notes page 294

set. Then,

(# of all injective maps from A to B)


= n ( n − 1) ( n − 2) · · · ( n − m + 1) (283)
 
n
= m! · . (284)
m

Remark 7.3.9. Let m, n, A, B be as in Theorem 7.3.8. If m > n, then the product


n (n − 1) (n − 2) · · · (n − m + 1) contains the factor n − n = 0, and thus must
itself be 0. Thus, Theorem 7.3.8 shows that there are no injective maps from A to
B if m > n. This is precisely what Theorem 6.1.1 tells us.

Proof of Theorem 7.3.8 (sketched). We shall give an informal proof, and later explain
what it relies on.
First of all, we note that m = | A| ∈ N and thus
n ( n − 1) ( n − 2) · · · ( n − m + 1)
 
n
=
m m!
(by (117), applied to k = m). Hence,
 
n
m! · = n ( n − 1) ( n − 2) · · · ( n − m + 1) . (285)
m
We denote the m elements of A by a1 , a2 , . . . , am (in some order). Now, if f : A →
B is an injective map, then the m values f ( a1 ) , f ( a2 ) , . . . , f ( am ) are distinct (i.e.,
no two of them are equal), so that they satisfy

f ( a1 ) ∈ B,
f ( a2 ) ∈ B \ { f ( a1 )} ,
f ( a3 ) ∈ B \ { f ( a1 ) , f ( a2 )} ,
f ( a4 ) ∈ B \ { f ( a1 ) , f ( a2 ) , f ( a3 )} ,
....

Hence, we can construct an injective map f : A → B as follows:

• Choose the value f ( a1 ) ∈ B. We have n options for this (since B has n


elements).
• Choose the value f ( a2 ) ∈ B \ { f ( a1 )}. We have n − 1 options for this (since
B \ { f ( a1 )} has n − 1 elements).
• Choose the value f ( a3 ) ∈ B \ { f ( a1 ) , f ( a2 )}. We have n − 2 options for this
(since B \ { f ( a1 ) , f ( a2 )} has n − 2 elements180 ).
180 This is because f ( a1 ) and f ( a2 ) are distinct (because of how we chose f ( a2 )).

December 25, 2021


Math 235 notes page 295

• Choose the value f ( a4 ) ∈ B \ { f ( a1 ) , f ( a2 ) , f ( a3 )}. We have n − 3 options


for this (since B \ { f ( a1 ) , f ( a2 ) , f ( a3 )} has n − 3 elements181 ).

• And so on, until we have chosen the last value f ( am ) (there are n − m + 1
options for it).

Note that the options that are available to us at each step of this procedure depend
on the previously made decisions (so our decisions are dependent); however, the
number of options at each step does not. Namely, we have n options in our first
decision, n − 1 options in our second decision, n − 2 options in our third decision,
and so on. Hence, in total, we have n (n − 1) (n − 2) · · · (n − m + 1) possibilities for
how we can make these choices. Since each of these possibilities leads to a different
injective map f : A → B, and since each injective map f : A → B can be obtained
from one of these possibilities, we thus conclude that

(# of all injective maps from A to B) = n (n − 1) (n − 2) · · · (n − m + 1)


 
n
= m! · (by (285)) .
m
This proves Theorem 7.3.8 (if you believe in our informal argument using “choosing
values”).
Our above proof of Theorem 7.3.8 used the following fact, which we shall state
in an informal way here:

Theorem 7.3.10 (Dependent product rule). Consider a situation in which you


have to make n decisions (in order). Assume that

• you have a1 options in decision 1;

• you have a2 options in decision 2 (no matter what option you chose in
decision 1);

• you have a3 options in decision 3 (no matter what options you chose in
decisions 1 and 2);

• . . .;

• you have an options in decision n (no matter what options you chose in the
previous decisions).

Then, the total # of possibilities for how you can make these choices is
a1 a2 · · · a n .

This can be made rigorous (see [Newste20, Theorem 7.2.19] or [Loehr11, §1.8]).
Note that we have applied Theorem 7.3.10 to m instead of n in our proof of Theorem
181 This is because f ( a1 ), f ( a2 ) and f ( a3 ) are distinct (because of how we chose f ( a2 ) and f ( a3 )).

December 25, 2021


Math 235 notes page 296

7.3.8 (since the procedure by which we constructed an injective map f : A → B


required m decisions).
There is also an alternative way of formalizing the above proof of Theorem 7.3.8,
without explicitly mentioning the Dependent product rule. Namely, instead of con-
structing an injective map f : A → B by choosing its values f ( a1 ) , f ( a2 ) , . . . , f ( am )
in order, we fix an element a of A (unless A is empty, in which case Theorem 7.3.8
is rather trivial), and we construct an injective map f : A → B by first choosing
its value f ( a) and then choosing all remaining values at the same time (which is
tantamount to choosing an injective map from A \ { a} to B \ { f ( a)}, because the
values to be chosen must differ from f ( a)). This procedure involves only two steps,
and thus is easier to formalize. There are always exactly n options at the first step,
whereas the # of options at the second step is the # of injective maps from A \ { a}
to B \ { f ( a)}, which we can obtain from our induction hypothesis if we induct on
| A|. See [19fco, §2.4.2] for the details of this argument.

7.3.5. Tuples with non-repetition requirements


The next definition codifies three different ways in which tuples can avoid having
repeated elements:

Definition 7.3.11. A tuple ( a1 , a2 , . . . , ak ) (of any kind of objects) is said to be

• injective if a1 , a2 , . . . , ak are distinct;

• Smirnov (or Carlitz or non-stuttering) if it satisfies ai 6= ai+1 for each i ∈


{1, 2, . . . , k − 1};
• cyc-Smirnov if it satisfies both
– the relation ai 6= ai+1 for each i ∈ {1, 2, . . . , k − 1} and
– the relation ak 6= a1 (assuming that k > 0).

We are using the proper names “Smirnov” and “Carlitz” as adjectives here. “Cyc-
Smirnov” is short for “cyclically Smirnov”. One can think of Smirnov tuples as
tuples that can have repeated entries, but never in consecutive positions. Cyc-
Smirnov tuples are defined in the same way, except that the last and the first po-
sitions also count as consecutive (which is natural if one imagines the tuple being
written on a round band).
Clearly, any injective tuple with at least one entry is cyc-Smirnov; also, every
cyc-Smirnov tuple is Smirnov.

Example 7.3.12. (a) The tuple (5, 1, 2) is injective (and thus Smirnov and cyc-
Smirnov).
(b) The tuple (2, 1, 2) is not injective and not cyc-Smirnov, but it is Smirnov.
(c) The tuple (2, 1, 2, 1) is cyc-Smirnov (and thus Smirnov), but not injective.

December 25, 2021


Math 235 notes page 297

(d) The tuple (2, 2, 1) is not Smirnov (and thus neither cyc-Smirnov nor injec-
tive).

Let us now count these tuples:

Exercise 7.3.2. Let n, k ∈ N. Let A be an n-element set.


(a) How many injective k-tuples ( a1 , a2 , . . . , ak ) ∈ Ak exist?
(b) Assume that k > 0. How many Smirnov k-tuples ( a1 , a2 , . . . , ak ) ∈ Ak exist?
(c) Assume that k > 0. How many cyc-Smirnov k-tuples ( a1 , a2 , . . . , ak ) ∈ Ak
exist?

Discussion of Exercise 7.3.2. (a) Recall the notation [k ] = {1, 2, . . . , k} (from Conven-
tion 7.2.1). Now, we claim that the injective k-tuples ( a1 , a2 , . . . , ak ) ∈ Ak are “the
same as” the injective maps from [k ] to A. To be more precise, there is a bijection
n o
{injective maps from [k] to A} → injective k-tuples ( a1 , a2 , . . . , ak ) ∈ Ak ,
f 7→ ( f (1) , f (2) , . . . , f (k ))

(check this!). Hence, the bijection principle yields

(# of injective maps from [k] to A)


 
k
= # of injective k-tuples ( a1 , a2 , . . . , ak ) ∈ A ,

therefore
 
# of injective k-tuples ( a1 , a2 , . . . , ak ) ∈ Ak
= (# of injective maps from [k] to A)
= n ( n − 1) ( n − 2) · · · ( n − k + 1)

(by (283), applied to k, [k ] and A instead of m, A and B). This solves Exercise 7.3.2
(a).
(b) To construct a Smirnov k-tuple ( a1 , a2 , . . . , ak ) ∈ Ak , we proceed as follows:

• We choose its first entry a1 ∈ A. (There are n options.)

• We choose its second entry a2 ∈ A \ { a1 }. (There are n − 1 options.)

• We choose its third entry a3 ∈ A \ { a2 }. (There are n − 1 options.)

• We choose its fourth entry a4 ∈ A \ { a3 }. (There are n − 1 options.)

• And so on, until the last entry ak has been chosen.

December 25, 2021


Math 235 notes page 298

Thus, the Dependent product rule shows that the total # of possibilities for how we
can make these choices is
n ( n − 1 ) ( n − 1 ) · · · ( n − 1 ) = n ( n − 1 ) k −1 .
| {z }
k−1 times

So the # of Smirnov k-tuples ( a1 , a2 , . . . , ak ) ∈ Ak is n (n − 1)k−1 . This solves Exer-


cise 7.3.2 (b).
(c) Forget that we fixed k. For each positive integer k, we let c (n, k ) denote the #
of cyc-Smirnov k-tuples ( a1 , a2 , . . . , ak ) ∈ Ak . Thus, we want to compute c (n, k).
First we deal with the case k = 1: A 1-tuple ( a1 ) ∈ A1 cannot be cyc-Smirnov,
since the condition “ak 6= a1 ” in the definition of a cyc-Smirnov tuple would boil
down to the clearly impossible inequality a1 6= a1 for a 1-tuple. Thus, there exist
no cyc-Smirnov 1-tuples ( a1 ) ∈ A1 . In other words, c (n, 1) = 0.
Assume now that k > 1. We agree to only consider tuples with entries in A in
this solution. That is, “k-tuple” will always mean “k-tuple of elements of A” (and
likewise for (k − 1)-tuples).
We say that a k-tuple ( a1 , a2 , . . . , ak ) ∈ Ak is noncyc-Smirnov if it is Smirnov and
satisfies ak = a1 . Thus, each Smirnov k-tuple ( a1 , a2 , . . . , ak ) ∈ Ak is either cyc-
Smirnov or noncyc-Smirnov (depending on whether it satisfies ak 6= a1 or ak = a1 );
it cannot be both at the same time. Hence, the sum rule yields
(# of Smirnov k-tuples)
= (# of cyc-Smirnov k-tuples) + (# of noncyc-Smirnov k-tuples) .
Hence,
(# of cyc-Smirnov k-tuples)
= (# of Smirnov k-tuples) − (# of noncyc-Smirnov k-tuples) .
This equality turns out to be useful, because we will soon see that both terms on
its right hand side are easier to compute than the left hand side.
If ( a1 , a2 , . . . , ak ) ∈ Ak is a noncyc-Smirnov k-tuple, then ak−1 6= ak (since ( a1 , a2 , . . . , ak )
is Smirnov) and therefore ak−1 6= ak = a1 (since ( a1 , a2 , . . . , ak ) is noncyc-Smirnov),
so that the (k − 1)-tuple ( a1 , a2 , . . . , ak−1 ) ∈ Ak−1 is a cyc-Smirnov (k − 1)-tuple.
Thus, we obtain a map
f : {noncyc-Smirnov k-tuples} → {cyc-Smirnov (k − 1) -tuples} ,
( a 1 , a 2 , . . . , a k ) 7 → ( a 1 , a 2 , . . . , a k −1 ) .
(All that this map f does is removing the last entry of a k-tuple.)
Conversely, if ( a1 , a2 , . . . , ak−1 ) ∈ Ak−1 is a cyc-Smirnov (k − 1)-tuple, then
( a1 , a2 , . . . , ak−1 , a1 ) ∈ Ak is a noncyc-Smirnov k-tuple (since its last entry equals its
first entry). Thus, we obtain a map
g : {cyc-Smirnov (k − 1) -tuples} → {noncyc-Smirnov k-tuples} ,
( a 1 , a 2 , . . . , a k −1 ) 7 → ( a 1 , a 2 , . . . , a k −1 , a 1 ) .

December 25, 2021


Math 235 notes page 299

It is easy to see that the maps f and g are mutually inverse (indeed, f ◦ g = id
is clear, whereas g ◦ f = id follows from the fact that each noncyc-Smirnov k-tuple
has the form ( a1 , a2 , . . . , ak−1 , a1 ) for some a1 , a2 , . . . , ak−1 ∈ A). Thus, the map f is
invertible, i.e., a bijection. Hence, the bijection principle shows that

(# of noncyc-Smirnov k-tuples) = (# of cyc-Smirnov (k − 1) -tuples)


= c (n, k − 1)

(since c (n, k − 1) was defined as the # of cyc-Smirnov (k − 1)-tuples).


Now, the definition of c (n, k ) yields

c (n, k ) = (# of cyc-Smirnov k-tuples)


= (# of Smirnov k-tuples) − (# of noncyc-Smirnov k-tuples)
| {z } | {z }
= n ( n −1 ) k −1 =c(n,k−1)
(by Exercise 7.3.2 (b))

= n (n − 1)k−1 − c (n, k − 1) . (286)

Forget that we fixed k. We thus have proved the equality (286) for each integer
k > 1. Moreover, recall that c (n, 1) = 0. This gives us a recurrent description of
the sequence (c (n, 1) , c (n, 2) , c (n, 3) , . . .). We attempt to solve this recurrence by

December 25, 2021


Math 235 notes page 300

plugging the recursive equation (286) into itself:

c (n, k )
= n ( n − 1 ) k −1 − c (n, k − 1) (by (286))
| {z }
=n(n−1)k−2 −c(n,k−2)
(by (286))
 
 
 
= n ( n − 1 ) k −1 −  n ( n − 1 ) k −2 − c (n, k − 2)
 

 | {z } 
=n(n−1)k−3 −c(n,k−3)
 
(by (286))
  

= n (n − 1)k−1 − n (n − 1)k−2 − n (n − 1)k−3 − c (n, k − 3)


| {z }
=···
= ···
    

= n (n − 1)k−1 − n (n − 1)k−2 − n (n − 1)k−3 − · · · − n (n − 1)1 − c (n, 1)


| {z }
     =0
k −1 k −2 k −3 1
= n ( n − 1) − n ( n − 1) − n ( n − 1) − · · · − n ( n − 1)
= n (n − 1)k−1 − n (n − 1)k−2 + n (n − 1)k−3 ± · · · + (−1)k n (n − 1)1
k −2 k −2
= ∑ (−1) k −i
n ( n − 1) = (−1) n (n − 1) · ∑ (−1)i (n − 1)i
i +1 k

i =0 i =0
| {z } | {z } | {z }
=(−1)k (−1)i =(n−1)(n−1)i =((−1)(n−1))i
=(1−n)i
k −2
1 − (1 − n ) k −1
= (−1)k n (n − 1) · ∑ (1 − n ) i = (−1)k n (n − 1) ·
1 − (1 − n )
|i=0 {z }
=(1−n)0 +(1−n)1 +···+(1−n)k−2
1 − (1 − n ) k −1
=
1 − (1 − n )
(by (4))

1 − (1 − n ) k −1  
= (−1)k n (n − 1) · = (−1)k (n − 1) · 1 − (1 − n)k−1
n
= (−1) (n − 1) − (−1) (n − 1) (1 − n)k−1
k k
| {z }
=(−1)k−1 (n−1)k−1

= (−1)k (n − 1) − (−1)k (n − 1) (−1)k−1 (n − 1)k−1


| {z }
=−(n−1)k

= (n − 1)k + (−1)k (n − 1) .

December 25, 2021


Math 235 notes page 301

Thus our answer is

c (n, k ) = (n − 1)k + (−1)k (n − 1) for each k ≥ 1.

(If you found the way we derived this answer vertiginous, you can also prove it
by induction on k using c (n, 1) = 0 and (286). See [17f-hw3s, solution to Exercise
5 (b)] for the details of this straightforward proof.182 ) Thus, the # of cyc-Smirnov
k-tuples is c (n, k ) = (n − 1)k + (−1)k (n − 1). This solves Exercise 7.3.2 (c).
(An aside for the graph-theoretically trained reader: Exercise 7.3.2 is equivalent
to some known formulas for the chromatic polynomials of certain graphs. Indeed,
the injective k-tuples can be regarded as proper colorings of the complete graph
Kk ; the Smirnov k-tuples as proper colorings of the path graph Pk ; the cyc-Smirnov
k-tuples as proper colorings of the cycle graph Ck . From this point of view, the an-
swers to the three parts of Exercise 7.3.2 are really computing the chromatic poly-
nomials of these graphs Kk , Pk and Ck , and our approach to Exercise 7.3.2 (c) is a
particular case of the “deletion-contraction recurrence” for chromatic polynomials.
See [White10a] or [Guicha20, §5.9] for brief introductions to chromatic polynomi-
als. Four different solutions of Exercise 7.3.2 (c) – all stated in the language of
chromatic polynomials – can be found in [LeeShi19].)

7.4. Permutations
7.4.1. All permutations
Next, let us count the permutations of a finite set ([19fco, §2.4.4]):

Theorem 7.4.1. Let n ∈ N. Let X be an n-element set. Then,

(# of permutations of X ) = n!.

Example 7.4.2. Let n = 3 and X = [n] = [3]. Then, Theorem 7.4.1 says that
(# of permutations of X ) = n! = 3! = 6. Here are the 6 permutations of X
(written in two-line notation – i.e., the entries in the bottom row are the images
of the entries in the top row):
     
1 2 3 1 2 3 1 2 3
, , ,
1 2 3 1 3 2 2 1 3
     
1 2 3 1 2 3 1 2 3
, , .
2 3 1 3 1 2 3 2 1

182 I have denoted cyc-Smirnov tuples as “rounded smords” in [17f-hw3s, Exercise 5 (b)] (and also
denoted Smirnov tuples as “smords” in [17f-hw3s, Exercise 5 (a)]). This was mainly done in
order to make googling for solutions harder. (“Smord” is short for “Smirnov word”.)

December 25, 2021


Math 235 notes page 302

We shall prove Theorem 7.4.1 as a particular case of the following fact:

Theorem 7.4.3. Let n ∈ N. Let U and V be two n-element sets. Then,

(# of bijections from U to V ) = n!.

Proof of Theorem 7.4.3. The sets U and V are n-element sets; hence, |U | = n and
|V | = n. Thus, |U | = n = |V |. Therefore, Theorem 6.1.3 shows that every injective
map from U to V is bijective. Conversely, every bijective map from U to V is
injective (by definition). Combining the preceding two sentences, we conclude that
the bijective maps from U to V are precisely the injective maps from U to V. Thus,
(# of bijective maps from U to V )
= (# of injective maps from U to V )
= n ( n − 1) ( n − 2) · · · ( n − n + 1)
| {z }
=1
(by (283), applied to A = U, B = V and m = n)
= n (n − 1) (n − 2) · · · 1 = 1 · 2 · · · · · n = n!.
But “bijection” means the same thing as “bijective map”. Hence,
(# of bijections from U to V ) = (# of bijective maps from U to V ) = n!.
This proves Theorem 7.4.3.
Proof of Theorem 7.4.1. The permutations of X are the same thing as the bijective
maps from X to X (by the definition of “permutation”). In other words, they are
the same thing as the bijections from X to X. Hence,
(# of permutations of X ) = (# of bijections from X to X ) = n!
(by Theorem 7.4.3, applied to U = X and V = X).This proves Theorem 7.4.1.

7.4.2. Permutations σ with σ (1) > σ (2)


The following notation is fairly standard in mathematics:

Definition 7.4.4. Let n ∈ N. The set of all permutations of [n] is denoted by Sn ,


and is called the n-th symmetric group.

As we explained above, this set Sn is indeed a group (in the sense of abstract
algebra) and thus deserves its name. In particular, the set Sn (for each n ∈ N)
is closed under composition (i.e., if f , g ∈ Sn , then f ◦ g ∈ Sn ) and closed under
inversion (i.e., if f ∈ Sn , then f −1 ∈ Sn ).
(Some authors use notations like Sn , Σn or Sym (n) instead of Sn ; note that all of
these are variations on the letter “S”.)

December 25, 2021


Math 235 notes page 303

Exercise 7.4.1. Let n ≥ 2 be an integer. How many permutations σ ∈ Sn satisfy


σ (1) > σ (2) ?

We shall outline two solutions to this exercise, as they illustrate two different
counting strategies that are both rather useful.
First solution to Exercise 7.4.1 (sketched). This is an outline; see [18s-mt1s, proof of
Proposition 0.5] for a more detailed writeup183 .
Recall that Sn is the set of all permutations of [n]. Thus,

|Sn | = (# of permutations of [n]) = n!

(by Theorem 7.4.1, applied to X = [n]).


We shall say that a permutation σ ∈ Sn is

• green if it satisfies σ (1) > σ (2);

• red if it satisfies σ (1) < σ (2).

Every permutation σ ∈ Sn is either green or red184 , but no permutation σ ∈ Sn


can be both green and red at the same time185 . Hence, the set Sn is the union of its
two disjoint subsets {green permutations σ ∈ Sn } and {red permutations σ ∈ Sn }.
Thus, the sum rule yields

|Sn | = |{green permutations σ ∈ Sn }| + |{red permutations σ ∈ Sn }| . (287)

On the other hand, I claim that “the colors are equidistributed”: i.e., the number
of green permutations σ ∈ Sn equals the number of red permutations σ ∈ Sn .
To prove this, I will construct a bijection from {green permutations σ ∈ Sn } to
{red permutations σ ∈ Sn }.
Indeed, the idea is simple: If σ ∈ Sn is a green permutation, then interchanging
the first two values of σ 186 yields a new permutation τ ∈ S , which is red
n
(because interchanging the first two values σ (1) and σ (2) obviously inverts the
inequality σ (1) > σ (2)). Thus, we obtain a map

f : {green permutations σ ∈ Sn } → {red permutations σ ∈ Sn } ,


σ 7→ (σ with the first two values interchanged) .

183 Note that [18s-mt1s, Proposition 0.5] is not quite the same as our Exercise 7.4.1, but it is completely
analogous; the only difference is that σ (1) > σ (2) is replaced by σ (3) > σ (4).
184 Indeed, every permutation σ ∈ S is injective, and thus satisfies σ (1) 6 = σ (2), so that it must
n
satisfy either σ (1) > σ (2) or σ (1) < σ (2).
185 since σ (1) > σ (2) would contradict σ (1) < σ (2)
186 We consider the values of a permutation σ ∈ S
n to be implicitly listed in the order
σ (1) , σ (2) , . . . , σ (n). Thus, the “first two values of σ” are understood to be σ (1) and σ (2).
Interchanging these two values means that we change the permutation so that the values σ (1)
and σ (2) become the values at 2 and 1, respectively (i.e., they switch their roles).

December 25, 2021


Math 235 notes page 304

(More formally, “σ with the first two values interchanged” can be defined as fol-
lows: Let s1 be the permutation of [n] that swaps the numbers 1 and 2 while leaving
all other numbers unchanged. That is, s1 is given by

2, if i = 1;

s1 (i ) = 1, if i = 2; for all i ∈ [n] .

i, if i ∈
/ {1, 2}

Then, “σ with the first two values interchanged” is the permutation σ ◦ s1 of [n].
To wit, when we compose σ with s1 , the first two values σ (1) and σ (2) of σ get
interchanged, while all other values of σ stay at their places.)
So we have obtained a map

f : {green permutations σ ∈ Sn } → {red permutations σ ∈ Sn } .

Likewise, we obtain a map

g : {red permutations σ ∈ Sn } → {green permutations σ ∈ Sn }

that is defined in the same way as f (viz., it interchanges the first two values of
σ). The maps f and g are mutually inverse, because if we interchange the first
two values of a permutation σ and subsequently interchange them again, we end
up back at our original permutation σ. Hence, the map f is invertible, and thus
is a bijection. So we have found a bijection from {green permutations σ ∈ Sn } to
{red permutations σ ∈ Sn } (namely, f ). Therefore, the bijection principle yields

|{green permutations σ ∈ Sn }| = |{red permutations σ ∈ Sn }| . (288)

Now, (287) becomes

|Sn | = |{green permutations σ ∈ Sn }| + |{red permutations σ ∈ Sn }|


| {z }
=|{green permutations σ∈Sn }|
(by (288))
= |{green permutations σ ∈ Sn }| + |{green permutations σ ∈ Sn }|
= 2 · |{green permutations σ ∈ Sn }| .

Hence,
1 1
|{green permutations σ ∈ Sn }| = |Sn | = n! = n!/2.
2 |{z} 2
=n!
In other words, the number of all green permutations σ ∈ Sn is n!/2. In other
words, the number of all permutations σ ∈ Sn satisfying σ (1) > σ (2) is n!/2
(because these permutations are precisely the green permutations σ ∈ Sn ). This
solves Exercise 7.4.1.

December 25, 2021


Math 235 notes page 305

Our above solution was an example of “counting by symmetry”: We did not


count the green permutations directly; instead, we showed that they are in bijection
with the remaining (i.e., red) permutations σ ∈ Sn (that is, we matched up each
green permutation with a red one), from which we concluded that they make up
1
exactly half of the set Sn ; and this told us that there are |Sn | = n!/2 of them.
2
This sort of reasoning is not so infrequent in combinatorics; it often explains why
answers to some counting problems turn out to be representable as fractions (like
n!/2), even though of course they are integers.
Here is a more conventional way to solve Exercise 7.4.1:
Second solution to Exercise 7.4.1 (sketched). A permutation σ ∈ Sn is the same as an
injective map σ : [n] → [n] (as we have already seen in our proof of Theorem
7.4.1). Thus, the following is a way to construct a permutation σ ∈ Sn satisfying
σ (1) > σ (2):

• First, we choose the set {σ (1) , σ (2)}. This set must be a 2-element subset
of [n] (indeed, we must have σ (1) 6= σ (2), since σ must be injective), but
is otherwise arbitrary; thus, the numberofoptions is the # of all 2-element
n
subsets of [n]. But the latter number is (by Theorem 4.3.12, applied to
2  
n
S = [n] and k = 2). Hence, the number of options at this step is .
2
Note that, once we have chosen the set {σ (1) , σ (2)}, the values σ (1) and
σ (2) are uniquely determined, because the inequality σ (1) > σ (2) forces
σ (1) to be the largest element of this set and σ (2) to be its smallest element.

• Next, we choose the value σ (3). This value must be an element of the (n − 2)-
element set [n] \ {σ (1) , σ (2)}; thus, there are n − 2 options for it.

• Next, we choose the value σ (4). This value must be an element of the (n − 3)-
element set [n] \ {σ (1) , σ (2) , σ (3)} (this is an (n − 3)-element set because
σ (1) , σ (2) , σ (3) are distinct); thus, there are n − 3 options for it.

• Next, we choose the value σ (5). This value must be an element of the (n − 4)-
element set [n] \ {σ (1) , σ (2) , σ (3) , σ (4)}; thus, there are n − 4 options for
it.

• And so on, until all n values σ (1) , σ (2) , . . . , σ (n) are chosen. (Note that
there will be n − (n − 1) = 1 options for the last value σ (n).)

Thus, the Dependent product rule shows that the total # of possibilities for how we

December 25, 2021


Math 235 notes page 306

can make these choices is


 
n
· ( n − 2) ( n − 3) · · · 1
2
| {z }
n ( n − 1)
=
2
(by (121))
n ( n − 1) 1
= · ( n − 2) ( n − 3) · · · 1 = · n ( n − 1) · ( n − 2) ( n − 3) · · · 1
2 2 | {z }
=n(n−1)···1=1·2·····n=n!
1
= · n! = n!/2.
2
Hence, the # of all permutations σ ∈ Sn satisfying σ (1) > σ (2) is n!/2. This solves
Exercise 7.4.1 again.
(This solution followed the Hint in [18s-mt1s, Remark 0.7].)

7.4.3. The average number of fixed points of a permutation


Recall that for any n ∈ N, we let Sn denote the set of all permutations of [n].
For our next exercise, we need the following definition:

Definition 7.4.5. Let X be a set. Let f : X → X be a map.


(a) A fixed point of f means an element x ∈ X such that f ( x ) = x.
(b) We let Fix f denote the set of all fixed points of f . (Thus, Fix f =
{ x ∈ X | f ( x ) = x }.)

Exercise 7.4.2. Let n be a positive integer. Prove that ∑ |Fix w| = n!.


w ∈ Sn

In other words, this exercise states that the average number of fixed points of a
permutation of [n] is 1.
Exercise 7.4.2 was Problem 1 at the International Mathematical Olympiad (IMO)
1987. We give a solution using some (very basic) probability theory (specifically,
the linearity of expectation):
Solution to Exercise 7.4.2 (sketched). We shall use the language of probability (specif-
ically, discrete random variables and their expected values). See [GriSne07, §6.1]
for a quick refresher. Note that our solution can just as well be restated as a purely
combinatorial argument (using interchange of summation signs instead of linearity
of expectation).
We have
|Sn | = n! (289)
(indeed, this can be shown as in the First solution to Exercise 7.4.1).

December 25, 2021


Math 235 notes page 307

Our goal is to prove that ∑ |Fix w| = n!. In other words, our goal is to prove
w ∈ Sn
that ∑ |Fix w| = |Sn | (since |Sn | = n!). In other words, our goal is to prove that
w ∈ Sn
1
∑ |Fix w| = 1. The left hand side of this equality is the average of |Fix w|
| Sn | w ∈ Sn
when w ranges over all of Sn . In other words, it is the expected value of |Fix σ |
when σ is a discrete random variable uniformly distributed over Sn . This suggests
that we use random variables.
We consider a discrete random variable σ that is uniformly distributed over Sn .
We use the notation Pr ( A) for the probability of an event A, and we use the nota-
tion E ( X ) for the expected value of a numerically-valued random variable X. It is
known that any n numerically-valued random variables X1 , X2 , . . . , Xn satisfy
E ( X1 + X2 + · · · + X n ) = E ( X1 ) + E ( X2 ) + · · · + E ( X n ) . (290)
(In fact, this is part of the principle of linearity of expectation. See [GriSne07, Theorem
6.2] for the case n = 2; the general case follows by induction on n.)
Now, we claim that each w ∈ Sn satisfies187
|Fix w| = [w (1) = 1] + [w (2) = 2] + · · · + [w (n) = n] . (291)
[Proof: Let w ∈ Sn . Let i = |Fix w|. Thus, w has i fixed points. If x is one of these i
fixed points, then w ( x ) = x and thus [w ( x ) = x ] = 1; on the other hand, if x is not
a fixed point of w, then w ( x ) 6= x and thus [w ( x ) = x ] = 0. Hence, the sum on the
right hand side of (291) has i addends equal to 1 (one such addend for each of the
i fixed points of w), while the remaining addends are 0. Therefore, the right hand
side of (291) equals i · 1 + (n − i ) · 0 = i = |Fix w|, and thus (291) is proved.]
Now, applying (291) to our random permutation σ, we find
|Fix σ| = [σ (1) = 1] + [σ (2) = 2] + · · · + [σ (n) = n] .
Hence,
E (|Fix σ|) = E ([σ (1) = 1] + [σ (2) = 2] + · · · + [σ (n) = n])
= E ([σ (1) = 1]) + E ([σ (2) = 2]) + · · · + E ([σ (n) = n])
(by (290))
n
= ∑ E ([σ (i) = i]) . (292)
i =1

Now, let us fix an i ∈ [n]. What is the expected value E ([σ (i ) = i ]) ?


If E is any event, then E ([ E]) = Pr ( E) (since [ E] = 1 if E holds, and [ E] = 0
otherwise). Thus, E ([σ (i ) = i ]) = Pr (σ (i ) = i ). Now, what is the probability that
σ (i ) = i ?
Here are two ways of answering this question:188
187 We
are using the Iverson bracket notation (see Definition 4.3.19) here.
188 We
are not doing a proof by double counting here, so we only need to answer this question in
one way. I am showing two ways just for the sake of illustrating different approaches.

December 25, 2021


Math 235 notes page 308

• One way is to use symmetry. Namely, since σ is uniformly distributed across


Sn , the random variable σ (i ) will take each of the n possible values 1, 2, . . . , n
with equal probabilities (for symmetry reasons189 ). In other words, the n
probabilities

Pr (σ (i ) = 1) , Pr (σ (i ) = 2) , . . . , Pr (σ (i ) = n)

are equal. But the sum of these n probabilities is

Pr (σ (i ) = 1) + Pr (σ (i ) = 2) + · · · + Pr (σ (i ) = n) = 1

(since σ (i ) must take one of the n values 1, 2, . . . , n, and of course cannot take
more than one of them simultaneously). Hence, these n probabilities must all
189 Forthe skeptics, let me spell these symmetry reasons out:
We must show that if u and v are any two elements of [n], then the probability of σ (i ) = u
equals the probability of σ (i ) = v.
So let u, v ∈ [n]. Then, there exists a permutation t ∈ Sn that sends u to v. (For example, we
can define t to be the permutation of [n] that swaps u and v and leaves the remaining elements
of [n] unchanged.) Consider such a t. The inverse t−1 of this permutation t is then a permutation
of [n] that sends v to u.
Now, consider the map

Φ : { w ∈ Sn | w ( i ) = u } → { w ∈ Sn | w ( i ) = v } ,
w 7→ t ◦ w.

It is easy to see that this map Φ is well-defined (i.e., if w ∈ Sn satisfies w (i ) = u, then t ◦ w ∈ Sn


and (t ◦ w) (i ) = v). Likewise, consider the map

Ψ : { w ∈ Sn | w ( i ) = v } → { w ∈ Sn | w ( i ) = u } ,
w 7→ t−1 ◦ w.

Then, it is easy to see that the maps Φ and Ψ are mutually inverse (for example, Φ ◦ Ψ =
id
 is because
 each permutation w ∈ Sn satisfies (Φ ◦ Ψ) (w) = Φ (Ψ (w)) = t ◦ t−1 ◦ w =
t ◦ t−1 ◦w = w = id (w)). Hence, the map Φ is invertible, i.e., is bijective. The bijection
| {z }
=id
principle thus yields

|{w ∈ Sn | w (i ) = u}| = |{w ∈ Sn | w (i ) = v}| . (293)

However, σ is uniformly distributed over Sn ; thus,

|{w ∈ Sn | w (i ) = u}|
(the probability of σ (i ) = u) = .
| Sn |
Likewise,
|{w ∈ Sn | w (i ) = v}|
(the probability of σ (i ) = v) = .
| Sn |
The right hand sides of these two equalities are equal (because of (293)). Hence, the left hand
sides are also equal. In other words, the probability of σ (i ) = u equals the probability of
σ (i ) = v. This is precisely what we wanted to show.

December 25, 2021


Math 235 notes page 309

1
equal (because if we are given n equal numbers whose sum is 1, then each
n
1 1
of these n numbers must be ). In other words, we have Pr (σ (i ) = j) =
n n
1
for each j ∈ [n]. Applying this to j = i, we obtain Pr (σ (i ) = i ) = .
n
• Alternatively, we can just count the permutations w ∈ Sn satisfying w (i ) =
i. Indeed, we can construct such a permutation w by choosing its values
w (1) , w (2) , . . . , w (i − 1) , w (i + 1) , w (i + 2) , . . . , w (n) in order (skipping w (i ),
since w (i ) is already predetermined to be i). Each value must differ both
from i and from all previously chosen values (since w must be injective), so
we have n − 1 options for the first value, n − 2 options for the second, n − 3
for the third, and so on. Thus, by the dependent product rule, the total #
of possibilities for how we can make these choices is (n − 1) (n − 2) · · · 1 =
1 · 2 · · · · · (n − 1) = (n − 1)!. Therefore,
(# of permutations w ∈ Sn satisfying w (i ) = i ) = (n − 1)!.
In other words,
|{w ∈ Sn | w (i ) = i }| = (n − 1)!. (294)
But since σ is uniformly distributed over Sn , we have
|{w ∈ Sn | w (i ) = i }|
Pr (σ (i ) = i ) =
| Sn |
( n − 1) !
= (by (294) and (289))
n!
1
= (since n! = n · (n − 1)!) .
n
1
Thus, we have shown that Pr (σ (i ) = i ) = , so that
n
1
E ([σ (i ) = i ]) = Pr (σ (i ) = i ) =
. (295)
n
Forget that we fixed i. We thus have proved (295) for each i ∈ [n]. Hence, (292)
becomes
n n
1 1
E (|Fix σ|) = ∑ E ([σ (i ) = i ]) = ∑ = n · = 1.
i =1
| {z } i =1 n n
1
=
n
(by (295))
1
But the definition of expected value yields E (|Fix σ |) = ∑ |Fix w| (since σ
| Sn | w ∈ Sn
is uniformly distributed over Sn ). Hence,
1
|Sn | w∑
|Fix w| = E (|Fix σ|) = 1,
∈S n

December 25, 2021


Math 235 notes page 310

so that ∑ |Fix w| = |Sn | = n!. This solves Exercise 7.4.2.


w ∈ Sn

See [17f-hw7s, solution to Exercise 2] for the same solution, rewritten in elemen-
tary combinatorial language. See also [19fco-mt2s, Exercise 4] for a solution to the
following generalization:

Exercise 7.4.3. Let k ∈ N. Let n ≥ k be an integer. Prove that


   
|Fix w| n n!
∑ k
= (n − k)!
k
= .
k!
w∈S n

7.5. Double counting


Counting is not just an end in itself; it can also be used to prove equalities. To
wit, many counting problems can be solved in several ways, yielding different-
looking results. (For example, the counting problem “how many subsets does
the set[n] have?” has answer 2n because of Theorem 7.3.1; but it also has answer
n n
∑ because of Theorem 4.3.12190 .) Of course, these results must therefore be
k =0 k  
n n
n
equal (so, for example, the previous parenthetical sentence entails 2 = ∑ ,
k =0 k
which is precisely the claim of Corollary 4.3.17). Hence, by answering a counting
problem in two different ways, we obtain an equality “for free”. Thus we obtain a
powerful method for proving equalities: Try to find a counting problem such that
both sides of the equality are answers to this problem. This strategy is known as
double counting. Let us see a simple but important example of this strategy:

7.5.1. The Chu–Vandermonde identity for nonnegative integers

Proposition 7.5.1 (Chu–Vandermonde identity for nonnegative integers). Let n ∈


N and x, y ∈ N. Then,
  n   
x+y x y
= ∑ .
n k =0
k n−k

190 In more detail: Any subset of [n] has size k for some k ∈ {0, 1, . . . , n}. Thus, the sum rule yields
n n  
n
(# of subsets of [n]) = ∑ (# of subsets of [n] having size k) = ∑ ,
k =0
| {z } k =0 k
=(# of k-element
 subsets
 of [n])
n
=
k
(by Theorem 4.3.12)

qed.

December 25, 2021


Math 235 notes page 311

For example, for n = 2, this equality states that


  2            
x+y x y x y x y x y
= ∑ = + +
2 k =0
k 2−k 0 2 1 1 2 0
| {z } | {z } |{z} |{z}
=1 =x =y =1
       
y x x y
= + xy + = + xy + .
2 2 2 2
Proof of Proposition 7.5.1 (sketched). We apply double counting. The counting prob-
lem we want to solve in two ways is the following: Let S be the ( x + y)-element set
{1, 2, . . . , x } ∪ {−1, −2, . . . , −y}. How many n-element subsets does S have? Let us
answer this question in two ways: 191
 
x+y
First way: The answer is . Indeed, this follows from Theorem 4.3.12
n
(applied to x + y, S and n instead of n, S and k), since S is an ( x + y)-element set.
Second way: An n-element subset of S has at least 0 and at most n positive ele-
ments. Thus, the sum rule yields
(# of n-element subsets of S)
n
= ∑ (# of n-element subsets of S having exactly k positive elements) .
k =0

Now, let us compute the addends on the right hand side of this equality. (Note that
some of these addends can be 0, but this needs not worry us: The argument we
will be making in the following paragraph applies to them just as well as it does to
the others.)
Fix k ∈ {0, 1, . . . , n}. How many n-element subsets I of S have exactly k positive
elements? Such a subset I must have exactly k positive elements, and thus must
have exactly n − k negative elements (since it must have n elements in total, and 0
is not available because 0 ∈ / S). Hence, we can construct such a subset I as follows:
 
x
• First, we choose the k positive elements of I. (There are options for them,
k
by Theorem 4.3.12192 .)
191 Hereis an illustration of the case x = 5, y = 3 and n = 4 (with the green blob being the n-element
subset):

−3 −2 −1 1 2 3 4 5

192 since they must belong to the x-element set {1, 2, . . . , x }

December 25, 2021


Math 235 notes page 312

 
y
• Then, we choose the n − k negative elements of I. (There are options
n−k
for them, by Theorem 4.3.12193 .)

Thus, the product rule


 shows
 that the total # of possibilities for how we can make
x y
these choices is . Thus,
k n−k

(# of n-element subsets of S having exactly k positive elements)


  
x y
= . (296)
k n−k

Now, forget that we fixed k. Hence, we have proved (296) for each k ∈ {0, 1, . . . , n}.
Now,

(# of n-element subsets of S)
n
= ∑ (|# of n-element subsets of S having exactly k positive elements)
k =0
{z   }
x y
=
k n−k
(by (296))
n   
x y
= ∑ .
k =0
k n − k
  
x ny
So the answer to our counting problem is ∑ .
k =0 k n−k
 Now,we have answered our counting problem in  two ways. The
 first way yielded
x+y n x y
as an answer; the second way yielded ∑ . Comparing these
n     k=0 k n−k
x+y n x y
answers, we obtain = ∑ . This proves Proposition 7.5.1.
n k =0 k n−k
(See [19s, proof of Lemma 2.17.15] or [19fco, §2.6.1, Second proof of Theorem
2.6.1 for x, y ∈ N] for different writeups of this proof.)
The words “for nonnegative integers” in the name of Proposition 7.5.1 hint at
the fact that there is a more general version of the Chu–Vandermonde identity; we
shall see this soon.

7.5.2. The trinomial revision formula for nonnegative integers


Here is another identity that can be shown using double counting:

193 since they must belong to the y-element set {−1, −2, . . . , −y}

December 25, 2021


Math 235 notes page 313

Proposition 7.5.2 (Trinomial revision formula for nonnegative integers). Let


n, a, b ∈ N. Then,
n−b
     
n a n
= .
a b b a−b

 Proposition
  7.5.2 is known as the trinomial revision formula, since the product
n a
of two binomial coefficients is known as a “trinomial coefficient”, and
a b
this proposition allows “revising” it (i.e., rewriting it as a different product of two
binomial coefficients). It is a useful tool in manipulating binomial coefficients.
Again, we have not stated it in the greatest possible generality, but we have to start
somewhere. Note that particular cases of Proposition 7.5.2 have already been used
twice in solutions of problems posed above194 .
Proof of Proposition 7.5.2. We will use double counting again. Consider the follow-
ing counting problem: Assume you have n people. How many ways are there to
choose a committee consisting of a of these n people, and also choose a subcommittee
consisting of b people from the committee?
Throwing away the unnecessary anthropomorphism, we can restate this problem
in a more convenient language as follows: Fix an n-element set N (whose elements
are our n people). We want to count all pairs ( A, B), where A is an a-element
subset of N (this will be our committee) and B is a b-element subset of A (this will
be our subcommittee).195 In other words, we want to count all pairs ( A, B) of sets
satisfying B ⊆ A ⊆ N and | A| = a and | B| = b. We shall refer to such pairs as CS
pairs196 , and we shall count their # in two ways197 :
First way: In order to construct a CS pair ( A, B), we
 first choose the committee A
n
and then choose its subcommittee B. We have many options for A (because
a
A hastobe an a-element subset of the n-element set N); then, after choosing A, we
a
have many options for B (because B has to be a b-element subset of A). Thus,
b
194 Namely, the equality (525) in the solution to Exercise 4.5.5 and the equality (667) in the solution
to Exercise 5.4.3 are particular cases of Proposition 7.5.2.
195 Here is a symbolic picture of this situation:

B A

196 short for “committee-subcommittee pairs”


197 We will be using Theorem 4.3.12 in both of these ways.

December 25, 2021


Math 235 notes page 314

  
n a
by the dependent product rule, the total # of CS pairs is .
a b
Second way: In order to construct a CS pair ( A, B), wefirst  choose the subcom-
n
mittee B and then choose the committee A. We have many options for B
b
(because B has to be a b-element subset of the n-element set N). After choosing B,
how many options do we have for A ? The committee A has to be an a-element
subset of N, but it is also required to contain the (already chosen) subcommittee B
as a subset, so that b of its a elements are already decided. We only need to choose
the remaining a − b elements of A. These a − b elements have to come from the
(n − b)-element set N \ B (because the elements of B have already been chosen to
lie in A). Thus, we are choosing an ( a− b)-element subset of the (n − b)-element
n−b n−b
  
set N \ B. The # of ways to do this is . 198 Therefore, we have
a−b a−b
many options for choosing A. Hence, by the dependent product rule, the total # of
n−b
  
n
CS pairs is .
b a−b
Now, we have computed
   the # of CS pairs in two different ways.  The first way
n−b
 
n a n
gave us the result , while the second way gave us the result .
a b b a−b
n−b
     
n a n
Comparing these results, we find = . Thus, Proposition
a b b a−b
7.5.2 is proven.
See [19fco, §2.2.2] for a more formal version of the above proof. Because of this
proof, Proposition 7.5.2 is sometimes called the “committee-subcommittee identity”.

7.5.3. The polynomial identity trick


We have proved both the Chu–Vandermonde identity and the Trinomial revision
formula by double counting. These proofs relied heavily on the combinatorial
interpretation of binomial coefficients (Theorem
  4.3.12). The latter interpretation
n
makes sense only for binomial coefficients with n ∈ N; it says nothing about
  k
n
binomial coefficients in which n is negative or non-integer. Nevertheless, the
k
Chu–Vandermonde identity and the Trinomial revision formula can be generalized
to non-integer values of some of the arguments:199
198 Here, we need to know that n − b ∈ N. Why is this the case? It does not follow from the
assumptions of Proposition 7.5.2, since we have not assumed that b ≤ n. However, it does follow
from the fact that we are in the second step of our construction of ( A, B) and therefore already
have chosen a b-element subset B of N; indeed, this fact clearly entails that b = | B| ≤ | N | = n.
If we didn’t have b ≤ n, we could not have chosen a b-element subset B of N in the first place,
and thus we would have never gotten to the point where we are choosing A.
199 We are using the set C of complex numbers in stating the following two theorems. Readers

unfamiliar with complex numbers can replace the symbol C by R throughout this section; this

December 25, 2021


Math 235 notes page 315

Theorem 7.5.3 (Chu–Vandermonde identity). Let n ∈ N and x, y ∈ C. Then,


  n   
x+y x y
= ∑ .
n k =0
k n − k

Theorem 7.5.4 (Trinomial revision formula). Let n, a, b ∈ C. Then,

n−b
     
n a n
= .
a b b a−b

Clearly, Proposition 7.5.1 and Proposition 7.5.2 are particular cases of Theorem
7.5.3 and Theorem 7.5.4 (which is why we have called them “propositions” rather
than “theorems”). The proofs we gave for the two propositions no longer apply to
the theorems that generalize them; how should we then prove the theorems?
One thing we can try to do is start from scratch and search for non-combinatorial
proofs of Theorem 7.5.3 and Theorem 7.5.4. Such proofs indeed exist: An algebraic
proof of Theorem 7.5.3 (completely unrelated to our above proof of Proposition
7.5.1) can be found in [Grinbe15, first proof of Theorem 3.29]200 . It is not a par-
ticularly enlightening or memorable proof, but it serves its purpose just fine (i.e.,
it proves Theorem 7.5.3 in full generality, without requiring x, y ∈ N), and it even
has a slight advantage in being easy to explain (as it requires little else besides
standard manipulations of sums and products). Theorem 7.5.4 can also be proved
by direct computation (using Definition 4.3.1); this proof can be found in [19fco,
§2.2.1, proof of Proposition 1.3.35] (and is arguably even easier than the above
combinatorial proof of Proposition 7.5.2).
However, this supplantation of combinatorial proofs by algebraic ones leaves a
bad aftertaste. Is double counting just a toy that only works in particular cases (i.e.,
usually, when all variables lie in N)? One of the hallmarks of a good mathematical
proof is that it can be adapted to many natural generalizations of the result being
proved; our double-counting proofs of Proposition 7.5.1 and Proposition 7.5.2 fail
this criterion. There is also a more practical concern: Double counting can be used
not just in proving these two propositions; there are many other results which need
it far more (sometimes, the only known proofs use double counting). We cannot
always expect to find an alternative proof that avoids double counting and thus can
be generalized immediately.
Good news: this is a solvable problem. You can have your cake and eat it too!
While our double-counting proofs cannot themselves be generalized to non-integer
values of x, y or n, there is nevertheless a trick that allows to easily deduce the
will result in a slight loss of generality, but this generality is not important for what we are doing.
(None of our arguments in this section depend on whether our numbers   are  real or 
complex.)
200 The main idea is to induct on n, using the “absorption identity” y y y−1
= (which is
n n n−1
easily proved).

December 25, 2021


Math 235 notes page 316

general results (such as Theorem 7.5.3 and Theorem 7.5.4) from their particular
cases that can be proved combinatorially (such as Proposition 7.5.1 and Proposition
7.5.2). I call this trick the polynomial identity trick, and it has far more applications
than salvaging combinatorial proofs; but this is probably one of the simplest to
explain. My exposition of this trick follows [19fco, §2.6.2].
The polynomial identity trick relies on the following well-known theorem:201
Theorem 7.5.5. Let P be a nonzero polynomial (with complex coefficients, in a
single variable X). Then, P has at most deg P many roots.
For example:
1 1 √
• The degree-3 polynomial 3X 3 − 2X + 1 has 3 roots, namely −1, + i 3 and
2 6
1 1 √ √
− i 3 (where i = −1 is the imaginary unit).
2 6
• The degree-3 polynomial X 3 − X 2 − X + 1 has 2 roots, namely 1 and −1.
Theorem 7.5.5 is often called the “easy half of the Fundamental Theorem of Al-
gebra”. We will not prove it here, but the reader can find a proof of Theorem 7.5.5
in any good textbook on abstract algebra (e.g., in [Goodma15, Corollary 1.8.24],
[Joyce17, Theorem 1.58], [Walker87, Corollary 4.5.10], [CoLiOs15, Chapter 1, §5,
Corollary 3], [19s, Theorem 7.6.11], [Elman20, Corollary 33.8] and [Knapp16, Corol-
lary 1.14]).
We don’t really need to use complex numbers in Theorem 7.5.5; the theorem
remains true if we restrict ourselves to real or rational numbers (since any real or
rational number is a complex number as well). Complex numbers are special in
that they allow replacing the words “at most” in Theorem 7.5.5 by “exactly”, as
long as we count the roots with multiplicity (so, for example, the double root 1
of the polynomial ( X − 1)2 X counts as two roots 1, 1 rather than as a single root
1). But this is a much deeper result (known as the Fundamental Theorem of Algebra),
which we shall not need in our combinatorial applications and thus don’t bother
stating here.
Theorem 7.5.5 has two corollaries, which are used frequently in combinatorics:
Corollary 7.5.6. If a polynomial P (with complex coefficients, in a single variable
X) has infinitely many roots, then P is the zero polynomial.
Proof of Corollary 7.5.6 (sketched). If P was nonzero, then Theorem 7.5.5 would yield
that P has at most deg P many roots, which would contradict the assumption that
P has infinitely many roots. Thus, P is zero, so that Corollary 7.5.6 follows. (See
[19fco, proof of Corollary 2.6.9] for details.)
201 Recall that a root of a univariate polynomial P means a complex number r that satisfies P (r ) = 0.
Also, the degree deg P of a nonzero polynomial P is the exponent in the largest power of
the variable that appears in P with a nonzero coefficient. (That is, if we write P in the form
P = a0 X 0 + a1 X 1 + · · · + an X n , where X is our variable and where an 6= 0, then the degree of P
is n.)

December 25, 2021


Math 235 notes page 317

Corollary 7.5.7. Let P and Q be polynomials (with complex coefficients, in a


single variable X). Let S be an infinite set of complex numbers. Assume that

P (x) = Q (x) for all x ∈ S. (297)

Then, P = Q.
Proof of Corollary 7.5.7. We claim that the polynomial P − Q has infinitely many
roots. Indeed, each x ∈ S satisfies
( P − Q) ( x ) = P ( x ) − Q ( x ) = 0 (by (297))
and therefore is a root of P − Q. Thus, the polynomial P − Q has each x ∈ S as a
root; hence, it has infinitely many roots (since S is an infinite set). Corollary 7.5.6
(applied to P − Q instead of P) thus shows that P − Q is the zero polynomial. In
other words, P − Q = 0. Hence, P = Q. This proves Corollary 7.5.7.
Corollary 7.5.7 reveals that an equality P = Q between two (univariate) poly-
nomials P and Q can be proved by showing that the polynomials agree on each
element of a (fixed) infinite set S (i.e., that P ( x ) = Q ( x ) for all x ∈ S); it is not
necessary to check that they agree on each complex number (but, rather, this result
is obtained “for free”). This is called the polynomial identity trick.
Before we use this trick to derive Theorem 7.5.3 and Theorem 7.5.4 from their
particular cases, we illustrate it on a toy problem:
Exercise 7.5.1. Let a ∈ C. Let n ∈ N be even. Prove that
! !
n n n
∑ (−1)i ai · ∑ ai = ∑ a2i . (298)
i =0 i =0 i =0

For instance, for n = 4, the equality (298) says that


   
1 − a + a2 − a3 + a4 · 1 + a + a2 + a3 + a4 = 1 + a2 + a4 + a6 + a8 .
There are many simple ways to solve Exercise 7.5.1 (for instance, induction on
n/2 can be used); but let us give a solution that saves on computation by using the
polynomial identity trick:
Solution to Exercise 7.5.1. Note that n + 1 is odd (since n is even).
Let us first assume that a ∈/ {−1, 1}. Thus, a 6= −1 and a 6= 1. From a 6= −1, we
obtain − a 6= 1.
The number a is distinct from 1 (since a 6= 1). Hence, applying the equality (4)
to a and n + 1 instead of b and n, we obtain202
1 − a n +1
a0 + a1 + · · · + a(n+1)−1 = .
1−a
202 Tobe fully precise, the equality (4) was only stated for real b, whereas here we are applying it
to the complex number a. But this does not really matter, since the equality (4) holds for all
complex numbers b (and the same proof that we gave for it applies in this generality).

December 25, 2021


Math 235 notes page 318

Comparing this with

a0 + a1 + · · · + a(n+1)−1 = a0 + a1 + · · · + an (since (n + 1) − 1 = n)
n
= ∑ ai ,
i =0

we obtain
n
1 − a n +1
∑ ai = 1−a
. (299)
i =0
The same argument (applied to − a instead of a) yields
n
1 − (− a)n+1
∑ (−a) = 1 − (−a)
i
(300)
i =0

(since − a 6= 1). Multiplying this equality by (299), we obtain


! !
n n
∑ (−a)i · ∑ ai
i =0 i =0
n +1
1 − (− a) 1 − a n +1
= ·
1 − (− a) 1−a
 
  
   
(− a)n+1  · 1 − an+1 / 1 − (− a) · (1 − a)
 
1 −
=
| {z }  | {z }
 
=− an+1 =1+ a
(since n+1 is odd)
    
= 1 − − an+1 · 1 − an+1 / ((1 + a) · (1 − a))
| {z } | {z }
2 =1− a
=1 + a n +1
 
        2   
= 1 + a n +1 · 1 − a n +1 / 1 − a 2 =  1 − a n +1  / 1 − a2
 
| {z }  | {z } 
2
=1 − ( a n +1 ) = a(n+1)·2 = a2(n+1) =( a2 )n+1
(since (1+b)·(1−b)=1−b2
for each b∈C)
 n +1
1 − a2
   n +1   
2 2
= 1− a / 1−a = .
1 − a2
Comparing this with
 
! ! !
 n n n n
 ∑ (− a)i  · ∑ ai ∑ (−1)i ai ∑ ai

 = · ,
i =0
| {z }  i =0 i =0 i =0
=(−1)i ai

December 25, 2021


Math 235 notes page 319

we obtain ! !  n +1
n n 1 − a2
∑ (−1) i i
a · ∑ ai =
1 − a2
. (301)
i =0 i =0

On the other hand, a2 is distinct from 1 (since a ∈


/ {−1, 1}). Now,
n n
  i  0  1  n
∑ a =∑ a
2i
|{z}
2
= a 2
+ a 2
+ · · · + a2
i =0 i =0
=( a2 )i
 0  1  (n+1)−1
2 2
= a + a + · · · + a2 (since n = (n + 1) − 1)
 n +1
1 − a2
=
1 − a2

(by (4), applied to a2 and n + 1 instead of b and n). 203 Comparing this equality
with (301), we obtain
! !
n n n
∑ (−1)i ai · ∑ ai = ∑ a2i .
i =0 i =0 i =0

Thus, we have proved (298) under the assumption that a ∈ / {−1, 1}. How can we
complete this solution to a full (unconditional) proof of (298)?
One way would be to check the remaining two cases (a = 1 and a = −1) by
hand. This is easy and can easily be done by the reader. But I will instead show
another way, which requires no computation whatsoever. Namely, forget that we
fixed a. We thus have proved that the equality (298) holds for all complex numbers
a ∈/ {−1, 1}. In other words, we have proved that (298) holds for all a ∈ C \
{−1, 1}. Now, define two polynomials P and Q (with complex coefficients, in a
single variable X) by
! !
n n n
P= ∑ (−1) i
X i
· ∑X i
and Q= ∑ X2i .
i =0 i =0 i =0

Then, for each a ∈ C, we have


! !
n n
P ( a) = ∑ (−1) i i
a · ∑a i
(302)
i =0 i =0

(by the definition of P) and


n
Q ( a) = ∑ a2i (303)
i =0

203 Again,we have applied (4) to a complex number b; again, this is fine because (4) could just as
well have been stated for a complex number b.

December 25, 2021


Math 235 notes page 320

(by the definition of Q). Now, each a ∈ C \ {−1, 1} satisfies


! !
n n
P ( a) = ∑ (−1)i ai · ∑ ai (by (302))
i =0 i =0
n
= ∑a 2i
(since we have proved that (298) holds for all a ∈ C \ {−1, 1})
i =0
= Q ( a) (by (303)) .

In other words, we have P ( a) = Q ( a) for all a ∈ C \ {−1, 1}. Renaming the


variable a as x in this statement, we obtain the following: We have P ( x ) = Q ( x ) for
all x ∈ C \ {−1, 1}. Hence, Corollary 7.5.7 (applied to S = C \ {−1, 1}) yields that
P = Q (since the set C \ {−1, 1} is infinite). Thus, each a ∈ C satisfies P ( a) = Q ( a).
In view of (302) and (303), this rewrites as follows: Each a ∈ C satisfies
! !
n n n
∑ (−1)i ai · ∑ ai = ∑ a2i .
i =0 i =0 i =0

This solves Exercise 7.5.1.


Now, let us use the polynomial identity trick to derive Theorem 7.5.4 from Propo-
sition 7.5.2:
Proof of Theorem 7.5.4 (sketched). We must prove the equality

n−b
     
n a n
= . (304)
a b b a−b

  holds if b ∈
First of all, it is easy to see that (304) / N. Indeed, if b ∈ / N, then
a n
both binomial coefficients and / N, then the
are 0 (by (118)). Thus, if b ∈
b b
equality (304) boils down to 0 = 0 (since each of its sides is a product with one
factor equal to 0), which is clearly true. Thus, we WLOG assume that b ∈ N in the
rest of this proof.
If we have a ∈ / N, then we have a − b ∈ / N as well (since otherwise, we would
have a − b ∈ N and therefore a = |a {z b ∈ N, which would contradict
− b} + |{z}
∈N ∈N
n−b
 
 
n
a∈/ N), and therefore both binomial coefficients and are 0 (by (118)).
a a−b
Hence, if we have a ∈ / N, then the equality (304) boils down to 0 = 0, which is
clearly true. Thus, we WLOG assume that a ∈ N in the rest of this proof.
Now, we have a, b ∈ N, but we don’t necessarily have n ∈ N. If n ∈ N, then
/N
(304) follows from Proposition 7.5.2, but how can we prove it for n ∈  ?
n
We take a broader view. We have defined the binomial coefficient for any
k
number n; but we can just as well extend this definition by plugging a polynomial

December 25, 2021


Math 235 notes page 321

variable (or even a polynomial) for n. That


 is, if F is any polynomial and k is a
F
number, then we define a polynomial as follows:
k

• If k ∈ N, then we set

F ( F − 1) ( F − 2) · · · ( F − k + 1)
 
F
= . (305)
k k!

/ N, then we set
• If k ∈  
F
= 0. (306)
k

This definition is precisely Definition 4.3.1, with n replaced by F. Thus, if F is


  and if x is any number,
any polynomial,  then  the result of substituting x into the
F F (x)
polynomial equals the number . This will be used without saying.
k k
With this all said, we can define two polynomials P and Q (with complex coeffi-
cients, in a single variable X) by

X−b
     
X a X
P (X) = and Q (X) = .
a b b a−b
204 Then, for all x ∈ N, we have
      
x a X a
P (x) = since P ( X ) =
a b a b
x−b
  
x
= (by Proposition 7.5.2, applied to x instead of n)
b a−b
= Q (x)

X−b x−b
     
X x
(since Q ( X ) = and thus Q ( x ) = ). Therefore, Corol-
b a−b b a−b
lary 7.5.7 (applied to S = N) shows that P = Q (since the set N is infinite).
Evaluating both sides of this equality at the number n, we thus find P (n) = Q (n)
204 Explicitly, these polynomials look as follows: We have

X ( X − 1) ( X − 2) · · · ( X − a + 1) a
 
P (X) = .
a! b

Furthermore, if a − b ∈ N, then

X ( X − 1) ( X − 2) · · · ( X − b + 1) ( X − b ) ( X − b − 1) ( X − b − 2) · · · ( X − b − ( a − b ) + 1)
Q (X) = · .
b! ( a − b)!

X ( X − 1) ( X − 2) · · · ( X − b + 1)
/ N, then Q ( X ) =
(On the other hand, if a − b ∈ · 0 = 0.)
b!

December 25, 2021


Math 235 notes page 322

(no matter  n ∈ N or n ∈
whether N). But the definitions
/  of P and Q show that
n−b
 
n a n n a
P (n) = and Q (n) = . Hence, = P (n) = Q (n) =
a b b a−b a b
n−b
 
n
. This proves (304), and thus Theorem 7.5.4 is proven.
b a−b
Note that we have used the polynomial identity trick (in the shape of Corollary
7.5.7) to generalize the equality (304) from n ∈ N to n ∈ C. However, we did not
use this trick to generalize it from a ∈ N to a ∈ C (or from b ∈ N to b ∈ C); instead,
we have used ad-hoc arguments to prove that (304) holds in the cases a ∈ / N and
b∈ / N. In fact, the polynomial identity trick would
  not have helped us here. The
n
reason is that, while the binomial coefficient is a polynomial function in n
k 

205 , it is not a polynomial function in k (indeed, n is zero for all negative k, but
k
nonzero for k = 0; but this is not how a polynomial function in k could behave).
Thus we needed a different argument to generalize from a, b ∈ N to a, b ∈ C.
Next, let us derive Theorem 7.5.3 from Proposition 7.5.1. This will use the poly-
nomial identity trick twice – once to generalize from x ∈ N to x ∈ C, and once
again to generalize from y ∈ N to y ∈ C. (Alternatively, we could do it in sitting
if we generalized Corollary 7.5.7 to polynomials in two variables; this is how it is
done in [Grinbe15, §3.3.3, Second proof of Theorem 3.30].)
We begin by showing an “intermediate stage” between Proposition 7.5.1 and
Theorem 7.5.3:

Lemma 7.5.8. Let n ∈ N and x ∈ N and y ∈ C. Then,


  n   
x+y x y
= ∑ .
n k =0
k n−k

Lemma 7.5.8 is clearly more general than Proposition 7.5.1 but less than Theorem
7.5.3. We shall first deduce this lemma from Proposition 7.5.1, and then use this
lemma to deduce Theorem 7.5.3 in turn. Both deductions will use the polynomial
identity trick.
Proof of Lemma 7.5.8. It shall be convenient for us to rename the variables x and y
as u and v. Thus, we let n ∈ N and u ∈ N and v ∈ C. We must then prove that
  n   
u+v u v
= ∑ . (307)
n k =0
k n−k

205 This
 means that for any fixed number k, there is a 
polynomial
 P such that each number n satisfies
n X
= P (n). (Namely, this P is the polynomial .)
k k

December 25, 2021


Math 235 notes page 323

Define two polynomials P and Q (with complex coefficients, in a single variable


X) by   n   
u+X u X
P (X) = and Q (X) = ∑ .
n k =0
k n − k
206 Thus, each x ∈ N satisfies
  n   
u+x u x
P (x) = and Q (x) = ∑
n k =0
k n−k

and therefore
  n   
u+x u x
P (x) = = ∑
n k =0
k n−k
 
by Proposition 7.5.1 (applied to u and x instead of x and y),
since u ∈ N and x ∈ N
= Q (x) .

That is, we have P ( x ) = Q ( x ) for all x ∈ N. Hence, Corollary 7.5.7 (applied to


S = N) yields that P = Q (since N is infinite). Thus, P (v) = Q (v). But the
definitions of P and Q yield
  n   
u+v u v
P (v) = and Q (v) = ∑ .
n k =0
k n−k

Hence,   n   
u+v u v
= P (v) = Q (v) = ∑ .
n k =0
k n−k
This proves (307). Thus, Lemma 7.5.8 is proven.
Proof of Theorem 7.5.3. It shall again be convenient for us to rename the variables x
and y as u and v. Thus, we let n ∈ N and u ∈ C and v ∈ C. We must then prove
that   n   
u+v u v
= ∑ . (308)
n k =0
k n−k
Define two polynomials P and Q (with complex coefficients, in a single variable
X) by   n   
X+v X v
P (X) = and Q (X) = ∑ .
n k =0
k n−k

 
206 Here F
we are using binomial coefficients in which F is a polynomial. See our above proof of
k
Theorem 7.5.4 for the definition of this kind of binomial coefficients.

December 25, 2021


Math 235 notes page 324

207 Thus, each x ∈ N satisfies


  n   
x+v x v
P (x) = and Q (x) = ∑
n k =0
k n−k

and therefore
  n   
x+v x v
P (x) = = ∑
n k =0
k n−k
(by Lemma 7.5.8 (applied to y = v), since x ∈ N)
= Q (x) .

That is, we have P ( x ) = Q ( x ) for all x ∈ N. Hence, Corollary 7.5.7 (applied to


S = N) yields that P = Q (since N is infinite). Thus, P (u) = Q (u). But the
definitions of P and Q yield
  n   
u+v u v
P (u) = and Q (u) = ∑ .
n k =0
k n − k

Hence,   n  
u+v u v
= P (u) = Q (u) = ∑ .
n k =0
k n−k
This proves (308). Thus, Theorem 7.5.3 is proven.
After these proofs, it might appear that the polynomial identity trick is magic. In
some ways, this is true, as it allowed us to extend combinatorial proofs to situations
 
n
in which combinatorics has no say (such as properties of binomial coefficients
k
with non-integer n). However, it has its limitations.  For example, we cannot use it
n i
to extend Exercise 4.5.8 (a) to negative n (since ∑ is not a polynomial function
i =0 k  
n
in n); nor can we use it to extend Theorem 4.3.10 to negative n (since is
n−k
not a polynomial function in n); nor can we use it to extend Theorem 4.3.8 to
n!
negative n (indeed, does not even make sense when n is negative). See
k! · (n − k )!
[19fco, §2.6.4] for more examples of what can and what cannot be done using the
polynomial identity trick.

 
207 Here F
we are using binomial coefficients in which F is a polynomial. See our above proof of
k
Theorem 7.5.4 for the definition of this kind of binomial coefficients.

December 25, 2021


Math 235 notes page 325

7.5.4. A probabilistic proof


The next exercise is a classical identity with binomial coefficients ([Engel98, Chapter
5, Example E18], [Engel98, Exercise 8.4], [GrKnPa94, (5.20)], [Grinbe15, Exercise
3.27 (b)]):

Exercise 7.5.2. Let n ∈ N. Prove that


n  
n+k 1
∑ k 2k = 2n .
k =0

Several solutions to this exercise are known. In particular, [Grinbe15, Exer-


cise 3.27 (b)] gives an algebraic proof by manipulating sums; an elegant proof
by induction on n appears in https://math.stackexchange.com/a/1874857 and
[Tomesc85, solution to Problem 1.1 (b)]. More proofs can be found at https://
math.stackexchange.com/questions/1874816 and at https://math.stackexchange.
com/questions/1928040 and at https://math.stackexchange.com/questions/1782432
and at https://math.stackexchange.com/questions/3392981 . An equivalent prob-
lem is [YagYag64, Problem 73b]. We shall give a probabilistic proof – i.e., in essence,
a proof by double counting, except that we formulate it in terms of probabilities
rather than numbers. This proof is essentially the one given in [Engel98, Chapter
5, Example E18].
Solution to Exercise 7.5.2 (sketched). Consider a fair coin (i.e., a coin that is equally
likely to come up heads as it is to come up tails when it is tossed). We toss this
coin 2n + 1 times208 . Let H be the event “the coin comes up heads at least n + 1
times”, and let T be the event “the coin comes up tails at least n + 1 times”. What
can we say about the probabilities Pr H and Pr T of the events H and T ?
First of all, the events H and T cannot happen at the same time, because this
would require at least (n + 1) + (n + 1) = 2n + 2 tosses (but we are only tossing
our coin 2n + 1 times). Furthermore, at least one of the events H and T must
happen (since otherwise, the coin comes up heads at most n times and comes up
tails at most n times, so that we must have tossed it at most n + n = 2n times,
which contradicts the fact that we are tossing it 2n + 1 times). Thus, exactly one
of the events H and T must happen. In other words, the events H and T are
complements of each other. Hence, their probabilities add up to 1; that is, we have
Pr H + Pr T = 1.
Now, let us compute Pr H. For each k ∈ {0, 1, . . . , n}, we define the event

Hk = (“the coin comes up heads at least n + 1 times,


and by the (n + 1) -st time it comes up heads,
it has come up tails exactly k times”) .

208 The tosses are independent.

December 25, 2021


Math 235 notes page 326

For example, if n = 3, and if the coin comes up tails first, then heads, then tails
again, then heads, then heads, then heads, then tails again, then the event H2
happens (because the coin has come up tails exactly twice by the 4-th time it comes
up heads).
Now we claim that

Pr H = Pr ( H0 ) + Pr ( H1 ) + · · · + Pr ( Hn ) . (309)

[Proof: If the event H happens, then exactly one of the n + 1 events H0 , H1 , . . . , Hn


must be happening (because by the (n + 1)-st time the coin comes up heads, it must
have come up tails some number of times between 0 and n 209 ). Since the events
H0 , H1 , . . . , Hn are disjoint, and since they are subsets of H, we thus conclude that
(309) holds.]
Next, let us fix k ∈ {0, 1, . . . , n}. We want to compute Pr ( Hk ). The event Hk can
be rewritten as follows:

Hk = (“the first n + k times that we toss the coin,


it comes up tails exactly k times; furthermore,
it comes up heads the (n + k + 1) -st time we toss it”) . (310)

Thus, its probability Pr ( Hk ) is easy to compute:210


 
n+k 1 1
Pr ( Hk ) = · n+k · . (311)
k 2 2
[Proof: Let us first find the probability of the event “the first n + k times that we
toss the coin, it comes up tails exactly k times”.
Indeed, the first n + k tosses of the coin can give 2n+k different outcomes (where
we treat an outcome as an (n + k)-tuple of heads/tails events211 ). All these 2n+k
outcomes are equally probable (since the coin is fair), and thus have probability
1
n + k
each. How many of these 2n+k outcomes have the property that the coin
2
comes up tails exactly k times? An outcome O of the first n + k tosses is uniquely
determined by the set

IO := {i ∈ {1, 2, . . . , n + k} | the coin comes up tails in the i-th toss} .

The coin comes up tails exactly k times in this outcome O if and only if the set IO
has size k. Thus, we are looking for the# of k-element
 subsets of {1, 2, . . ., n + k};
n+k n+k
but Theorem 4.3.12 shows that this # is . Thus, there are precisely
k k
many outcomes (of the first n + k tosses) that have the property that the coin comes
209 Itcannot have come up tails more than n times, since we are only tossing the coin 2n + 1 times.
210 Computing Pr ( Hk ) is known as Banach’s matchbox problem.
211 For example, the outcome “the coin comes up heads, then tails, then heads” is encoded as the

3-tuple (“heads”, “tails”, “heads”).

December 25, 2021


Math 235 notes page 327

1
up tails exactly k times. Since each outcome has probability , we thus conclude
2n + k
that

Pr (“the first n + k times that we toss the coin,


it comes up tails exactly k times”)
 
n+k 1
= · n+k . (312)
k 2

Also, since our coin is fair, we have

Pr (“the coin comes up heads the (n + k + 1) -st time we toss it”)


1
= . (313)
2
But the different tosses of the coin are independent. Hence,

Pr (“the first n + k times that we toss the coin,


it comes up tails exactly k times; furthermore,
it comes up heads the (n + k + 1) -st time we toss it”)
= Pr (“the first n + k times that we toss the coin,
it comes up tails exactly k times”)
· Pr (“the coin comes up heads the (n + k + 1) -st time we toss it”)
 
n+k 1 1
= · n+k · (by (312) and (313)) .
k 2 2

Since the event on the left   of this equality is precisely Hk , we can rewrite
hand side
n+k 1 1
this equality as Pr ( Hk ) = · n+k · . Thus, (311) is proved.]
k 2 2
Now, (309) becomes
n
Pr H = Pr ( H0 ) + Pr ( H1 ) + · · · + Pr ( Hn ) = ∑ Pr ( Hk )
k =0  | {z }
n+k 1 1
= · ·
k 2n + k 2
(by (311))
n   n  
n+k 1 1 n+k 1 1 1
= ∑ k
· n+k · = ∑
k
· n· k·
k =0 |2{z } 2 k=0 2 2 2
1 1
= ·
2n 2k
n  
1 1 n+k 1
= · n·∑ .
2 2 k =0 k 2k

December 25, 2021


Math 235 notes page 328

The same argument (with the roles of heads and tails interchanged) yields
n  
1 1 n+k 1
Pr T = · n · ∑ .
2 2 k =0 k 2k

Adding these two equalities together, we find


n   n  
1 1 n+k 1 1 1 n+k 1
Pr H + Pr T = · n · ∑ + · ·∑
2 2 k =0 k 2k 2 2n k =0 k 2k
n   n  
1 1 n+k 1 1 n+k 1
= 2· · n · ∑ k
= n·∑ .
2 2 k =0 k 2 2 k =0 k 2k

Comparing this with Pr H + Pr T = 1, we obtain


n  
1 n+k 1
2n k∑
· k
= 1.
=0
k 2

Hence,
n  
n+k 1
∑ k 2 k
= 2n .
k =0
This solves Exercise 7.5.2.
The solution we just gave for Exercise 7.5.2 suggests a generalization, which can
be obtained if we replace the fair coin by a biased coin. (See [Grinbe15, Exercise
3.27 (a)] for this generalization, which is known as the Daubechies identity.)
Results like Theorem 7.5.3, Theorem 7.5.4, Theorem 4.3.10, Proposition 4.3.6, The-
orem 4.3.7, Exercise 4.5.8 and Exercise 7.5.2 are commonly called binomial identities,
as they are identities involving binomial coefficients. We shall see several more such
identities in the coming sections. Even more can be found in [GrKnPa94, Chapter
5], [Spivey19], [Riorda68] and [BenQui03]. (The book [BenQui03], in particular, is
devoted to proving such identities by double counting.)

7.6. Recitation #7: More on counting and binomial coefficients


Here are some more exercises on counting and binomial coefficients.

7.6.1. More binomial identities


The first of these exercises ([19fco, Proposition 2.6.13]) is a binomial identity some-
times called the “upside-down Chu–Vandermonde identity” (since it looks like
Proposition 7.5.1 with the binomial coefficients turned “upside down”):

December 25, 2021


Math 235 notes page 329

Exercise 7.6.1. Let n ∈ N and x, y ∈ N. Prove that


n  
n−k
  
n+1 k
= ∑ .
x+y+1 k =0
x y

Note that (unlike Proposition 7.5.1) this exercise cannot be generalized to x, y ∈


C. (For instance, n = 0 and x = −1 and y = 0 would be a counterexample.)
First solution to Exercise 7.6.1 (sketched). The following proof is the same as [19fco,
§2.6.5, second proof of Proposition 2.6.13].
We apply double counting. Specifically, we ask ourselves: How many ( x + y + 1)-
element subsets does the set [n + 1] have? As always, we shall answer this question
in two ways:  
n+1
First way: The answer is , since Theorem 4.3.12 (applied to n + 1,
x+y+1
[n + 1] and x + y + 1 instead of n, S and k) shows that
(# of ( x + y + 1) -element subsets of [n + 1])
 
n+1
= . (314)
x+y+1
Second way: If U is any set of integers, and k ∈ {1, 2, . . . , |U |}, then we let
mink U denote the k-th smallest element of U. For example, min2 {3, 6, 8, 9} = 6
and min4 {3, 6, 8, 9} = 9.
If U is an ( x + y + 1)-element subset of [n + 1], then minx+1 U is well-defined
(since x + 1 ∈ {1, 2, . . . , x + y + 1} = {1, 2, . . . , |U |}) and belongs to U and therefore
to [n + 1] (since U ⊆ [n + 1]). Hence, the sum rule yields
(# of ( x + y + 1) -element subsets of [n + 1])
= ∑ (# of ( x + y + 1) -element subsets U of [n + 1] satisfying minx+1 U = j) .
j∈[n+1]

(Some addends on the right hand side of this equality will be 0, but as usual we
are OK with this.)
Now, fix j ∈ [n + 1]. Let us compute
(# of ( x + y + 1) -element subsets U of [n + 1] satisfying minx+1 U = j) .
If U is an ( x + y + 1)-element subset of [n + 1] satisfying minx+1 U = j, then U has
precisely x elements smaller than j (by the definition of minx+1 U) and therefore
precisely ( x + y + 1) − ( x + 1) = y elements larger than j. Hence, we can construct
such a subset U through the following procedure:
j−1
 
• First, we choose the x elements of U that are smaller than j. We have
x
options for this. (Indeed, the x elements we are choosing need to belong

December 25, 2021


Math 235 notes page 330

to [n + 1] and be smaller than j; that is, they need to come from the set
{1, 2, . . . , j − 1}. Thus, we are really choosing an x-element subset of the set
( j − 1)-element set {1, 2, . . . , j − 1}. But Theorem 4.3.12 says that there are
j−1
 
precisely many such subsets.)
x
n+1−j
 
• Then, we choose the y elements of U that are larger than j. We have
y
options for this. (Indeed, the y elements we are choosing need to belong
to [n + 1] and be larger than j; that is, they need to come from the set
{ j + 1, j + 2, . . . , n + 1}. Thus, we are really choosing a y-element subset of
the set (n + 1 − j)-element set  { j + 1, 
j + 2, . . . , n + 1}. But Theorem 4.3.12
n+1−j
says that there are precisely many such subsets.)
y
• We don’t need to decide whether j will be an element of U, since this is
already predetermined: We must have j ∈ U in order to have minx+1 U = j.

j−1 n+1−j
  
According to the product rule, there are possibilities for how
x y
these choices can be made. Thus,

(# of ( x + y + 1) -element subsets U of [n + 1] satisfying minx+1 U = j)


j−1 n+1−j
  
= . (315)
x y

Now, forget that we fixed j. Recall that

(# of ( x + y + 1) -element subsets of [n + 1])


= ∑ (# of ( x + y + 1) -element subsets U of [n + 1] satisfying minx+1 U = j)
j∈[n+1]
| {z }
j−1 n+1−j
  
=
x y
(by (315))
n +1 
j−1 n+1−j j−1 n − ( j − 1)
     
= ∑ x y
= ∑ x y
j∈[n+1] | {z } j =1
n − ( j − 1)
| {z } 
n +1
=∑ =
j =1 y
(since n+1− j=n−( j−1))
n
n−k
  
k
= ∑ (316)
k =0
x y

(here, we have substituted k for j − 1 in the sum).

December 25, 2021


Math 235 notes page 331

Comparing (316) with (314), we obtain


n  
n−k
  
n+1 k
= ∑ .
x+y+1 k =0
x y
This solves Exercise 7.6.1.
There is also an alternative, algebraic solution to Exercise 7.6.1, which proceeds
by applying the Chu–Vandermonde identity (Theorem 7.5.3) to n − x − y, − x − 1
and −y − 1 instead of n, x and y (this requires n − x − y ∈ N, but the case when
this is not so can easily be boiled down to 0 = 0) and rewriting the result using
symmetry (Theorem 4.3.10) and upper negation (Proposition 4.3.6). See [19fco, first
proof of Proposition 2.6.13] for the details of this solution. This solution illustrates
how useful it can be to plug in “combinatorially meaningless” values (like, in our
case, the negative numbers − x − 1 and −y − 1) into binomial identities (presuming,
of course, that said identities do hold for these values; this is why we have bothered
to generalize the Chu–Vandermonde identity from x, y ∈ N to x, y ∈ C).
Remark 7.6.1. Exercise 4.5.8 (a) (which is commonly known as the “hockey-stick
identity”) is a particular case of Exercise 7.6.1. Figure out why! (See [19fco,
Exercise 2.6.4] for the answer.)
Here is another binomial identity:
Exercise 7.6.2. Let a, b ∈ C and n, m ∈ N satisfy m < n. Prove that
n   
j n aj + b
∑ (−1) j m
= 0.
j =0

Before we solve this exercise, let me quickly mention that Exercise 7.6.2 is a
generalization of Proposition 4.3.18. Indeed, if n is a positive integer, then Exercise
7.6.2 (applied to m = 0, a = 1 and b = 0) yields
n   
j n 1j + 0
∑ (−1) j 0
= 0 = [ n = 0] (since n 6= 0)
j =0

and thus
n    n   n  
n 1j + 0 n k n
[n = 0] = ∑ (−1) j
= ∑ (−1) j = ∑ (−1) k ;
j

j =0
j 0 j =0 k =0
| {z }
=1
(by (119))

but this is precisely the claim of Proposition 4.3.18 in the case when n > 0. Thus,
in the case when n > 0, Proposition 4.3.18 follows from Exercise 7.6.2. (The case
when n = 0 is trivial.)
There are various ways to solve Exercise 7.6.2, but the following is perhaps the
shortest (and has the advantage of illustrating the usefulness of Exercise 5.4.2):

December 25, 2021


Math 235 notes page 332

Solution to Exercise 7.6.2. Define a polynomial P (with complex coefficients, in a


single variable X) by
− aX + b
 
P (X) = .
m
212 Thus,
− aX + b
 
P (X) =
m
(− aX + b) (− aX + b − 1) (− aX + b − 2) · · · (− aX + b − m + 1)
=
m!
(by (305), since m ∈ N) .
Hence, the polynomial P has degree ≤ m (since each of the m factors − aX + b,
− aX + b − 1, − aX + b − 2, . . ., − aX + b − m + 1 in the numerator has degree ≤ 1
213 , whereas the denominator is just a constant). Thus, Exercise 5.4.2 (d) yields that

each x ∈ N satisfies
n  
k n
∑ (−1) k P (x − k) = 0
k =0
(since n > m (because we assumed that m < n)). Applying this to x = 0, we obtain
n  
k n
∑ (−1) k P (0 − k) = 0.
k =0
Thus,
 
n   n  
k n n
0 = ∑ (−1) − }k = ∑ (−1)
P 0| {z k
P (−k )
k =0
k k =0
k | {z }
=−k
− a (−k) + b
 
=
m
− aX + b

(since P( X )= )
m
n n
− a (−k) + b
     
k n k n ak + b
= ∑ (−1) = ∑ (−1)
k =0
k m k m
|  {z  } k=0
ak + b
=
m
(since − a(−k)= ak)
n   
j n aj + b
= ∑ (−1) .
j =0
j m

This solves Exercise 7.6.2.


 
212 Here F
we are using binomial coefficients in which F is a polynomial. See our above proof of
k
Theorem 7.5.4 for the definition of this kind of binomial coefficients.
213 You may be tempted to say “degree 1”, but this would not be quite correct: If a = 0, then all these

factors are constants and thus have degree 0.

December 25, 2021


Math 235 notes page 333

7.6.2. Counting perfect matchings of a finite set


Let us count something else: set partitions.

Definition 7.6.2. Let S be a set.


(a) A set partition of S means a set { E1 , E2 , . . . , Ek } of disjoint nonempty subsets
of S satisfying S = E1 ∪ E2 ∪ · · · ∪ Ek .
(b) If P = { E1 , E2 , . . . , Ek } is a set partition of S, then the sets E1 , E2 , . . . , Ek are
called the blocks of P.

Example 7.6.3. (a) Here are three set partitions of the set [6] = {1, 2, 3, 4, 5, 6}:

P1 = {{1, 3} , {2, 4, 5} , {6}} ;


P2 = {{1} , {2, 4, 5, 6} , {3}} ;
P3 = {{1} , {3} , {2, 5, 6, 4}} .

Note that the set partitions P2 and P3 are actually identical (since the order of
elements in a set does not matter).
(b) Here are all set partitions of the set [3] = {1, 2, 3}:

{{1, 2, 3}} , {{1, 2} , {3}} , {{1, 3} , {2}} , {{2, 3} , {1}} ,


{{1} , {2} , {3}} .

And here are the same set partitions, drawn as pictures (each block of the set
partition is drawn as a blob):

3 3 3
3 3

1 2 1 2 1 2
1 2 1 2

If S is a set, and if P is a set partition of S, then any element of S belongs to exactly


one block of P. Readers familiar with equivalence relations will thus recognize the
notion of a set partition as a different language for the notion of an equivalence
relation.214
214 Namely:

• If ∼ is an equivalence relation on a set S, then the set of all equivalence classes of ∼ is a


set partition of S.
• If P is a set partition of a set S, then the binary relation “a and b belong to one and the
same block of P” (on two elements a and b of S) is an equivalence relation on S.

Thus, we can transform an equivalence relation into a set partition and vice
versa. These two transformations are mutually inverse, so they are bijections between

December 25, 2021


Math 235 notes page 334

Remark 7.6.4. Let n ∈ N. The # of all set partitions of [n] is known as the n-th Bell
number Bn . The sequence ( B0 , B1 , B2 , . . .) = (1, 1, 2, 5, 15, 52, 203, . . .) is Sequence
A000110 in the OEIS, and has the following nice recursive formula:
n  
n
Bn+1 = ∑ B for each n ∈ N.
k =0
k k

(It is a neat exercise on counting to prove this. A proof can be found in [Guicha20,
Theorem 1.4.3].) No closed form expression for Bn is known. (See [Gardne91,
Chapter Two] for a popular-science survey of Bell numbers.)

We want to count a certain special type of set partitions:

Definition 7.6.5. Let S be a set. A perfect matching of S shall mean a set partition
{ E1 , E2 , . . . , Ek } of S such that E1 , E2 , . . . , Ek are 2-element sets.

Example 7.6.6. (a) Here are all perfect matchings of the set [4] = {1, 2, 3, 4}:

{{1, 2} , {3, 4}} , {{1, 3} , {2, 4}} , {{1, 4} , {2, 3}} .

And here are the same perfect matchings, drawn as pictures (each block of the
perfect matching is drawn as a blob):

2 3 2 3 2 3

1 4 1 4 1 4

(b) The set [6] has 15 perfect matchings; three of them are

{{1, 2} , {3, 4} , {5, 6}} , {{1, 4} , {2, 6} , {3, 5}} , {{1, 6} , {2, 5} , {3, 4}} .

(c) The set [5] has no perfect matchings.

One can think of a perfect matching of a set S as a way to pair up the elements of
S with each other in such a way that each element of S ends up in exactly one pair.
(Here, the word “pair” is to be understood in its common-language meaning, not
in its mathematical meaning; the correct mathematical word is “two-element set”.)

{equivalence relations on S} and {set partitions on S} (for a given set S). The proof of this
is completely straightforward axiom checking; you can find it spelled out in [Goodma15, Propo-
sition 2.6.7].

December 25, 2021


Math 235 notes page 335

Exercise 7.6.3. Let n ∈ N. Let S be an n-element set. Find the # of all perfect
matchings of S.

We shall sketch two solutions to Exercise 7.6.3, without ever going fully rigorous
(which would be rather tedious in this particular case). Our first solution will use a
decision procedure to construct a perfect matching of S (which will allow counting
the perfect matchings of S via the dependent product rule), while our second will
exemplify a counting strategy known as overcounting.
First solution to Exercise 7.6.3 (sketched). Let us first show the following:

Claim 1: If n is odd, then (# of perfect matchings of S) = 0.

[Proof of Claim 1: Let n be odd. We must prove that (# of perfect matchings of S) =


0.
Assume the contrary. Thus, there exists a perfect matching of S. Consider this
perfect matching, and denote it by { E1 , E2 , . . . , Ek } (with E1 , E2 , . . . , Ek being dis-
tinct).
Now, { E1 , E2 , . . . , Ek } is a perfect matching of S. In other words, { E1 , E2 , . . . , Ek }
is a set partition of S such that E1 , E2 , . . . , Ek are 2-element sets (by the definition
of “perfect matching”). Since E1 , E2 , . . . , Ek are 2-element sets, we have | E1 | = 2,
| E2 | = 2, . . ., | Ek | = 2.
We know that { E1 , E2 , . . . , Ek } is a set partition of S. In other words, E1 , E2 , . . . , Ek
are disjoint subsets of S satisfying S = E1 ∪ E2 ∪ · · · ∪ Ek (by the definition of “set
partition”). Now, since S is an n-element set, we have

n = |S| = | E1 ∪ E2 ∪ · · · ∪ Ek | (since S = E1 ∪ E2 ∪ · · · ∪ Ek )
= | E1 | + | E2 | + · · · + | Ek | (since E1 , E2 , . . . , Ek are disjoint)
= 2| + 2 +{z· · · + 2} (since | E1 | = 2, | E2 | = 2, . . . , | Ek | = 2)
k times
= k · 2 = 2k.

This entails that n is even. This contradicts the fact that n is odd. This contradiction
shows that our assumption was false. Hence, Claim 1 is proven.]
Claim 1 solves Exercise 7.6.3 in the case when n is odd. Thus, for the rest of this
solution, we WLOG assume that n is even. Thus, n/2 ∈ N.
We WLOG assume that S = [n]. Indeed, S is an n-element set, so we can relabel
the elements of S as 1, 2, . . . , n; this clearly does not change the # of perfect match-
ings of S (because, as we relabel the elements of S, we can relabel the elements of
the blocks in all perfect matchings of S 215 ).
If P is a perfect matching of S, then we shall say that two distinct elements of S
are partners of each other (in P) if and only if they belong to one and the same block
215 What we are actually using here is the “isomorphism principle”. See [19fco, §1.7.2] for some more
discussion about this principle.

December 25, 2021


Math 235 notes page 336

of P. Given a perfect matching P of S, it is clear that any element of S has exactly


one partner (in P), since each block of P is a 2-element set (and since any element
of S belongs to exactly one block of P). For example, if P is the perfect matching
{{1, 4} , {2, 3}} of the set {1, 2, 3, 4}, then the partner of 1 (in P) is 4.
Clearly, if P is a perfect matching of S, then the partner of any p ∈ S (in P) is an
element q ∈ S distinct from p, and the partner of this latter element q is p again.
Moreover, a perfect matching of S is uniquely determined if we know the partner
of each element. This suggests the following method for constructing a perfect
matching P of S:

• Choose the partner of 1 (in P). There are n − 1 options for this (since the
partner of 1 must be distinct from 1). We declare both 1 and its partner to be
partnered.

• Take the smallest unpartnered216 element p2 of S, and choose its partner.


There are n − 3 options (since neither p2 nor the two partnered elements
qualify as partners). We declare both p2 and its partner to be partnered.

• Take the smallest unpartnered element p3 of S, and choose its partner. There
are n − 5 options (since neither p3 nor the four partnered elements qualify as
partners). We declare both p3 and its partner to be partnered.

• We go on like this until no more unpartnered elements of S remain. Since n


is even, this will happen after precisely n/2 choices of partners, since every
such choice removes exactly 2 elements from the set of unpartnered elements.

The dependent product rule shows that there are precisely

(n − 1) (n − 3) (n − 5) · · · (n − 2 (n/2) + 1)

possibilities for how these choices can be made. Each possibility leads to a different
perfect matching of S, and each perfect matching of S can be obtained in this way.

216 We call an element of S unpartnered if we have not declared it to be partnered yet. (Of course,
in the perfect matching we are constructing, it will eventually have a partner.) The smallest
unpartnered element of S is 2 if the partner we have chosen for 1 is distinct from 2; otherwise, it
is 3.

December 25, 2021


Math 235 notes page 337

Hence,

(# of perfect matchings of S)
= (n − 1) (n − 3) (n − 5) · · · (n − 2 (n/2) + 1)
| {z }
=1
= ( n − 1) ( n − 3) ( n − 5) · · · 1
 

= 1 · 3 · 5 · · · · ·  |{z}
n −1 (317)
=2(n/2)
= 1 · 3 · 5 · · · · · (2 (n/2) − 1)
(2 (n/2))!
= n/2 (by Exercise 4.2.3, applied to n/2 instead of n)
2 (n/2)!
n!
= n/2 (since 2 (n/2) = n) . (318)
2 · (n/2)!
Combining this with Claim 1, we thus conclude that

0,
 if n is odd;
(# of perfect matchings of S) = n!
 2n/2 · (n/2)! ,
 if n is even.

[Remark: Instead of proving Claim 1 the way we did above, we could have used
the same decision procedure that we used in the case when n is even. This would
have given a different proof of Claim 1. Indeed, the last decision in our decision
procedure requires choosing a partner for the smallest unpartnered element; if n
is odd, then there are 0 options for it, because the smallest unpartnered element
at that point is the last unpartnered element and thus cannot find a partner. This
entails that (if n is odd) the number of possibilities is (n − 1) (n − 3) (n − 5) · · · 0 =
0. Thus, Claim 1 is proved again.]
Second solution to Exercise 7.6.3 (sketched). As in the first solution above, we can show
that (# of perfect matchings of S) = 0 when n is odd. Thus, for the rest of this so-
lution, we WLOG assume that n is even.
Again, as in the first solution above, we WLOG assume that S = [n]. Thus, we
need to find the # of perfect matchings of [n].
To each permutation σ of [n], we assign the perfect matching

M (σ ) := {{σ (1) , σ (2)} , {σ (3) , σ (4)} , . . . , {σ (n − 1) , σ (n)}} of [n] .

(Note that this is well-defined because n is even, and is a perfect matching because
σ is bijective.) Thus, we have found a map

M : {permutations of [n]} → {perfect matchings of [n]} .

December 25, 2021


Math 235 notes page 338

We know that there are n! permutations of [n]. What does this mean about the #
of perfect matchings of [n] ?
The map M is not a bijection (unless n = 0), since different permutations σ
can lead to the same perfect matching M (σ). Thus, we cannot apply the bijection
principle. However, we might be able to salvage the idea if we can compute how
many different permutations σ lead to a single perfect matching.
Thus, let us fix a perfect matching P of [n]. How many permutations σ of [n]
satisfy M (σ) = P ?
Each block of P is a 2-element set (since P is a perfect matching), and the sum of
the sizes of these 2-element sets is |[n]| (since P is a set partition of [n]). Thus, the
# of blocks of P is |[n]| /2 = n/2. In other words, P has exactly n/2 blocks. Hence,
|{z}
=n
we can write P in the form

P = {{i1 , i2 } , {i3 , i4 } , . . . , {in−1 , in }} ,

where i1 , i2 , . . . , in are the elements of [n] in some order. If σ is a permutation of [n]


that satisfies M (σ ) = P, then we must thus have

{{σ (1) , σ (2)} , {σ (3) , σ (4)} , . . . , {σ (n − 1) , σ (n)}}


= M (σ) (by the definition of M (σ))
= P = {{i1 , i2 } , {i3 , i4 } , . . . , {in−1 , in }} .
This means that the n/2 two-element sets

{σ (1) , σ (2)} , {σ (3) , σ (4)} , . . . , {σ (n − 1) , σ (n)}


must be precisely the n/2 two-element sets {i1 , i2 } , {i3 , i4 } , . . . , {in−1 , in } in
some order.
This suggests the following method for constructing a permutation σ of [n] sat-
isfying M (σ ) = P:

• First, we decide which of the 2-element sets


{σ (1) , σ (2)} , {σ (3) , σ (4)} , . . . , {σ (n − 1) , σ (n)} is which of the 2-
element sets {i1 , i2 } , {i3 , i4 } , . . . , {in−1 , in }. There are (n/2)! options
for this decision, since we are (in effect) choosing a bijection from the set
{1, 2, . . . , n/2} to the set {{i1 , i2 } , {i3 , i4 } , . . . , {in−1 , in }} (and Theorem
7.4.3 shows that the # of such bijections is (n/2)!).
After this decision, each of the 2-element sets

{σ (1) , σ (2)} , {σ (3) , σ (4)} , . . . , {σ (n − 1) , σ (n)}


is determined.
• Then, we decide which of the two elements of the 2-element set {σ (1) , σ (2)}
will be σ (1). There are 2 options for this. The other (unchosen) element will
then be σ (2).

December 25, 2021


Math 235 notes page 339

• Then, we decide which of the two elements of the 2-element set {σ (3) , σ (4)}
will be σ (3). There are 2 options for this. The other (unchosen) element will
then be σ (4).
• And so on, until all values σ (1) , σ (2) , . . . , σ (n) have been chosen.
The dependent product rule shows that the total # of possibilities for how these
choices can be made is
(n/2)! · 2| · 2 ·{z· · · · 2} = (n/2)! · 2n/2 .
n/2 times

Hence,
(# of permutations σ of [n] satisfying M (σ) = P)
= (n/2)! · 2n/2 . (319)
Now, forget that we fixed P. We thus have proved (319) for each perfect matching
P of [n]. Note that the right hand side of (319) does not depend on P; it is the same
for all P. This is what will now allow us to compute the # of perfect matchings of
[ n ].
For each permutation σ of [n], we know that M (σ) is a perfect matching of [n].
Hence, by the sum rule217 , we have
(# of permutations σ of [n])
= ∑ (# of permutations σ of [n] satisfying M (σ) = P)
P is a perfect
| {z }
matching of [n] =(n/2)!·2n/2
(by (319))

= ∑ (n/2)! · 2n/2
P is a perfect
matching of [n]

= (# of perfect matchings of [n]) · (n/2)! · 2n/2 .


Therefore,
1
(# of perfect matchings of [n]) = · (# of permutations σ of [n])
(n/2)! · 2n/2 | {z }
=n!
(by Theorem 7.4.1)
1 n!
= n/2
· n! = n/2 .
(n/2)! · 2 2 · (n/2)!
This recovers (318) and solves Exercise 7.6.3 again.
Here is the “sum rule” we used in this solution:

217 more
precisely, by the slightly more flexible version of the sum rule we will state below (as
Theorem 7.6.7)

December 25, 2021


Math 235 notes page 340

Theorem 7.6.7 (Sum rule in map form). Let S and W be two finite sets. Let
f : S → W be a map. Then,

|S| = ∑ (# of s ∈ S satisfying f (s) = w) .


w ∈W

Theorem 7.6.7 is a more flexible restatement of Theorem 7.1.2 (which is why


we also call it the “sum rule”). Indeed, both theorems are formalizing the same
underlying principle: namely, that if a set is split into several disjoint subsets, then
the size of the set is the sum of the sizes of these subsets. They differ only in how
the subsets are encoded (namely, in Theorem 7.1.2, the subsets are S1 , S2 , . . . , Sk ; in
Theorem 7.6.7, the subsets are {s ∈ S | f (s) = w} for various w ∈ W).
The trick we used in our second solution to Exercise 7.6.3 deserves some more
comment. We found a map

M : {permutations of [n]} → {perfect matchings of [n]}

that is not (in general) a bijection, but nevertheless has the property that it takes
all possible values the same number of times. (That is, the # of permutations σ
of [n] satisfying M (σ) = P is the same for all perfect matchings P.) This allowed
us to relate the # of perfect matchings of [n] with the # of permutations of [n].
This strategy is known as the shepherd’s principle: “If you want to count a flock of
sheep, count the legs and divide by 4”. In our case, the sheep were the perfect
matchings of [n], and the legs were the permutations of [n]. (So each sheep had
2n/2 · (n/2)! legs, and the map M sent each leg to its sheep.) Uses of this principle
abound in combinatorics; in particular, Theorem 4.3.12 can be proved using it (see
[LeLeMe16, §15.5.1] or [19fco, §2.7] for this proof). The shepherd’s principle is also
known as the division rule or rule of division, although (as we have seen) it is a simple
consequence of the sum rule and there is usually nothing gained by stating it as a
separate theorem.
A different variant of our second solution to Exercise 7.6.3 appears in [18f-hw3s,
solution to Exercise 3 (c)]. We also note that the case of Exercise 7.6.3 for n even
appears in [Engel98, Chapter 5, Example E8] (our n is denoted by 2n there).

7.7. Homework set #7


This is a regular problem set. See Section 3.7 for details on grading.
This homework set covers the above parts of Chapter 7. Some of the problems
may be unrelated. Keep in mind that identities between binomial coefficients can
be proved in many ways (not just combinatorially)!
Please solve at most 5 problems. (No points will be given for further solutions.)
Recall Definition 7.4.5 for the following exercise:

December 25, 2021


Math 235 notes page 341

Exercise 7.7.1. Let U and V be two finite sets. Let f : U → V and g : V → U be


two maps. Prove that |Fix ( f ◦ g)| = |Fix ( g ◦ f )|.

Our next exercise is an analogue of Exercise 3.8.3:

Exercise 7.7.2. Let n be a positive integer. Prove that the number of even positive
divisors of n is even if and only if n/2 is not a perfect square.

The next exercise relies on Convention 7.2.1:

Exercise 7.7.3. Let n and r be positive integers. Prove that


 
n+1
∑ min S = r + 1 .
S⊆[n];
|S|=r

(Recall that the summation sign “ ∑ ” means “sum over all subsets S of [n]
S⊆[n];
|S|=r
satisfying |S| = r”, that is, “sum over all r-element subsets S of [n]”.)

Exercise 7.7.4. Let n be a positive integer. Find the # of compositions of n that


don’t contain 1 as an entry.
(For example, if n = 7, then the compositions of n that don’t contain 1 as an
entry are (7), (5, 2), (4, 3), (3, 4), (2, 5), (3, 2, 2), (2, 3, 2) and (2, 2, 3).)

Exercise 7.7.5. Let n be a positive integer. Let k ∈ N.


(a) A composition of n into k parts means a composition of n that has exactly k
entries (i.e., is a k-tuple). Find the # of compositions of n into k parts.
(b) A weak composition of n into k parts means a k-tuple of nonnegative integers
whose sum is n. (So it is like a composition of n into k parts, but its entries are
allowed to be 0.) Find the # of weak compositions of n into k parts.

Exercise 7.7.6. Let n ∈ N. Prove that


n −1 
n − 1 ( k + 1) !

∑ k n k
= n.
k =0

Exercise 7.7.7. Let n ∈ N. Prove that


n 
2n − 1
  
2n
∑ k n−k = n n .
k =0

December 25, 2021


Math 235 notes page 342

Exercise 7.7.8. Let ( f 0 , f 1 , f 2 , . . .) and ( g0 , g1 , g2 , . . .) be two sequences of numbers.


Assume that
n  
i n
gn = ∑ (−1) fi for every n ∈ N.
i =0
i
Prove that
n  
n
f n = ∑ (−1) gi
for every n ∈ N.
i =0
i i

Exercise 7.7.9. Let n ∈ N.


(a) Prove that n 
−1/2 −1
   
2n
= .
n 4 n
(b) Prove that
n
2 (n − k)
  
2k
∑ k n − k
= 4n .
k =0

Exercise 7.7.10. Prove that there is a unique sequence (u0 , u1 , u2 , . . .) of positive


integers such that
n  
n+r
un = ∑
2
u n −r for all n ∈ N.
r =0 r

7.8. Alternating sums and Inclusion/Exclusion


7.8.1. The Principle of Inclusion and Exclusion
Consider the following:

• If U is a finite set, and if A is a subset of U, then

|U \ A | = |U | − | A | . (320)

In fact, this is just Theorem 7.1.8 (applied to U and A instead of A and B).

• If U is a finite set, and if A and B are two subsets of U, then

|U \ ( A ∪ B)| = |U | − | A| − | B| + | A ∩ B| . (321)

Indeed, this is not hard to see by applying (320) three times218 . Alternatively,
there is a simple intuitive way to convince yourself of (321): If A and B are two
218 Here are the details: Let U be a finite set, and let A and B be two subsets of U. Then, it
is known from set theory (or easy to verify by drawing Venn diagrams) that U \ ( A ∪ B) =

December 25, 2021


Math 235 notes page 343

subsets of a finite set U, then you can try to count the elements of U \ ( A ∪ B)
by starting with |U | and subtracting | A| and | B|. However, this will leave the
elements of A ∩ B subtracted twice instead of once; this flaw can be corrected
by adding | A ∩ B| back in. This leads to the equality (321).

• If U is a finite set, and if A, B and C are three subsets of U, then

|U \ ( A ∪ B ∪ C )| = |U | − | A| − | B| − |C | + | A ∩ B| + | A ∩ C | + | B ∩ C |
− | A ∩ B ∩ C| . (322)

This, too, can be proved by applying (320) several times (or, more easily, by
applying (320) once and (321) twice, using U \ ( A ∪ B ∪ C ) = (U \ ( A ∪ B)) \
(C \ (( A ∩ C ) ∪ ( B ∩ C )))). We leave the proof to the interested reader. Again,

(U \ A) \ ( B \ ( A ∩ B)). Hence,

|U \ ( A ∪ B)| = |(U \ A) \ ( B \ ( A ∩ B))| = |U \ A| − | B \ ( A ∩ B)|


| {z } | {z }
=|U |−| A| =| B|−| A∩ B|
(by (320)) (by (320)
(applied to B and A∩ B
instead of U and A),
since A∩ B is a subset of B)
!
by (320) (applied to U \ A and B \ ( A ∩ B)
instead of U and A), since B \ ( A ∩ B) is a subset of U \ A
= (|U | − | A|) − (| B| − | A ∩ B|) = |U | − | A| − | B| + | A ∩ B| .

Thus, (321) is proved.

December 25, 2021


Math 235 notes page 344

there also is a way to convince yourself of (322) by a counting argument219 :


If A, B and C are three subsets of a finite set U, then you can count the
elements of U \ ( A ∪ B ∪ C ) by starting with |U |, then subtracting | A|, | B| and
|C |, then correcting for the doubly subtracted common elements by adding
| A ∩ B|, | A ∩ C | and | B ∩ C |, and finally correcting for the elements of A ∩ B ∩
C (which have been added once, subtracted thrice and added back in thrice,
but should not be counted) by subtracting | A ∩ B ∩ C |.

The three identities (320), (321) and (322) appear to be parts of a pattern: The left
hand sides have the form |U \ ( A1 ∪ A2 ∪ · · · ∪ An )| for some subsets A1 , A2 , . . . , An
of a finite set U, and the right hand sides are signed sums of the sizes of intersec-
tions of some of these subsets (including |U |, which we consider to be the “trivial
intersection”). This pattern indeed persists; let us state it in its general form:

Theorem 7.8.1 (Principle of Inclusion and Exclusion (complement form)). Let

219 Best done with a Venn diagram at hand (courtesy of Alain Matthes on tex.stackexchange):

A∩B B∩C

A∩B∩C

A C
A∩C

December 25, 2021


Math 235 notes page 345

n ∈ N. Let U be a finite set. Let A1 , A2 , . . . , An be n subsets of U. Then,

|U \ ( A1 ∪ A2 ∪ · · · ∪ An )|
= |U |
− | A1 | − | A2 | − · · · − | A n |
| {z }
all sizes | Ai |
+ | A 1 ∩ A 2 | + | A 1 ∩ A 3 | + · · · + | A n −1 ∩ A n |
| {z }
all sizes | Ai ∩ A j | with i < j

− | A 1 ∩ A 2 ∩ A 3 | − | A 1 ∩ A 2 ∩ A 4 | − · · · − | A n −2 ∩ A n −1 ∩ A n |
| {z }
all sizes | Ai ∩ A j ∩ Ak | with i < j<k

±···
+ (−1)n | A1 ∩ A2 ∩ · · · ∩ An |
n
= ∑ (−1)m ∑ A i1 ∩ A i2 ∩ · · · ∩ A i m .
m =0 (i1 ,i2 ,...,im )∈[n]m ;
i1 <i2 <···<im

Here, the “empty” intersection Ai1 ∩ Ai2 ∩ · · · ∩ Aim for m = 0 is understood to


mean the set U.

The right hand side of the equality in Theorem 7.8.1 is rather unwieldy, and the
“middle hand side” (which is just a rewritten version of the right hand side without
using the ∑ sign) is even worse. Thus, let us introduce a notation that will allow
us to restate Theorem 7.8.1 in a simpler way:

Definition 7.8.2. Let I be a nonempty set. For each i ∈ I, let Ai be a set. Then,
T
Ai denotes the set
i∈ I
{ x | x ∈ Ai for each i ∈ I } .
Ai is called the intersection of all Ai with i ∈ I.
T
This set
i∈ I

It is easy to see that if I = {i1 , i2 , . . . , im } is a finite set, and if Ai is a set for each
i ∈ I, then \
A i = A i1 ∩ A i2 ∩ · · · ∩ A i m . (323)
i∈ I
T
The notation Ai (for the intersection of a family of sets) is similar to the no-
i∈ I
tation ∑ ai (for the sum of a finite family of numbers). However, in the notation
i∈ I
Ai , the set I must be nonempty (unlike in ∑ ai ) but can be infinite (unlike in
T
i∈ I i∈ I
∑ ai , which is usually undefined when I is infinite).
i∈ I
Now, we can restate Theorem 7.8.1 as follows:

December 25, 2021


Math 235 notes page 346

Theorem 7.8.3 (Principle of Inclusion and Exclusion (complement form)). Let


n ∈ N. Let U be a finite set. Let A1 , A2 , . . . , An be n subsets of U. Then,

∑ (−1)| I |
\
|U \ ( A1 ∪ A2 ∪ · · · ∪ An )| = Ai . (324)
I ⊆[n] i∈ I
T
Here, the “empty” intersection Ai is understood to mean the set U.
i ∈∅

T
Remark 7.8.4. We have defined the “empty” intersection Ai in Theorem 7.8.3;
i ∈∅
why didn’t we already do this back in Definition 7.8.2?
The reason is that we have had U available in Theorem 7.8.3, and, in a sense,
were treating A1 , A2 , . . . , An as subsets of U rather than just as arbitrary sets.
Had we tried to extend Definition 7.8.2 to the case when I = ∅, we would have
obtained \
Ai = { x | x ∈ Ai for each i ∈ ∅} = {all x }
i ∈∅

(since the condition “x ∈ Ai for each i ∈ ∅” is vacuously true, whatever x is),


which is not a well-defined set (it would be a so-called “universal set”, which
does not exist in set theory as it would lead to Russell’s paradox). (And even if it
was a well-defined set, its size would certainly be infinite.) However, in Theorem
T
7.8.3, we defined Ai to mean U, which is a reasonable interpretation of the
i ∈∅
(otherwise ill-defined) set “{all x }” if we consider x to be implicitly required to
be an element of U.
T
(Note that defining Ai to mean U is slightly slippery, since it entails that
T i ∈∅
Ai depends not just on the n sets A1 , A2 , . . . , An but also on U, even though
i ∈∅
U is not part of the notation. In practice, this causes no real confusion unless one
works with two different U’s at the same time – which one rarely does.)

Combining Theorem 7.8.3 with the difference rule, we also obtain the following:

Theorem 7.8.5 (Principle of Inclusion and Exclusion (union form)). Let n ∈ N.


Let A1 , A2 , . . . , An be n finite sets. Then,

∑ (−1)| I |−1
\
| A1 ∪ A2 ∪ · · · ∪ A n | = Ai . (325)
I ⊆[n]; i∈ I
I 6 =∅

Theorem 7.8.3 and Theorem 7.8.5 are known as the principle(s) of inclusion and
exclusion or as the Sylvester sieve formulas. (The word “sieve” refers to the metaphor-
ical view that the sums on the right hand sides of (324) and (325) are “sieving” the

December 25, 2021


Math 235 notes page 347

elements of U, leaving only those in U \ ( A1 ∪ A2 ∪ · · · ∪ An ) (resp. A1 ∪ A2 ∪ · · · ∪


An ) behind.)
We won’t prove Theorem 7.8.1, Theorem 7.8.3 and Theorem 7.8.5 right now; the
impatient reader can find their proofs all over the literature:

• Theorem 7.8.3 is [19fco, Theorem 2.9.7] (where it is proved using manipula-


tion of finite sums and Iverson brackets). It also appears in [Smid09] (with
a proof by induction), in [Galvin17, Theorem 16.1] (with two proofs) and in
[Grinbe15, Theorem 3.42] (in a slightly more general form).

• Theorem 7.8.5 is [19fco, Theorem 2.9.6] (where it is derived from Theorem


7.8.3 by setting U = A1 ∪ A2 ∪ · · · ∪ An and using the difference rule). It also
appears in [White10b], in [Galvin17, (12)] and in [Grinbe15, Theorem 3.43].

• Theorem 7.8.1 is a restatement of Theorem 7.8.5. Indeed, the awkward double


sum
n
∑ (−1)m ∑ A i1 ∩ A i2 ∩ · · · ∩ A i m
m =0 (i1 ,i2 ,...,im )∈[n]m ;
i1 <i2 <···<im

(when expanded) has the same addends as the sum ∑ (−1)| I |


T
Ai ; only
I ⊆[n] i∈ I
the indexing of these addends is different. (See [19fco, proof of Proposition
2.9.4] for the details of this argument, although our sums have a |U | addend
whereas the sums in [19fco, proof of Proposition 2.9.4] do not.)

Several generalizations of the Principles of Inclusion and Exclusion can be found


in [Grinbe15, Theorems 3.44, 3.45 and 3.46], in [Aigner07, §5.1 and §5.2] and in
[Comtet74, Chapter IV].
In practice, the following restatement of Theorem 7.8.3 tends to be most conve-
nient to apply:

Theorem 7.8.6 (Principle of Inclusion and Exclusion (complement form)). Let


n ∈ N. Let U be a finite set. Let A1 , A2 , . . . , An be n subsets of U. Then,

(# of x ∈ U satisfying x ∈
/ Ai for all i ∈ [n])
= ∑ (−1)| I | (# of x ∈ U satisfying x ∈ Ai for all i ∈ I ) . (326)
I ⊆[n]

Theorem 7.8.6 is equivalent to Theorem 7.8.3 because each side of the equality
(326) equals to the corresponding side of (324). (We shall explain this in more detail
in Subsection 7.8.3 below.)

December 25, 2021


Math 235 notes page 348

7.8.2. An example: counting surjections


The principle of inclusion and exclusion can be used to count many kinds of objects.
See [19fco, §2.9], [Aigner07, §5.1], [AndFen04, Chapter 6], [Tomesc85, Chapter 2],
[Galvin17, §16–§17] or [Guicha20, §2.2] for various examples. We shall show just
one application here (which may be one of the most famous): We shall count the
surjective maps between two given finite sets. Note that we have already counted
all maps (Theorem 7.3.6), all injective maps (Theorem 7.3.8) and all bijective maps
(Theorem 7.4.3 when the two sets have equal sizes; otherwise there are none).
Counting the surjective maps is the hardest of these questions; here is the answer:

Theorem 7.8.7. Let m, n ∈ N. Let A be an m-element set. Let B be an n-element


set. Then,
n  
n −i n m
(# of all surjective maps from A to B) = ∑ (−1) i .
i =0
i

Proof of Theorem 7.8.7 (sketched). (See [19fco, §2.4.5, proof of Proposition 2.4.11, and
§2.9.4, proof of Theorem 2.4.17] for more details.220 ) We WLOG assume that B = [n]
(since otherwise, we can just relabel the n elements of B as 1, 2, . . . , n, without
changing the # of all surjective maps from A to B).
We say that a map f : A → B misses an element i ∈ B if f does not take i as
a value (i.e., if there exists no a ∈ A such that i = f ( a)). (The terminology is
motivated by the standard illustrations in which maps are drawn as collections of
arrows.)
We let U = B A = {all maps from A to B}. For each i ∈ [n], we define a subset
Ai of U by

Ai = {all maps f : A → B that miss i }


= {all maps f : A → B that do not take i as a value} .

Thus, we have defined n subsets A1 , A2 , . . . , An of U. Hence, Theorem 7.8.6 yields


that (326) holds.

220 See also [Gunder10, Exercise 595] or [19fco, solution to Exercise 2.4.4] for alternative proofs.

December 25, 2021


Math 235 notes page 349

However, the left hand side of (326) is


(# of x ∈ U satisfying x ∈/ Ai for all i ∈ [n])
= (# of f ∈ U satisfying f ∈ / Ai for all i ∈ [n])
= (# of all maps f : A → B satisfying f ∈ / Ai for all i ∈ [n])
(since U = {all maps from A to B})
= (# of all maps f : A → B such that f takes i as a value for all i ∈ [n])
 
since the statement “ f ∈/ Ai ” is equivalent
to “ f takes i as a value” (by the definition of Ai )
= (# of all maps f : A → B that take each i ∈ [n] as a value)
= (# of all maps f : A → B that take each i ∈ B as a value)
(since [n] = B)
= (# of all surjective maps from A to B) . (327)
Meanwhile, we can also rewrite the numbers on the right hand side of (326): Let I
be any subset of [n]. Then,
(# of x ∈ U satisfying x ∈ Ai for all i ∈ I )
= (# of f ∈ U satisfying f ∈ Ai for all i ∈ I )
= (# of all maps f : A → B satisfying f ∈ Ai for all i ∈ I )
(since U = {all maps from A to B})
= (# of all maps f : A → B such that f misses i for all i ∈ I )
 
since the statement “ f ∈ Ai ” is equivalent
to “ f misses i” (by the definition of Ai )
= (# of all maps f : A → B such that f misses all elements of I )
= (# of all maps f : A → B such that no value of f belongs to I )
= (# of all maps f : A → B such that all values of f belong to B \ I )
= (# of all maps from A to B \ I ) .
Here, the last equality sign is due to the fact that the maps f : A → B such that all
values of f belong to B \ I are “essentially the same as” the maps from A to B \ I
(or, to be more precise, there is a bijection from the set of the former maps to the
set of the latter maps; but all this bijection does is change the target of the map,
without changing any of its values). Hence,
(# of x ∈ U satisfying x ∈ Ai for all i ∈ I )
= (# of all maps from A to B \ I ) = ( B \ I ) A = | B \ I || A|
(by Theorem 7.3.6, applied to B \ I instead of B)
= (| B| − | I |)| A| (since | B \ I | = | B| − | I | (because I ⊆ [n] = B))
= (n − | I |)m (328)

December 25, 2021


Math 235 notes page 350

(since | B| = n and | A| = m).


Forget that we fixed I. We thus have proved (328) for each subset I of [n]. Now,
(327) entails

(# of all surjective maps from A to B)


= (# of x ∈ U satisfying x ∈ / Ai for all i ∈ [n])
= ∑ (−1)| I | (# of x ∈ U satisfying x ∈ Ai for all i ∈ I ) (by (326))
I ⊆[n]
| {z }
=(n−| I |)m
(by (328))
n
= ∑ |I|
(−1) (n − | I |) = m
∑ ∑ (−1)| I | (n − | I |)m
I ⊆[n] k =0 I ⊆[n];
| {z }
| I |=k =(−1)k (n−k)m
(since | I |=k)
 
here, we have split the sum according to the value of | I | ,
since | I | ∈ {0, 1, . . . , n} for each subset I of [n]
n
= ∑ ∑ (−1)k (n − k)m
k =0 I ⊆[n];
| I |=k
| {z }
=(# of subsets I of [n] satisfying | I |=k)·(−1)k (n−k)m
n
= ∑ |(# of subsets I of [n] satisfying | I | = k) · (−1)k (n − k)m
k =0
{z }
=(# of k-element
 subsets of [ n ])
n
=
k
(by Theorem 4.3.12)
n   n  
n n
= ∑ · (−1)k (n − k)m = ∑ (−1)k (n − k )m
k =0
k k =0
k
 } 
| {z
n
=
n−k
(by Theorem 4.3.10)
n    n
n n −i n m
= ∑ (−1) k
n−k
(n − k) = ∑ (−1)
m
i
i
k =0 i =0

(here, we have substituted n − i for k in the sum). This proves Theorem 7.8.7.
As a welcome byproduct of Theorem 7.8.7, we obtain two binomial identities:

Corollary 7.8.8. (a) If n, m ∈ N satisfy m < n, then


n  
n −i n m
∑ (−1) i
i = 0.
i =0

December 25, 2021


Math 235 notes page 351

(b) For any n ∈ N, we have


n  
n n
∑ (−1) n −i
i
i = n!.
i =0

Proof of Corollary 7.8.8. (a) We could easily obtain Corollary 7.8.8 (a) by applying
Exercise 5.4.2 (d) to the polynomial P ( x ) = x m ; however, let us instead derive it
from Theorem 7.8.7.
Indeed, let n, m ∈ N satisfy m < n. Then, |[m]| = m and |[n]| = n. Thus,
|[m]| = m < n = |[n]|; therefore, Theorem 6.1.7 (applied to U = [m] and V = [n])
shows that a map f : [m] → [n] cannot be surjective. In other words, there exists
no surjective map f : [m] → [n]. In other words,

(# of all surjective maps from [m] to [n]) = 0.


However, Theorem 7.8.7 (applied to A = [m] and B = [n]) yields
n  
n m
(# of all surjective maps from [m] to [n]) = ∑ (−1) n −i
i
i
i =0

(since [m] is an m-element set, whereas  [n] is an n-element set). Comparing these
n n
two equalities, we obtain ∑ (−1)n−i im = 0. This proves Corollary 7.8.8 (a).
i =0 i
(b) Let n ∈ N. Corollary 6.2.9 (b) (applied to X = [n]) shows that any surjective
map f : [n] → [n] is a permutation of [n]. In other words, any surjective map
from [n] to [n] is a permutation of [n]. Conversely, any permutation of [n] is a
surjective map from [n] to [n] (because any permutation is bijective and thus sur-
jective). Combining the results of the previous two sentences, we conclude that the
permutations of [n] are precisely the surjective maps from [n] to [n]. Hence,

(# of all permutations of [n])


n  
n n
= (# of all surjective maps from [n] to [n]) = ∑ (−1) n −i
i
i
i =0

(by Theorem 7.8.7, applied to m = n, A = [n] and B = [n]). Comparing this with

(# of all permutations of [n]) = n! (by Theorem 7.4.1, applied to X = [n]) ,


 
n
n −i n n
we obtain ∑ (−1) i = n!. This proves Corollary 7.8.8 (b).
i =0 i

7.8.3. A weighted version and a proof


The principle of inclusion and exclusion in all its forms we have seen above is far
from being the pinnacle of generality. One of its most useful generalizations is

December 25, 2021


Math 235 notes page 352

obtained by assigning weights (i.e., arbitrary numbers) to the elements of U. Then,


the size | T | of a subset T of U can be replaced by its “total weight” ∑ w ( x )
x∈T
(where w ( x ) is the weight assigned to an x ∈ U). This suggests the following
generalization of Theorem 7.8.6:

Theorem 7.8.9 (Weighted Principle of Inclusion and Exclusion (complement


form)). Let n ∈ N. Let U be a finite set. For each x ∈ U, let w ( x ) be a number.
Let A1 , A2 , . . . , An be n subsets of U. Then,

∑ w (x) = ∑ (−1)| I | ∑ w (x) .


x ∈U; I ⊆[n] x ∈U;
x∈
/ Ai for all i ∈[n] x ∈ Ai for all i ∈ I

We shall prove Theorem 7.8.9 and then derive Theorem 7.8.6 and Theorem 7.8.3
from it. The proof will rely on an innocent little proposition which I occasionally
call the cancellation lemma, as it is about a sum of +1s and −1s that cancel each
other out221 :

Proposition 7.8.10. Let S be a finite set. Then,

∑ (−1)| I | = [S = ∅] .
I ⊆S

Once again, we are using the Iverson bracket notation here (see Definition 4.3.19).

Example 7.8.11. The subsets of {1, 2} are ∅, {1}, {2} and {1, 2}. Thus, applying
Proposition 7.8.10 to S = {1, 2}, we find

(−1)|∅| + (−1)|{1}| + (−1)|{2}| + (−1)|{1,2}| = [{1, 2} = ∅] .


| {z } | {z } | {z } | {z }
=1 =−1 =−1 =1

Indeed, both sides of this equality are 0 (the left hand side because the addends
cancel; the right hand side because {1, 2} 6= ∅).
221 Aside:This is far from the only “cancellation lemma” in mathematics! There are various others,
n −1 2kgπ
such as ∑ cos = n · [n | g] for any positive integer n and any g ∈ Z. Here, it is no longer
k =0 n
+1s and −1s cancelling each other, but rather different phases of the cosine wave. With complex
numbers available, this can be improved even further to
n −1
∑ e2kgπi/n = n · [n | g] ,
k =0

which is the driving force behind the discrete Fourier transform.


There are philosophical similarities between the cancellation lemma (and its combinatorial
uses to “extract” certain kinds of addends from sums) and the Fourier inversion formula (and
its Fourier-analytic uses to extract certain frequencies from waves).

December 25, 2021


Math 235 notes page 353

Proof of Proposition 7.8.10 (sketched). Proposition 7.8.10 appears in [19fco, Proposi-


tion 2.9.10] with two detailed proofs; we shall only outline one here.
First of all, we observe that [|S| = 0] = [S = ∅]. Indeed, if S = ∅, then both truth
values [S = ∅] and [|S| = 0] equal 1; otherwise, they both equal 0.
Let n = |S|. Hence, S is an n-element set. Thus, if I is any subset of S, then
| I | ∈ {0, 1, . . . , n}. Hence, we can split the sum ∑ (−1)| I | according to the value
I ⊆S
of | I | as follows:

∑ (−1)| I |
I ⊆S

= ∑ ∑ (−1)| I | = ∑ ∑ (−1)k
k∈{0,1,...,n} I ⊆S; k∈{0,1,...,n} I ⊆S;
| {z }
| I |=k =(−1)k | I |=k
(since | I |=k) | {z }
=(# of subsets I of S satisfying | I |=k)·(−1)k

= ∑ (# of subsets I of S satisfying | I | = k) · (−1)k


k∈{0,1,...,n}
| {z }
| {z } =(# of k-element
  subsets of S )
n n
=∑ =
k =0 k
(by Theorem 4.3.12)
n
  n  
n k n
= ∑ (−1) = ∑ (−1)
k
= [ n = 0] (by Proposition 4.3.18)
k =0
k k =0
k
= [|S| = 0] (since n = |S|)
= [ S = ∅] .

This proves Proposition 7.8.10.


It is now easy to prove Theorems 7.8.9, 7.8.6 and 7.8.3:
Proof of Theorem 7.8.9. We have

∑ (−1)| I | ∑ w (x) = ∑ ∑ (−1)| I | w ( x )


I ⊆[n] x ∈U; I ⊆[n] x ∈U;
x ∈ Ai for all i ∈ I x ∈ Ai for all i ∈ I

= ∑ ∑ (−1)| I | w ( x ) . (329)
x ∈U I ⊆[n];
x ∈ Ai for all i ∈ I

(Here, for the last equality sign, we have interchanged the two summation signs; as
usual, the “x ∈ Ai for all i ∈ I” condition moved under the inner summation sign.
This relied on Theorem 4.1.25.)
Now, fix x ∈ U. We shall compute the sum ∑ (−1)| I | .
I ⊆[n];
x ∈ Ai for all i ∈ I

December 25, 2021


Math 235 notes page 354

Indeed, define a subset S of [n] by

S = {i ∈ [ n ] | x ∈ Ai } .

Then, for any subset I of [n], we have the logical equivalence

( x ∈ Ai for all i ∈ I ) ⇐⇒ ( I ⊆ S)

(that is, the statement “x ∈ Ai for all i ∈ I” holds if and only if the statement
“I ⊆ S” holds)222 . Hence, the condition “x ∈ Ai for all i ∈ I” under the summation
sign ∑ can be replaced by “I ⊆ S”. We thus obtain
I ⊆[n];
x ∈ Ai for all i ∈ I

∑ (−1)| I | = ∑ (−1)| I | = ∑ (−1)| I |


I ⊆[n]; I ⊆[n]; I ⊆S
x ∈ Ai for all i ∈ I I ⊆S
 
since the subsets I of [n] satisfying I ⊆ S
are just the subsets of S (because S ⊆ [n] )
= [ S = ∅] (by Proposition 7.8.10)
= [{i ∈ [n] | x ∈ Ai } = ∅] (331)

(since S = {i ∈ [n] | x ∈ Ai }).


On the other hand, we have the following chain of logical equivalences:

({i ∈ [n] | x ∈ Ai } = ∅)
⇐⇒ (there exists no i ∈ [n] such that x ∈ Ai )
⇐⇒ ( x ∈
/ Ai for all i ∈ [n]) . (332)

However, equivalent logical statements have equal truth values: i.e., if A and B are
two equivalent logical statements, then [A] = [B]. Therefore, from the equivalence
(332), we obtain the equality

[{i ∈ [n] | x ∈ Ai } = ∅] = [ x ∈
/ Ai for all i ∈ [n]] .

222 Proof. Let I be a subset of [n]. For any i ∈ [n], we have the logical equivalence

(i ∈ S) ⇐⇒ ( x ∈ Ai ) (330)

(because S = {i ∈ [n] | x ∈ Ai }). Now, we have the following chain of equivalences:


 
 
( I ⊆ S) ⇐⇒  i| ∈
{z S} for all i ∈ I  ⇐⇒ ( x ∈ Ai for all i ∈ I ) .
 
 
⇐⇒( x ∈ Ai )
(by (330))

Thus, we have the equivalence ( x ∈ Ai for all i ∈ I ) ⇐⇒ ( I ⊆ S), qed.

December 25, 2021


Math 235 notes page 355

Thus, (331) rewrites as

∑ (−1)| I | = [ x ∈
/ Ai for all i ∈ [n]] . (333)
I ⊆[n];
x ∈ Ai for all i ∈ I

Now, forget that we fixed x. We thus have proved (333) for each x ∈ U.
Now, (329) becomes

∑ (−1)| I | ∑ w (x)
I ⊆[n] x ∈U;
x ∈ Ai for all i ∈ I

= ∑ ∑ (−1)| I | w ( x )
x ∈U I ⊆[n];
x ∈ Ai for all i ∈ I
 

∑ ∑ (−1)| I | 
 
= 
  w (x)
x ∈U I ⊆[n];
x ∈ Ai for all i ∈ I
| {z }
=[ x ∈
/ Ai for all i ∈[n]]
(by (333))

= ∑ [x ∈
/ Ai for all i ∈ [n]] w ( x )
x ∈U
= ∑ [x ∈
/ Ai for all i ∈ [n]] w (x)
x ∈U;
| {z }
x∈
/ Ai for all i ∈[n] =1
(since we have ( x ∈
/ Ai for all i ∈[n]))

+ ∑ [x ∈
/ Ai for all i ∈ [n]] w (x)
x ∈U;
| {z }
not ( x ∈
/ Ai for all i ∈[n]) =0
(since we don’t have ( x ∈
/ Ai for all i ∈[n]))
 
since each x ∈ U either satisfies ( x ∈
/ Ai for all i ∈ [n])
or does not
= ∑ 1w ( x ) + ∑ 0w ( x ) = ∑ w (x) .
x ∈U; x ∈U; x ∈U;
| {z }
/ Ai for all i ∈[n] =w( x )
x∈ not ( x ∈
/ Ai for all i ∈[n]) x∈
/ Ai for all i ∈[n]
| {z }
=0

This proves Theorem 7.8.9.


Proof of Theorem 7.8.6. For each x ∈ U, set w ( x ) = 1. Then, Theorem 7.8.9 yields

∑ w (x) = ∑ (−1)| I | ∑ w (x) . (334)


x ∈U; I ⊆[n] x ∈U;
x∈
/ Ai for all i ∈[n] x ∈ Ai for all i ∈ I

December 25, 2021


Math 235 notes page 356

However,

∑ w (x)
x ∈U;
| {z }
x∈
/ Ai for all i ∈[n] =1
(by the definition of w( x ))

= ∑ 1 = (# of x ∈ U satisfying x ∈
/ Ai for all i ∈ [n]) · 1
x ∈U;
x∈
/ Ai for all i ∈[n]
= (# of x ∈ U satisfying x ∈
/ Ai for all i ∈ [n]) . (335)

Moreover, each subset I of [n] satisfies

∑ w (x)
x ∈U;
| {z }
x ∈ Ai for all i ∈ I =1
(by the definition of w( x ))

= ∑ 1 = (# of x ∈ U satisfying x ∈ Ai for all i ∈ I ) · 1


x ∈U;
x ∈ Ai for all i ∈ I
= (# of x ∈ U satisfying x ∈ Ai for all i ∈ I ) . (336)

In light of (335) and (336), we can rewrite the equality (334) as

(# of x ∈ U satisfying x ∈
/ Ai for all i ∈ [n])
= ∑ (−1)| I | (# of x ∈ U satisfying x ∈ Ai for all i ∈ I ) .
I ⊆[n]

This proves Theorem 7.8.6.


Proof of Theorem 7.8.3. The set U \ ( A1 ∪ A2 ∪ · · · ∪ An ) consists of all x ∈ U satis-
fying x ∈/ A1 ∪ A2 ∪ · · · ∪ An (by the definition of a set difference). In other words,
this set consists of all x ∈ U satisfying x ∈/ Ai for all i ∈ [n] (because the condition
“x ∈/ A1 ∪ A2 ∪ · · · ∪ An ” is equivalent to “x ∈
/ Ai for all i ∈ [n]”). Hence,

|U \ ( A1 ∪ A2 ∪ · · · ∪ An )|
= (# of x ∈ U satisfying x ∈ / Ai for all i ∈ [n])
= ∑ (−1)| I | (# of x ∈ U satisfying x ∈ Ai for all i ∈ I ) (337)
I ⊆[n]

(by Theorem 7.8.6).


Now, we claim the following:

Claim 1: Let I be a subset of [n]. Then,


\
Ai = { x ∈ U | x ∈ Ai for all i ∈ I } .
i∈ I

December 25, 2021


Math 235 notes page 357

[Proof of Claim 1: Let us warm up by studying the empty set. We have

{ x ∈ U | x ∈ Ai for all i ∈ ∅} = U, (338)

since the condition “x ∈ Ai for all i ∈ ∅” is vacuously true for all x ∈ U. On the
other hand, \
Ai = U,
i ∈∅
T
since we defined the “empty intersection” Ai to be U. Comparing this with
i ∈∅
(338), we obtain \
Ai = { x ∈ U | x ∈ Ai for all i ∈ ∅} .
i ∈∅

In other words, Claim 1 holds for I = ∅. Thus, for the rest of this proof, we WLOG
assume that I 6= ∅. This assumption is helpful, since we defined
T
Ai differently
T i ∈∅
than we defined Ai for nonempty I.
i∈ I
Now we know that I is nonempty (since I 6= ∅). Hence,
T
Ai is literally the
i∈ I
intersection of the sets Ai for i ∈ I. Since the latter sets Ai are subsets of U, we thus
T
conclude that their intersection Ai is also a subset of U (since any intersection of
i∈ I
subsets of U is a subset of U). Therefore,
!
\ \
Ai = U ∩ Ai
i∈ I i∈ I
= U ∩ { x | x ∈ Ai for each i ∈ I }
 T 
since the definition of Ai
 i∈ I 
Ai = { x | x ∈ Ai for each i ∈ I }
T
yields
 
i∈ I
= { x ∈ U | x ∈ Ai for each i ∈ I }
= { x ∈ U | x ∈ Ai for all i ∈ I } .

This proves Claim 1.]

December 25, 2021


Math 235 notes page 358

Now,

∑ (−1)| I |
\
Ai
I ⊆[n] i∈ I
| {z }
={ x ∈U | x ∈ Ai for all i ∈ I }
(by Claim 1)

= ∑ (−1)| I | |{ x ∈ U | x ∈ Ai for all i ∈ I }|


I ⊆[n]
| {z }
=(# of x ∈U satisfying x ∈ Ai for all i ∈ I )

= ∑ |I|
(−1) (# of x ∈ U satisfying x ∈ Ai for all i ∈ I ) .
I ⊆[n]

Comparing this with (337), we obtain

∑ (−1)| I |
\
|U \ ( A1 ∪ A2 ∪ · · · ∪ An )| = Ai .
I ⊆[n] i∈ I

This proves Theorem 7.8.3.


Finally, Theorem 7.8.5 follows easily from Theorem 7.8.3.223
As many other properties of sums, Theorem 7.8.9 has an analogue for integrals
over measurable sets. It says that a (Lebesgue) measurable function w defined on a
measurable subset U ∈ A of a measure space ( X, A, µ) satisfies
Z Z

U \( A1 ∪ A2 ∪···∪ An )
wdµ = ∑ (−1) |I|
T
Ai
wdµ
I ⊆[n] i∈ I

whenever A1 , A2 , . . . , An are n measurable subsets of U. As a particular case, if


E1 , E2 , . . . , En are n events in a probability space, then

Pr (neither E1 nor E2 nor E3 nor · · · nor En ) = ∑ (−1)| I | Pr ( Ei for all i ∈ I ) .


I ⊆[n]
223 Hereis the main idea: Let A1 , A2 , . . . , An be n finite sets. Then, define U = A1 ∪ A2 ∪ · · · ∪ An .
This set U is finite again, and the sets A1 , A2 , . . . , An are subsets of U. Thus, Theorem 7.8.3
shows that (324) holds. Subtract this equality (324) from the tautological equality |U | = |U |. The
result is

∑ (−1)| I |
\
|U | − |U \ ( A1 ∪ A2 ∪ · · · ∪ An )| = |U | − Ai .
I ⊆[n] i∈ I

But the left hand side of this equality is easily seen to be | A1 ∪ A2 ∪ · · · ∪ An |, whereas the right
| I |−1
∑ (−1) Ai (since the |U | term cancels the I = ∅ addend in the sum).
T
hand side is
I ⊆[n]; i∈ I
I 6 =∅
Thus, we obtain (325), and thus Theorem 7.8.5 is proved.

December 25, 2021


Math 235 notes page 359

7.8.4. Recitation #8: More subtractive counting


We have already seen (e.g., in our solution to Exercise 7.3.2 (c)) how the difference
rule can help in solving enumerative problems. In essence, the idea is that in order
to count some objects that satisfy a certain property, it can be better to first count
the objects that don’t satisfy it. The Principle of Inclusion and Exclusion can be
viewed as an extension of this to several properties. Let us now see some other
uses of negativity (differences and powers of −1) in enumerative combinatorics.
Recall our convention [d] = {1, 2, . . . , d} for each d ∈ N. (This was Convention
7.2.1.)

Exercise 7.8.1. Let n ∈ N. Let d be a positive integer.


An n-tuple ( x1 , x2 , . . . , xn ) ∈ [d]n will be called 1-even if the number 1 occurs
in it an even number of times (i.e., the number of i ∈ [n] satisfying xi = 1
is even). (For example, the 3-tuples (5, 1, 1) and (2, 2, 3) are 1-even, while the
3-tuple (4, 2, 1) is not.)
Compute the # of 1-even n-tuples in [d]n .
[Example: If d = 3 and n = 2, then the 1-even n-tuples in [d]n are (1, 1), (2, 2),
(2, 3) and (3, 2).]

This exercise is [18s-hw3s, Exercise 5], but we shall give two solutions different
from the one given in [18s-hw3s] (although the second one is related).
First solution of Exercise 7.8.1 (sketched). Forget that we fixed n. For each n ∈ N, we
let en denote the # of 1-even n-tuples in [d]n . We thus must compute en for each
n ∈ N.
We shall do this similarly to how we solved Exercise 7.3.2 (c): We will first es-
tablish a recursive equation for en in terms of en−1 , and then solve this equation to
obtain an explicit formula.
We first notice that e0 = 1. Indeed, there is only one 0-tuple in [d]0 (namely, the
empty list ()), and this 0-tuple is 1-even (since the number 1 occurs 0 times in it).
Now, let n be a positive integer. Then, the definition of en yields224

en = (# of 1-even n-tuples)
d
= ∑ (# of 1-even n-tuples ( x1 , x2 , . . . , xn ) satisfying xn = k)
k =1

(by the sum rule, since xn ∈ [d] for each n-tuple ( x1 , x2 , . . . , xn )).
We now want to compute the # of 1-even n-tuples ( x1 , x2 , . . . , xn ) ∈ [d]n satisfying
xn = k for a given k ∈ [d]. The answer will depend on whether k is 1 or not.

224 Inthe following argument, the word “n-tuple” will always mean “n-tuple in [d]n ”, and similarly
the word “(n − 1)-tuple” will always mean “(n − 1)-tuple in [d]n−1 ”. We will not need tuples of
elements of sets other than [d].

December 25, 2021


Math 235 notes page 360

First, we can find the answer if k is not 1: For each k ∈ [d] satisfying k 6= 1, we
have
(# of 1-even n-tuples ( x1 , x2 , . . . , xn ) satisfying xn = k)
= e n −1 . (339)
[Proof of (339): Let k ∈ [d] satisfy k 6= 1. If an n-tuple ( x1 , x2 , . . . , xn ) satisfies
xn = k, then the number 1 occurs as often in the (n − 1)-tuple ( x1 , x2 , . . . , xn−1 ) as it
does in the n-tuple ( x1 , x2 , . . . , xn ) (since we have xn = k 6= 1, and thus the removal
of the last entry xn from the n-tuple ( x1 , x2 , . . . , xn ) does not affect the occurrences
of 1 in this n-tuple). Thus, in particular, if an n-tuple ( x1 , x2 , . . . , xn ) satisfying
xn = k is 1-even, then the (n − 1)-tuple ( x1 , x2 , . . . , xn−1 ) is 1-even. Hence, we
obtain a map
{1-even n-tuples ( x1 , x2 , . . . , xn ) satisfying xn = k} → {1-even (n − 1) -tuples} ,
( x 1 , x 2 , . . . , x n ) 7 → ( x 1 , x 2 , . . . , x n −1 ) .
This map is easily seen to be a bijection225 . Thus, the bijection principle yields
|{1-even n-tuples ( x1 , x2 , . . . , xn ) satisfying xn = k}|
= |{1-even (n − 1) -tuples}| = (# of 1-even (n − 1) -tuples) = en−1
(since en−1 was defined as the # of 1-even (n − 1)-tuples). But this is clearly equiv-
alent to (339). This proves (339).]
Next, let us answer our question for k = 1: We have
(# of 1-even n-tuples ( x1 , x2 , . . . , xn ) satisfying xn = 1)
= d n −1 − e n −1 . (340)

[Proof of (340): The set of all (n − 1)-tuples is [d]n−1 . Thus, (# of (n − 1) -tuples) =


[d]n−1 = |[d]|n−1 = dn−1 (since |[d]| = d).
We need one more notion: An (n − 1)-tuple will be called 1-odd if the number
1 occurs in it an odd number of times. Thus, any (n − 1)-tuple is either 1-even or
1-odd (but not both at the same time). Thus, the sum rule yields
(# of (n − 1) -tuples) = (# of 1-even (n − 1) -tuples) + (# of 1-odd (n − 1) -tuples) ,
so that
(# of 1-odd (n − 1) -tuples) = (# of (n − 1) -tuples) − (# of 1-even (n − 1) -tuples)
| {z } | {z }
= d n −1 = e n −1
(by the definition of en−1 )

= d n −1 − e n −1 .
225 Indeed, the map
{1-even (n − 1) -tuples} → {1-even n-tuples ( x1 , x2 , . . . , xn ) satisfying xn = k} ,
( x 1 , x 2 , . . . , x n −1 ) 7 → ( x 1 , x 2 , . . . , x n −1 , k )
is easily seen to be well-defined and inverse to it.

December 25, 2021


Math 235 notes page 361

Now, what does this have to do with the 1-even n-tuples ( x1 , x2 , . . . , xn ) satisfying
xn = 1 ?
If an n-tuple ( x1 , x2 , . . . , xn ) satisfies xn = 1, then the number 1 occurs one less
time in the (n − 1)-tuple ( x1 , x2 , . . . , xn−1 ) than it does in the n-tuple ( x1 , x2 , . . . , xn )
(since we have xn = 1, and thus the removal of the last entry xn from the n-tuple
( x1 , x2 , . . . , xn ) removes exactly one occurrence of 1 from this n-tuple). Thus, in
particular, if an n-tuple ( x1 , x2 , . . . , xn ) satisfies xn = 1, and if the number 1 occurs
an even number of times in this n-tuple, then the number 1 will occur an odd
number of times in the (n − 1)-tuple ( x1 , x2 , . . . , xn−1 ). In other words, if an n-tuple
( x1 , x2 , . . . , xn ) satisfying xn = 1 is 1-even, then the (n − 1)-tuple ( x1 , x2 , . . . , xn−1 )
is 1-odd. Hence, we obtain a map
{1-even n-tuples ( x1 , x2 , . . . , xn ) satisfying xn = 1} → {1-odd (n − 1) -tuples} ,
( x 1 , x 2 , . . . , x n ) 7 → ( x 1 , x 2 , . . . , x n −1 ) .
This map is easily seen to be a bijection226 . Thus, the bijection principle yields
|{1-even n-tuples ( x1 , x2 , . . . , xn ) satisfying xn = 1}|
= |{1-odd (n − 1) -tuples}| = (# of 1-odd (n − 1) -tuples) = dn−1 − en−1 .
But this is clearly equivalent to (340). This proves (340).]
Now, recall that
d
en = ∑ (# of 1-even n-tuples ( x1 , x2 , . . . , xn ) satisfying xn = k)
k =1
= (# of 1-even n-tuples ( x1 , x2 , . . . , xn ) satisfying xn = 1)
| {z }
= d n −1 − e n −1
(by (340))
d
+ ∑ (|# of 1-even n-tuples ( x1 , x2 , . . . , xn ) satisfying xn = k)
k =2
{z }
= e n −1
(by (339) (since k≥2>1 and thus k6=1))
 
here, we have split off the addend for k = 1
from the sum
d
= d n −1 − e n −1 + ∑ e n −1 = d n −1 − e n −1 + ( d − 1 ) e n −1
k =2
| {z }
=(d−1)en−1

= d n −1 + ( d − 2 ) e n −1 .
226 Indeed, the map
{1-odd (n − 1) -tuples} → {1-even n-tuples ( x1 , x2 , . . . , xn ) satisfying xn = 1} ,
( x 1 , x 2 , . . . , x n −1 ) 7 → ( x 1 , x 2 , . . . , x n −1 , 1 )
is easily seen to be well-defined and inverse to it.

December 25, 2021


Math 235 notes page 362

Forget that we fixed n. We thus have shown that

e n = d n −1 + ( d − 2 ) e n −1 (341)

for every positive integer n. Set u = d − 2. Then, (341) rewrites as

en = dn−1 + uen−1 . (342)

We can attempt to solve this recurrence by substituting this equality back into itself:

e n = d n −1 + u e n −1 (by (342))
|{z}
=dn−2 +uen−2
(by (342))
 
 
n −1
 n −2 
=d +u
d +u e n −2 

 |{z} 
=dn−3 +uen−3
(by (342))
  

= d n −1 + u  d n −2 + u  d n −3 + u e n −3  
|{z}
=···
= ···
    

= d n −1 + u  d n −2 + u  d n −3 + u  · · · + u  d 0 + u e0    
|{z}
=1
    
= d n −1 + u d n −2 + u d n −3 + u · · · + u d 0 + u
= d| n−1 + udn−2 + u2 dn−3 {z
+ u3 dn−4 + · · · + un−1 d}0 +un
n −1
= ∑ u i d n −1− i
i =0
un − dn
=
u−d
(since (82) (applied to m=n and a=u and b=d)
n −1
yields (u−d) ∑ ui dn−1−i =un −dn )
i =0
 
un − dn un − dn
= + un = + un since u − d = d − 2 − d = −2
u−d −2 |{z}
= d −2
1 1 n
= (dn + un ) = d + ( d − 2) n

(since u = d − 2) .
2 2
Thus we have obtained the explicit formula

1 n
d + ( d − 2) n

en = (343)
2

December 25, 2021


Math 235 notes page 363

for each n ∈ N.
As with most such formulas, once they are known, they are easy to prove by induction.
For example, here is a quick inductive proof of (343):
[Alternative proof of (343): We shall prove (343)
 by inductionon n:
1 0 1
Induction base: Comparing e0 = 1 with d + (d − 2)0  = (1 + 1) = 1, we obtain
2 |{z} | {z } 2
=1 =1
1 0 
e0 = d + (d − 2)0 . In other words, (343) holds for n = 0.
2
Induction step: Let m be a positive integer. Assume (as the induction hypothesis) that
(343) holds for n = m − 1. We must show that (343) holds for n = m.
We have assumed that (343) holds for n = m − 1. In other words, we have em−1 =
1  m −1 
d + (d − 2)m−1 . Now, (341) (applied to n = m) yields
2

e m = d m −1 + ( d − 2 ) e m −1
|{z}
1 m −1
=(d +(d−2)m−1 )
2
1  m −1 
= d m −1 + ( d − 2 ) · d + ( d − 2 ) m −1
2
1    
= d m −1 + d · d m −1 + ( d − 2 ) m −1 − d m −1 + ( d − 2 ) m −1
2
1  m −1 
= d· d + ( d − 2 ) m −1 − ( d − 2 ) m −1
2 

1 
m −1 m −1
 
m −1 
= d · d + ( d − 2) −2 ( d − 2)

2 |

{z } 
=ddm−1 +d(d−2)m−1
 
1ddm−1 + d (d − 2)m−1 − 2 (d − 2)m−1 

=
2 | {zm } | {z }
=d
=(d−2)(d−2)m−1 =(d−2)m
1 m
d + ( d − 2) m .

=
2
In other words, (343) holds for n = m. This completes the induction step. Thus, (343) is
proved.]
Exercise 7.8.1 is answered by (343).
Second solution of Exercise 7.8.1 (sketched). Here is a more elegant argument.
Having introduced the notion of “1-even” tuples, let us also introduce the op-
posite notion: An n-tuple ( x1 , x2 , . . . , xn ) ∈ [d]n will be called 1-odd if the number
1 occurs in it an odd number of times. Thus, any n-tuple ( x1 , x2 , . . . , xn ) ∈ [d]n is
either 1-even or 1-odd (but not both at the same time).
Let en denote the # of 1-even n-tuples in [d]n . Let on denote the # of 1-odd n-tuples
in [d]n . Thus, we must compute en .

December 25, 2021


Math 235 notes page 364

We notice that [d]n = |[d]|n = dn (since |[d]| = d), and thus

dn = [d]n = # of all n-tuples in [d]n




= # of 1-even n-tuples in [d]n + # of 1-odd n-tuples in [d]n


 
| {z } | {z }
= en =on
(by the definition of en ) (by the definition of on )

by the sum rule, since any n-tuple ( x1 , x2 , . . . , xn ) ∈ [d]n


 

is either 1-even or 1-odd (but not both at the same time)


= en + on .
In other words,
en + on = dn . (344)
Now, we shall compute en − on . Indeed, for each k ∈ [d], let us define a number
(
−1, if k = 1;
s (k) = (345)
1, if k > 1.

Thus, s (1) = −1 and s (2) = s (3) = · · · = s (d) = 1. Why are we defining these
strange numbers? We will soon see.
If ( x1 , x2 , . . . , xn ) ∈ [d]n is an n-tuple, then
(
1, if ( x1 , x2 , . . . , xn ) is 1-even;
s ( x1 ) s ( x2 ) · · · s ( x n ) = (346)
−1, if ( x1 , x2 , . . . , xn ) is 1-odd.

[Proof of (346): Let ( x1 , x2 , . . . , xn ) ∈ [d]n be an n-tuple. Each of the n factors


s ( x1 ) , s ( x2 ) , . . . , s ( xn ) in the product s ( x1 ) s ( x2 ) · · · s ( xn ) is either −1 or 1 (ac-
cording to (345)). Thus, the entire product s ( x1 ) s ( x2 ) · · · s ( xn ) is a product of 1’s
and (−1)’s. Therefore, this product equals 1 if an even number of its factors are
(−1)’s, and equals −1 if an odd number of its factors are (−1)’s. But the number
of factors of the product s ( x1 ) s ( x2 ) · · · s ( xn ) that are (−1)’s is precisely the num-
ber of occurrences of the number 1 in the n-tuple ( x1 , x2 , . . . , xn ), since each such
occurrence contributes a factor that is −1 (because (345) says that s ( xi ) = −1 if and
only if xi = 1). Thus, this number of factors that are (−1)’s is even if ( x1 , x2 , . . . , xn )
is 1-even, and is odd if ( x1 , x2 , . . . , xn ) is 1-odd. Combining these observations, we
obtain (346).]
Now, consider the sum

∑ s ( x1 ) s ( x2 ) · · · s ( x n )
( x1 ,x2 ,...,xn )∈[d]n
| {z }

1, if ( x1 , x2 , . . . , xn ) is 1-even;
=
−1, if ( x , x , . . . , x ) is 1-odd
1 2 n
(
1, if ( x1 , x2 , . . . , xn ) is 1-even;
= ∑ −1, if ( x1 , x2 , . . . , xn ) is 1-odd.
( x1 ,x2 ,...,xn )∈[d]n

December 25, 2021


Math 235 notes page 365

This sum has en many addends equal to 1 (since there are en many 1-even n-tuples
( x1 , x2 , . . . , xn ) ∈ [d]n ) and on many addends equal to −1 (since there are on many
1-odd n-tuples ( x1 , x2 , . . . , xn ) ∈ [d]n ). Hence, this sum simplifies to

en · 1 + on · (−1) = en − on .

Thus, we obtain

∑ s ( x1 ) s ( x2 ) · · · s ( x n ) = e n − o n .
( x1 ,x2 ,...,xn )∈[d]n

Hence,

en − on = ∑ s ( x1 ) s ( x2 ) · · · s ( x n ) = ∑ s (k1 ) s (k2 ) · · · s (k n )
( x1 ,x2 ,...,xn )∈[d]n (k1 ,k2 ,...,k n )∈[d]n

(here, we have renamed the summation index). On the other hand, Theorem 4.2.14
(applied to mi = d and pi,k = s (k)) yields

n d n
∏ ∑ s (k) = ∑ ∏ s (k i ) = ∑ s (k1 ) s (k2 ) · · · s (k n ) .
i =1 k =1 (k1 ,k2 ,...,k n )∈[d]n i =1
| {z } (k1 ,k2 ,...,k n )∈[d]n
=s(k1 )s(k2 )···s(k n )

Comparing these two equalities, we obtain


!n
n d d
en − o n = ∏ ∑ s (k) = ∑ s (k) .
i =1 k =1 k =1

In view of
d
∑ s (k) = s|{z}
(1) + s (2) + s (3) + · · · + s ( d )
k =1
|{z} |{z} |{z}
=−1 =1 =1 =1
= (−1) + 1| + 1 +{z· · · + 1} = (−1) + (d − 1) · 1 = d − 2,
d−1 times

this rewrites as
e n − o n = ( d − 2) n . (347)
Adding this equality to (344), we obtain

( e n + o n ) + ( e n − o n ) = d n + ( d − 2) n .

In view of (en + on ) + (en − on ) = 2en , this rewrites as 2en = dn + (d − 2)n . Dividing


1 n
d + (d − 2)n . Hence, we have solved Exer-

this equality by 2, we obtain en =
2
cise 7.8.1 again (and, reassuringly, obtained the same answer as the first time).

December 25, 2021


Math 235 notes page 366

The trick used in the second solution above is not just slick; it has further appli-
cations. Superficially, what we did was finding en by first computing en + on and
en − on and then adding up and dividing by 2. But the “reason” why en − on was
so much easier to find than en alone is that en − on was a sum (of 1’s and (−1)’s)
over all (not just the 1-even) n-tuples ( x1 , x2 , . . . , xn ) ∈ [d]n , and the addends could
be decomposed as products s ( x1 ) s ( x2 ) · · · s ( xn ).
A more sophisticated use of this strategy can be used to solve the following
exercise ([18f-hw4s, Exercise 7]):

Exercise 7.8.2. Let n ∈ N and d ∈ N.


An n-tuple ( x1 , x2 , . . . , xn ) ∈ [d]n will be called all-even if each number occurs
in it an even number of times (i.e., for each j ∈ [d], the number of i ∈ [n]
satisfying xi = j is even). (For example, the 4-tuples (1, 5, 1, 5) and (2, 2, 3, 3) are
all-even, while the 4-tuple (4, 1, 1, 1) is not.)
Prove that the # of all-even n-tuples in [d]n is

d  
1 d
2d
∑ k (d − 2k)n .
k =0

We omit the solution for now (see [18f-hw4s, Exercise 7]). (TODO: Insert it.)

7.9. A bit of extremal combinatorics


So far in this chapter, we have been doing enumerative combinatorics, which is
mostly about questions of the form “how many things exist with this or that prop-
erty”. Extremal combinatorics, on the other hand, is the science of questions like
“how big or small can things get while satisfying this or that property?”. Here are
some examples:

• Given n ∈ N, how many distinct subsets of [n] can you pick so that every two
subsets you have picked have a nonempty intersection? (We shall answer this
below.)
• Given n, k ∈ N, how many distinct k-element subsets of [n] can you pick so
that every two subsets you have picked have a nonempty intersection? (We
shall answer this below. Note that the case 2k > n is trivial – make sure you
see why!)
• Given n ∈ N, how many distinct subsets of [n] can you pick so that no subset
you have picked is a subset of another? (We shall answer this below.)
• Given n ∈ N, how many distinct n-tuples (i1 , i2 , . . . , in ) ∈ {0, 1}n can you pick
so that no two n-tuples you have picked differ in just a single entry? (Such
a pick is known as a single-error-detecting code. But this makes the question
sound harder than it is!)

December 25, 2021


Math 235 notes page 367

• Given n, k ∈ N, how many distinct numbers can you pick from the set [n]
so that any two distinct numbers a, b you have picked satisfy | a − b| ≥ k ?
(Using the terminology of Exercise 3.7.1, this is just asking for the largest
 of a k-lacunar
size subset of {1, 2, . . . , n}.) It is easy to seethat the answer is
n+k−1 n+k−1

. (Indeed, you can certainly pick distinct numbers
k k
with this property227 , and Exercise 3.7.1 shows that you cannot pick more228 .)

The attentive reader will notice that the pigeonhole principles also belong to
extremal combinatorics, as they answer questions like “how many distinct elements
can you pick from a given n-element set?” or “how few elements can you pick from
a given n-element set so that every element has been picked at least once?”. Our
point here is not to dwell on fundamentals like this, but to put them into a new
context.
I shall not give a proper introduction to extremal combinatorics, but I shall solve
three of the above questions to give an idea of how the subject (or at least a small
part of it) feels like. The reader can find a lot more in [Galvin17, Chapter 43
onward], [Jukna11], [Engel97] and other places.

Convention 7.9.1. The word “collection” is a synonym for “set”. For reasons
of clarity, we shall speak of “collections of sets” instead of “sets of sets”. For
example, {{1, 2} , {1, 3} , {5}} is a collection of subsets of [5].

7.9.1. Sperner’s theorem


We begin with answering the question “Given n ∈ N, how many distinct subsets
of [n] can you pick so that no subset you have picked is a subset of another?”:

Definition 7.9.2. Let S be a set. A set antichain of S means a collection J of subsets


of S such that no two distinct sets A, B ∈ A satisfy A ⊆ B.

Example 7.9.3. (a) The collection {{1, 2} , {1, 3} , {5}} is a set antichain of [5].
(b) The collection {{1, 2} , {1, 3} , {2}} is not a set antichain of [5], since {2} ⊆
{1, 2}.
227 Namely, you can pick the numbers

0k + 1, 1k + 1, 2k + 1, . . . , (q − 1) k + 1,

n+k−1
 
where q = . An easy computation shows that they all belong to [n] and have the
k
property required.
228 More precisely, Exercise 3.7.1 shows that you cannot pick more than n + k − 1 distinct numbers
k
with this property. But you can only pick an integer number of numbers; thus, “no more than
n+k−1 n+k−1

” is tantamount to “no more than ”.
k k

December 25, 2021


Math 235 notes page 368

Theorem 7.9.4 (Sperner’s theorem). Let n ∈ N. Let Sbe an n-element


 set. Then,
n
the maximum possible size of a set antichain of S is .
bn/2c

Before we prove this theorem, let us do two things. First, as a warmup, we shall
prove a similar (but much simpler) result about set chains – a dual notion to set
n
antichains. Then, we shall show an inequality saying that is the largest
  bn/2c
n
of all binomial coefficients (for a fixed n ∈ N).
k
Definition 7.9.5. Let S be a set. A set chain of S means a collection C of subsets
of S such that any two distinct sets A, B ∈ C satisfy A ⊆ B or B ⊆ A.

Example 7.9.6. (a) The collection {{1, 2} , {1, 2, 5} , {1, 2, 3, 4, 5}} is a set chain of
[5].
(b) The collection {{1, 2} , {1, 3} , {1, 2, 3}} is not a set chain of [5], since {1, 2}
and {1, 3} satisfy neither {1, 2} ⊆ {1, 3} nor {1, 3} ⊆ {1, 2}.

Theorem 7.9.7. Let n ∈ N. Let S be an n-element set. Then, the maximum


possible size of a set chain of S is n + 1.

Proof of Theorem 7.9.7 (sketched). Let s1 , s2 , . . . , sn be the n elements of S. The collec-


tion

{{s1 , s2 , . . . , sn } | i ∈ {0, 1, . . . , n}}


= {{} ,
{ s1 } ,
{ s1 , s2 } ,
{ s1 , s2 , s3 } ,
...,
{s1 , s2 , . . . , sn }}

is clearly a set chain of S, and has size n + 1. Thus, it remains to prove that any set
chain of S has size ≤ n + 1.
Indeed, let C be a set chain of S. We must thus prove that |C| ≤ n + 1.
Each set I ∈ C is a subset of S, and thus satisfies | I | ∈ {0, 1, . . . , n} (since S is an
n-element set). Hence, we can define a map

f : C → {0, 1, . . . , n} ,
I 7→ | I | .

This map f simply sends each set I ∈ C to its size. Now, we claim that this map f
is injective. Indeed, if A and B are two distinct elements of C, then we have A ⊆ B

December 25, 2021


Math 235 notes page 369

or B ⊆ A (since C is a set chain), and therefore we must have | A| 6= | B| (because


if we had | A| = | B|, then either of the two relations A ⊆ B and B ⊆ A would
imply that A = B 229 , which would contradict the fact that A and B are distinct);
but this rewrites as f ( A) 6= f ( B) (since the definition of f yields f ( A) = | A| and
f ( B) = | B|). Thus, the map f is injective. Hence, Theorem 6.1.2 (applied to U = C
and V = {0, 1, . . . , n}) yields |C| ≤ |{0, 1, . . . , n}| = n + 1. This is precisely what
we had to show. Thus, the proof of Theorem 7.9.7 is complete.
Next, as we promised, comes an inequality for binomial coefficients:
   
n n
Lemma 7.9.8. Let n ∈ N and k ∈ R. Then, ≤ .
k bn/2c

Proof of Lemma 7.9.8 (sketched). There are many proofs for this; here is an outline of
what might be the simplest  one.  
n n
Theorem 4.3.10 yields = . Thus, if k > n − k, then we can replace
k  n − k
n
k by n − k without changing . Hence, for the rest of this proof, we WLOG
k
assume that k ≤ n − k. Hence, 2k ≤ n, so that k ≤ n/2 and therefore k ≤ bn/2c
(since k is an integer).
     
n n n
/ N, then
If k ∈ =0≤ (since / N, then
≥ 0). Thus, if k ∈
k bn/2c bn/2c
Lemma 7.9.8 holds. Hence, for the rest of this proof, we WLOG assume that k ∈ N.
Combining k ∈ N with k ≤ bn/2c, we find k ∈ {0, 1, . . . , bn/2c}.
Now, we claim the following chain of inequalities:
       
n n n n
< < < ··· < . (348)
0 1 2 bn/2c
(In terms of Pascal’s triangle, this is simply saying that the binomial coefficients in
the n-th row of Pascal’s triangle strictly increase until the middle of the row. For
example,
 for  n = 4, this
 is saying that 1 < 4 < 6.) Clearly, if we can prove (348),
n n n
then ≤ will follow, since is one of the binomial coefficients in
k bn/2c k
the chain (348) (because k ∈ {0, 1, . . . , bn/2c}). Thus,we  onlyneed  to prove (348).
n n
In order to prove (348), we need to show that < for each i ∈
i i+1
{0, 1, . . . , bn/2c − 1}. Let us do this: Let i ∈ {0, 1, . . . , bn/2c − 1}. Thus, i ≥ 0
and i ≤ bn/2c −1 ≤ n/2 − 1. Hence, i + 1 ≤ n/2, so that 2 (i + 1) ≤ n and thus
| {z }
≤n/2
i + 1 ≤ n − (i + 1) < n − i, so that n − i > i + 1. Also, i ∈ {0, 1, . . . , n} (since
| {z }
>i
229 Here,we are using the fact that if X and Y are two finite sets satisfying X ⊆ Y and | X | = |Y |,
then X = Y.

December 25, 2021


Math 235 notes page 370

i≥0 and i ≤ n/2 − 1 < n/2 ≤ n); hence, Theorem 4.3.8 (applied to k = i) yields
n n!
= > 0 (since factorials are positive).
i i! (n − i )!
It is not hard to prove that
   
n n
( i + 1) = (n − i ) . (349)
i+1 i

(In fact, this is Lemma A.4.9 (b), applied to k = i.) Thus,


     
n n n
( i + 1) = (n − i ) > ( i + 1)
i+1 | {z } i i
> i +1
 
n
(here, we have used > 0). We can divide this inequality by i + 1 (since
i        
n n n n
i + |{z}
1 > 0), and thus obtain > . In other words, < .
|{z} i+1 i i i+1
≥0 >0    
n n
Thus, we have shown that < for each i ∈ {0, 1, . . . , bn/2c − 1}. 230
i i+1
As we explained above, this proves the chain (348) and thus completes the proof of
Lemma 7.9.8.
Proof of Theorem 7.9.4 (sketched). (We are following [Galvin17, second proof of The-
orem 53.2] here.)
For each k ∈ {0, 1, . . . , n}, the collection

{all k-element subsets of S}

is a set antichain of S (because a k-element subset of Scannot  be a subset of a


n
different k-element subset of S). This collection has size (by Theorem 4.3.12).
k
  for each k ∈ {0, 1, . . . , n}, we have found a set antichain of S that has size
Thus,
n
. In particular, taking k = bn/2c, we thus have found a set antichain of S that
k  
n
has size .
bn/2c  
n
It thus remains to show that any set antichain of S has size ≤ .
bn/2c 
n
Indeed, let A be a set antichain of S. We must thus show that |A| ≤ .
bn/2c
We WLOG assume that S = [n] (as we can always relabel the n elements of S by
1, 2, . . . , n). Recall the set Sn from Definition 7.4.4. (Permutations appear nowhere

230 Another proof of this can be found in [Guicha20, Theorem 1.3.4].

December 25, 2021


Math 235 notes page 371

in Theorem 7.9.4, but as we will soon see, they are the key to its proof.) For each
permutation σ ∈ Sn , we let Cσ be the collection

{{σ (1) , σ (2) , . . . , σ (i )} | i ∈ {0, 1, . . . , n}}


= { {} ,
{σ (1)} ,
{σ (1) , σ (2)} ,
{σ (1) , σ (2) , σ (3)} ,
...,
{σ (1) , σ (2) , . . . , σ (n)} }.
This collection Cσ is a set chain of [n] = S, and has size |Cσ | = n + 1.
We now set 231
s := ∑ ∑ [ I ∈ Cσ ] .
I ∈A σ ∈ Sn
We shall find an upper bound and a lower bound for s, and use them to obtain an
inequality. (This is a variant of the double counting technique.)
To obtain an upper bound, we observe the following:

Claim 1: For any σ ∈ Sn , we have ∑ [ I ∈ Cσ ] ≤ 1.


I ∈A

[Proof of Claim 1: Let σ ∈ Sn . Recall that Cσ is a set chain; thus, any two distinct
sets A, B ∈ Cσ satisfy
A ⊆ B or B ⊆ A (350)
(by the definition of “set chain”). On the other hand, A is a set antichain; thus,
no two distinct sets A, B ∈ A satisfy A ⊆ B. In other words, any two distinct sets
A, B ∈ A satisfy
A 6⊆ B. (351)
Now, each addend of the sum ∑ [ I ∈ Cσ ] is a truth value and thus equals either
I ∈A
0 or 1; moreover, the # of addends that equal 1 is precisely the # of all I ∈ A
satisfying I ∈ Cσ . Hence,

∑ [ I ∈ Cσ ] = (# of all I ∈ A satisfying I ∈ Cσ ) · 1 + (some number of 0’s)


I ∈A
= (# of all I ∈ A satisfying I ∈ Cσ ) · 1
= (# of all I ∈ A satisfying I ∈ Cσ ) . (352)

In order to prove Claim 1, we need to show that ∑ [ I ∈ Cσ ] ≤ 1. In view of


I ∈A
(352), this boils down to showing that

(# of all I ∈ A satisfying I ∈ Cσ ) ≤ 1. (353)


231 We use the Iverson bracket notation (Definition 4.3.19).

December 25, 2021


Math 235 notes page 372

In other words, we need to show that there is at most one set I ∈ A satisfying
I ∈ Cσ .
Assume the contrary. Thus, there exist two such sets I. In other words, there exist
two distinct sets A, B ∈ A satisfying A, B ∈ Cσ . Consider these A, B. From (350),
we obtain A ⊆ B or B ⊆ A. However, from (351), we obtain A 6⊆ B. Hence, B ⊆ A
(since A ⊆ B or B ⊆ A). However, we can also apply (351) to B and A instead of A
and B. Thus, we obtain B 6⊆ A. This contradicts B ⊆ A. This contradiction shows
that our assumption was wrong, so we are done proving that there is at most one
set I ∈ A satisfying I ∈ Cσ . Hence, we have proved (353). As explained above, this
yields Claim 1.]
Now,

s= ∑ ∑ [ I ∈ Cσ ] = ∑ ∑ [ I ∈ Cσ ]
I ∈A
| {z
σ ∈ Sn
}
σ ∈ Sn
|I ∈A {z }
= ∑ ∑ ≤1
σ ∈ Sn I ∈A (by Claim 1)

≤ ∑ 1 = |Sn | · 1 = |Sn | = (# of permutations of [n])


σ ∈ Sn
= n! (354)

(by Theorem 7.4.1, applied to X = [n]). Thus we have obtained an upper bound for
s.
In order to find a lower bound, we will need the following:

n!
Claim 2: For any I ∈ A, we have ∑ [ I ∈ Cσ ] ≥  .
σ ∈ Sn n
bn/2c

[Proof of Claim 2: Let I ∈ A. Let k = | I |; thus, k = | I | ∈ {0, 1, . . . , n} (since I is a


subset of the n-element set S).
Now, each addend of the sum ∑ [ I ∈ Cσ ] is a truth value and thus equals
σ ∈ Sn
either 0 or 1; moreover, the # of addends that equal 1 is precisely the # of all σ ∈ Sn
satisfying I ∈ Cσ . Hence,

∑ [ I ∈ Cσ ] = (# of all σ ∈ Sn satisfying I ∈ Cσ ) · 1 + (some number of 0’s)


σ ∈ Sn
= (# of all σ ∈ Sn satisfying I ∈ Cσ ) · 1
= (# of all σ ∈ Sn satisfying I ∈ Cσ ) . (355)

Now, how many permutations σ ∈ Sn satisfy I ∈ Cσ ?


Let σ ∈ Sn be a permutation. We know that I is a k-element set (since k = | I |);
but the only k-element set in the set chain Cσ is {σ (1) , σ (2) , . . . , σ (k )} (by the
definition of Cσ ). Hence, we have I ∈ Cσ if and only if I = {σ (1) , σ (2) , . . . , σ (k )}.

December 25, 2021


Math 235 notes page 373

Forget that we fixed σ. We thus have shown that a permutation σ ∈ Sn satisfies


I ∈ Cσ if and only if I = {σ (1) , σ (2) , . . . , σ (k )}. Hence,

(# of all σ ∈ Sn satisfying I ∈ Cσ )
= (# of all σ ∈ Sn satisfying I = {σ (1) , σ (2) , . . . , σ (k)}) . (356)

But a permutation σ ∈ Sn satisfying I = {σ (1) , σ (2) , . . . , σ (k )} can be constructed


using the following decision procedure:

• First, we choose the value σ (1) (provided that 1 ≤ k). There are k options
for it, since σ (1) needs to belong to the k-element set I (because we want
I = {σ (1) , σ (2) , . . . , σ (k )}).

• Next, we choose the value σ (2) (provided that 2 ≤ k). There are k − 1 options
for it, since σ (2) needs to belong to the k-element set I (because we want
I = {σ (1) , σ (2) , . . . , σ (k )}) and be distinct from σ (1).

• Next, we choose the value σ (3) (provided that 3 ≤ k). There are k − 2 options
for it, since σ (3) needs to belong to the k-element set I (because we want
I = {σ (1) , σ (2) , . . . , σ (k )}) and be distinct from σ (1) and σ (2).

• And so on, until the first k values σ (1) , σ (2) , . . . , σ (k) of σ have been cho-
sen. At this point, we have assigned k distinct elements of the set I as
values σ (1) , σ (2) , . . . , σ (k ). Thus, by the pigeonhole principle for injec-
tions, each of the k elements of I has been assigned as one of the k values
σ (1) , σ (2) , . . . , σ (k ) (since I is a k-element set). We have therefore ensured
that I = {σ (1) , σ (2) , . . . , σ (k )}. We still need to choose the remaining values
σ (k + 1) , σ (k + 2) , . . . , σ (n) of σ, though.

• Next, we choose the value σ (k + 1). There are n − k options for it, since
σ (k + 1) needs to belong to the n-element set [n] and be distinct from the k
numbers σ (1) , σ (2) , . . . , σ (k).

• Next, we choose the value σ (k + 2). There are n − k − 1 options for it, since
σ (k + 2) needs to belong to the n-element set [n] and be distinct from the
k + 1 numbers σ (1) , σ (2) , . . . , σ (k + 1).

• And so on, until all n values σ (1) , σ (2) , . . . , σ (n) have been chosen.

According to the dependent product rule, the total # of possibilities for making
these choices is
n!
k (k − 1) (k − 2) · · · 1 · (n − k ) (n − k − 1) · · · 1 = k! · (n − k )! =  
| {z } | {z } n
=1·2·····k =1·2·····(n−k)
=k! =(n−k)!
k

December 25, 2021


Math 235 notes page 374

 
n n!
(since Theorem 4.3.8 yields = ). Hence,
k k! · (n − k )!

(# of all σ ∈ Sn satisfying I = {σ (1) , σ (2) , . . . , σ (k)})


n!
=  . (357)
n
k

Now, (355) becomes

∑ [ I ∈ Cσ ] = (# of all σ ∈ Sn satisfying I ∈ Cσ )
σ ∈ Sn
= (# of all σ ∈ Sn satisfying I = {σ (1) , σ (2) , . . . , σ (k)})
(by (356))
n!
=  (by (357))
n
k
    
n! n n
≥  since Lemma 7.9.8 yields ≤ .
n k bn/2c
bn/2c
This proves Claim 2.]
Now,
n! n!
s= ∑ ∑ [ I ∈ Cσ ] ≥ ∑ 
n
 = |A| · 
n
. (358)
I ∈A σ ∈ Sn I ∈A
| {z } bn/2c bn/2c
n!
≥ 
n
bn/2c
(by Claim 2)

Thus we have obtained a lower bound for s. From (358), we obtain


n!
|A| ·   ≤ s ≤ n! (by (354)) .
n
bn/2c
 
n
Dividing this inequality by n! and multiplying it by , we obtain |A| ≤
    bn/2c
n n
(since n! and are nonnegative). This is precisely what we
bn/2c bn/2c
needed to show. Thus, Theorem 7.9.4 is proven.

December 25, 2021


Math 235 notes page 375

Remark 7.9.9. Theorem 7.9.4 (applied to n = 5  and S  = [5]) yields


 that the
5 5
maximum possible size of a set antichain of [5] is = = 10. As we
b5/2c 2
have seen in the proof, an example of a set antichain of [5] having this maximum
size is

{all 2-element subsets of [5]}


= {{1, 2} , {1, 3} , {1, 4} , {1, 5} , {2, 3} , {2, 4} ,
{2, 5} , {3, 4} , {3, 5} , {4, 5}}.

Another example of such an antichain is {all 3-element subsets of [5]}. It can be


shown that these two examples are the only set antichains of [5] having maxi-
mum size. More generally: If n ∈ N, and if S is an n-element
 set, then the only
n
set antichains of S having maximum size (that is, size ) are
bn/2c

{all bn/2c -element subsets of S} and


{all (n − bn/2c) -element subsets of S} .

(When n is even, these two antichains are identical.) See [Engel97, Theorem 1.1.1
(b)] for a proof of this.

7.9.2. Intersecting collections


Next, let us answer the question “Given n ∈ N, how many distinct subsets of [n]
can you pick so that every two subsets you have picked have a nonempty intersec-
tion?”. Such a pick will be called an intersecting collection:

Definition 7.9.10. Let S be a set. An intersecting collection of S means a collection


J of subsets of S such that any A, B ∈ J satisfy A ∩ B 6= ∅.

Example 7.9.11. (a) The collection {{1, 2} , {1, 3} , {2, 3}} is an intersecting col-
lection of [4].
(b) The collection {{1, 2} , {1, 3} , {2}} is not an intersecting collection of [4],
since {1, 3} ∩ {2} = ∅.

Now we can answer our question ([Galvin17, Theorem 44.2]):

Theorem 7.9.12. Let n be a positive integer. Let S be an n-element set. Then, the
maximum possible size of an intersecting collection of S is 2n−1 .

Proof of Theorem 7.9.12 (sketched). The set S is nonempty (since it is an n-element set,
but n is positive). Thus, there exists some t ∈ S. Pick such a t.
The collection
{all subsets of S that contain t}

December 25, 2021


Math 235 notes page 376

is an intersecting collection of S (indeed, any two sets A, B in this collection have


at least the element t in common and therefore satisfy A ∩ B 6= ∅). This collection
has size 2n−1 (check this!). Thus, we have found an intersecting collection of S that
has size 2n−1 .
It now remains to show that any intersecting collection of S has size ≤ 2n−1 .
So let J be an intersecting collection of S. We must show that |J| ≤ 2n−1 .
If T is any subset of S, then the complement S \ T of T will be denoted by T.
This complement T is disjoint from T (this is a general property of complements)
and also distinct from T (since S is nonempty). 
If T is any subset of S, then we shall refer to the collection T, T (which consists
of just two sets: T and its complement T) as the pigeonhole of T. Note that a subset
T of S and its complement T have the same pigeonhole, since
( )
  
the pigeonhole of T = T, |{z} T = T, T = T, T = (the pigeonhole of T ) .
=T

There are 2n subsets of S in total, and each of them lies in a unique pigeonhole
(namely, each subset T lies in the pigeonhole of T). Since each pigeonhole contains
precisely two subsets of S (this is where we are using our observation that the com-
plement T of a set T is distinct from T), we thus conclude that there are precisely
2n−1 pigeonholes.
Now, the crucial observation is the following: The two sets in any given pigeon-
hole are disjoint (because they are complements of one another). Hence, J cannot
contain more than one set from any given pigeonhole (since J is an intersecting
collection, so that no two sets in J are disjoint). Thus, by the pigeonhole principle
for injections, the size of J is ≤ to the # of pigeonholes. In other words, |J| ≤ 2n−1
(since there are precisely 2n−1 pigeonholes). This is precisely what we needed to
show. Thus, Theorem 7.9.12 is proved.

Remark 7.9.13. The maximum size (2n−1 ) in Theorem 7.9.12 is achieved not just
for collections of the form {all subsets of S that contain t} for some t ∈ S. For
example, if n = 3 and S = [3], then the collection

{{1, 2} , {1, 3} , {2, 3} , {1, 2, 3}}

also is an intersecting collection of S having maximum size (that is, in this case,
2n−1 = 23−1 = 4). This illustrates that the sets in an intersecting collection need
not all have an element in common.

The last extremal combinatorics question we shall answer is “Given n, k ∈ N,


how many distinct k-element subsets of [n] can you pick so that every two subsets
you have picked have a nonempty intersection?”. In our language, this is asking for
the maximum size of an intersecting collection that consists entirely of k-element
sets. We are lazy and give these collections a new name:

December 25, 2021


Math 235 notes page 377

Definition 7.9.14. Let S be a set. Let k ∈ N. An intersecting k-collection of S means


a collection J of k-element subsets of S such that any A, B ∈ J satisfy A ∩ B 6= ∅.

Example 7.9.15. The collection {{1, 2} , {1, 3} , {2, 3}} is an intersecting 2-


collection of [4].

Theorem 7.9.16 (Erdös–Ko–Rado theorem). Let n and k be positive integers. Let


S be an n-element set. Then:
(a)If n ≥2k, then the maximum possible size of an intersecting k-collection of
n−1
S is .
k−1
(b)Ifn < 2k, then the maximum possible size of an intersecting k-collection of
n
S is .
k
It may appear strange that the answers in the cases n ≥ 2k and n < 2k are so
different, but the proof will reveal the reason for this.
Proof of Theorem 7.9.16 (sketched). We start with part (b), which is more of a joke
than a theorem.
(b) Assume that n < 2k. Then, any two k-element subsets A, B of S satisfy
A ∩ B 6= ∅ (because otherwise, A and B would be disjoint, and thus the sum rule
would yield | A ∪ B| = | A| + | B| = k + k = 2k, which would contradict
|{z} |{z}
=k =k

| A ∪ B| ≤ |S| (since A ∪ B ⊆ S)
= n < 2k
). Therefore, the collection {all k-element
 subsets of S} is an intersecting k-collection
n
of S. The size of this collection is , and clearly there is no intersecting k-
k  
n
collection of S having higher size (since there are only many k-element sub-
k
 of S). Thus, the maximum possible size of an intersecting k-collection of S is
sets
n
. This proves Theorem 7.9.16 (b).
k
(a) Assume that n ≥ 2k. Thus, n ≥ 2k > k (since k is positive), so that k < n.
The set S is nonempty (since it is an n-element set, but n is positive). Thus, there
exists some t ∈ S. Pick such a t.
The collection
{all k-element subsets of S that contain t}
n−1
 
is an intersecting k-collection of S (check this!), and has size (check this!).
k − 1
n−1

Thus, we have found an intersecting k-collection of S that has size .
k−1

December 25, 2021


Math 235 notes page 378

n−1
 
It now remains to show that any intersecting k-collection of S has size ≤ .
k − 1
n−1
 
So let J be an intersecting k-collection of S. We must show that |J| ≤ .
k−1
The following elegant argument (which I have taken from [Galvin17, first proof
of Theorem 49.1] with only expositional changes) is known as “Katona’s cycle
proof”, and has seen uses in various settings (see [BorMea16] and [Frankl20] for
two surveys). Again (as already in the proof of Sperner’s theorem above) we in-
volve permutations for no obvious reason.
We WLOG assume that S = [n] (since we can otherwise just relabel the elements
of S). Recall that Sn denotes the set of all permutations of [n]. We recall that
|Sn | = n! (which we have seen, e.g., in the proof of Theorem 7.9.4).
We extend any permutation σ ∈ Sn of [n] to an n-periodic map σ : {1, 2, 3, . . .} →
[n]. That is, if σ ∈ Sn is a permutation, then we recursively define the extra values
σ (n + 1) , σ (n + 2) , σ (n + 3) , . . . by setting

σ ( n + 1) : = σ (1) ,
σ ( n + 2) : = σ (2) ,
σ ( n + 3) : = σ (3) ,
....

(Thus, explicitly, if i is a positive integer, then σ (i ) = σ ( j), where j is the unique ele-
ment of [n] satisfying i ≡ j mod n.) Thus, for each permutation σ ∈ Sn , the sequence
(σ (1) , σ (2) , σ (3) , . . .) begins with the n “original” values of σ and then continues
by repeating these n values over and over. Hence, this sequence (σ (1) , σ (2) , σ (3) , . . .)
is n-periodic. Let us also notice that if σ ∈ Sn is a permutation, and if p ∈
{0, 1, . . . , n}, then any p consecutive elements of this sequence (σ (1) , σ (2) , σ (3) , . . .)
(that is, any p elements of the form σ (i + 1) , σ (i + 2) , . . . , σ (i + p), where i ∈ N)
are distinct.
Fix a permutation σ ∈ Sn . For each i ∈ N, we define a subset

Wi (σ ) = {σ (i + 1) , σ (i + 2) , . . . , σ (i + k)}

of [n]. Thus,

W0 (σ) = {σ (1) , σ (2) , . . . , σ (k )} ,


W1 (σ ) = {σ (2) , σ (3) , . . . , σ (k + 1)} ,
W2 (σ ) = {σ (3) , σ (4) , . . . , σ (k + 2)} ,
....

These sets W0 (σ) , W1 (σ) , W2 (σ) , . . . (that is, the sets Wi (σ) for all i ∈ N) will
be called the windows of σ. 232 It is easy to see that these windows Wi (σ) are
k-element subsets of [n] (indeed, for any i ∈ N, the k elements
232 The following way of visualizing the windows of σ might be useful: Imagine the values

December 25, 2021


Math 235 notes page 379

σ (i + 1) , σ (i + 2) , . . . , σ (i + k ) of Wi (σ) are distinct, since σ is a permutation).


Moreover, the first n windows
W0 (σ ) = {σ (1) , σ (2) , . . . , σ (k )} ,
W1 (σ ) = {σ (2) , σ (3) , . . . , σ (k + 1)} ,
...,
Wn−1 (σ ) = {σ (n) , σ (n + 1) , . . . , σ (n + k − 1)}

of σ are distinct233 , whereas all other windows of σ are repetitions of these n win-
dows234 . Hence, there are n windows of σ in total. We let Bσ denote the collection
σ (1) , σ (2) , . . . , σ (n) written on the circumference on a circle (in clockwise order); then, a win-
dow of σ is just a set of k values appearing consecutively on the circle. For example, if n = 8
and k = 3, and if σ ∈ S8 is the permutation that sends 1, 2, 3, 4, 5, 6, 7, 8 to 3, 1, 7, 4, 5, 6, 8, 2,
respectively, then the windows of σ are

W0 (σ ) = {3, 1, 7} ,
W1 (σ ) = {1, 7, 4} ,
W2 (σ ) = {7, 4, 5} ,
W3 (σ ) = {4, 5, 6} ,
W4 (σ ) = {5, 6, 8} ,
W5 (σ ) = {6, 8, 2} ,
W6 (σ ) = {8, 2, 3} ,
W7 (σ ) = {2, 3, 1} .

Two of these windows (namely, W2 (σ ) in green, and W7 (σ ) in yellow) are shown on the follow-
ing picture:
8

6 2

5 3

4 1

233 Check this! (Here, we need to recall that 0 < k < n and that σ is injective.)
234 That is,

Wn (σ ) = W0 (σ ) ,
Wn+1 (σ ) = W1 (σ ) ,
Wn+2 (σ ) = W2 (σ ) ,
....

December 25, 2021


Math 235 notes page 380

{W0 (σ) , W1 (σ) , W2 (σ) , . . .} of all windows of σ. Thus, |Bσ | = n (since there are n
windows of σ in total).
Forget that we fixed σ. Thus, for each permutation σ ∈ Sn , we have defined a
collection
Bσ = {W0 (σ) , W1 (σ) , W2 (σ) , . . .} (359)
of “windows of σ”.
We now set 235
s := ∑ ∑ [ I ∈ Bσ ] .
I ∈J σ ∈ Sn

We shall find an upper bound and a lower bound for s, and use them to obtain
an inequality. (If you are feeling a deja-vu here: yes, we are mimicking the above
proof of Theorem 7.9.4.)
To obtain an upper bound, we observe the following:

Claim 1: For any σ ∈ Sn , we have ∑ [ I ∈ Bσ ] ≤ k.


I ∈J

[Proof of Claim 1: Let σ ∈ Sn . Then,

∑ [ I ∈ Bσ ] = (# of all I ∈ J satisfying I ∈ Bσ ) . (360)


I ∈J

(Indeed, this can be proved in the same way as we proved (352) above, except that
we are now using the collection Bσ instead of Cσ .) Thus,

∑ [ I ∈ Bσ ] = (# of all I ∈ J satisfying I ∈ Bσ )
I ∈J
= |J ∩ Bσ | . (361)

In order to prove Claim 1, we need to show that ∑ [ I ∈ Bσ ] ≤ k. In view of (361),


I ∈J
this boils down to showing that

|J ∩ Bσ | ≤ k. (362)

If |J ∩ Bσ | = 0, then this is obvious (since 0 ≤ k). Hence, we WLOG assume that we


don’t have |J ∩ Bσ | = 0. Thus, the set J ∩ Bσ is nonempty. Hence, there exists some
W ∈ J ∩ Bσ . Consider this W. Note that W ∈ J ∩ Bσ ⊆ Bσ = {all windows of σ }; in
other words, W is a window of σ. Hence, W is a k-element set (since any window
of σ is a k-element set). In other words, |W | = k, so that W 6= ∅ (since k is positive).
We shall say that two sets A and B intersect if A ∩ B 6= ∅. We shall also use the
verb “intersect” transitively – i.e., we shall say “A intersects B” (or “B intersects
A”) for “A and B intersect”.

This follows from the fact that the sequence (σ (1) , σ (2) , σ (3) , . . .) is n-periodic.
235 We
use the Iverson bracket notation (Definition 4.3.19).

December 25, 2021


Math 235 notes page 381

If A ∈ J and B ∈ J are two distinct sets, then A ∩ B 6= ∅ (since J is an intersecting


k-collection). In other words, if A ∈ J and B ∈ J are two distinct sets, then A and B
intersect. In other words, any two distinct sets belonging to J intersect. Thus, it is
easy to see that
J ∩ Bσ ⊆ {windows of σ that intersect W } . (363)
[Proof of (363): We must show that W 0 ∈ {windows of σ that intersect W } for
each W 0 ∈ J ∩ Bσ . So let W 0 ∈ J ∩ Bσ . We must show that
W 0 ∈ {windows of σ that intersect W }. In other words, we must show that W 0
is a window of σ that intersects W. It is clear that W 0 is a window of σ (since
W 0 ∈ J ∩ Bσ ⊆ Bσ = {all windows of σ}); hence, it only remains to show that
W 0 intersects W. If W 0 = W, then this is obvious (because in this case, we have
W 0 ∩ W = W 6= ∅). Thus, we WLOG assume that W 0 6= W. We have W ∈ J ∩ Bσ ⊆ J
and W 0 ∈ J ∩ Bσ ⊆ J and W 0 6= W; thus, W and W 0 are two distinct sets belonging to
J. Hence, W and W 0 intersect (since any two distinct sets belonging to J intersect).
In other words, W 0 intersects W. This completes our proof of (363).]
So we have proved (363). In order to prove (362), it thus looks reasonable to ask:
How many windows of σ intersect W ?
The answer is 2k − 1 (which is not hard to check, but too large to be useful), but
it pays off to be more precise.
We have W ∈ Bσ = {W0 (σ ) , W1 (σ ) , W2 (σ) , . . .} (by the definition of Bσ ). In
other words, there exists some i ∈ N satisfying W = Wi (σ). Consider such an i.
We note that if we replace i by i + n, then Wi (σ ) does not change236 . Thus, we can
WLOG assume that i ≥ n (since otherwise, we can replace i by i + n). We have

W = Wi (σ) = {σ (i + 1) , σ (i + 2) , . . . , σ (i + k )}

(by the definition of Wi (σ)). Now, we define the k − 1 windows

L1 = Wi−k+1 (σ) , L2 = Wi−k+2 (σ ) , ..., Lk−1 = Wi−1 (σ )

(that is, L j = Wi−k+ j (σ) for each j ∈ {1, 2, . . . , k − 1}) as well as the k − 1 windows

R1 = Wi+1 (σ) , R2 = Wi+2 (σ) , ..., Rk−1 = Wi+k−1 (σ)

236 because the definition of Wi+n (σ ) yields

Wi+n (σ ) = {σ (i + n + 1) , σ (i + n + 2) , . . . , σ (i + n + k )}
= {σ (i + 1 + n) , σ (i + 2 + n) , . . . , σ (i + k + n)}
= {σ (i + 1) , σ (i + 2) , . . . , σ (i + k)}
!
since the sequence (σ (1) , σ (2) , σ (3) , . . .) is n-periodic,
and thus σ (u + n) = σ (u) for each u ≥ 1
= Wi (σ)

December 25, 2021


Math 235 notes page 382

(that is, R j = Wi+ j (σ ) for each j ∈ {1, 2, . . . , k − 1}). 237 It is easy to see that the
only windows of σ that intersect W are the 2 (k − 1) + 1 windows

L1 , L2 , . . . , Lk−1 , W, R1 , R2 , . . . , Rk−1 .

In other words,

{windows of σ that intersect W } ⊆ { L1 , L2 , . . . , Lk−1 , W, R1 , R2 , . . . , Rk−1 } .

Now, (363) becomes

J ∩ Bσ ⊆ {windows of σ that intersect W }


⊆ { L1 , L2 , . . . , Lk−1 , W, R1 , R2 , . . . , Rk−1 } . (364)

Now, in order to profit from this observation, let us see how many of the 2 (k − 1) +
1 windows L1 , L2 , . . . , Lk−1 , W, R1 , R2 , . . . , Rk−1 can actually belong to J ∩ Bσ .
If j ∈ {1, 2, . . . , k − 1} is arbitrary, then the windows L j and R j are distinct and
do not intersect238 , and thus cannot both belong to J at the same time (since any
two distinct sets belonging to J intersect), and thus cannot both belong to J ∩ Bσ at
237 Let us visualize these 2 (k − 1) windows on an example:
Let n = 8 and k = 3, and let σ ∈ S8 be the permutation that sends 1, 2, 3, 4, 5, 6, 7, 8 to
3, 1, 7, 4, 5, 6, 8, 2, respectively. Let W = W7 (σ ) = {2, 3, 1}. Then, the following picture shows the
2 windows L1 and L2 (in blue) and the 2 windows R1 and R2 (in red) as transparent blobs:

6 2

5 3

4 1

7
.

(The numbers on the circumference of the circle are the values of σ written in clockwise order.
The yellow blob is the window W.) Note that the letter “L” has been chosen because the win-
dows L1 and L2 are “left” (in the sense of “counterclockwise from”, on the circle) of the window
W; likewise the letter “R” stands for “right”. (Furthermore, the colors blue and red have been
chosen to hint at the letters L and R.)
238 Proof. Let j ∈ {1, 2, . . . , k − 1}. The definitions of L and R yield
j j

L j = Wi−k+ j (σ ) = {σ (i − k + j + 1) , σ (i − k + j + 2) , . . . , σ (i + j)} and


R j = Wi+ j (σ ) = {σ (i + j + 1) , σ (i + j + 2) , . . . , σ (i + j + k)} .

December 25, 2021


Math 235 notes page 383

the same time (since J ∩ Bσ ⊆ J). In other words, if j ∈ {1, 2, . . . , k − 1} is arbitrary,


then the collection J ∩ Bσ contains at most one of the two windows L j and R j . In
other words:

• The collection J ∩ Bσ contains at most one of the two windows L1 and R1 .

• The collection J ∩ Bσ contains at most one of the two windows L2 and R2 .

• ...

• The collection J ∩ Bσ contains at most one of the two windows Lk−1 and Rk−1 .

Altogether, this shows that the collection J ∩ Bσ contains at most k − 1 of the


2 (k − 1) windows L1 , R1 , L2 , R2 , . . . , Lk−1 , Rk−1 . Since we further know that the col-
lection J ∩ Bσ contains the window W, we thus conclude that the collection J ∩ Bσ
contains at most (k − 1) + 1 of the 2 (k − 1) + 1 windows L1 , R1 , L2 , R2 , . . . , Lk−1 , Rk−1 , W.
In other words,

|(J ∩ Bσ ) ∩ { L1 , R1 , L2 , R2 , . . . , Lk−1 , Rk−1 , W }| ≤ (k − 1) + 1 = k.

In view of

( J ∩ B σ ) ∩ { L 1 , R 1 , L 2 , R 2 , . . . , L k −1 , R k −1 , W }
| {z }
={ L1 ,L2 ,...,Lk−1 ,W,R1 ,R2 ,...,Rk−1 }
= (J ∩ Bσ ) ∩ { L1 , L2 , . . . , Lk−1 , W, R1 , R2 , . . . , Rk−1 }
= J ∩ Bσ (by (364)) ,

this rewrites as |J ∩ Bσ | ≤ k. This proves (362). As we explained above, this proves


Claim 1.]
Now,

s= ∑ ∑ [ I ∈ Bσ ] = ∑ ∑ [ I ∈ Bσ ]
I ∈J σ ∈ Sn σ ∈ Sn I ∈J
| {z } | {z }
= ∑ ∑ ≤k
σ ∈ Sn I ∈J (by Claim 1)

≤ ∑ k = |Sn | ·k = n! · k. (365)
σ ∈ Sn
|{z}
=n!

Thus we have obtained an upper bound for s.


In order to find a lower bound (better yet: actually a precise value) for s, we will
need the following:
But the 2k “consecutive” values

σ ( i − k + j + 1) , σ ( i − k + j + 2) , . . . , σ ( i + j + k )

of σ are distinct (since n ≥ 2k); thus, the above equalities show that the sets L j and R j are disjoint.
In other words, the sets L j and R j do not intersect. Qed.

December 25, 2021


Math 235 notes page 384

Claim 2: For any I ∈ J, we have ∑ [ I ∈ Bσ ] = n · k! · (n − k )!.


σ ∈ Sn

[Proof of Claim 2: Let I ∈ J. Thus, I is a k-element subset of S (since J is a


collection of k-element subsets of S). In other words, I is a k-element subset of [n]
(since S = [n]). We have

∑ [ I ∈ Bσ ] = (# of all σ ∈ Sn satisfying I ∈ Bσ ) . (366)


σ ∈ Sn

(Indeed, this can be proved in the same way as we proved (355) above, except that
we are now using the collection Bσ instead of Cσ .) Now, how many permutations
σ ∈ Sn satisfy I ∈ Bσ ?
Let σ ∈ Sn be a permutation. Then, Bσ is the collection of all windows of σ; thus,

Bσ = {W0 (σ ) , W1 (σ) , . . . , Wn−1 (σ)}

(since there are n windows of σ in total, and these n windows are precisely
W0 (σ) , W1 (σ) , . . . , Wn−1 (σ)). Thus, we have I ∈ Bσ if and only if we have I =
Wi (σ ) for some i ∈ {0, 1, . . . , n − 1}.
Forget that we fixed σ. We thus have shown that a permutation σ ∈ Sn satisfies
I ∈ Bσ if and only if it satisfies I = Wi (σ ) for some i ∈ {0, 1, . . . , n − 1}. Hence,

(# of all σ ∈ Sn satisfying I ∈ Bσ )
= (# of all σ ∈ Sn satisfying I = Wi (σ) for some i ∈ {0, 1, . . . , n − 1})
n −1
= ∑ (# of all σ ∈ Sn satisfying I = Wi (σ)) . (367)
i =0

(Here, the last equality sign is a consequence of the sum rule, because the sets
{σ ∈ Sn | I = Wi (σ)} for i ∈ {0, 1, . . . , n − 1} are disjoint239 .)
Now, let us fix i ∈ {0, 1, . . . , n − 1}. Then, a permutation σ ∈ Sn satisfying
I = Wi (σ ) can be constructed using the following decision procedure:

• First, we choose the k values σ (i + 1) , σ (i + 2) , . . . , σ (i + k ) of σ (in this or-


der). These k values must belong to the k-element subset I of [n] (since we
want to have I = Wi (σ ) = {σ (i + 1) , σ (i + 2) , . . . , σ (i + k )}) and be distinct
(since σ needs to be injective). Thus, we have k options for the first of these
values, k − 1 options for the second, k − 2 for the third, and so on.

239 Proof.Assume the contrary. Thus, these sets are not disjoint. In other words, there exists a
permutation σ ∈ Sn that satisfies I = Wi (σ ) for two different values of i ∈ {0, 1, . . . , n − 1}.
Consider this σ. We have seen above that the first n windows W0 (σ ) , W1 (σ ) , . . . , Wn−1 (σ )
of σ are distinct. However, two of these n windows equal I (since σ satisfies I = Wi (σ) for
two different values of i ∈ {0, 1, . . . , n − 1}). Therefore, two of these n windows are equal.
This contradicts the fact that these n windows are distinct. This contradiction shows that our
assumption was false, qed.

December 25, 2021


Math 235 notes page 385

Once these choices are made, we have assigned k distinct elements of the set
I as values σ (i + 1) , σ (i + 2) , . . . , σ (i + k). Thus, by the pigeonhole principle
for injections, each of the k elements of I has been assigned as one of the k
values σ (i + 1) , σ (i + 2) , . . . , σ (i + k ) (since I is a k-element set). We have
therefore ensured that I = {σ (i + 1) , σ (i + 2) , . . . , σ (i + k )} = Wi (σ). We
still need to choose the remaining n − k values of σ, though.
• Next, we choose the remaining n − k values σ (i + k + 1) , σ (i + k + 2) , . . . , σ (i + n)
of σ (in this order). These n − k values must be elements of [n] that are dis-
tinct from each other and from the already chosen k values; thus, we have
n − k options for the first of them, n − k − 1 options for the second, n − k − 2
options for the third, and so on.

According to the dependent product rule, the total # of possibilities for making
these choices is

k (k − 1) (k − 2) · · · 1 · (n − k ) (n − k − 1) · · · 1 = k! · (n − k )!.
| {z } | {z }
=1·2·····k =1·2·····(n−k)
=k! =(n−k)!

Hence,

(# of all σ ∈ Sn satisfying I = Wi (σ))


= k! · (n − k)!. (368)

Now, forget that we fixed i. We thus have proved (368) for each i ∈ {0, 1, . . . , n − 1}.
Now, (366) becomes

∑ [ I ∈ Bσ ] = (# of all σ ∈ Sn satisfying I ∈ Bσ )
σ ∈ Sn
n −1
= ∑ (|# of all σ ∈ Sn satisfying I = Wi (σ)) (by (367))
i =0
{z }
=k!·(n−k)!
(by (368))
n −1
= ∑ k! · (n − k)! = n · k! · (n − k)!.
i =0

This proves Claim 2.]


Now,

s= ∑ ∑ [ I ∈ Bσ ] = ∑ n · k! · (n − k)! = |J| · n · k! · (n − k)!.


I ∈J σ ∈ Sn I ∈J
| {z }
=n·k!·(n−k)!
(by Claim 2)

Hence,
|J| · n · k! · (n − k)! = s ≤ n! · k (by (365)) .

December 25, 2021


Math 235 notes page 386

Dividing this inequality by n · k! · (n − k )!, we obtain

n! · k n−1
   
k n! k n
|J| ≤ = · = =
n · k! · (n − k )! n k! · (n − k )! n k k−1
| {z  }
n
=
k
(by Theorem 4.3.8)

(by Exercise 4.5.4 (a), applied to m = k). This proves Theorem 7.9.16 (a).

December 25, 2021


Math 235 notes page 387

8. Invariants and Monovariants


Mathematicians frequently study “dynamical” objects, i.e., objects that change with
time: games, algorithms, recursively defined sequences240 . We shall refer to such
things as processes. A process is called deterministic if its state at a given time is
uniquely determined by its states at the previous times; otherwise it is called non-
deterministic. For example, computing the Fibonacci numbers f 0 , f 1 , f 2 , . . . one by
one using their recursive definition is a deterministic process, whereas casting a
die multiple times and summing the scores is a nondeterministic process. We shall
restrict our attention to processes with precisely defined states (which the object
can have at any given time) and precisely defined moves (i.e., ways in which the ob-
ject can change from one moment to the other; i.e., allowable transitions between
states). For example, let us formalize “the process of computing the Fibonacci num-
bers f 0 , f 1 , f 2 , . . . one by one using their recursive definition” as a precise process:

• Its states are finite tuples ( a1 , a2 , . . . , ak ) of integers with at least 2 entries (i.e.,
with k ≥ 2).

• Its moves are to insert a new entry ak + ak−1 at the end of a given tuple
( a1 , a2 , . . . , a k ).

Thus, if we start this process with the state (0, 1), then we will arrive at the state
(0, 1, 1) after one move, then at the state (0, 1, 1, 2) after another move, then at the
state (0, 1, 1, 2, 3) after a third move, and so on. After n moves, our state will be the
(n + 2)-tuple ( f 0 , f 1 , . . . , f n+1 ). Note that the state will never be the entire Fibonacci
sequence ( f 0 , f 1 , f 2 , . . .), since a state is always a finite tuple; but each Fibonacci
number will eventually appear in the state. Of course, the same process (with a
different starting state) can be used to compute not just the Fibonacci sequence, but
any (1, 1)-recurrent sequence.
Given a process, we can ask several questions about it:

• Can a certain state ever be reached by the process from a given starting state?

• What states can be reached at all?

• Does the process exhibit periodic behavior (i.e., do its states form a periodic
sequence)?

• Is the process reversible? That is, is there a way to reconstruct a state from
the next state?

• What things stay unchanged throughout the process?

• What things change only in one direction (i.e., only get smaller or only get
larger) throughout the process?
240 or their continuous analogues: functions defined as solutions to differential equations

December 25, 2021


Math 235 notes page 388

The last two questions in this list are sufficiently important that they have names.
Things that stay unchanged during a process are called invariants (or conserved quan-
tities) of this process; things that change only in one direction (e.g., only get smaller,
or only get larger) are called monovariants. In many cases, finding invariants or
monovariants (or both) is not just interesting in itself, but also helps answering
some of the other questions (for example, knowing that some quantity decreases at
each step of the process immediately guarantees that the process does not return
to any previous state). Here are some examples that you may have seen:

• The Euclidean algorithm for computing the gcd of two nonnegative integers
rests on the fact that if we subtract an integer from another (i.e., replace a pair
( a, b) of integers by ( a − b, b) or by ( a, b − a)), then the gcd of the two integers
does not change. In other words, the gcd is an invariant of the subtraction
operation that keeps getting used in the algorithm.241 More generally, almost
all nontrivial algorithms in mathematics are analyzed with the help of loop
invariants, which are things (e.g., quantities or statements) that never change
when the algorithm is performed.

• Proposition 2.2.4 can be restated as follows: If a positive integer can only


change by 1 (upwards or downwards) but is not allowed to ever become 0,
then it always remains positive. Thus, its sign is an invariant.

• In the Euclidean algorithm, the sum of the two nonnegative integers decreases
at each step. Thus, it is a monovariant. (This is why the Euclidean algorithm
terminates.)

• In Exercise 1.1.5, lemmings can fall off the cliff but never come back. Thus,
the number of lemmings on the cliff is a monovariant: it can only decrease.

• The monotone convergence theorem says that a sequence of real numbers


that is increasing and bounded from above converges to its supremum. The
“increasing” condition here can be viewed as a monovariant (viz., the en-
tries of the sequence increase as we move along the sequence), whereas the
“bounded” condition can be viewed as an invariant (viz., the entries remain
≤ to the bound, no matter where we stand in the sequence). Thus, the mono-
tone convergence theorem is one way in which monovariants and invariants
can be useful.

• Our solutions to Exercise 3.7.10 illustrate various uses of invariants and mono-
variants. (For example, in the first solution, the comb number is a monovari-
ant, whereas the number of 1s in the bitstring is an invariant. In the second
solution, load a is a monovariant, and ones a is an invariant.)
241 There are actually two versions of the Euclidean algorithm: In one version, the smaller integer
keeps getting subtracted from the larger integer; in the other version, the larger integer keeps
getting divided with remainder by the smaller integer. The gcd is an invariant for both of these
versions.

December 25, 2021


Math 235 notes page 389

Physics has its share of invariants and monovariants, too (e.g., energy and mo-
mentum are famous invariants, while entropy is a monovariant).
There is no general theory of how to construct invariants and monovariants,
let alone find specific ones that are useful for a given problem. Doing so often
requires ingenuity, experience and luck. The best we can do is show some examples
and discuss some common threads. More can be found in [Engel98, Chapter 1],
[GelAnd17, §1.5], [Grinbe08, Kapitel 4], [Carl17, Kapitel 5] and [Zeitz17, §3.4].242

8.1. Invariants
We begin by illustrating the use of invariants on some examples. See [LeLeMe16,
§6.1] for a brief but rigorous introduction.

8.1.1. Simple examples


We begin with a classical simple exercise ([Grinbe08, Aufgabe 4.1]):

Exercise 8.1.1. A chunk of ice is floating in the sea. At each moment, a chunk
can break into 3 or into 5 smaller chunks. Assuming that no chunks can ever
melt, is it possible that there are precisely 100 chunks left after some time has
passed?

Solution to Exercise 8.1.1 (sketched). No.


Proof. At the beginning, there is only 1 chunk of ice; thus, the total number of
chunks is odd. Each time a chunk breaks apart, the number of chunks increases by
2 or by 4 (since the chunk breaks into 3 or into 5 smaller chunks); thus, the total
number of chunks remains odd (because increasing an odd number by 2 or by 4
preserves its oddness). Thus, the total number of chunk can never become 100.
This proves our negative answer.
The next exercise is [Grinbe08, Aufgabe 4.2]:

Exercise 8.1.2. Fix a positive integer n.


(a) You have the n numbers 1, 2, . . . , n written on a blackboard. In one move,
you can erase two numbers a and b and write the number a + b instead.
You keep making these moves until only one number is left on the blackboard.
Prove that this will happen after precisely n − 1 moves. Will the remaining num-
ber depend on the specific moves you have taken? If not, what is this number?
(b) Answer the same questions if a + b is replaced by a − b.
(c) Answer the same questions if a + b is replaced by ab.
(d) Answer the same questions if a + b is replaced by a + b + 5.
(e) Answer the same questions if a + b is replaced by ab + a + b.
(f) Answer the same questions if a + b is replaced by a2 + b2 .
242 Manyof the following examples are taken from [Engel98, Chapter 1], [Grinbe08, Kapitel 4] and
from the Russian problem database http://www.problems.ru/ .

December 25, 2021


Math 235 notes page 390

Solution to Exercise 8.1.2 (sketched). (a) Every move decreases the number of num-
bers written on the table by 1. Since this number was n at the onset, it is thus clear
that it will take precisely n − 1 moves to reduce it down to 1. Thus, after precisely
n − 1 moves, only one number will be left on the blackboard.
Now, we claim that this number is 1 + 2 + · · · + n. In fact, each of our moves
leaves the sum of all numbers on the blackboard unchanged (because it removes
two addends a and b and inserts the addend a + b instead). Since this sum was
1 + 2 + · · · + n at the onset, it will therefore remain 1 + 2 + · · · + n throughout the
procedure, and thus will still be 1 + 2 + · · · + n at the end. But since there is only
one number left on the blackboard at the end, this means that this number will
have to be 1 + 2 + · · · + n. Thus, in particular, this number will not depend on the
specific moves taken. Thus, Exercise 8.1.2 (a) is solved.
(b) Again, we can show (as in our above solution to Exercise 8.1.2 (a)) that after
precisely n − 1 moves, only one number will be left on the blackboard. However,
this time, this number may well depend on the specific moves taken. This does in
fact happen already for n = 2, since the two numbers 1 and 2 can be replaced by
any of 1 − 2 = −1 and 2 − 1 = +1 (depending on which of them we take to be a
and which we take to be b). Thus, Exercise 8.1.2 (b) is solved.
(c) This can be solved in the exact same way as Exercise 8.1.2 (a), except that
all sums need to be replaced by products. Thus, the number that remains on the
blackboard after n − 1 moves are made is not 1 + 2 + · · · + n but 1 · 2 · · · · · n = n!.
(But it still does not depend on the specific moves taken.) Thus, Exercise 8.1.2 (c) is
solved.
(d) Again, we can show (as in our above solution to Exercise 8.1.2 (a)) that after
precisely n − 1 moves, only one number will be left on the blackboard. Again, this
remaining number does not depend on the specific moves taken; but this time, this
is a bit trickier to prove. Namely: We define the weird-sum of k numbers a1 , a2 , . . . , ak
to be the number ( a1 + 5) + ( a2 + 5) + · · · + ( ak + 5). Then, each of our moves
leaves the weird-sum of the numbers on the blackboard unchanged (indeed, the
move removes two addends of the form a + 5 and b + 5 from this weird-sum, and
replaces them with the addend ( a + b + 5) + 5; but this new addend clearly has
the same effect as the two addends that were removed, because ( a + 5) + (b + 5) =
a + b + 10 = ( a + b + 5) + 5). Since this weird-sum was

(1 + 5) + (2 + 5) + · · · + (n + 5) = (1 + 2 + · · · + n) + 5n
at the onset, it will therefore remain (1 + 2 + · · · + n) + 5n throughout the proce-
dure, and thus will still be (1 + 2 + · · · + n) + 5n at the end. But since there is only
one number left on the blackboard at the end, this means that this number will
have to be (1 + 2 + · · · + n) + 5n − 5 (because the weird-sum of a single number a
is a + 5). Thus, in particular, this number will not depend on the specific moves
taken. Thus, Exercise 8.1.2 (d) is solved.
(e) Again, we can show (as in our above solution to Exercise 8.1.2 (a)) that after
precisely n − 1 moves, only one number will be left on the blackboard. Again,
this remaining number does not depend on the specific moves taken; but this time,

December 25, 2021


Math 235 notes page 391

this is a bit trickier to prove. Namely: We define the weird-product of k numbers


a1 , a2 , . . . , ak to be the number ( a1 + 1) ( a2 + 1) · · · ( ak + 1). Then, each of our moves
leaves the weird-product of the numbers on the blackboard unchanged (indeed,
the move removes two factors of the form a + 1 and b + 1 from this weird-product,
and replaces them with the factor ( ab + a + b) + 1; but this new factor clearly has
the same effect as the two factors that were removed, because ( a + 1) (b + 1) =
ab + a + b + 1 = ( ab + a + b) + 1). Since this weird-product was

1 · 2 · · · · · ( n + 1)
(1 + 1) (2 + 1) · · · ( n + 1) = 2 · 3 · · · · · ( n + 1) =
1
= 1 · 2 · · · · · ( n + 1) = ( n + 1) !

at the onset, it will therefore remain (n + 1)! throughout the procedure, and thus
will still be (n + 1)! at the end. But since there is only one number left on the
blackboard at the end, this means that this number will have to be (n + 1)! − 1
(because the weird-product of a single number a is a + 1). Thus, in particular, this
number will not depend on the specific moves taken. Thus, Exercise 8.1.2 (e) is
solved.
(f) Again, we can show (as in our above solution to Exercise 8.1.2 (a)) that after
precisely n − 1 moves, only one number will be left on the blackboard. However,
this time, this number may well depend on the specific moves taken. For example,
2 2
if n = 3, then we can get either 12 + 22 + 32 = 34 or 12 + 22 + 32 = 170
depending on what move we do first. Thus, Exercise 8.1.2 (f) is solved.
Parity-related invariants are particularly common in contest problems. Here is
an example:

Exercise 8.1.3. The numbers 1, 2, . . . , 100 are written in a row (in this order, from
left to right). In a move, you can swap any two numbers at a distance of 2 (i.e.,
any two numbers that have exactly one number written between them). Can
you end up with the numbers 100, 99, . . . , 1 (in this order, from left to right) by a
sequence of such moves?
[Example: The analogous question for 5 instead of 100 has a positive answer:

swap first and swap third and


third numbers fifth numbers
(1, 2, 3, 4, 5) −→ (3, 2, 1, 4, 5) −→ (3, 2, 5, 4, 1)

swap second and swap first and


fourth numbers third numbers
−→ (3, 4, 5, 2, 1) −→ (5, 4, 3, 2, 1) .

Solution to Exercise 8.1.3 (sketched). No, you cannot.

December 25, 2021


Math 235 notes page 392

Proof. We define the position of a number i ∈ [100] to be the (unique) j ∈ [100]


with the property that i is the j-th number from the left on our row. Thus, at the
beginning, each number i ∈ [100] stands in position i. Hence, in particular, the
number 1 is in an odd position (namely, in position 1) at the beginning.
Of course, the positions of our numbers can change when you make moves.
Namely, when you make a move, each number moves precisely 2 positions to the
right or 2 positions to the left or not at all.243 Hence, when you make a move,
the position of each number does not change its parity (i.e., it stays even if it was
even, and it stays odd if it was odd). Thus, in particular, the position of 1 does not
change its parity under any move. Thus, after any sequence of moves, the number
1 will still be in an odd position (since 1 was in an odd position at the beginning).
Hence, in particular, the number 1 will never be in position 100 (since 100 is not
odd). Therefore, you will never end up with the numbers 100, 99, . . . , 1 (in this
order, from left to right), because this would entail the number 1 being in position
100. This concludes our proof.

8.1.2. More examples


Here are some trickier problems that can be solved with invariants. The following
exercise ([Grinbe08, Aufgabe 4.6], somewhat generalized) is a Russian olympiad
classic:

Exercise 8.1.4. Let n ≥ 2 be an integer. Consider n trees arranged in a circle.


Initially, there is one sparrow sitting on each tree. Every minute, two of the n
sparrows move: Namely, one sparrow moves to the next tree in clockwise order,
whereas the other sparrow moves to the next tree in counterclockwise order. (The
two moves are simultaneous. Any tree can fit an arbitrary number of sparrows,
including 0.)
Is it possible that, after some time, all sparrows end up on the same tree?
Answer this question depending on n.
[Example: For n = 5, the answer is “yes”. Indeed, here is a way how the

243 For example, the move that transforms (1, 2, 3, 4, 5) into (3, 2, 1, 4, 5) causes the number 1 to move
precisely 2 positions to the right and causes the number 3 to move precisely 2 positions to the
left, and leaves all remaining numbers unmoved.

December 25, 2021


Math 235 notes page 393

sparrows can end up on the same tree after 3 minutes:

0
1 2
1
0 →
1 →
1
1
2
1

0
1 0
0
0 →
0
3
5
1
0

(where the five points are the five trees, and the number at each point is counting
the sparrows on that tree; furthermore, the red arrows are showing where the
sparrows will move in the next step).]

Solution to Exercise 8.1.4 (sketched). Yes if n is odd; no if n is even.


Proof. The pair of simultaneous moves that happens every minute (i.e., one spar-
row moving one tree clockwise, and another sparrow moving one tree counter-
clockwise) will be called a bimove. Thus, we must prove the following two claims:

Claim 1: Assume that n is odd. Then, there is a sequence of bimoves


that results in all sparrows sitting on the same tree.

Claim 2: Assume that n is even. Then, there is no sequence of bimoves


that results in all sparrows sitting on the same tree.

[Proof of Claim 1: The following is a generalization of the movements shown in


the example in the statement of the exercise.
We write n in the form n = 2m + 1 for some m ∈ N. (Such an m can be found,
since n is an odd positive integer.) Thus, we have 2m + 1 trees. We label these trees
with the numbers −m, −m + 1, . . . , m − 1, m in clockwise order (starting at some
randomly chosen tree). Initially, each tree has one sparrow sitting in it.
Now, the sparrows make the following bimoves:

December 25, 2021


Math 235 notes page 394

• First, the sparrow on tree −m and the sparrow on tree m move to the trees
−m + 1 and m − 1, respectively244 . Now, trees −m and m are empty.
• Now, we have two sparrows on tree −m + 1 and two sparrows on tree m − 1.
These four sparrows move to the trees −m + 2 and m − 2 (first one pair, then
the other)245 . Now, trees −m + 1 and m − 1 are empty.

• Now, we have three sparrows on tree −m + 2 and three sparrows on tree


m − 2. These six sparrows move to the trees −m + 3 and m − 3 (first one pair,
then another, then the last remaining pair). Now, trees −m + 2 and m − 2 are
empty.

• Now, we have four sparrows on tree −m + 3 and four sparrows on tree m − 3.


These eight sparrows move to the trees −m + 4 and m − 4 (in pairs of two).
Now, trees −m + 3 and m − 3 are empty.

• And so on, until all trees other than tree 0 are empty. At this point, all
sparrows have arrived on tree 0.

Thus, Claim 1 is proven.]


[Proof of Claim 2: Let us label the n trees with the numbers 1, 2, . . . , n in clockwise
order (starting at some randomly chosen tree). A placement of sparrows on trees
(with each sparrow being on one tree) will be called a state. Thus, our initial state
has one sparrow on each of the trees 1, 2, . . . , n.
If S is a state, then we define the charge c (S) of S to be the sum

∑ tS (s) ,
s is a sparrow

where tS (s) is the number of the tree on which the sparrow s sits in the state S.
Thus, the charge of the initial state is 1 + 2 + · · · + n (since the sparrows in the
initial state sit on the trees 1, 2, . . . , n).
Clearly, a bimove transforms a state into another state. Now, the crucial obser-
vation is the following: When a state is transformed by a bimove, the charge of
the state either does not change or changes by n (in one or the other direction). In
order to convince ourselves of this, we let α and β be the two sparrows that move
in the bimove (where α is the sparrow that moves clockwise, and β is the sparrow
that moves counterclockwise), and we let i and j be the two trees on which they
were sitting before the bimove. Now, we analyze four possible cases:

244 These movements can be achieved by a single bimove, since tree −m + 1 is the next tree from
tree −m in clockwise order, whereas tree m − 1 is the next tree from tree m in counterclockwise
order.
245 These movements can be achieved by two bimoves, since tree − m + 2 is the next tree from tree

−m + 1 in clockwise order, whereas tree m − 2 is the next tree from tree m − 1 in counterclockwise
order.

December 25, 2021


Math 235 notes page 395

• If i < n and j > 1, then the sparrows α and β are sitting on trees i + 1 and
j − 1 after the bimove. Thus, in this case, the charge of the state increases by
(i + 1) + ( j − 1) − i − j = 0. In other words, the charge does not change.
• If i = n and j > 1, then the sparrows α and β are sitting on trees 1 and
j − 1 after the bimove. Thus, in this case, the charge of the state increases
by246 1 + ( j − 1) − i − j = −i = −n (since i = n). In other words, the charge
decreases by n.

• If i < n and j = 1, then the sparrows α and β are sitting on trees i + 1 and
n after the bimove. Thus, in this case, the charge of the state increases by
(i + 1) + n − i − j = n + 1 − j = n + 1 − 1 = n. In other words, the charge
|{z}
=1
increases by n.

• If i = n and j = 1, then the sparrows α and β are sitting on trees 1 and


n after the bimove. Thus, in this case, the charge of the state increases by
1 + n − |{z}
i − j = 1 + n − n − 1 = 0. In other words, the charge does not
|{z}
=n =1
change.

Thus, in each of the four cases, the charge either does not change or changes by n.
Therefore, the charge after the bimove is congruent to the charge before the bimove
modulo n. In other words, the two charges leave the same remainder when divided
by n.
Thus we have shown that a bimove does not change the remainder that the
charge of the state leaves when divided by n. Since the charge of the initial state is
1 + 2 + · · · + n, we thus conclude that the charge of any state that can be achieved
by a sequence of bimoves will still leave the same remainder when divided by n as
1 + 2 + · · · + n does.
Now, let us look at a state where all sparrows sit on the same tree. If this tree is
tree i, then the charge of the state is ∑ i = ni (since there are n sparrows).
s is a sparrow
Thus, if we can achieve this state by a sequence of bimoves, then ni must leave
the same remainder when divided by n as 1 + 2 + · · · + n does (according to the
previous paragraph). In other words, if we can achieve this state by a sequence
of bimoves, then we must have ni ≡ 1 + 2 + · · · + n mod n. Therefore, if we can
achieve this state by a sequence of bimoves, then we must have 1 + 2 + · · · + n ≡
ni ≡ 0 mod n (since n | ni).

246 Theword “increase” is being understood in the wide sense here: To increase a number by k
means to add k to the number, whether or not k is positive. Thus, “increase by −5” is simply
another way to say “decrease by 5”.

December 25, 2021


Math 235 notes page 396

However, we do not have 1 + 2 + · · · + n ≡ 0 mod n. Indeed, we have


 
n ( n + 1) n n
1+2+···+n = = ·  |{z}
n +1 ≡ · (0 + 1)
2 2 2 | {z }
|{z} ≡0 mod n =1
This is an integer
(since n is even)
n
= 6≡ 0 mod n.
2
Thus, the previous paragraph lets us conclude that we cannot achieve a state where
all sparrows sit on the same tree. This proves Claim 2.]
Thus, Exercise 8.1.4 is solved.
Here is another classical exercise:
Exercise 8.1.5. Let n ≥ 3 and m ≥ 3 be two integers. You have a rectangular
n × m-grid of lamps (i.e., a table with n rows and m columns, with a lamp in
each of its nm cells). Initially, all nm lamps are off. In a move, you can choose a
row or a column of the grid, and flip all lamps in this row or column. (To “flip” a
lamp means to turn it on if it was off, and to turn it off if it was on.) Can you, by
some sequence of moves, obtain a state in which the four corner lamps (i.e., the
lamps in the four corner cells of the grid) are on whereas all remaining lamps
are off?
[Example: Let us represent a lamp turned off by the number 0, and a lamp
turned on by the number 1. Then, for n = 3 and m = 4, here is the starting state:

0 0 0 0
0 0 0 0 .
0 0 0 0

One possible move is to flip all lamps in the third column (from the left). This
results in
0 0 1 0
0 0 1 0 .
0 0 1 0
From this state, one possible further move is to flip all lamps in the second row.
This results in
0 0 1 0
1 1 0 1 .
0 0 1 0
(Note that the third lamp in the second row is now turned off again, since it has
been flipped twice.)]

December 25, 2021


Math 235 notes page 397

Solution to Exercise 8.1.5 (sketched). No, you cannot.


Proof. Consider the four lamps in the upper-left corner (i.e., at the intersection of
the topmost two rows with the leftmost two columns). Call these four lamps the
special lamps. For example, in the case when n = 3 and m = 4, here are the four
special lamps (marked with asterisks):

∗ ∗
∗ ∗

Each move either leaves the states of the four special lamps unchanged, or flips
exactly two of them247 . Thus, the number of special lamps that are on either re-
mains unchanged or changes by 2 (in one or the other direction) when a move is
made248 . Therefore, the parity of this number never changes (i.e., if it was even,
then it stays even; if it was odd, then it stays odd). But at the onset, this number
was even (because at the onset, all four special lamps were off). Hence, after any
sequence of moves, the number of special lamps that are on will remain even. Thus,
in particular, it is impossible to achieve a state in which the four corner lamps are
on whereas all remaining lamps are off (because such a state would have exactly 1
special lamp that is on249 ). This solves Exercise 8.1.5.

Remark 8.1.1. Let us consider the lamp-flipping “game” from Exercise 8.1.5 a
bit further. What is the total number of possible states that can be achieved by a
sequence of moves (starting with the initial state in which all lamps are turned
off)?

247 Indeed, this can be verified case by case:

• If the move flips one of the topmost two rows, then exactly two special lamps get flipped.
• If the move flips any other row, then none of the special lamps get flipped, so the states
of the four special lamps remain unchanged.
• If the move flips one of the leftmost two columns, then exactly two special lamps get
flipped.
• If the move flips any other column, then none of the special lamps get flipped, so the
states of the four special lamps remain unchanged.

248 Proof: Consider a move. As we have just seen, this move either leaves the states of the four special
lamps unchanged, or flips exactly two of them. If it leaves the states of the four special lamps
unchanged, then the number of special lamps that are on clearly remains unchanged. On the
other hand, if the move flips exactly two of the four special lamps, then the number of special
lamps that are on increases by 2 (if the two special lamps it flips were both off) or decreases by
2 (if the two special lamps it flips were both on) or remains unchanged (if the two special lamps
it flips were in different states – i.e., one of them was on and the other was off).
249 Here we are using the assumptions n ≥ 3 and m ≥ 3. If you don’t see why, ask yourself why

only one of the four corner lamps is special!

December 25, 2021


Math 235 notes page 398

Here is an outline of a solution to this question. We shall refer to rows and


columns of our grid as lines. Thus, the grid has n + m lines in total (viz., its n
rows and its m columns). It is easy to see that the order of moves does not matter:
If we are flipping two lines, it does not matter which of them we are flipping first.
(Here, “flipping a line” means flipping every lamp on this line.) Furthermore, if
we flip a line twice, we return to the state we had before the flipping (because
every lamp on the line has been flipped twice). Thus, any state that can be
achieved by a sequence of moves can also be achieved by a sequence of moves in
which each line is flipped at most once. Moreover, the order of the moves does
not matter. The total number of such sequences (without accounting for the
order of moves) is 2n+m , since we just need to decide which of the n + m lines
we flip. However, not all of the 2n+m such sequences result in different states;
for example, if we flip every line, the result is the original state (as if we hadn’t
flipped anything). It turns out that flipping the last column is unnecessary:
The effect of flipping the last column is identical with the effect of flipping all
remaining lines. Hence, we only need to consider sequences of moves in which
each line is flipped at most once, and the last column is not flipped at all. There
are 2n+m−1 such sequences, and moreover it can be shown that they all produce
different states. (Why? Hint: Look at the effect on the last column.)
Hence, the total number of states that can be achieved by a sequence of moves
is 2n+m−1 . This is a far cry from the total number of possible states (which is
2nm , since each of the nm lamps can be either on or off).

The next exercise is [Engel98, Chapter 1, Example E2]:

Exercise 8.1.6. Let n be an odd positive integer. You have the 2n numbers
1, 2, . . . , 2n written on a blackboard. In one move, you can erase two numbers a
and b and write the number | a − b| instead. You keep doing this until only one
number remains. Prove that this remaining number will be odd.

First solution to Exercise 8.1.6 (sketched). In the initial state of the blackboard (i.e., be-
fore you make any moves), all numbers on the blackboard are integers (in fact, they
are 1, 2, . . . , 2n in the initial state). Thus, even after you start making moves, all
numbers on the blackboard remain integers (because any move applied to integers
only produces integers).
We define the board sum to be the sum of all numbers on the blackboard. In the
initial state of the blackboard, this board sum is
2n (2n + 1)
1 + 2 + · · · + 2n = (by (9), applied to 2n instead of n)
2  

= n
|{z}
 2n +1 ≡ 1 (0 + 1) = 1 mod 2.
|{z}
≡1 mod 2 ≡0 mod 2
(since n is odd)

In other words, in the initial state, the board sum is odd.

December 25, 2021


Math 235 notes page 399

Now, it is not hard to see that (in general) a move will change the board sum.
However, the parity of the board sum will remain unchanged. In order to see this,
we need a few auxiliary observations: We first notice that every integer x satisfies
| x | ≡ x mod 2. (369)
(Indeed, if x is an integer, then | x | is always either x or − x; however, both x and
− x are congruent to x modulo 2. Thus, (369) follows.) Now, if a and b are any two
integers, then we have
−a − b + | a − b| ≡ − a − b + ( a − b) = −2b ≡ 0 mod 2,
| {z }
≡ a−b mod 2
(by (369)
(applied to x = a−b))

and thus
the integer − a − b + | a − b| is even. (370)
Now, if you apply a move, then you erase two numbers a and b from the blackboard
and write the number | a − b| instead; as a result, the board sum increases250 by
− a − b + | a − b|. Since − a − b + | a − b| is even (by (370), because a and b are
integers), this entails that the board sum increases by an even integer. Hence, the
parity of the board sum does not change.
Now, we have seen two things:
• In the initial state, the board sum is odd.
• The parity of the board sum does not change when we make a move.
Hence, after any number of moves, the board sum remains odd. Thus, the board
sum will still be odd at the very end of the process, when there is only one number
left on the blackboard. But this means that the number left on the blackboard is odd
(because the board sum at that point will be that single number). Thus, Exercise
8.1.6 is solved.
Second solution to Exercise 8.1.6 (sketched). Just as in the first solution above, we can
see that all the numbers on the blackboard remain integers (even after you start
making moves).
The odd-count will mean the number of odd numbers on the blackboard. In the
initial state of the blackboard, this odd-count is n, since exactly n of the 2n numbers
1, 2, . . . , 2n are odd. Now, how does the odd-count change when a move is applied?
• If you apply a move that erases an even number a and an even number b,
then the new number | a − b| written on the board in this move is even (since
a and b are even, so that a − b is even), and thus the odd-count remains the
same (since no odd numbers were erased and no odd numbers were written).
250 Theword “increase” is being understood in the wide sense here: To increase a number by k
means to add k to the number, whether or not k is positive. Thus, “increase by −5” is simply
another way to say “decrease by 5”.

December 25, 2021


Math 235 notes page 400

• If you apply a move that erases an even number a and an odd number b, then
the new number | a − b| written on the board in this move is odd (since a is
even and b is odd, so that a − b is odd), and thus the odd-count remains the
same (since one odd number was erased and one odd number was written).

• If you apply a move that erases an odd number a and an even number b, then
the odd-count also remains the same (this is proved just as the preceding
claim).

• If you apply a move that erases an odd number a and an odd number b, then
the new number | a − b| written on the board in this move is even (since a and
b are odd, so that a − b is even), and thus the odd-count decreases by 2 (since
two odd numbers were erased but no odd numbers were written).

Combining these four observations, we see that if you apply a move, then the
odd-count either remains the same or decreases by 2. Thus, the parity of the odd-
count never changes. But we know that the odd-count was odd in the initial state
(in fact, the odd-count was n in the initial state, but n is odd). Hence, the odd-count
must remain odd throughout the process (since its parity never changes). Hence, at
the end of the process, when there is only one number left on the blackboard, the
odd-count will still be odd. But this means that the number left on the blackboard
is odd (because if it was even, then there would be no odd number left on the
blackboard; but this would cause the odd-count to be 0, which would contradict
the fact that it is odd). This solves Exercise 8.1.6 again.
Finally, here is a quickie problem (a popular puzzle in Russia, commonly as-
cribed to I. M. Gelfand) which shows that even the simplest processes can have
useful invariants:

Exercise 8.1.7. A milk cup contains 200 ml of milk; a tea cup contains 200 ml of
tea. You take a full spoon of milk from the milk cup and pour it into the tea cup;
then you stir the latter cup. Then you take a full spoon of milk-tea mixture from
the tea cup and pour it back into the milk cup. What is larger now: the amount
of milk in the tea cup, or the amount of tea in the milk cup?

Solution to Exercise 8.1.7 (sketched). The two amounts are the same.
Proof. Let us introduce some notations:

• Let m be the amount of milk in the milk cup (after the pourings have been
done).

• Let m0 be the amount of milk in the tea cup (after the pourings have been
done).

• Let t be the amount of tea in the tea cup (after the pourings have been done).

December 25, 2021


Math 235 notes page 401

• Let t0 be the amount of tea in the milk cup (after the pourings have been
done).

We thus need to show that m0 = t0 .


Invariants come to our help here: The total quantity of milk does not change;
thus, m + m0 = 200 ml (since the total quantity of milk was 200 ml before the pour-
ings, and is now m + m0 after the pourings). Similarly, t + t0 = 200 ml. Hence,
m + m0 = 200 ml = t + t0 . Also, the two cups have the same quantity of fluid (after
the pourings have been done), because one full spoon was transferred from one to
the other and then one full spoon was transferred backwards (so each cup has lost
as much fluid as it has gained). Hence, m + t0 = t + m0 (since m + t0 is the quantity
of fluid in the milk cup, and t + m0 is the quantity of fluid in the tea cup). In other
words, m − m0 = t − t0 . Subtracting this equality from m + m0 = t + t0 , we obtain
(m + m0 ) − (m − m0 ) = (t + t0 ) − (t − t0 ). This simplifies to 2m0 = 2t0 . In other
words, m0 = t0 . This proves our claim.
[Remark: Note that it doesn’t matter whether the tea and the milk in the tea cup
have mixed properly when we stirred them! Even if the spoon we have taken back
from the tea cup was mostly milk, the argument still remains valid, and the answer
is the same.]

8.1.3. Applications to sequence integrality


Let us now briefly return to a topic we have already discussed before (particularly
in Section 4.11): the phenomenon in which a sequence defined recursively turns
out to consist of integers even though its recursive definition involves division. We
shall now see a few more instances of this phenomenon; it turns out that invariants
can be quite useful in proving these.
We begin with the following ([Gale98, Chapter 4, (2)]):

Exercise 8.1.8. Fix a positive integer k ≥ 2. Define a sequence ( a0 , a1 , a2 , . . .) of


positive rational numbers recursively by setting

an = 1 for each n < k (371)

and
a2n−1 + a2n−2 + · · · + a2n−k+1
an = (372)
an−k
for each n ≥ k.

a2k−1 + a2k−2 + · · · + a21 12 + 12 + · · · + 12


(For example, ak = = = k − 1.)
a0 1
Prove that an is a positive integer for each integer n ≥ 0.

Solution to Exercise 8.1.8. Let us first play around with the recursive equation (372).

December 25, 2021


Math 235 notes page 402

Let n be an integer such that n ≥ k + 1. Thus, n ≥ n − 1 ≥ k (since n ≥ k + 1).


Hence, the equality (372) holds. Multiplying both sides of this equality by an−k , we
obtain
an an−k = a2n−1 + a2n−2 + · · · + a2n−k+1 . (373)
The same argument (applied to n − 1 instead of n) yields
an−1 a(n−1)−k = a2(n−1)−1 + a2(n−1)−2 + · · · + a2(n−1)−k+1 (since n − 1 ≥ k)
| {z } | {z } | {z }
= a2n−2 = a2n−3 = a2n−k

= a2n−2 + a2n−3 + · · · + a2n−k .


In view of (n − 1) − k = n − k − 1, this rewrites as
an−1 an−k−1 = a2n−2 + a2n−3 + · · · + a2n−k .
Subtracting this equality from (373), we obtain
   
an an−k − an−1 an−k−1 = a2n−1 + a2n−2 + · · · + a2n−k+1 − a2n−2 + a2n−3 + · · · + a2n−k
| {z } | {z }
= a2n−1 +( a2n−2 + a2n−3 +···+ a2n−k+1 ) =( a2n−2 + a2n−3 +···+ a2n−k+1 )+ a2n−k
  
= a2n−1 + a2n−2 + a2n−3 + · · · + a2n−k+1
  
2 2 2 2
− a n −2 + a n −3 + · · · + a n − k +1 + a n − k
= a2n−1 − a2n−k .
Adding an−1 an−k−1 + a2n−k to both sides of this equality, we obtain

an an−k + a2n−k = a2n−1 + an−1 an−k−1 .


Thus,
an−k ( an + an−k ) = an an−k + a2n−k = a2n−1 + an−1 an−k−1 = an−1 ( an−1 + an−k−1 ) .
Dividing both sides of this equality by an−1 an−2 · · · an−k , we obtain
an−k ( an + an−k ) a (a + a n − k −1 )
= n −1 n −1 .
a n −1 a n −2 · · · a n − k a n −1 a n −2 · · · a n − k
This rewrites as
an + an−k a + a n − k −1
= n −1 (374)
a n −1 a n −2 · · · a n − k +1 a n −2 a n −3 · · · a n − k
251 .

251 because

an−k ( an + an−k ) an−k ( an + an−k )


=
a n −1 a n −2 · · · a n − k ( a n −1 a n −2 · · · a n − k −1 ) a n − k
(since an−1 an−2 · · · an−k = ( an−1 an−2 · · · an−k−1 ) an−k )
an + an−k
=
a n −1 a n −2 · · · a n − k +1

December 25, 2021


Math 235 notes page 403

Now, the equality (374) has a rather nice property: The subscripts on the right
hand side are precisely by 1 lower than the corresponding subscripts on the left
hand side! In other words, if we denote the left hand side by bn , then the right
hand side will be bn−1 . Thus, the equality (374) is, in a way, saying that the ratio
an + an−k
is an “invariant” of the sequence ( a0 , a1 , a2 , . . .): it does not
a n −1 a n −2 · · · a n − k +1
change as we “move up” the sequence (i.e., it does not change from n − 1 to n).
Let us now formalize this. Forget that we fixed n. We thus have proved the
equality (374) for each integer n ≥ k + 1.
Now, let us define a number
an + an−k
bn =
a n −1 a n −2 · · · a n − k +1

for each integer n ≥ k. Thus, we have defined a sequence (bk , bk+1 , bk+2 , . . .) of
rational numbers. It is easy to see that

bk = k (375)
252 .

Now, the equality (374) entails that

bn = bn − 1 (377)

and
a n −1 ( a n −1 + a n − k −1 ) a n −1 ( a n −1 + a n − k −1 )
=
a n −1 a n −2 · · · a n − k a n −1 ( a n −2 a n −3 · · · a n − k )
(since an−1 an−2 · · · an−k = an−1 ( an−2 an−3 · · · an−k ))
a n −1 + a n − k −1
=
a n −2 a n −3 · · · a n − k

252 Proof of (375): For each i ∈ {1, 2, . . . , k − 1}, we have i ≤ k − 1 < k and therefore

ai = 1 (376)
k −1 k −1
(by (371), applied to n = i). Hence, ∏ ai = ∏ 1 = 1. Moreover, 0 < k (since k ≥ 2 > 0);
i =1 |{z} i =1
=1
(by (376))
thus, a0 = 1 (by (371), applied to n = 0). Finally, (372) (applied to n = k) yields

a2k−1 + a2k−2 + · · · + a2k−k+1 a2 + a2k−2 + · · · + a2k−k+1


ak = = k −1 (since ak−k = a0 = 1)
ak−k 1
= a2k−1 + a2k−2 + · · · + a2k−k+1 = a2k−1 + a2k−2 + · · · + a21 = a21 + a22 + · · · + a2k−1
k −1 k −1 k −1
= ∑ a2i = ∑ |{z}
12 = ∑ 1 = (k − 1) · 1 = k − 1.
i =1 |{z} i =1 =1 i =1
= 12
(since (376) yields ai =1)

December 25, 2021


Math 235 notes page 404

for every integer n ≥ k + 1 253 . In other words, we have

bn − 1 = bn for every integer n ≥ k + 1.

Thus, we get a chain of equalities bk = bk+1 = bk+2 = bk+3 = · · · . Therefore,


bn = bk for each integer n ≥ k. Hence, for each integer n ≥ k, we have

bn = bk = k (379)

(by (375)).
Now, if n is an integer satisfying n ≥ k, then
 
an + an−k
an + an−k = bn a n − 1 a n − 2 · · · a n − k + 1 since bn =
|{z} a n −1 a n −2 · · · a n − k +1
=k
(by (379))
= kan−1 an−2 · · · an−k+1

and thus
an = kan−1 an−2 · · · an−k+1 − an−k . (380)
We are now almost there. The equality (380) that we just proved is a new re-
currence equation for our sequence ( a0 , a1 , a2 , . . .) that can be used to prove by a
straightforward strong induction on n that all entries an of the sequence are in-
tegers. This is the same kind of argument that we have made in the solution to
Now, the definition of bk yields
 
ak + ak−k
bk = =  ak + ak−k  / ( ak−1 ak−2 · · · ak−k+1 ) = ( ak + 1) /1
 
a k −1 a k −2 · · · a k − k +1 |{z} | {z }
= a0 =1 = ak−1 ak−2 ··· a1
k −1
= a1 a2 ··· ak−1 = ∏ ai =1
i =1

= ak + 1 = k (since ak = k − 1) .

This proves (375).


253 Proof. an + an−k
Let n be an integer such that n ≥ k + 1. The definition of bn yields bn = .
a n −1 a n −2 · · · a n − k +1
The definition of bn−1 yields
an−1 + a(n−1)−k a n −1 + a n − k −1
bn − 1 = = (378)
a(n−1)−1 a(n−1)−2 · · · a(n−1)−k+1 a n −2 a n −3 · · · a n − k

(since a(n−1)−k = an−k−1 and a(n−1)−1 a(n−1)−2 · · · a(n−1)−k+1 = an−2 an−3 · · · an−k ). Hence,
| {z } | {z } | {z }
= a n −2 = a n −3 = an−k

an + an−k a n −1 + a n − k −1
bn = = (by (374))
a n −1 a n −2 · · · a n − k +1 a n −2 a n −3 · · · a n − k
= bn − 1 (by (378)) .

This proves (377).

December 25, 2021


Math 235 notes page 405

Exercise 1.1.2 (b). But for the sake of completeness, let me give the details of this
argument:
We claim that
am ∈ Z for each m ∈ N. (381)
[Proof of (381): We proceed by strong induction on m:
Induction step: Let n ∈ N. Assume (as the induction hypothesis) that (381) holds
for m < n. We must show that (381) holds for m = n. In other words, we must
prove that an ∈ Z.
If n < k, then this is clearly true (since (371) yields an = 1 ∈ Z in this case).
Hence, we WLOG assume that n ≥ k for the rest of this proof.
Thus, (380) yields an = kan−1 an−2 · · · an−k+1 − an−k . But we have assumed that
(381) holds for m < n. In other words, am ∈ Z holds for each m ∈ N satisfying
m < n. In other words, am ∈ Z holds for each m ∈ {0, 1, . . . , n − 1}. In other words,
the n elements a0 , a1 , . . . , an−1 all belong to Z. In other words, the n elements
a0 , a1 , . . . , an−1 are integers.
Hence, in particular, the k − 1 elements an−1 , an−2 , . . . , an−k+1 are integers (since
these k − 1 elements an−1 , an−2 , . . . , an−k+1 are among the n elements a0 , a1 , . . . , an−1 ),
and the element an−k is an integer (since this element is, too, among the n ele-
ments a0 , a1 , . . . , an−1 ). Therefore, the difference kan−1 an−2 · · · an−k+1 − an−k is an
integer as well (since it is formed by multiplying and subtracting the integers k,
an−1 , an−2 , . . . , an−k+1 and an−k ). In other words, kan−1 an−2 · · · an−k+1 − an−k ∈ Z.
Hence, an = kan−1 an−2 · · · an−k+1 − an−k ∈ Z. This completes the induction step.
Thus, the proof of (381) is complete.]
Now, let n ≥ 0 be an integer. Thus, n ∈ N, so that an ∈ Z (by (381), applied
to m = n). In other words, an is an integer. Furthermore, an is positive (since
( a0 , a1 , a2 , . . .) is a sequence of positive rational numbers). Hence, an is a positive
integer. This solves Exercise 8.1.8.
Here is another example ([Gale98, Chapter 4, (4)]):254

Exercise 8.1.9. Fix a positive integer k ≥ 2. Define a sequence ( a0 , a1 , a2 , . . .) of


positive rational numbers recursively by setting

an = 1 for each n < k (382)

and
a n −1 a n −2 + a n −2 a n −3 + · · · + a n − k +2 a n − k +1
an = (383)
an−k
for each n ≥ k.

254 Wenote that Exercise 8.1.9 generalizes Exercise 4.11.8 (a), because if we take k = 4, then the
sequence ( a0 , a1 , a2 , . . .) defined in Exercise 8.1.9 will be precisely the sequence (b0 , b1 , b2 , . . .) in
Exercise 4.11.8 (a).

December 25, 2021


Math 235 notes page 406

(The sum in the numerator on the right hand side of (383) is an−1 an−2 +
k −2
an−2 an−3 + · · · + an−k+2 an−k+1 = ∑ an−i an−i−1 .)
i =1
Prove that an is a positive integer for each integer n ≥ 0.

Solution to Exercise 8.1.9 (sketched). This is similar to the above solution to Exercise
8.1.8, so we restrict ourselves to an outline.
Again, we begin by playing around with the recursive equation.
Let n be an integer satisfying n ≥ k + 2. Thus, n ≥ n − 2 ≥ k (since n ≥ k + 2);
hence, (383) holds. Multiplying both sides of (383) by an−k , we obtain

a n a n − k = a n −1 a n −2 + a n −2 a n −3 + · · · + a n − k +2 a n − k +1 . (384)

The same argument (applied to n − 2 instead of n) yields

a n −2 a n − k −2 = a n −3 a n −4 + a n −4 a n −5 + · · · + a n − k a n − k −1 .
255 Subtracting this equality from (384), we find

a n a n − k − a n −2 a n − k −2 = ( a n −1 a n −2 + a n −2 a n −3 + · · · + a n − k +2 a n − k +1 )
− ( a n −3 a n −4 + a n −4 a n −5 + · · · + a n − k a n − k −1 )
= a n −1 a n −2 + a n −2 a n −3 − a n − k +1 a n − k − a n − k a n − k −1 .
Adding an−2 an−k−2 + an−k+1 an−k + an−k an−k−1 to both sides of this equality, we
obtain

a n a n − k + a n − k +1 a n − k + a n − k a n − k −1 = a n −1 a n −2 + a n −2 a n −3 + a n −2 a n − k −2 .

Adding an−k an−2 to both sides of this equality256 , we obtain

a n a n − k + a n − k +1 a n − k + a n − k a n − k −1 + a n − k a n −2
= a n −1 a n −2 + a n −2 a n −3 + a n −2 a n − k −2 + a n − k a n −2 .
In other words,

a n − k ( a n + a n −2 + a n − k +1 + a n − k −1 ) = a n −2 ( a n −1 + a n −3 + a n − k + a n − k −2 ) .

Dividing both sides of this equality by an−2 an−3 · · · an−k , we obtain


a n + a n −2 + a n − k +1 + a n − k −1 a + a n −3 + a n − k + a n − k −2
= n −1 . (385)
a n −2 a n −3 · · · a n − k +1 a n −3 a n −4 · · · a n − k
Now, forget that we fixed n. We thus have proved the equality (385) for each
integer n ≥ k + 2.
255 You might wonder why we used n − 2 instead of n − 1 here (unlike in the above solution to
Exercise 8.1.8). The best answer I have is “I have tried using n − 1, and it didn’t lead me
anywhere”.
256 This is somewhat unmotivated, but will serve to make the pattern below symmetric.

December 25, 2021


Math 235 notes page 407

Now, let us define a number


a n + a n −2 + a n − k +1 + a n − k −1
bn =
a n −2 a n −3 · · · a n − k +1

for each integer n ≥ k + 1. Thus, we have defined a sequence (bk+1 , bk+2 , bk+3 , . . .)
of rational numbers. It is easy to see that bk+1 is an integer (since ak−1 , ak−2 , . . . , a0
are all equal to 1, and thus all denominators involved in computing bk+1 are 1s).
Now, the equality (385) entails that

bn = bn − 1

for each integer n ≥ k + 2 (because its left hand side is bn , while its right hand side
is bn−1 ). In other words, we have bn−1 = bn for every integer n ≥ k + 2. Thus, we
get a chain of equalities bk+1 = bk+2 = bk+3 = bk+4 = · · · . From here, we can finish
as in the above solution to Exercise 8.1.8.
Here is a third example ([Gale98, Chapter 4, (3)]):

Exercise 8.1.10. Fix an odd positive integer k ≥ 2. Define a sequence


( a0 , a1 , a2 , . . .) of positive rational numbers recursively by setting

an = 1 for each n < k (386)

and
a n −1 a n −2 + a n −3 a n −4 + · · · + a n − k +2 a n − k +1
an = (387)
an−k
for each n ≥ k.

(The sum in the numerator on the right hand side of (387) is an−1 an−2 +
(k−1)/2
a n −3 a n −4 + · · · + a n − k +2 a n − k +1 = ∑ an−2i+1 an−2i .)
i =1
Prove that an is a positive integer for each integer n ≥ 0.

Solution to Exercise 8.1.10 (sketched). This is similar to the above solution to Exercise
8.1.8, so we restrict ourselves to an outline.
Again, we begin by playing around with the recursive equation.
Let n be an integer satisfying n ≥ k + 2. Thus, n ≥ n − 2 ≥ k (since n ≥ k + 2);
hence, (387) holds. Multiplying both sides of (387) by an−k , we obtain

a n a n − k = a n −1 a n −2 + a n −3 a n −4 + · · · + a n − k +2 a n − k +1 . (388)

The same argument (applied to n − 2 instead of n) yields

a n −2 a n − k −2 = a n −3 a n −4 + a n −5 a n −6 + · · · + a n − k a n − k −1 .

December 25, 2021


Math 235 notes page 408

Subtracting this equality from (388), we find


a n a n − k − a n −2 a n − k −2 = ( a n −1 a n −2 + a n −3 a n −4 + · · · + a n − k +2 a n − k +1 )
− ( a n −3 a n −4 + a n −5 a n −6 + · · · + a n − k a n − k −1 )
= a n −1 a n −2 − a n − k a n − k −1 .
Adding an−2 an−k−2 + an−k an−k−1 to both sides of this equality, we obtain
a n a n − k + a n − k a n − k −1 = a n −1 a n −2 + a n −2 a n − k −2 .
In other words,
a n − k ( a n + a n − k −1 ) = a n −2 ( a n −1 + a n − k −2 ) .
Dividing both sides of this equality by an−2 an−3 · · · an−k , we obtain
a n + a n − k −1 a + a n − k −2
= n −1 . (389)
a n −2 a n −3 · · · a n − k +1 a n −3 a n −4 · · · a n − k
Now, forget that we fixed n. We thus have proved the equality (389) for each
integer n ≥ k + 2.
Now, let us define a number
a n + a n − k −1
bn =
a n −2 a n −3 · · · a n − k +1
for each integer n ≥ k + 1. Thus, we have defined a sequence (bk+1 , bk+2 , bk+3 , . . .)
of rational numbers. It is easy to see that bk+1 is an integer (since ak−1 , ak−2 , . . . , a0
are all equal to 1, and thus all denominators involved in computing bk+1 are 1s).
Now, the equality (389) entails that
bn = bn − 1
for each integer n ≥ k + 2 (because its left hand side is bn , while its right hand side
is bn−1 ). In other words, we have bn−1 = bn for every integer n ≥ k + 2. Thus, we
get a chain of equalities bk+1 = bk+2 = bk+3 = bk+4 = · · · . From here, we can finish
as in the above solution to Exercise 8.1.8.

8.2. Monovariants
Next we shall see some exercises illustrating the use of monovariants (i.e., quan-
tities that change only in one direction). We begin with a basic fact about sorting
sequences. First, a definition:
Definition 8.2.1. (a) We say that an n-tuple (b1 , b2 , . . . , bn ) of real numbers is
weakly increasing if b1 ≤ b2 ≤ · · · ≤ bn . (For example, the 5-tuple (1, 4, 4, 7, 9) is
weakly increasing.)
(b) Let (b1 , b2 , . . . , bn ) be an n-tuple of real numbers. We say that two entries
bi and b j (with i < j) of this n-tuple are out of order if bi > b j . (For example, the
entries 4 and 2 in the 5-tuple (1, 4, 3, 2, 5) are out of order; thus, this 5-tuple is
not weakly increasing.)

December 25, 2021


Math 235 notes page 409

It is clear that an n-tuple of real numbers is weakly increasing if and only if it


has no two entries that are out of order. Now, the following exercise shows that we
can sort any n-tuple of real numbers into weakly increasing order by repeatedly
swapping out-of-order pairs of adjacent entries257 :

Exercise 8.2.1. Let n ∈ N. You start with an n-tuple ( a1 , a2 , . . . , an ) of real num-


bers. In one move, you are allowed to pick two adjacent entries ai and ai+1 of
this n-tuple that are out of order
 (i.e., satisfy ai > ai+1 ), and swap these two en-
n
tries. Prove that after at most such moves, the n-tuple will become weakly
2
increasing.
[Example: If n = 5 and if you start with the 5-tuple (2, 5, 4, 1, 3), then one
possible sequence of moves you can take is the following one:

swap 5 and 4 swap 5 and 1 swap 5 and 3


(2, 5, 4, 1, 3) −→ (2, 4, 5, 1, 3) −→ (2, 4, 1, 5, 3) −→ (2, 4, 1, 3, 5)

swap 4 and 1 swap 2 and 1 swap 4 and 3


−→ (2, 1, 4, 3, 5) −→ (1, 2, 4, 3, 5) −→ (1, 2, 3, 4, 5) .

The 5-tuple has become weakly increasing after these moves. Other sequences
of moves are also possible, but they all lead to the same final result.]

Solution to Exercise 8.2.1 (sketched). In this solution, the word “n-tuple” shall always
mean “n-tuple of real numbers”.
An inversion of an n-tuple ( a1 , a2 , . . . , an ) shall mean a pair (i, j) of elements of [n]
satisfying i < j and ai > a j . Thus, the inversions of an n-tuple correspond to the
pairs of entries of this n-tuple that are out of order. (However, an inversion is not
the pair of these entries, but rather the pair of their positions.) For example, the
inversions of the 4-tuple (3, 1, 4, 2) are (1, 2), (1, 4) and (3, 4). For another example,
the inversions of the 3-tuple (2, 2, 1) are (1, 3) and (2, 3). (Note that the pairs of
entries corresponding to these inversions are both (2, 1).)
The inversion number of an n-tuple shall be defined as the number of inversions of
this n-tuple. For example, the inversion number of the 4-tuple (3, 1, 4, 2) is 3, since
it has 3 inversions. We notice that the inversion number of an n-tuple is always a
nonnegative integer (by its definition).
Now, we claim the following:

Claim 1: Every move decreases the inversion number of our n-tuple


precisely by 1.

[Proof of Claim 1: I shall illustrate the argument visually before discussing it in


more technical detail.

257 This is the idea underlying the sorting algorithm called bubble sort ([TAoCP3, §5.2.2]).

December 25, 2021


Math 235 notes page 410

Let us visually represent the inversions of the 7-tuple (4, 1, 7, 3, 2, 5, 6).

 
4, 1, 7, 3, 2, 5, 6 .
(390)

The arcs here illustrate the inversions; more precisely, there is an arc between the
i-th entry and the j-th entry whenever (i, j) is an inversion of the 7-tuple. (The
colors will be explained later.) The two adjacent entries 7 and 3 (in positions 3 and
4) are out of order. The move that swaps these two entries transforms the 7-tuple
into the following 7-tuple:

 
4, 1, 3, 7, 2, 5, 6 .
(391)

Again, we have represented the inversions as arcs. What do we see? The two black
arcs have stayed in their positions; the red and the green arcs have slightly moved
and changed their colors (from red to green, and from green to red); the blue arc
has disappeared. The logic behind the colors is the following: The swap involved
the 3-rd and the 4-th entry of our 7-tuple. The arc that connects these two entries
was colored blue; the arcs that contain the 3-rd but not the 4-th entry were colored
green; the arcs that contain the 4-th but not the 3-rd entry were colored red; all
remaining arcs were colored black. The behavior is no longer strange:

• The black arcs from (390) remain arcs in (391), because the relevant entries do
not change.

• The green arcs from (390) appear (slightly stretched or compressed) as red
arcs in (391), since one of the relevant entries is moved (but not far enough to
jump past the other entry and therefore destroy the inversion).

• The red arcs from (390) appear (slightly stretched or compressed) as green
arcs in (391) (for the same reason).

• The blue arc from (390) disappears in (391) (since the two relevant entries are
no longer out of order in (391)).

This analysis accounts for all arcs in (391). Thus, we see that there is precisely one
less arc in (391) than in (390). In other words, the 7-tuple in (391) has precisely

December 25, 2021


Math 235 notes page 411

one less inversion than that in (390). In other words, our move has decreased the
inversion number by 1, exactly as Claim 1 predicted.
It is not hard (although somewhat laborious) to formalize this argument in full
generality. Instead of assigning colors to arcs, let me assign colors to the inversions
themselves. Consider a move that transforms an n-tuple a = ( a1 , a2 , . . . , an ) into an
n-tuple b = (b1 , b2 , . . . , bn ) by swapping two adjacent entries ai and ai+1 that are
out of order. (Thus, bi = ai+1 and bi+1 = ai and b j = a j for each j ∈ [n] \ {i, i + 1}.)
An inversion (u, v) of a or b will be called

• blue if both i and i + 1 belong to {u, v};

• green if i ∈ {u, v} but i + 1 ∈


/ {u, v};

• red if i + 1 ∈ {u, v} but i ∈


/ {u, v};

• black if neither i nor i + 1 belongs to {u, v}.

(These are precisely the colors of the corresponding arcs in (390) and in (391).) It is
clear that each inversion of a or b has exactly one of these four colors (blue, green,
red and black). Moreover:

• The n-tuple a has exactly one blue inversion (namely, (i, i + 1)), whereas the
n-tuple b has no blue inversions (since its i-th and (i + 1)-st entries are not
out of order).

• The n-tuple a has as many green inversions as the n-tuple b has red inver-
sions. Indeed, there is a bijection

{green inversions of a} → {red inversions of b}

that sends each green inversion (u, i ) of a to the red inversion (u, i + 1) of b
and sends each green inversion (i, v) of a to the red inversion (i + 1, v) of b.
(Obviously, any green inversion of a has one of the forms (u, i ) and (i, v).)

• The n-tuple a has as many red inversions as the n-tuple b has green inver-
sions. Indeed, there is a bijection

{red inversions of a} → {green inversions of b}

that sends each red inversion (u, i + 1) of a to the green inversion (u, i ) of
b and sends each red inversion (i + 1, v) of a to the green inversion (i, v)
of b. (Obviously, any red inversion of a has one of the forms (u, i + 1) and
(i + 1, v).)
• The n-tuple a has as many black inversions as the n-tuple b has black inver-
sions. Indeed, the black inversions of a are identical with the black inversions
of b.

December 25, 2021


Math 235 notes page 412

This accounting shows that the n-tuple a has exactly one more inversion than the n-
tuple b has. In other words, the inversion number of a equals the inversion number
of b plus 1. Thus, the move that transformed a into b had the effect of decreasing
the inversion number by 1. This proves Claim 1.258 ]
Now, Claim 1 shows that the inversion number of our n-tuple is a monovariant:
it keeps decreasing. Let us make this more precise:  
n
At the onset, the inversion number of our n-tuple is at most (since every
2
inversionof the n-tuple is a pair (i, j) of elements of [n] satisfying i < j; but there
n
are only such pairs259 ). Claim 1 shows that this inversion number decreases
2
 time you make a move. Hence, after kmoves,
by 1every  this inversion number will
n n
be − k. Therefore, if you make more than successive moves, then the in-
2     2
n n
version number becomes smaller than − = 0, which is clearly impossible
2 2
(since the inversion number ofann-tuple is always a nonnegative integer). Thus,  
n n
you cannot make more than successive moves. Hence, after at most
2 2
moves, you will obtain an n-tuple that does not allow for any further moves. But
such an n-tuple must necessarily be weakly increasing (because it does not allow
for any further moves, so it has no two adjacent entries that are out of order260 ;
but this
  means that its entries weakly increase from left to right). Thus, after at
n
most moves, you will obtain a weakly increasing n-tuple. This solves Exercise
2

258 A more formal exposition of this proof can be found in [Grinbe15, §7.80, proof of (1072)]. (Note
that the notation ` (a) used in [Grinbe15, §7.80, (1072)] is exactly what we call the inversion
number of a here, whereas the notation a ◦ sk used in [Grinbe15, §7.80, (1072)] is the result of
swapping the k-th and (k + 1)-st entries of the n-tuple a. Thus, [Grinbe15, (1072)] says precisely
that a move (in our sense) decreases the inversion number of an n-tuple by 1. The fact that
we are working with n-tuples of real numbers whereas [Grinbe15, §7.80, (1072)] is stated for
n-tuples of integers is immaterial; this makes no difference for the proof.)
259 Proof. There is a bijection

{pairs (i, j) of elements of [n] satisfying i < j} → {2-element subsets of [n]} ,


(i, j) 7→ {i, j} .

Hence, the bijection principle yields

|{pairs (i, j) of elements of [n] satisfying i < j}|


 
n
= |{2-element subsets of [n]}| = (# of 2-element subsets of [n]) =
2

(byTheorem
 4.3.12). In other words, the number of pairs (i, j) of elements of [n] satisfying i < j
n
is .
2
260 because any two adjacent entries that are out of order would create an opportunity for a move

December 25, 2021


Math 235 notes page 413

8.2.1.
Our next exercise ([Grinbe08, Aufgabe 4.16]) is again about lamps in a rectangu-
lar grid (just like Exercise 8.1.5):
Exercise 8.2.2. Let n and m be two positive integers. You have a rectangular
n × m-grid of lamps (i.e., a table with n rows and m columns, with a lamp in
each of its nm cells). A line shall mean a row or a column of the grid; thus, there
are n + m lines in total (namely, n rows and m columns). You say that a line is
bright if at least half of all lamps in this line are turned on.
In a move, you can choose a line, and flip all lamps in this line. (To “flip” a
lamp means to turn it on if it was off, and to turn it off if it was on. Note that
our definition of a move is exactly the same as in Exercise 8.1.5.)
Prove that (starting with an arbitrary state of the lamps – not necessarily all
turned off) you can always find a sequence of moves after which every line is
bright.
[Example: Let us represent a lamp turned off by the number 0, and a lamp
turned on by the number 1. Consider the following starting state (for n = 3 and
m = 4):
0 0 1 1
1 1 0 0 . (392)
0 0 1 0
In this state, the first two rows (from the top) are bright, and so is the third
column (from the left); but the remaining lines are not bright. However, we can
make all lines bright by the following sequence of moves: First, we flip all lamps
in the first and second columns; then, we flip all lamps in the second row. The
resulting state is
1 1 1 1
1 1 1 1 ,
1 1 1 0
and this does have the property that all lines are bright.]

Solution to Exercise 8.2.2 (sketched). We define the total brightness of a state to be the
# of all lamps that are turned on in this state. For example, the state shown in (392)
has total brightness 5. Note that the total brightness of any state is a nonnegative
integer that is ≤ nm (since there are only nm lamps in total).
Let me recall that any move consists in picking a line and flipping all lamps in
this line. We shall call a move lightbringing if the line getting picked was not bright
before the move. For example, if we start from the state (392), then flipping all
lamps in the topmost row is not a lightbringing move (since the topmost row was
already bright before the move), but flipping all lamps in the bottommost row is a
lightbringing move (since the bottommost row was not bright before the move).

December 25, 2021


Math 235 notes page 414

Now, we claim the following:

Claim 1: Any lightbringing move increases the total brightness of a state


by at least 1.

[Proof of Claim 1: Consider any lightbringing move. Let ` be the line that is picked
in this move. Thus, the move consists in flipping all lamps in this line `. Since this
move is lightbringing, we thus conclude that the line ` is not bright before this
move (by the definition of “lightbringing”). In other words, less than half of the
lamps in line ` are turned on before the move (by the definition of a “bright” line).
In other words, before the move, the line ` has fewer turned-on lamps than it has
turned-off lamps. But the move turns all the former lamps off and turns all the
latter lamps on (because the move flips all lamps in `). Hence, the move turns
fewer lamps off than it turns on (since the line ` has fewer turned-on lamps than
it has turned-off lamps before the move). Hence, the move increases the total # of
lamps that are turned on. In other words, the move increases the total brightness
of the state (since the total brightness of a state was defined as the total # of lamps
that are turned on). Therefore, the move increases the total brightness of the state
by at least 1 (since the total brightness is an integer, and thus, if it is increased, it
must necessarily be increased by at least 1). This proves Claim 1.]
Now, let us start with an arbitrary state, and keep making lightbringing moves
until this is no longer possible. (That is, we keep making lightbringing moves as
long as there is any line that is not bright; we stop when there are no such lines left
any more.) I claim that this process will end after at most nm moves. Indeed, Claim
1 shows that any lightbringing move increases the total brightness of a state by at
least 1. Hence, if we manage to make nm + 1 moves, then the total brightness will
be at least nm + 1 (since the total brightness was nonnegative in the initial state, and
has been increased by 1 in each of our nm + 1 moves); but this would contradict the
fact that the total brightness of any state is ≤ nm (and thus < nm + 1). Thus, we
cannot make nm + 1 moves. Hence, our process will stop after at most nm moves.
The resulting state (at the end of our process) will have the property that every line
is bright (since otherwise, it would have a line that is not bright, and therefore we
could apply one more lightbringing move to it). Thus, we have found a sequence
of moves after which every line is bright. This solves Exercise 8.2.2.
Here is yet another lamp puzzle ([Grinbe08, Aufgabe 4.20]), albeit stated in terms
of flags rather than lamps:

Exercise 8.2.3. A country has finitely many towns, some of which are connected
by roads. We say that two towns are each others’ neighbors if they are connected
by a direct road (not passing through any other town). (No town counts as its
own neighbor.)
Each town flies a flag, which has a certain color. We shall briefly say “A town
T flies a color c” for “A town T flies a flag of color c”.

December 25, 2021


Math 235 notes page 415

Every once in a while, a revolution happens in a town: The town’s flag is


repainted in the color of the plurality of its neighbors. That is, if T is a town,
and if a plurality of T’s neighbors are flying a certain color c, then the revolution
causes the flag of T to be repainted in color c. (“Plurality” means “relative
majority”, i.e., more neighbors than any other color. That is, “a plurality of T’s
neighbors are flying color c” means “for each color d 6= c, the number of T’s
neighbors flying color c is larger than the number of T’s neighbors flying color
d”. If T was already flying color c right before the change, then nothing changes,
and this does not count as a revolution.)

Assume that revolutions cannot happen simultaneously in several towns.


Prove that the revolutions will eventually end – i.e., after sufficiently many rev-
olutions, no more revolutions will happen.

[Example: Here is an example of a country with 7 towns (with direct roads


represented by line segments):

R B

Y Y
B
.

Here, the colors of the nodes represent the colors of the flags hoisted by the
respective towns, and the letters inside the nodes represent them as well (for the
convenience of anyone reading this in black-and-white). (“Y” means “yellow”;
“R” means “red”; “B” means “blue”.) Now, a revolution can happen (e.g.) in
the yellow-flagged town at the bottom right of the country. The plurality of this
town’s neighbors are flying blue flags (in fact, both of its neighbors are), so the

December 25, 2021


Math 235 notes page 416

revolution causes this town to fly a blue flag, too:

R B

Y B
B
.

Next, a revolution can happen (e.g.) in the blue-flagged town at the bottom
of the country. The plurality of this town’s neighbors (namely, two of its three
neighbors) are flying yellow flags; thus, this town becomes yellow too:

R B

Y B
Y
. (393)

Next, a revolution can happen in the red town, resulting in

Y B

Y B
Y
.

December 25, 2021


Math 235 notes page 417

The country is now stable: No further revolutions can happen. (This does not
mean that each town has the same flag color as a plurality of its neighbors; it
only means that no other color has a plurality among its neighbors.)]

Remark 8.2.2. If revolutions were allowed to happen simultaneously in Exercise


8.2.3, then the claim of the exercise would not be true. For instance, here is
an example where revolutions all happen simultaneously in all towns, causing
every town to switch colors every time (and never stabilizing):

B Y

Y Y → B B →

B Y

Y Y → ··· .

Some things can be said about the variant of the exercise in which all possible
revolutions are happening simultaneously (e.g., each night, at midnight, every
town whose flag color differs from that of a plurality of its neighbors undergoes
a revolution). In this case, I suspect that the country will either become stable,
or will end up oscillating between two states from a certain day on. A similar
result (albeit not quite the same, as it includes a rule for tiebreaking between
equinumerous pluralities) appears in [GolTch83, Theorem 2.1].

Solution to Exercise 8.2.3 (sketched). A couple shall mean a set { a, b} of two towns a
and b that are connected by a (direct) road. A couple { a, b} shall be called discordant
if the towns a and b fly different colors; otherwise, it shall be called non-discordant.
(Of course, these concepts depend on the state of the country; a discordant couple
can become non-discordant after a revolution, and vice versa.)

December 25, 2021


Math 235 notes page 418

Define the discord of a state to be the # of all discordant couples in this state. (For
example, the discord of the state shown in (393) is 5. The discord of a state can
be read off its pictorial representation, as it is simply the # of segments whose two
endpoints have different colors – at least if we don’t have two towns connected by
more than one direct road.)
The discord of a state is thus a nonnegative integer.
Now, we claim the following:

Claim 1: Each revolution decreases the discord of the state.

[Proof of Claim 1: Let us consider a revolution happening in a town t. We notice


that the only flag that gets recolored during this revolution is the flag in town t.
Let d be the color that t flies before the revolution, and let c be the color that t flies
after the revolution. Due to the way revolutions work, the color c must be the flag
color of a plurality of t’s neighbors. Thus, in particular, more of t’s neighbors are
flying the color c than are flying the color d. (Here we are using the fact that c 6= d,
which is because otherwise our “revolution” would not count as a revolution.) Let
γ be the # of t’s neighbors that are flying the color c, and let δ be the # of t’s
neighbors that are flying the color d. (We don’t need to specify whether we are
talking of “before the revolution” or “after the revolution”, since the revolution
only changes the color of t, not the color of t’s neighbors.) Thus, γ > δ (since more
of t’s neighbors are flying the color c than are flying the color d). Hence, γ − δ > 0.
Now, we consider the effect of the revolution on couples:

• If a couple does not include t, then the revolution does not change the discordant/non-
discordant status of the couple (i.e., if the couple was discordant before the
revolution, then it stays discordant; if it was non-discordant, then it stays
non-discordant).

• If a couple has the form {t, x }, where x is a neighbor of t flying the color
d, then this couple {t, x } was non-discordant before the revolution (since t
also had the color d before the revolution) but becomes discordant after the
revolution (because the color of t changes). Note that there are exactly δ such
couples (since δ is the # of t’s neighbors that are flying the color d).

• If a couple has the form {t, y}, where y is a neighbor of t flying the color c,
then this couple {t, y} was discordant before the revolution (since t had the
color d, and since c 6= d) but becomes non-discordant after the revolution
(because the color of t changes to c). Note that there are exactly γ such
couples (since γ is the # of t’s neighbors that are flying the color c).

• If a couple has the form {t, z}, where z is a neighbor of t flying a color distinct
from d and c, then this couple {t, z} was discordant before the revolution and
remains so after the revolution.

December 25, 2021


Math 235 notes page 419

This accounts for all couples. Thus, the revolution causes exactly δ non-discordant
couples to become discordant, and causes exactly γ discordant couples to become
non-discordant. The total # of discordant couples thus decreases by γ − δ. Since
γ − δ > 0, this shows that the total # of discordant couples decreases. Thus, Claim
1 is proven.]
The rest of the solution is now essentially a repetition of the “infinite descent”
argument we have seen in the discussion of Exercise 5.3.1. Namely, Claim 1 shows
that each revolution decreases the discord of the state. But the discord of any state
is a nonnegative integer, and thus cannot decrease indefinitely. More concretely: If
the discord of the original state was N, then the discord cannot decrease more than
N times without becoming negative. Thus, we cannot have more than N successive
revolutions. This solves Exercise 8.2.3.
The following exercise is a variation on Exercise 8.1.3 – with a different answer,
however:

Exercise 8.2.4. The numbers 1, 2, . . . , 99 are written in a row (in this order, from
left to right). In a move, you can swap any two numbers at a distance of 2 (i.e.,
any two numbers that have exactly one number written between them). Can
you end up with the numbers 99, 98, . . . , 1 (in this order, from left to right) by a
sequence of such moves?
[See the Example in Exercise 8.1.3 for how such moves look like.]

Solution to Exercise 8.2.4 (sketched). Yes, you can.


Proof. The number 99 is odd, so we cannot proceed as in Exercise 8.1.3. However,
we can argue as follows:261
We identify each state with the 99-tuple consisting of the numbers written on the
row, in the order in which they appear (from left to right). Thus, the initial state is
the 99-tuple (1, 2, . . . , 99), whereas the state we are trying to reach is (99, 98, . . . , 1).
First of all, we observe that our moves are reversible: More precisely, we can undo
each move by making the same move (since swapping the same two numbers twice
in a row is tantamount to doing nothing). Thus, if there is a sequence of moves that
transforms a certain state A into a certain state B, then there also is a sequence of
moves that transforms the state B into the state A (namely, the original sequence of
moves, but made in backwards order). Hence, in particular, if there is a sequence
of moves that transforms the state (99, 98, . . . , 1) into the state (1, 2, . . . , 99), then
there also is a sequence of moves that transforms the state (1, 2, . . . , 99) into the
state (99, 98, . . . , 1).
Hence, instead of solving the exercise as it is posed, let us solve the “inverse”
exercise (i.e., the exercise with initial state and desired state interchanged): Let
us find a sequence of moves that transforms the state (99, 98, . . . , 1) into the state
(1, 2, . . . , 99). As we have just said, this is equivalent to the exercise as it is posed.

261 Notethat we are not going to use any “new” monovariants in this argument; instead, we shall
use Exercise 8.2.1, thus in a way reusing the monovariant we already used to solve Exercise 8.2.1.

December 25, 2021


Math 235 notes page 420

We define the position of a number i ∈ [99] in a given state to be the (unique)


j ∈ [99] with the property that i is the j-th number from the left on our row.
In any state, we shall call a number i ∈ [99] odd-positioned if its position is odd262 ,
and we shall call a number even-positioned if its position is even. In the initial state of
our “inverse” exercise (which, as we recall, is the 99-tuple (99, 98, . . . , 1)), the odd-
positioned numbers are 99, 97, 95, . . . , 1 (indeed, their positions are 1, 3, 5, . . . , 99,
respectively), and the even-positioned numbers are 98, 96, 94, . . . , 2 (indeed, their
positions are 2, 4, 6, . . . , 98, respectively). A move can change the position of a
number, but it does not change the parity of this position (as we have already
seen in the solution to Exercise 8.1.3). Thus, odd-positioned numbers remain odd-
positioned after any number of moves. Hence, the numbers 99, 97, 95, . . . , 1 are not
just odd-positioned at the onset, but remain odd-positioned after any number of
moves. Likewise, the numbers 98, 96, 94, . . . , 2 remain even-positioned.
Now, let us focus entirely on the odd-positioned numbers (while forgetting about
the even-positioned numbers). Using our moves, we can swap any two adjacent
odd-positioned numbers263 . From Exercise 8.2.1, we know that there is a sequence
of such swaps that rearranges these odd-positioned numbers in weakly increasing
order. Each of these swaps corresponds to a move in the sense of Exercise 8.2.4;
moreover, these moves do not affect the even-positioned numbers. Hence, after
we perform all these moves, our odd-positioned numbers have been rearranged in
increasing order (so that they are now 1, 3, 5, . . . , 97, 99 from left to right), whereas
the even-positioned numbers are still as they were at the onset (i.e., they are still
98, 96, 94, . . . , 2 from left to right).
Next, let us perform the analogous operations with the even-positioned num-
bers: Our moves allow us to swap any two adjacent even-positioned numbers,
and (with the help of Exercise 8.2.1) we can find a sequence of such swaps that
rearranges these even-positioned numbers in weakly increasing order without af-
fecting the odd-positioned numbers. Thus, after we perform all these moves, our
even-positioned numbers have been rearranged in increasing order (so that they are
now 2, 4, 6, . . . , 96, 98 from left to right), whereas the odd-positioned numbers are
still as they were before this second set of moves (i.e., they are still 1, 3, 5, . . . , 97, 99
from left to right).
Thus, in the state we have now obtained after all these moves, the odd-positioned
numbers are 1, 3, 5, . . . , 97, 99 from left to right, and the even-positioned numbers
are 2, 4, 6, . . . , 96, 98 from left to right. Hence, this state is (1, 2, . . . , 99). Thus, we
have found a sequence of moves that transforms the state (99, 98, . . . , 1) into the
state (1, 2, . . . , 99). This solves the “inverse” exercise, and thus (as we have already
explained) also solves the original Exercise 8.2.4.
We note that our above solution illustrates yet another useful tool in problem
262 i.e.,
if it has an even # of numbers to its left
263 Here, “adjacent” means “adjacent, if we ignore the even-positioned numbers”. That is, two odd-
positioned numbers are said to be adjacent if there are no odd-positioned numbers between
them. In terms of the original row of 99 numbers, this means that they have exactly one number
between them.

December 25, 2021


Math 235 notes page 421

solving: the tactic of inverting a problem. In our case, this meant interchanging
the starting state and the desired goal. This is a useful tactic in its own right (and
can be useful even when the moves are not reversible; in such cases one will have
to define a new kind of moves, which undo the original moves). It is known as
“working backwards” and is briefly discussed in [Engel98, §14.3].
The next exercise is another quasi-geometric puzzle:

Exercise 8.2.5. Let n ≥ 2 be an integer. A country has n towns, the distances


between which are distinct.
(a) You start in a town A1 . From there you travel to the town A2 that is farthest
away from A1 . From there you travel to the town A3 that is farthest away from
A2 . You continue travelling in the same pattern. Prove the following: If A3 6= A1 ,
then you never come back to the town A1 .
(b) Prove the same claim if the words “farthest away from” are replaced by
“closest to”. (Of course, a town does not count as the closest town to itself.)
[Example: Assume that n = 4 and that the towns are the four points A =
(0, 0), B = (1, 1), C = (3, 0) and D = (0, −2) in the Euclidean plane. This is
illustrated in the following picture:

1.4 2.2
A 3 C
3.1
2 3.6

(with the edges labeled by their respective lengths). Now, in Exercise 8.2.5 (a), if
you start in the town A, then you travel to the town C, then to D, then to C, and
afterwards just keep moving around between C and D. In Exercise 8.2.5 (b), if
you start in the town D, then you travel to the town A, then to B, then to A, and
afterwards just keep moving around between B and A.]

We notice that Exercise 8.2.5 (b) can be restated in terms of the cowboys from
Exercise 5.2.5. Indeed, in the latter language, it says that the paths of the bullets
do not form any closed polygonal path (other than “2-gons”) whenever n ≥ 2 (not
necessarily odd).
Solution to Exercise 8.2.5 (sketched). (a) The trick is to realize that each leg of your
journey is longer than the previous one, unless it leads you straight back to the
town you just came from. Here are the details: We claim the following:

December 25, 2021


Math 235 notes page 422

Claim 1: We have | A1 A2 | ≤ | A2 A3 | ≤ | A3 A4 | ≤ · · · .

Claim 2: If A3 6= A1 , then | A1 A2 | < | A2 A3 |.

[Proof of Claim 1: We must show that | Ai−1 Ai | ≤ | Ai Ai+1 | for each integer i ≥ 2.
So let i ≥ 2 be an integer. We have Ai−1 6= Ai (since you don’t ever travel from
a town directly to itself). From the way the journey A1 A2 A3 · · · was defined, we
know that Ai+1 is the town that is farthest away from Ai . Hence, | Ai Ai+1 | ≥
| Ai X | for every town X 6= Ai . We can apply this to X = Ai−1 (since Ai−1 6= Ai ),
and conclude that | Ai Ai+1 | ≥ | Ai Ai−1 | = | Ai−1 Ai |. In other words, | Ai−1 Ai | ≤
| Ai Ai+1 |. This is precisely what we needed to show. Thus, Claim 1 is proven.]
[Proof of Claim 2: Assume that A3 6= A1 . Then, the line segments A1 A2 and A2 A3
are distinct. Hence, | A1 A2 | 6= | A2 A3 | (since we assumed that the distances between
the towns are distinct). However, Claim 1 yields | A1 A2 | ≤ | A2 A3 |. Combining this
with | A1 A2 | 6= | A2 A3 |, we obtain | A1 A2 | < | A2 A3 |. Thus, Claim 2 follows.]
Now, assume that A3 6= A1 . We must prove that you never come back to the
town A1 . Indeed, assume the contrary. Thus, you do come back to the town A1
at some point. In other words, there exists an integer i ≥ 2 such that Ai = A1 .
Consider this i. Note that Ai = A1 6= A2 (since you don’t ever travel from a town
directly to itself), and thus i 6= 2. Hence, i ≥ 3 (since i ≥ 2).
Now, Claim 1 yields | A1 A2 | ≤ | A2 A3 | ≤ | A3 A4 | ≤ · · · , so that | A2 A3 | ≤
264 . Hence, A A
| A 3 A 4 | ≤ · · · ≤ | A i −1 A i | | 2 3 | ≤ | Ai−1 Ai |. But Claim 2 yields
| A1 A2 | < | A2 A3 |. Thus,

| A 1 A 2 | < | A 2 A 3 | ≤ | A i −1 A i | = | A i A i −1 | = | A 1 A i −1 | (394)

(since Ai = A1 ). Also, Ai−1 6= Ai (since you don’t ever travel from a town directly
to itself), and thus Ai−1 6= Ai = A1 .
However, from the way the journey A1 A2 A3 · · · was defined, we know that A2 is
the town that is farthest away from A1 . Hence, | A1 A2 | ≥ | A1 X | for every town X 6=
A1 . Applying this to X = Ai−1 , we obtain | A1 A2 | ≥ | A1 Ai−1 | (since Ai−1 6= A1 ).
This contradicts (394). This contradiction shows that our assumption was wrong.
Hence, Exercise 8.2.5 (a) is solved.
(b) Exercise 8.2.5 (b) can be solved by the exact same argument as Exercise 8.2.5
(a), just with all inequality signs reversed (i.e., we have to replace every “≤” by an
“≥” and likewise).
The next exercise (which is similar in many ways to Exercise 8.2.3) models the
typical failure of breakout rooms at a Zoom conference:

264 Ifi = 3, then this chain of inequalities is a trivial chain with only one number and no inequality
signs. But as you can easily see, this does not invalidate the argument that we are now going to
make.

December 25, 2021


Math 235 notes page 423

Exercise 8.2.6. Several people are in a building with several rooms. Each minute,
one person leaves a room and moves to another that has more people (not count-
ing the person who is moving). (That is: If a person was in a room with m other
people, he moves to a room with more than m other people.) Prove that eventu-
ally, all of the people will end up in the same room.
[Example: Let us assume that the starting state is (4, 2, 2), by which we mean
that there are 4 people in one room, 2 in another, and 2 in a third room. Now,
one of the two people from the second room may move into the third, resulting
in the state (4, 1, 3). Then, one person from the third room may move into the
first, resulting in (5, 1, 2). Then, the single inhabitant from the second room may
move into the first, resulting in (6, 0, 2). Two more moves later, we obtain the
state (8, 0, 0), which means that everybody is in the first room.]

Solution to Exercise 8.2.6 (sketched). A dispersed couple shall mean a 2-element set {u, v}
consisting of two people u and v that are in different rooms. (Of course, this no-
tion depends on the state.) Define the dispersion of a state to be the # of dispersed
couples in that state. (For example, the state (4, 2, 2) in the above example has dis-
persion 4 · 2 + 4 · 2 + 2 · 2 = 20.) Clearly, the dispersion of a state is a nonnegative
integer.
Now, we claim the following:

Claim 1: Each minute, the dispersion of the state decreases.

[Proof of Claim 1: Consider what happens in a given minute. Namely, one person
leaves a room and moves to another that has more people (not counting the person
who is moving). Let p be this person; let M be the room that p is leaving; let N
be the room that p is entering. Then, room N has more people than room M (not
counting p), because p is moving to a room with more people.
Let m be the # of people in room M (not counting p), and let n be the # of people
in room N (not counting p). Then, n > m (since room N has more people than
room M), so that n − m > 0. It is now easy to see that this move decreases the
dispersion of the state by n − m (since n dispersed couples disappear265 , and m
new dispersed couples appear266 ). Since n − m > 0, this entails that the dispersion
of the state decreases. Thus, Claim 1 is proven.]
The rest of the solution is now essentially a repetition of the “infinite descent”
argument we have seen in the discussion of Exercise 5.3.1 (and again in the solution
to Exercise 8.2.3). Namely, Claim 1 shows that the dispersion of the state decreases
each minute. But the dispersion of any state is a nonnegative integer, and thus
cannot decrease indefinitely. More concretely: If the dispersion of the original state
was N, then the dispersion cannot decrease more than N times without becoming
negative. Thus, the moves cannot go on for more than N minutes.
265 Namely, the n couples of the form { p, x } with x ∈ N were dispersed before the move but are no
longer dispersed after the move.
266 Namely, the m couples of the form { p, x } with x ∈ M were not dispersed before the move but

become dispersed after the move.

December 25, 2021


Math 235 notes page 424

Hence, after at most N moves, we must arrive at a state where no person can
move any more. But what does it mean that no person can move? If there is any
dispersed couple { p, q}, then at least one of the two people p and q can move267 .
Hence, if no person can move, then there is no dispersed couple, and therefore all
of the people must be in the same room. Thus, after at most N moves, we must
arrive at a state where all of the people are in the same room (because we know
that after at most N moves, we must arrive at a state where no person can move
any more). This solves Exercise 8.2.6.
Next, a more advanced monovariant problem:

Exercise 8.2.7. Consider a hotel with an infinite number of rooms, arranged se-
quentially on the ground floor. The rooms are labelled (from left to right) by
integers i ∈ Z, with room i being adjacent to rooms i − 1 and i + 1. (To be spe-
cific, room i − 1 is left of room i, while room i + 1 is right of room i.) Thus, the
hotel looks as follows:

··· ···
↑ ↑ ↑ ↑ ↑ ↑
room −2 room −1 room 0 room 1 room 2 room 3

(where the boxes of the table correspond to the rooms; of course, we are only
showing a small part of the actually infinite hotel).
A finite number of violinists are staying in the hotel; each room has at most
one violinist in it. Each night, some two violinists staying in adjacent rooms (if
two such violinists exist) decide they cannot stand each other’s noise, and move
apart: One of them moves to the nearest unoccupied room to the left, while
the other moves to the nearest unoccupied room to the right. (The two violin-
ists move simultaneously, so one moving away does not prevent the other from
moving. Only two violinists move in any given night.) This keeps happening for
as long as there are two violinists in adjacent rooms.
Prove that this moving will stop after a finite number of days (i.e., there will
be a day when no two violinists are in adjacent rooms any more).
[Example: Let us assume that initially, there are 5 violinists (named a, b, c, d, e),
arranged as follows:

··· a b c d e ··· (395)

267 Proof:
Assume that there is a dispersed couple { p, q}. We claim that at least one of the two people
p and q can move. Indeed, we WLOG assume that the room containing p has at least as many
people in it as the room containing q (otherwise, we can just interchange p with q). Then, the
room containing p has (strictly) more people than the room containing q if we don’t count q
(because not counting q decreases the head count of the latter room by 1). Therefore, q can move
from the latter room into the former room (according to the rules of the game). Thus, at least
one of the two people p and q can move (in this case, q). Qed.

December 25, 2021


Math 235 notes page 425

(where the boxes of the table correspond to the rooms; of course, we are only
showing a small part of the actually infinite hotel). On the first night, let’s say
the violinists a and b tire of each other’s presence and move apart; this results in
the following state:

··· a b c d e ···

Now, let’s say that violinists b and c move apart on the next night, resulting in

··· a b d c e ···

On the next night, violinists c and e decide to move apart:

··· a b c d e ···

On the next night, violinists c and d decide to move apart:

··· a b c d e ···

On the next night, violinists b and c decide to move apart:

··· a b c d e ···

On the next night, violinists a and b decide to move apart:

··· a b c d e ···

Now, there are no more neighbors – so no further moves can happen.


(Of course, there were choices involved in this process; we have only shown
one possibility. Other pairs of neighbors may have moved apart instead, and the
resulting state could well be different. But the exercise claims that whatever way
the violinists move, the moving will come to an end eventually.)]

Solution to Exercise 8.2.7 (sketched). Note that each room has at most one violinist
staying in it in the initial state. This property remains valid in all later states as
well, since violinists can only move into unoccupied rooms.
Let us regard the violinists as indistinguishable (i.e., we don’t care which violinist
is in which room, but only care about which rooms are occupied).268
Thus, we can identify any state with the finite subset {i ∈ Z | room i is occupied}
of Z (since each room has at most one violinist staying in it). Let us make this iden-
tification; thus, states are finite subsets of Z. For example, the state shown in (395)
is the subset {3, 4, 6, 7, 9}, provided that the rooms shown in (395) are the rooms
268 Indeed, the identities of the violinists are clearly immaterial to the problem at hand.

December 25, 2021


Math 235 notes page 426

1, 2, . . . , 11.
Thus, any move removes two consecutive integers j and j + 1 from the state and
inserts two new integers into the state (one of which is < j while the other is
> j + 1). More precisely: If S is a state and j is an integer such that both j and j + 1
belong to S, then there is a move that transforms S into the state

(S \ { j, j + 1})
∪ {the largest integer < j that does not belong to S}
∪ {the smallest integer > j + 1 that does not belong to S} .

We define the entropy of a state S to be the sum ∑ 2i (recalling that S is a finite


i ∈S
subset of Z). This is a rational number (since the sum is finite).
It is easy to see that this entropy increases each night. In other words:

Claim 1: Whenever two violinists move apart, the entropy of the state
increases.

[Proof of Claim 1: Consider two violinists moving apart. Let j and j + 1 be the
rooms where they live before the move, and let p and q be the rooms where they
live after the move, labelled in such a way that p < j and q > j + 1. Then, q > j + 1,
so that q ≥ j + 2 (since q and j + 1 are integers) and thus

2q ≥ 2 j+2 = 2 · 2 j+1 = |{z}


2 j +1 + 2 j +1 > 2 j + 2 j +1
>2 j

and therefore 2 p + 2q > 2q > 2 j + 2 j+1 . In other words, 2 p + 2q − 2 j − 2 j+1 > 0.


Now, recall that the entropy of a state S was defined as the sum ∑ 2i . The
i ∈S
move that we are currently considering removes the two addends 2 j and 2 j+1 from
this sum, and inserts the two addends 2 p and 2q in their stead. Thus, this move
increases this sum by 2 p + 2q − 2 j − 2 j+1 . Since 2 p + 2q − 2 j − 2 j+1 > 0, this shows
that this move increases this sum. In other words, this move increases the entropy.
In other words, the entropy after the move is greater than the entropy before the
move. This proves Claim 1.]
This was a good step towards the solution, but we have still a long way to go.
In theory, there are infinitely many states possible (after all, a state is just a finite
subset of Z, and there are infinitely many of those), so the entropy could keep
increasing indefinitely without the moves ever coming to an end. If we could
somehow show that only finitely many possible states can be reached, then Claim
1 would show that the moving must come to an end (because the set of possible
entropies would then also be finite, and thus the entropy could not keep increasing
forever).
Fortunately, we can indeed prove this. To do so, we let N be the # of violinists in
the hotel. (Clearly, this # does not change during the process.) We shall show that

December 25, 2021


Math 235 notes page 427

the violinists never move “too far” away from their original rooms; more precisely,
they will always stay within 3N rooms of the interval between the leftmost and the
rightmost room occupied in the initial state. We shall now make this precise.
Let S0 be the initial state. Consider a sequence of g (successive) moves, starting
from state S0 and leading to states S1 , S2 , S3 , . . . , Sg in this order (i.e., the first move
transforms state S0 into state S1 ; the next move transforms state S1 into state S2 ; and
so on). Thus, in any one of the states S0 , S1 , . . . , Sg , there are exactly N violinists
in the hotel (since the # of violinists in the hotel never changes, and always equals
N), and thus exactly N occupied rooms (since each occupied room has exactly one
violinist in it). In other words, we have

N = | S0 | = | S1 | = · · · = S g . (396)

We WLOG assume that N > 0 (since otherwise, there are no violinists at all in the
hotel, and the exercise becomes trivial). Thus, the sets S0 , S1 , . . . , Sg are nonempty
finite sets (because (396) shows that each of them has N elements); therefore, their
minima and maxima are well-defined. Let α = min (S0 ) and ω = max (S0 ).
Now, we shall see that the violinists don’t spread “too fast” through the hotel.
To be more specific, we claim the following:

Claim 2: We have min (Si+1 ) ≥ min (Si ) − 1 for each i ∈ {0, 1, . . . , g − 1}.

[Proof of Claim 2: Let i ∈ {0, 1, . . . , g − 1}. We must show that min (Si+1 ) ≥
min (Si ) − 1.
Indeed, assume the contrary. Thus, min (Si+1 ) < min (Si ) − 1. Hence, min (Si+1 ) +
1 < min (Si ), so that min (Si ) > min (Si+1 ) + 1.
The room min (Si+1 ) is occupied in state Si+1 (since min (Si+1 ) ∈ Si+1 ). However,
all rooms269 k < min (Si ) are unoccupied in state Si (since min (Si ) is the smallest
element of Si ). Thus, in particular, the room min (Si+1 ) is unoccupied in state Si
(since min (Si+1 ) < min (Si ) − 1 < min (Si )). Thus, we have shown that the room
min (Si+1 ) is occupied in state Si+1 but not in state Si . Therefore, the move that
transforms state Si into state Si+1 must place a violinist in room min (Si+1 ). Let us
denote this violinist by p, and let us refer to this move as “the move Si → Si+1 ”.
Let r be the room which violinist p occupies in state Si (that is, before this move).
Then, r ≥ min (Si ) (since all rooms k < min (Si ) are unoccupied in state Si ), so
that r ≥ min (Si ) > min (Si ) − 1 > min (Si+1 ). Hence, in the move Si → Si+1 , the
violinist p moves left (since p moves from room r to room min (Si+1 )).
Recall again that all rooms k < min (Si ) are unoccupied in state Si . Hence, the
room min (Si+1 ) + 1 is unoccupied in state Si (because min (Si+1 ) + 1 < min (Si )).
Moreover, min (Si+1 ) < min (Si+1 ) + 1 < r (since r ≥ min (Si ) > min (Si+1 ) + 1). In
other words, the room min (Si+1 ) + 1 lies strictly between the two rooms min (Si+1 )
and r.

269 We
are identifying each integer with the corresponding room of our hotel. Thus, “rooms k <
min (Si )” means “rooms k to the left of room min (Si )”.

December 25, 2021


Math 235 notes page 428

Now, recall the nature of moves: When two violinists move apart, only one of
them moves left, and this violinist moves to the nearest unoccupied room to its
left. Thus, in the move Si → Si+1 , the violinist p moves to the nearest unoccupied
room to the left of room r (since he moves left, and since he is originally in room r).
This nearest unoccupied room, however, cannot be the room min (Si+1 ), because
the room min (Si+1 ) + 1 is also unoccupied in state Si and lies strictly between the
two rooms min (Si+1 ) and r (so that it is also to the left of room r but is nearer to r
than min (Si+1 )). Hence, in the move Si → Si+1 , the violinist p cannot move to the
room min (Si+1 ). But this contradicts the fact that (as we have seen above) the move
Si → Si+1 does place the violinist p in room min (Si+1 ). This contradiction shows
that our assumption was wrong. Hence, min (Si+1 ) ≥ min (Si ) − 1 is proved. This
proves Claim 2.]
We next introduce another notation. If S is any state (i.e., any finite subset of Z),
then we define the subset S−0+ of Z by

S −0+ = S ∪ { s + 1 | s ∈ S } ∪ { s − 1 | s ∈ S }
= {i ∈ Z | i ∈ S or i − 1 ∈ S or i + 1 ∈ S} .

In other words, S−0+ is the set of all integers i that belong to S themselves or have
a neighbor (that is, i − 1 or i + 1) belong to S. If we identify each integer with the
corresponding room in our hotel, then we can restate this as follows: S−0+ is the
set of all rooms that are occupied or adjacent to an occupied room (assuming that
S is the set of all occupied rooms)270 . Clearly, for any state S, we have

S −0+ ≤ 3 · | S | (397)

(this follows easily from (277)) and

S ⊆ S −0+ . (398)

Our next claim shows that if at least one of three consecutive rooms is occupied
at some point, then this property will remain valid in all future states (even though
it will not always be the same room that is occupied, or even the same # of rooms):

Claim 3: We have Si−0+ ⊆ Si−+01+ for each i ∈ {0, 1, . . . , g − 1}.

[Proof of Claim 3: Let i ∈ {0, 1, . . . , g − 1}. We must show that Si−0+ ⊆ Si−+01+ .
In other words, we must show that every k ∈ Si−0+ satisfies k ∈ Si−+01+ . So, let us
consider any k ∈ Si−0+ . We shall show that k ∈ Si−+01+ .
We have k ∈ Si−0+ . In other words, at least one of the three numbers k − 1, k and
k + 1 belongs to Si . In other words, at least one of the three rooms k − 1, k and k + 1
is occupied in state Si .
270 For example, if S = {2, 4, 8, 9}, then S−0+ = {2, 4, 8, 9} ∪ {3, 5, 9, 10} ∪ {1, 3, 7, 8} =
{ 1, 2, 3, 4, 5, 7, 8, 9, 10}.

December 25, 2021


Math 235 notes page 429

We must show that k ∈ Si−+01+ . In other words, we must show that at least one of
the three numbers k − 1, k and k + 1 belongs to Si+1 . In other words, we must show
that at least one of the three rooms k − 1, k and k + 1 is occupied in state Si+1 .
The state Si+1 is obtained from the state Si by a move. Let us consider all possi-
bilities for how this move can affect rooms k − 1, k and k + 1 (recalling that at least
one of these three rooms must be occupied in state Si ):

• If there is a violinist in room k before the move but no violinist in room k − 1,


then there will be a violinist in (at least) one of the rooms k − 1 and k after
the move. (Indeed, the move will either leave the violinist in room k in place,
or (if it does displace this violinist) it will cause a violinist to appear in room
k − 1.)

• If there is a violinist in room k before the move but no violinist in room k + 1,


then there will be a violinist in (at least) one of the rooms k + 1 and k after
the move. (Indeed, the move will either leave the violinist in room k in place,
or (if it does displace this violinist) it will cause a violinist to appear in room
k + 1.)

• If there are violinists in all three rooms k − 1, k and k + 1 before the move,
then at least one of these three violinists will remain in his room after the
move (since a move only displaces two violinists).

• If there is a violinist in room k − 1 before the move but no violinist in room k,


then there will be a violinist in (at least) one of the rooms k − 1 and k after the
move. (Indeed, the move will either leave the violinist in room k − 1 in place,
or (if it does displace this violinist) it will cause a violinist to appear in room
k.)

• If there is a violinist in room k + 1 before the move but no violinist in room k,


then there will be a violinist in (at least) one of the rooms k + 1 and k after the
move. (Indeed, the move will either leave the violinist in room k + 1 in place,
or (if it does displace this violinist) it will cause a violinist to appear in room
k.)

These five possibilities cover all the possible cases (since we know that at least
one of the three rooms k − 1, k and k + 1 is occupied in state Si ). Thus, in each
possible case, we have shown that there is a violinist in at least one of the three
rooms k − 1, k and k + 1 after the move. In other words, at least one of the three
rooms k − 1, k and k + 1 is occupied in state Si+1 . As we explained above, this
completes the proof of Claim 3.]
Let us draw some conclusions from Claim 3. It is not true that S0 ⊆ S1 ⊆ · · · ⊆
Sg , since an occupied room can become unoccupied after a move. However, Claim
3 shows that we have
S0−0+ ⊆ S1−0+ ⊆ · · · ⊆ S−
g
0+
. (399)

December 25, 2021


Math 235 notes page 430

In words, this is saying that if a room is occupied or adjacent to an occupied room,


then it will always remain occupied or adjacent to an occupied room.
In the rest of this solution, we shall use the notation [ p, q] for an integer interval.
That is, if p and q are two integers, then the notation [ p, q] shall denote the set
{ p, p + 1, . . . , q} = {i ∈ Z | p ≤ i ≤ q} (rather than, as it commonly does, the real
interval {i ∈ R | p ≤ i ≤ q}). This will be convenient, since we will have to deal
with integer intervals rather than real intervals in this solution.
Our next claim will show that the leftmost occupied room will always remain to
the right of the room α − 3N (so it cannot “wander off” to the left too far):

Claim 4: Let m ∈ {0, 1, . . . , g}. Then, min (Sm ) > α − 3N.

[Proof of Claim 4: Before I prove this formally, let me sketch what is going on
(as the formal proof does a good job of obscuring this). Consider how the state
evolves from S0 to Sm . With every move Si → Si+1 , the smallest element of the
state (i.e., the leftmost occupied room) shifts to the left by at most 1 (because of
Claim 2). For the initial state S0 , this smallest element is α (since α = min (S0 )).
Hence, if the smallest element of Sm is some integer β ≤ α (that is, we have β =
min (Sm ) ≤ α), then each integer j ∈ [ β, α] must be the smallest element of some
intermediate state between S0 and Sm (since otherwise, the smallest element would
have “jumped over” j, which is impossible given that it only shifts to the left by at
most 1 at each step). Hence, each integer j ∈ [ β, α] must be occupied in one of these
intermediate states. In other words, each integer j ∈ [ β, α] belongs to some Sk (with
k ∈ {0, 1, . . . , m}), and therefore also to Sk−0+ (since Sk ⊆ Sk−0+ ), and therefore also
to Sm−0+ (since (399) yields S−0+ ⊆ S−0+ ). This yields a lower bound on the size of
k m
Sm−0+ : Namely, it yields S−0+ ≥ α − β + 1. If β ≤ α − 3N, then this lower bound
m
entails Sm −0+ ≥ 3N + 1 > 3N, which contradicts the easily established fact that

Sm−0+ ≤ 3 · | S | = 3N. Hence, we must have β > α − 3N, and this is precisely
m
|{z}
=N
what Claim 4 claims.
Here is the proof in all its boring detail. We must show that min (Sm ) > α − 3N.
Assume the contrary. Thus, min (Sm ) ≤ α − 3 |{z}N < α = min (S0 ).
>0
Now, let j ∈ [min (Sm ) , min (S0 )] be arbitrary. We shall show that j ∈ Sm−0+ .

Indeed, we have j ∈ [min (Sm ) , min (S0 )]. In other words, j ∈ Z and min (Sm ) ≤
j ≤ min (S0 ).
There exists some k ∈ {0, 1, . . . , m} satisfying min (Sk ) ≤ j (for example, k = m
will work, since min (Sm ) ≤ j). Consider the smallest such k. Then, min (Sk ) ≤
j; however, if k 6= 0, then min (Sk−1 ) > j (since otherwise, k would not be the
smallest element of {0, 1, . . . , m} to satisfy min (Sk ) ≤ j). From this, it is easy to
see that min (Sk ) = j. Indeed, assume the contrary. Thus, min (Sk ) 6= j, so that
min (Sk ) < j (since min (Sk ) ≤ j) and therefore k 6= 0 (since otherwise, we would
have k = 0, so that min (Sk ) = min (S0 ) ≥ j, which would contradict min (Sk ) < j).
Hence, min (Sk−1 ) > j (because we said that if k 6= 0, then min (Sk−1 ) > j), so

December 25, 2021


Math 235 notes page 431

that min (Sk−1 ) ≥ j + 1 (since min (Sk−1 ) and j are integers). But k ∈ {1, 2, . . . , m}
(since k ∈ {0, 1, . . . , m} and k 6= 0), so that k − 1 ∈ {0, 1, . . . , m − 1}. Hence, Claim
2 (applied to i = k − 1) yields min (Sk ) ≥ min (Sk−1 ) − 1 ≥ j (since min (Sk−1 ) ≥
j + 1). This contradicts min (Sk ) < j. This contradiction shows that our assumption
was false. Hence, we obtain min (Sk ) = j. Thus, j = min (Sk ) ∈ Sk ⊆ Sk−0+ (by
(398)).
However, (399) yields Sk−0+ ⊆ Sm −0+ (since k ∈ {0, 1, . . . , m }). Hence, j ∈ S−0+ ⊆
k
Sm−0+ .

Now, forget that we fixed j. We thus have proved that j ∈ Sm −0+ for each j ∈

[min (Sm ) , min (S0 )]. In other words, [min (Sm ) , min (S0 )] ⊆ Sm −0+ . Hence,

−0+
|[min (Sm ) , min (S0 )]| ≤ Sm ≤ 3 · | Sm | (by (397))
|{z}
=N
(by (396))
= 3N,

so that
 

3N ≥ min (Sm ) , min (S0 ) = |[min (Sm ) , α]|


| {z }

= α − min (Sm ) + 1 (since min (Sm ) ≤ α)
> α − min (Sm ) .

In other words, min (Sm ) > α − 3N. This proves Claim 4.]

Claim 5: Let m ∈ {0, 1, . . . , g}. Then, max (Sm ) < ω + 3N.

[Proof of Claim 5: Claim 5 is an analogue of Claim 4: While Claim 4 says that


min (Sm ) cannot stray too far leftwards from min (S0 ), Claim 5 says that max (Sm )
cannot stray too far rightwards from max (S0 ). The proofs are analogous, too; our
above proof of Claim 4 thus can be easily transformed into a proof of Claim 5
(mutatis mutandis – e.g., all the signs need to be reversed, and similar changes).]
Now, Claim 4 and Claim 5 can be combined to the following:

Claim 6: Let m ∈ {0, 1, . . . , g}. Then, Sm ⊆ [α − 3N + 1, ω + 3N − 1].

[Proof of Claim 6: Let j ∈ Sm . Thus, j ≥ min (Sm ) > α − 3N (by Claim 4) and
j ≤ max (Sm ) < ω + 3N (by Claim 5). Combining these two inequalities, we obtain
j ∈ [α − 3N + 1, ω + 3N − 1] (since j is an integer).
Forget that we fixed j. We thus have shown that j ∈ [α − 3N + 1, ω + 3N − 1] for
each j ∈ Sm . In other words, Sm ⊆ [α − 3N + 1, ω + 3N − 1]. This proves Claim 6.]

December 25, 2021


Math 235 notes page 432

We note that ω = max (S0 ) ≥ min (S0 ) = α and thus |{z} | {z− 1} > α −
ω + 3N
≥α >−3N +1
(since N >0)
3N + 1. Hence, the interval [α − 3N + 1, ω + 3N − 1] is nonempty, and its size is

|[α − 3N + 1, ω + 3N − 1]| = (ω + 3N − 1) − (α − 3N + 1) + 1 = ω − α + 6N − 1.
Now, we can use (e.g.) the pigeonhole principle: Claim 1 entails that the entropy
of the state increases with every move. Thus,

(the entropy of S0 ) < (the entropy of S1 ) < · · · < the entropy of Sg .
Hence, the entropies of the g + 1 states S0 , S1 , . . . , Sg are distinct. Therefore, these
g + 1 states S0 , S1 , . . . , Sg must themselves be distinct. However, all these g + 1 states
S0 , S1 , . . . , Sg are subsets of the set [α − 3N + 1, ω + 3N − 1] (by Claim 6). Hence,
we have found g + 1 distinct subsets of the set [α − 3N + 1, ω + 3N − 1]. By the
pigeonhole principle, this entails that

g + 1 ≤ (# of all subsets of [α − 3N + 1, ω + 3N − 1])


= 2|[α−3N +1,ω +3N −1]| = 2ω −α+6N −1
(since |[α − 3N + 1, ω + 3N − 1]| = ω − α + 6N − 1) .

In other words, g ≤ 2ω −α+6N −1 − 1.


Now, forget that we fixed g and S1 , S2 , . . . , Sg . We thus have shown that any se-
quence of g (successive) moves, starting from state S0 , must satisfy g ≤ 2ω −α+6N −1 −
1. In other words, there is no sequence of (successive) moves, starting from state
S0 , that has more than 2ω −α+6N −1 − 1 moves. In other words, the moves cannot go
on for more than 2ω −α+6N −1 nights (if the initial state is S0 ). Hence, the moving
will stop after a finite number of days. This solves Exercise 8.2.7.
The next exercise (a slight generalization of [Engel98, Chapter 1, Example E4])
can be solved using a monovariant, even though no process or movement is inher-
ently present in the exercise. The trick here is to find a process first:

Exercise 8.2.8. Let m ∈ N. Each member of a parliament has at most m enemies.


(The notion of an “enemy” is mutual: If A is an enemy of B, then B is an enemy
of A.) Prove that it is possible to subdivide the parliament into two houses (with
each member going into exactly one house)271 such that each member has at
m
most enemies in his own house.
2

Solution to Exercise 8.2.8 (sketched). We construct a desired subdivision algorithmi-


cally: Start with some arbitrary subdivision of the parliament into two houses. A
m
member of the parliament will be called unhappy if he has more than enemies
2
271 For the pedants: A house can be empty.

December 25, 2021


Math 235 notes page 433

in his own house. As long as an unhappy member exists, we can pick an unhappy
member and move him into the other house. We keep doing these moves until no
more unhappy members exist. (We make these moves sequentially; we don’t move
several unhappy members simultaneously.)
I claim that these moves cannot go on forever (and thus, at some point, we will
end up with no more unhappy members). Indeed, I define a discordant couple to be
a two-element set {u, v} of two parliament members that are mutual enemies but
are in the same house. (Of course, this concept depends on the state.) I define the
discord of a state to be the # of discordant couples in that state. Now, the discord of
a state is always a nonnegative integer. Moreover, each of our moves decreases the
m
discord (this is easy to check: if a member is unhappy, then he has more than
2
m 272
enemies in his own house, and thus fewer than enemies in the other house ;
2
the move thus decreases his contribution to the discord273 ). Hence, by the same
kind of argument as in the above solution to Exercise 8.2.3, we see that the moves
cannot go on forever (since the discord is a nonnegative integer and thus cannot
keep decreasing forever). Hence, eventually, the moves will have stopped. In the
resulting subdivision of the parliament, no member will be unhappy (since an
unhappy member would enable a further move), which means that each member
m
has at most enemies in his own house. Thus, Exercise 8.2.8 is solved.
2
Remark 8.2.3. Exercise 8.2.8 would be false if the notion of an “enemy” was not
mutual. For instance, if we take m = 3, and if 0, 1, 2, 3, 4 are five parliament
members with each i ∈ {0, 1, 2, 3, 4} having enemies (i + 1) %5, (i + 2) %5 and
(i + 3) %5, then there is no way to prevent one of them from having more than
3
enemies in his own house, no matter how the parliament is subdivided into
2
two houses.

8.3. Homework set #8


This problem set is not to be handed in.
This homework set covers the above parts of Chapter 8 as well as other chapters
and unrelated ideas.274

272 since he has at most m enemies in total


273 In m
more detail: The member that is being moved belongs to more than discordant couples
2
m
before the move, but belongs to fewer than discordant couples after the move. Thus, the total
2
number of discordant couples that contain this member decreases when we make the move.
Since the move does not change the discordant couples that don’t contain this member, we can
thus conclude that the move decreases the total number of discordant couples, i.e., the discord.
274 Recall Definition 3.5.3, Convention 7.2.1 and Convention 7.2.2.

December 25, 2021


Math 235 notes page 434

Exercise 8.3.1. Let n be a positive integer. Let Z be the set of all pairs ( x, y) ∈ [n]2
satisfying x ⊥ y and x + y > n. (For example, if n = 5, then

Z = {(1, 5) , (2, 5) , (3, 4) , (3, 5) , (4, 3) , (4, 5) , (5, 1) , (5, 2) , (5, 3) , (5, 4)} . )

1
Find ∑ .
( x,y)∈ Z xy

Exercise 8.3.2. (a) Consider the following picture:

A B .

Compare the area of the red region with that of the blue region.
(Here, ABC is an isosceles right-angled triangle with right angle at A. We have
erected semicircles with diameters AB and AC, both pointing into the inside of
triangle ABC. We have also drawn a quarter-circle with center A and radius
AB = AC bordered by the points B and C. The red region is formed by removing
the two semicircles from the quarter-circle. The blue region is the (set-theoretical)
intersection of the two semicircles.)
(b) Let n ∈ N. Let σ be a permutation of [n]. Let j ∈ {0, 1, . . . , n}. Prove that

(# of all i ∈ [n] satisfying i ≥ j > σ (i ))


= (# of all i ∈ [n] satisfying σ (i ) ≥ j > i ) .

The next exercise uses a bit of analysis:

Exercise 8.3.3. What number is larger: eπ or π e ? Here, π is the number pi


(approximately 3.142), while e is Euler’s number (approximately 2.718).
(You don’t need a calculator.)

Exercise 8.3.4. Consider an n × m-rectangle subdivided into 1 × 1-squares in the


n+m
usual way (like a chessboard). Originally, fewer than of its nm squares are
2
infected. Every minute, each square that has at least 2 infected neighbors becomes
infected. (A neighbor of a square is a square that has an edge in common with

December 25, 2021


Math 235 notes page 435

it. A corner in common does not suffice.) Show that at least one square remains
uninfected no matter how long you wait.
[Example: If n = 3 and m = 5, then we may have the following initial state
(where “X” stands for an infected square):

X
X .
X

Then, after one minute, we will have

X X
X X .
X

After one more minute, we will have

X X
X X X .
X X

After one more minute, we will have

X X X
X X X .
X X X

There will be no more new infections after that.]

For the next exercise, imagine n students coming to a party; each student, on
arrival, leaves his coat on the coatrack. When the party ends, the students leave one
by one, each taking a (uniformly) random coat back from the coatrack. (We assume
that no student leaves before all students have entered.) The probability that each
1
student gets his original coat back is . What is the probability that no student
n!
1
gets his original coat back? The somewhat surprising answer is “approximately ,
e
where e is Euler’s number” (and the approximation becomes the better the larger
n is). The following exercise makes this precise:

December 25, 2021


Math 235 notes page 436

Exercise 8.3.5. Let n ∈ N. A derangement of [n] means a permutation of [n] that


has no fixed points (i.e., a permutation σ ∈ Sn that satisfies σ (i ) 6= i for each
i ∈ [n]). Let Dn denote the # of derangements of [n].
n n!
(a) Prove that Dn = ∑ (−1)k for each n ∈ N.
k
 = 0  k!
1
(b) Set round ( x ) = x + for each x ∈ R. Prove that
2
 
n!
Dn = round for all n ≥ 1.
e

The next exercise is about the “four-numbers game”. Assume you have four
integers a, b, c, d written (in counterclockwise order) on the circumference of a circle:

a
c

b .

These four integers subdivide the circle into four arcs. To make a difference move
means to replace these four integers by their consecutive (absolute-value) differ-
ences (i.e., on each of the four arcs of the circle, we write the absolute value of the
difference between the two integers placed on the endpoints of the arc; then, we

December 25, 2021


Math 235 notes page 437

erase the original integers). In other words, here is what a difference move does:

d d
|c − d| |d − a|

a → a
c c

|b − c| | a − b|
b b

|c − d| |d − a|

|b − c| | a − b|
.

The result of a difference move is again a placement of four integers on a circle;


thus, we can iterate difference moves again and again. Some experimenting sug-
gests the following conjectures:

• After four difference moves, all four integers on the circle will be even.

• After 4k difference moves (where k ∈ N), all four integers on the circle will
be divisible by 2k .

• If the four integers on the circle are nonnegative, then a difference move can-
not increase the largest of them.

• No matter what four integers we start with, we will always end up with
0, 0, 0, 0 if we make sufficiently many difference moves.

The following exercise (which redefines a difference move as a map D on the set
of 4-tuples of integers) states these conjectures in a rigorous fashion and asks you
to prove them:

Exercise 8.3.6. Consider the set Z4 of all 4-tuples of integers. Let D : Z4 → Z4


be the map that sends each 4-tuple ( a, b, c, d) ∈ Z4 to the 4-tuple

(| a − b| , |b − c| , |c − d| , |d − a|) ∈ Z4 .

December 25, 2021


Math 235 notes page 438

Prove the following:


(a) If a ∈ Z4 is any 4-tuple, then all entries of the 4-tuple D4 (a) are even.
(b) If a ∈ Z4 is any 4-tuple, and if k ∈ N, then all entries of the 4-tuple D4k (a)
are divisible by 2k .
(c) If a ∈ Z4 is any 4-tuple whose all four entries are nonnegative, then
     
0 1 2
max D (a) ≥ max D (a) ≥ max D (a) ≥ · · · .

Here, max b denotes the largest entry of a 4-tuple b ∈ Z4 .


(d) If a ∈ Z4 is any 4-tuple, then there exists some k ∈ N such that D k (a) =
(0, 0, 0, 0).
The claim of Exercise 8.3.6 (d) cries out for generalization; the next exercise shows
that this is not as easy as it may seem:
Exercise 8.3.7. (a) Prove that Exercise 8.3.6 (d) may fail if we replace Z by R.
That is, if we define a map D : R4 → R4 in the same way as in Exercise 8.3.6
but using R instead of Z, then there exists a 4-tuple a ∈ R4 such that no k ∈ N
satisfies D k (a) = (0, 0, 0, 0).
(b) Prove that the analogue of Exercise 8.3.6 (d) for 3-tuples instead of 4-tuples
(with the map D sending the 3-tuple ( a, b, c) to (| a − b| , |b − c| , |c − a|)) also fails:
i.e., there exists a 3-tuple a ∈ Z3 such that no k ∈ N satisfies D k (a) = (0, 0, 0).
Better yet, prove that if a ∈ Z3 is a 3-tuple whose entries are not all equal, then
there is no k ∈ N such that D k (a) = (0, 0, 0).
2 , x3 =

[Hint: For part (a), find two nonzero reals x, y such that D 1, x, x
y, yx, yx2 , yx3 .]


Exercise 8.3.8. The Leibniz triangle is a distant relative of Pascal’s triangle. Here
are its first few rows:
k =0
.
1 k =1
n=0 → .
1
1 1 k =2
n=1 → .
2 2
1 1 1 k =3
n=2 → .
3 6 3
1 1 1 1 k =4
n=3 → .
4 12 12 4
1 1 1 1 1 k =5
n=4 → .
5 20 30 20 5
1 1 1 1 1 1 k =6
n=5 → .
6 30 60 60 30 6
1 1 1 1 1 1 1
n=6 →
7 42 105 140 105 42 7

December 25, 2021


Math 235 notes page 439

It is defined as a family of rational numbers T (n, k) defined for all pairs of


nonnegative integers n, k satisfying k ≤ n and satisfying the following two prop-
erties:
1
1. We have T (n, 0) = T (n, n) = for each n ∈ N. (That is, the entries on
n+1
1 1 1
two sides of the triangle are , , , . . ..)
1 2 3
2. We have T (n, k ) = T (n + 1, k ) + T (n + 1, k + 1) for each n ∈ N and k ∈
{0, 1, . . . , n}. (That is, each entry is the sum of its two neighbors below.)

(a) Prove that the numbers T (n, k) are uniquely determined by this.
(b) Find an explicit formula for T (n, k).

Exercise 8.3.9. Let n and k be two positive integers. You have nk identical coins
distributed in n piles. Whenever two piles have an even number of coins in
total, you are allowed to move coins between these piles in such a way that the
numbers of coins on these two piles become equal. Such a move will be called
a balancing move. (For example, if you have a pile with 3 coins and a pile with
9 coins, then a balancing move will change these two piles into two piles with
6 coins each. Each balancing move only changes two piles.) The distribution of
coins is said to be level if all piles have the same number of coins.
Prove the following:
(a) If n is a power of 2, then any distribution of nk coins in n piles can be made
level by a sequence of balancing moves.
(b) If n is not a power of 2, then there is a distribution of nk coins in n piles
(for an appropriate k) that cannot be made level by any sequence of balancing
moves.
[Example: If n = 5 and k = 3, and if the original distribution is (2, 4, 1, 4, 4)
(that is, the first pile has 2 coins, the second has 4 coins, the third has 1 coin,
etc.), then here is one sequence of balancing moves that can be applied to this
distribution (where we are underlining the piles that are being balanced in the
next step):

(2, 4, 1, 4, 4) → (3, 3, 1, 4, 4) → (2, 3, 2, 4, 4) → (3, 3, 2, 3, 4) → (3, 3, 3, 3, 3) .

The distribution at the end of this sequence is level.]

Exercise 8.3.10. Let n ∈ N. A silo contains 2n + 1 boxes; each box contains an


integer amount of apples and an integer amount of pears.
(a) Prove that you can select n + 1 boxes that altogether contain at least half of
all the apples in the silo and also at least half of all the pears in the silo.
(b) Now assume that the boxes can also contain peaches. Is it always possible
to select n + 1 boxes that altogether contain at least half of all the apples in the

December 25, 2021


Math 235 notes page 440

silo, at least half of all the pears in the silo, and at least half of all the peaches in
the silo?
Exercise 8.3.11. Let a, b ∈ N. The “toads and frogs” puzzle is a one-player game
played on a 1 × ( a + b + 1) horizontal strip of squares. Initially, the leftmost a
squares are occupied by toads (one toad per square); the rightmost b squares
are occupied by frogs (one frog per square); the one remaining square is empty.
Thus, for example, for a = 3 and b = 5, the strip of squares looks as follows:

T T T F F F F F

(where “T” stands for a toad, and where “F” stands for a frog). A move in this
game is one of the following four operations:
• A toad moves one square to the right, assuming that the square it moves
to is empty. This is called a toad slide.
• A toad moves two squares to the right, assuming that the square it moves
to is empty and the square inbetween is occupied by a frog. (That is, a toad
jumps over a single frog into an empty square to its right.) This is called a
toad jump.
• A frog moves one square to the left, assuming that the square it moves to
is empty. This is called a frog slide.
• A frog moves two squares to the left, assuming that the square it moves to
is empty and the square inbetween is occupied by a toad. (That is, a frog
jumps over a single toad into an empty square to its left.) This is called a
frog jump.
The objective of the game is to achieve (by a sequence of moves, starting with
the initial state described above) the state in which the leftmost b squares are
occupied by frogs, the rightmost a squares are occupied by toads, and the one
remaining square is empty. For example, here is a way to achieve this objective
when a = 2 and b = 2:
toad slide
T T F F −→ T T F F
frog jump frog slide
−→ T F T F −→ T F T F
toad jump toad jump
−→ T F F T −→ F T F T
frog slide frog jump
−→ F T F T −→ F F T T
toad slide
−→ F F T T .

Prove that this objective can always be achieved in ab + a + b (strategically


chosen) moves.

December 25, 2021


Math 235 notes page 441

8.4. Homework set #9


This is a regular problem set. See Section 3.7 for details on grading.
This homework set covers Chapter 7 and Chapter 8. Some of the problems may
be unrelated.
Please solve at most 5 problems. (No points will be given for further solutions.)
The following exercise is a variation on Exercise 7.8.1:

Exercise 8.4.1. Let n and d be two positive integers.


An n-tuple ( x1 , x2 , . . . , xn ) ∈ [d]n will be called first-even if its first entry x1
occurs in it an even number of times (i.e., the number of i ∈ [n] satisfying xi = x1
is even). (For example, the 3-tuples (1, 5, 1) and (2, 2, 3) are first-even, while the
3-tuple (4, 1, 1) is not.)
Compute the # of first-even n-tuples in [d]n .

Next come two binomial identities:

Exercise 8.4.2. Let n ∈ N and p ∈ Z. Prove that


n
2n − 2k
    
k n n− p n
∑ (−1) k n + p = 2 p
.
k =0

Exercise 8.4.3. Let n be a positive integer. Prove that


n −1
(−1)i n − i
 
1
∑ n−i i
= (−1)(n+1)//3 (1 + [3 | n]) .
n
i =0

(See Definition 3.3.1 and Definition 4.3.19 for the notations used in Exercise 8.4.3.)
The next few exercises are about single-player games (aka nondeterministic pro-
cesses):

Exercise 8.4.4. A chocolate bar has the shape of an m × n-rectangle (subdivided


into little 1 × 1-squares by horizontal and vertical lines, in case your eating habits
are too healthy). For example, if m = 3 and n = 2, then it looks like this:

In one move, you can break a chocolate bar into two by splitting it along one of
the (horizontal or vertical) lines that divide it (unless it is already a 1 × 1-square).

December 25, 2021


Math 235 notes page 442

For example:

move move move


−→ −→ −→

move move
−→ −→ .

(a) What is the smallest number of moves necessary to break up the entire bar
into 1 × 1-squares?
(b) What is the largest number of moves necessary to break up the entire bar
into 1 × 1-squares?

Exercise 8.4.5. A circle is split into 6 sectors, and a number has been written in
each sector. These numbers are 1, 0, 1, 0, 0, 0 in clockwise order, as shown in the
following picture:

0
1 1

0 0
0

In one move, you can add 1 to any two numbers written in adjacent sectors.
Can you ever ensure that all six sectors have the same number written in them?

Exercise 8.4.6. Fix a positive integer n. Consider n chips placed in a heap. In a


move, you are allowed to split a heap H of chips into two smaller heaps H1 and
H2 ; when doing so, you gain | H1 | · | H2 | cents. (We treat heaps as sets of chips;
thus, | H1 | is the # of chips in heap H1 .) After sufficiently many moves, you
are left with n heaps, each containing exactly one chip. What is the maximum
number of cents you can have made by that moment?

December 25, 2021


Math 235 notes page 443

Exercise 8.4.7. Fix two positive integers a and b. Consider a + b bowls, numbered
1, 2, . . . , a + b. Initially, each of the bowls 1, 2, . . . , a contains an apple, and each
of the bowls a + 1, a + 2, . . . , a + b contains a pear. A move consists of picking two
numbers i, j ∈ [ a + b] satisfying i < a + b and j > 1 and i ≡ j mod 2, and moving
an apple from bowl i to bowl i + 1 and a pear from bowl j to bowl j − 1. (We
assume that these fruits do exist in these bowls; otherwise, the move cannot be
made. It is allowed for several fruits to lie in one bowl at the same time.)
The goal is to end up with each of the bowls 1, 2, . . . , b containing a pear and
each of the bowls b + 1, b + 2, . . . , b + a containing an apple. Show that this goal
can be reached if and only if the product ab is even.

Exercise 8.4.8. Consider a hotel with an infinite number of rooms, arranged se-
quentially on the ground floor. The rooms are labelled by integers i ∈ Z, with
room i being adjacent to rooms i − 1 and i + 1. A finite number of violinists are
staying in the hotel (it is possible for two violinists to be staying in the same
room). Each night, two violinists staying in the same room decide they cannot
stand each other’s noise, and move to the two adjacent rooms (i.e., if they were
in room i, they move to rooms i − 1 and i + 1). (Only two violinists move in any
given night.) This keeps happening for as long as there are two violinists staying
in the same room.
Prove that this moving will stop after a finite number of days (i.e., there will
be a day when no two violinists share a room any more).
[Example: Let us assume that initially, there are 5 violinists (named a, b, c, d, e),
arranged as follows:
a d
··· c ··· (400)
b e
(where the boxes of the table correspond to the rooms; of course, we are only
showing a small part of the actually infinite hotel). On the first night, let’s say
the violinists a and b tire of each other’s presence and move apart; this results in
the following state:

b d
··· a ··· .
c e
On the next night, the violinists b and c decide to move apart, and we obtain the
following state:
c
··· a b d ··· .
e
On the next night, the violinists c and e decide to move apart, and we obtain the
state
··· a b c d e ··· .

December 25, 2021


Math 235 notes page 444

Now, no two violinists occupy the same room any more, so no further moves can
happen.]

Our last two exercises on this homework set are about sequences of rational
numbers that turn out to be integer sequences (not unlike the ones in Section 4.11
and Subsection 8.1.3):

Exercise 8.4.9. Define a sequence (t0 , t1 , t2 , . . .) of positive rational numbers re-


cursively by setting
tn = 1 for each n < 4
and
1 + t n −1 t n −3
tn = for each n ≥ 4.
t n −4
(This is Sequence A217787 on the OEIS. Compare Example 4.11.5, which is sim-
ilar but not the same.)
Prove that tn is a positive integer for each integer n ≥ 0.

Exercise 8.4.10. Let q ∈ N. Define a sequence (t0 , t1 , t2 , . . .) of positive rational


numbers recursively by setting

tn = 1 for each n < 3

and
t2n−1 + qtn−1 tn−2 + t2n−2
tn = for each n ≥ 3.
t n −3
Prove that tn is a positive integer for each integer n ≥ 0.

December 25, 2021


Math 235 notes page 445

9. Number Theory II: Primes


We covered some of the basics of number theory in Chapter 3; now we shall go
deeper. The heroes of this chapter shall be the prime numbers (also known as primes);
we will see both some of their intrinsic properties and their applications.
As with all other chapters, this one will be just an introduction; the primes are
among the most well-studied and yet the most mysterious objects in mathemat-
ics, and the results that have been proved about them wouldn’t fit into a book,
let alone a chapter. Some books about primes are [Neale17] (a semi-popular sur-
vey with historical discussions and the occasional proof sketch), [CraPom05] (a
“computational perspective”, with special focus on algorithms and cryptographic
applications), [FinRos16] (a somewhat advanced introduction aimed at graduate
students) and [Narkie00] (a historical account with various classical proofs).

9.1. Primes
9.1.1. Definition and examples
We begin with the definition of a prime:
Definition 9.1.1. Let p be an integer greater than 1. We say that p is prime if the
only positive divisors of p are 1 and p. A prime integer is often just called a
prime.
Note that we required p to be greater than 1 here. Thus, 1 does not count as
prime even though its only positive divisor is 1 itself.
Example 9.1.2. (a) The integer 5 is a prime, since its only positive divisors are 1
and 5.
(b) The integer 6 is not a prime, since it has positive divisors beyond just 1 and
6. (For example, 2 is one of its positive divisors.)
(c) None of the integers 4, 6, 8, 10, 12, 14, 16, . . . (that is, the multiples of 2 that
are larger than 2) is a prime. Indeed, if p is any of these numbers, then p has a
positive divisor other than 1 and p (namely, 2), and therefore does not meet the
definition of “prime”.
(d) None of the integers 6, 9, 12, 15, 18, . . . (that is, the multiples of 3 that are
larger than 3) is a prime. The reason for this is similar to that in Example 9.1.2
(c).

9.1.2. The infinitude of the primes


The first (i.e., smallest) 15 primes are
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47.
One of the oldest famous theorems in mathematics is Euclid’s result that there are
infinitely many primes:

December 25, 2021


Math 235 notes page 446

Theorem 9.1.3. There are infinitely many primes.

Many proofs of this theorem are known; for example, six proofs can be found
in [AigZie14, Chapter 1]. We shall give two proofs here; but first, let us show that
every integer n > 1 is divisible by at least one prime:

Proposition 9.1.4. Let n > 1 be an integer. Then, there exists at least one prime
p such that p | n.

Proof of Proposition 9.1.4 (sketched). (See [19s, proof of Proposition 2.13.8] for de-
tails.) This is another application of the extremal principle: There exists a divisor of
n that is larger than 1 (for example, n itself is such a divisor). Let q be the smallest
such divisor. Then, q | n and q > 1.
We now claim that q is a prime. Indeed, assume the contrary. Thus, q is not a
prime; in other words, 1 and q are not the only positive divisors of q (by Definition
9.1.1). In other words, q has a positive divisor d distinct from 1 and q. Consider this
d. We have d | q | n and d > 1 (since d is a positive integer distinct from 1). Thus,
d is a divisor of n that is larger than 1. Hence, d ≥ q (since q is the smallest such
divisor). However, d | q entails d ≤ q (since d and q are both positive). Combining
this with d ≥ q, we obtain d = q, which contradicts the fact that d is distinct from
q. This contradiction shows that our assumption was wrong. Hence, q is a prime.
Thus, there exists at least one prime p such that p | n (namely, p = q). This proves
Proposition 9.1.4.
We can now step to the proofs of Theorem 9.1.3:
First proof of Theorem 9.1.3 (sketched). (See [19s, proof of Theorem 2.13.43] for de-
tails.) The following classical argument goes back to Euclid’s Elements: Let ( p1 , p2 , . . . , pk )
be any finite list of primes. We shall find a new prime p that is distinct from
p1 , p2 , . . . , p k .
Indeed, set n = p1 p2 · · · pk + 1. It is easy to see that n > 1. Hence, Proposition
9.1.4 shows that there exists at least one prime p such that p | n. Consider this p.
For each i ∈ {1, 2, . . . , k }, we have pi - 1 (since pi is a prime, so that pi > 1) and
thus

n= p p ···p +1 ≡ 0 + 1 = 1 6≡ 0 mod pi (since pi - 1 = 1 − 0) .


| 1 2{z }k
≡0 mod pi
(since pi | p1 p2 ··· pk )

In other words, for each i ∈ {1, 2, . . . , k }, we have pi - n and thus p 6= pi (since


p = pi would yield p = pi - n, which would contradict p | n). In other words, p is
distinct from p1 , p2 , . . . , pk .
Forget that we fixed ( p1 , p2 , . . . , pk ). Thus, for any finite list ( p1 , p2 , . . . , pk ) of
primes, we have found a new prime p that is distinct from p1 , p2 , . . . , pk . In other
words, for any finite list of primes, we have found a prime that is not in this list.
Thus, there are infinitely many primes. This proves Theorem 9.1.3.

December 25, 2021


Math 235 notes page 447

Second proof of Theorem 9.1.3. Let ( F0 , F1 , F2 , . . .) be the Fermat sequence, defined as


n
in Exercise 3.7.3. Let n ∈ N. Then, Fn = |{z} 22 +1 > 1. Hence, Proposition 9.1.4
>0
(applied to Fn instead of n) shows that there exists at least one prime p such that
p | Fn . Consider this prime p, and denote it by pn . Thus, pn is a prime satisfying
pn | Fn .
Now, forget that we fixed n. Thus, for each n ∈ N, we have constructed a prime
pn satisfying pn | Fn . Consider all these primes p0 , p1 , p2 , . . ..
We now claim that these primes p0 , p1 , p2 , . . . are distinct.
[Proof: Let n and m be two distinct nonnegative integers. We shall show that
pn 6= pm .
Indeed, assume the contrary. Thus, pn = pm . Note that pn is a prime; thus,
pn > 1 > 0, so that | pn | = pn . From pn = pm , we obtain pn | pm . Hence, Proposition
3.4.4 (i) (applied to a = pn and b = pm ) yields gcd ( pn , pm ) = | pn | = pn > 1.
Now, Exercise 3.7.3 (b) yields gcd ( Fn , Fm ) = 1. In other words, Fn ⊥ Fm (by
the definition of “coprime”)275 . But we have pn | Fn (by the construction of pn )
and pm | Fm (similarly). Thus, pn ⊥ pm (by Proposition 3.5.8, applied to a1 = pn ,
a2 = pm , b1 = Fn and b2 = Fm ). In other words, gcd ( pn , pm ) = 1 (by the definition
of “coprime”). This contradicts gcd ( pn , pm ) > 1. This contradiction shows that our
assumption was wrong. Hence, pn 6= pm .
Forget that we fixed n and m. We thus have shown that pn 6= pm whenever n and
m are two distinct nonnegative integers. In other words, the primes p0 , p1 , p2 , . . .
are distinct.]
We now know that the primes p0 , p1 , p2 , . . . are distinct. Hence, there are in-
finitely many primes (namely, these primes p0 , p1 , p2 , . . ., and possibly others as
well). This proves Theorem 9.1.3 again.

9.1.3. Basic properties


We next review some of the most basic properties of primes. Their proofs are
almost trivial, as we have already done the hard work in Chapter 3.

Proposition 9.1.5. Let p be a prime. Then, each i ∈ {1, 2, . . . , p − 1} is coprime


to p.

Proof of Proposition 9.1.5 (sketched). (See [19s, proof of Proposition 2.13.4] for de-
tails.) Let i ∈ {1, 2, . . . , p − 1}. We must prove that i is coprime to p. In other
words, we must prove that gcd (i, p) = 1.
From i ∈ {1, 2, . . . , p − 1}, we see that i is positive and satisfies i ≤ p − 1 < p.
Proposition 3.4.4 (f) yields gcd (i, p) | i and gcd (i, p) | p. From gcd (i, p) | i, we
obtain |gcd (i, p)| ≤ |i | (by Proposition 3.1.3 (b)). This rewrites as gcd (i, p) ≤ i
(since gcd (i, p) and i are positive). Hence, gcd (i, p) ≤ i < p.

275 Here, we are using the notation from Definition 3.5.3.

December 25, 2021


Math 235 notes page 448

But p is prime; thus, the only positive divisors of p are 1 and p. However,
gcd (i, p) is a positive divisor of p (since gcd (i, p) | p). Thus, gcd (i, p) must be
either 1 or p. Since gcd (i, p) < p, we thus conclude gcd (i, p) = 1. Proposition 9.1.5
is proven.

Proposition 9.1.6. Let p be a prime. Let a ∈ Z. Then, either p | a or p ⊥ a.

Proof of Proposition 9.1.6 (sketched). (See [19s, proof of Proposition 2.13.5] for a dif-
ferent proof.) We are in one of the following two cases:
Case 1: We have a%p = 0.
Case 2: We have a%p 6= 0.
Let us first consider Case 1. In this case, we have a%p = 0. However, Proposition
3.3.2 (b) (applied to n = p and u = a) yields that we have p | a if and only if
a%p = 0. Thus, p | a (since a%p = 0). Hence, Proposition 9.1.6 is proved in Case 1.
Let us now consider Case 2. In this case, we have a%p 6= 0. But Proposition
3.3.2 (a) (applied to n = p and u = a) yields that a%p ∈ {0, 1, . . . , p − 1} and
a%p ≡ a mod p. Combining a%p ∈ {0, 1, . . . , p − 1} with a%p 6= 0, we find a%p ∈
{0, 1, . . . , p − 1} \ {0} = {1, 2, . . . , p − 1}. Hence, Proposition 9.1.5 (applied to i =
a%p) yields that a%p is coprime to p. In other words, gcd ( a%p, p) = 1. But
Proposition 3.4.4 (e) (applied to p and a instead of a and b) yields

gcd ( p, a) = gcd ( p, a%p) = gcd ( a%p, p) (by Proposition 3.4.4 (b))


= 1.

In other words, p ⊥ a. Hence, Proposition 9.1.6 is proved in Case 2.


We have now proved Proposition 9.1.6 in both Cases 1 and 2. Hence, Proposition
9.1.6 always holds.
Any two distinct primes are coprime:

Proposition 9.1.7. Let p and q be two distinct primes. Then, p ⊥ q.

This is easy to prove using the above propositions (see [19s, solution to Exercise
2.13.1] for a detailed proof).
The following property of primes ([19s, Theorem 2.13.6]) is probably one of the
most important ones:

Theorem 9.1.8. Let p be a prime. Let a, b ∈ Z such that p | ab. Then, p | a or


p | b.

Proof of Theorem 9.1.8. Clearly, Theorem 9.1.8 is true if p | a. Hence, for the rest of
this proof, we WLOG assume that we don’t have p | a.
However, Proposition 9.1.6 shows that we have either p | a or p ⊥ a. Thus, p ⊥ a
(since we don’t have p | a). However, p | ab. Hence, Theorem 3.5.6 (applied to p, a
and b instead of a, b and c) yields p | b. Thus, p | a or p | b. This proves Theorem
9.1.8.

December 25, 2021


Math 235 notes page 449

Theorem 9.1.8 can be generalized to products of multiple factors:

Proposition 9.1.9. Let p be a prime. Let a1 , a2 , . . . , ak be integers such that p |


a1 a2 · · · ak . Then, p | ai for some i ∈ {1, 2, . . . , k }.

Hint to the proof of Proposition 9.1.9. This is easy to prove by induction on k (with
the induction step relying on Theorem 9.1.8). Alternatively, this can be derived
from Exercise 3.5.4 and Proposition 9.1.6. (See [19s, proof of Proposition 2.13.7] for
the latter proof.)
We notice that Proposition 9.1.9 is, in some way, saying that primes “act like
0” in the following sense: It is well-known that a product of numbers is 0 if and
only if one of the factors is 0. Proposition 9.1.9 says something similar: It says
that a product of integers is divisible by a prime p if and only if one of its factors is
divisible by p. (To be more precise, the proposition only claims the “only if” part of
this sentence; but the “if” part is obvious.) This analogy becomes even more vivid
if we replace the wording “divisible by p” by the (equivalent) wording “congruent
to 0 modulo p”. This foreshadows the existence of the finite field F p , which we will
later get to define.

9.1.4. A few exercises


A number of contest problems about primes can be solved using just the basic
properties above. As an example, let us prove what is perhaps one of the first
properties one will notice when writing down a list of primes:

Exercise 9.1.1. (a) Prove that every prime p > 2 is odd.


(b) Prove that every prime p > 3 satisfies either p ≡ 1 mod 6 or p ≡ 5 mod 6.

Solution to Exercise 9.1.1. (a) Let p > 2 be a prime. We must show that p is odd.
Indeed, assume (for the sake of contradiction) that p is even. Hence, 2 | p. Thus,
2 is a positive divisor of p. However, p is prime. In other words, the only positive
divisors of p are 1 and p (by the definition of “prime”). Thus, 2 must be either 1 or
p (since 2 is a positive divisor of p). Since 2 is not 1, we thus conclude that 2 is p.
In other words, 2 = p. This contradicts p > 2. This contradiction shows that our
assumption was false.
Hence, p is not even. In other words, p is odd. This proves Exercise 9.1.1 (a).
(b) Let p > 3 be a prime. We must prove that p ≡ 1 mod 6 or p ≡ 5 mod 6.
Indeed, p > 3 > 2. Hence, Exercise 9.1.1 (a) shows that p is odd. In other words,
p ≡ 1 mod 2 (by Exercise 3.3.2 (d), applied to u = p). In other words, 2 | p − 1. In
other words, there exists an integer c such that p − 1 = 2c. Consider this c. From
p − 1 = 2c, we obtain p = 2c + 1.
In the above solution to Exercise 9.1.1 (a), we have showed that p is not even. A
similar argument can be used to show that we don’t have p ≡ 0 mod 3 276 .
276 Here are the details:

December 25, 2021


Math 235 notes page 450

Now, Proposition 3.3.2 (a) (applied to n = 3 and u = c) yields that c%3 ∈


{0, 1, . . . , 3 − 1} and c%3 ≡ c mod 3. From c%3 ≡ c mod 3, we obtain c ≡ c%3 mod 3.
Also, Proposition 3.3.2 (d) (applied to n = 3 and u = c) yields that c = (c//3) 3 +
(c%3). Hence,
p=2 c
|{z} +1 = 2 ((c//3) 3 + (c%3)) + 1 = 6 (c//3) +2 (c%3) + 1
| {z }
=(c//3)3+(c%3) ≡0 mod 6
(since c//3 is an integer)
≡ 2 (c%3) + 1 mod 6. (401)

We have c%3 ∈ {0, 1, . . . , 3 − 1} = {0, 1, 2}. If we had c%3 = 1, then we would


have
p=2 c
|{z} +1 ≡ 2 · 1 + 1 = 3 ≡ 0 mod 3,
≡c%3=1 mod 3
which would contradict the fact that we don’t have p ≡ 0 mod 3. Hence, we cannot
have c%3 = 1. In other words, we have c%3 6= 1.
Combining c%3 ∈ {0, 1, 2} with c%3 6= 1, we obtain c%3 ∈ {0, 1, 2} \ {1} =
{0, 2}. In other words, we have c%3 = 0 or c%3 = 2. Hence, we must be in one of
the following two cases:
Case 1: We have c%3 = 0.
Case 2: We have c%3 = 2.
Let us first consider Case 1. In this case, we have c%3 = 0. Now, (401) becomes
p ≡ 2 (c%3) +1 = 1 mod 6. Hence, p ≡ 1 mod 6 or p ≡ 5 mod 6. Thus, Exercise
| {z }
=0
9.1.1 (b) is solved in Case 1.
Let us now consider Case 2. In this case, we have c%3 = 2. Now, (401) becomes
p ≡ 2 (c%3) +1 = 2 · 2 + 1 = 5 mod 6. Hence, p ≡ 1 mod 6 or p ≡ 5 mod 6. Thus,
| {z }
=2
Exercise 9.1.1 (b) is solved in Case 2.
We have now solved Exercise 9.1.1 (b) in both Cases 1 and 2. Thus, Exercise 9.1.1
(b) always holds.
Exercise 9.1.1 (a) shows that the primes larger than 2 are precisely the odd
primes.
Our next exercise is, in a certain sense, an analogue of Exercise 3.2.7. Recall that
Exercise 3.2.7 allows taking a congruence to the k-th power: If n, a, b are integers
satisfying a ≡ b mod n, then ak ≡ bk mod n for each k ∈ N. One might hope for
something similar to hold when the powers  arereplaced
 by binomial coefficients
a b
(i.e., when ak and bk are replaced by and ); but this is not generally the
k k
Assume (for the sake of contradiction) that p ≡ 0 mod 3. Hence, 3 | p. Thus, 3 is a positive
divisor of p. However, p is prime. In other words, the only positive divisors of p are 1 and p
(by the definition of “prime”). Thus, 3 must be either 1 or p (since 3 is a positive divisor of p).
Since 3 is not 1, we thus conclude that 3 is p. In other words, 3 = p. This contradicts p > 3. This
contradiction shows that our assumption was false. In other words, we don’t have p ≡ 0 mod 3.

December 25, 2021


Math 235 notes page 451

   
2 0
case (for example, 2 ≡ 0 mod 2 is true, but ≡ mod 2 is false). Neverthe-
2 2
less, it holds if n is prime and k < n, as the following exercise shows:277

Exercise 9.1.2. Let p be a prime. Let a and bbe two  integers such that a ≡
a b
b mod p. Let k ∈ {0, 1, . . . , p − 1}. Prove that ≡ mod p.
k k

Solution to 
Exercise
 9.1.2.
  Our plan is the following: First, we shall prove the con-
a b
gruence k! ≡ k! mod p; then, we will argue that k! ⊥ p, and thus (using
k k
Lemma 3.5.11) we will be able  the k! from this congruence.
  to cancel
a b
We begin by proving k! ≡ k! mod p. Indeed, (117) (applied to n = a)
k k
yields
a ( a − 1) ( a − 2) · · · ( a − k + 1)
 
a
= .
k k!
Multiplying this equality by k!, we find
 
a
k! = a ( a − 1) ( a − 2) · · · ( a − k + 1)
k
= ∏ ( a − s) . (402)
s∈{0,1,...,k−1}

The same argument (applied to b instead of a) yields


 
b
k!
k
= ∏ (b − s) . (403)
s∈{0,1,...,k−1}

However, a
|{z} −s ≡ b − s mod p for each s ∈ {0, 1, . . . , k − 1}. Hence, (41) (ap-
≡b mod p
plied to S = {0, 1, . . . , k − 1} and as = a − s and bs = b − s and n = p) yields
∏ ( a − s) ≡ ∏ (b − s) mod p. Hence,
s∈{0,1,...,k−1} s∈{0,1,...,k−1}
   
a b
k!
k
= ∏ ( a − s) ≡ ∏ (b − s) = k!
k
mod p
s∈{0,1,...,k−1} s∈{0,1,...,k−1}

(by (403)).
Now, k ≤ p − 1 (since k ∈ {0, 1, . . . , p − 1}) and k! = 1 · 2 · · · · · k. We shall next
show that k! ⊥ p.
Let i ∈ {1, 2, . . . , k}. Then, i ∈ {1, 2, . . . , k} ⊆ {1, 2, . . . , p − 1} (since k ≤ p − 1).
Thus, i is coprime to p (by Proposition 9.1.5). In other words, i ⊥ p.
277 Exercise 9.1.2 is [Grinbe19c, Proposition 5.5] (with u and v renamed as a and b).

December 25, 2021


Math 235 notes page 452

Forget that we fixed i. We thus have shown that each i ∈ {1, 2, . . . , k } satisfies
i ⊥ p. Thus, Exercise 3.5.4 (applied to c = p and ai = i) yields 1 · 2 · · · · · k ⊥ p.
In other   k! ⊥ p (since k! = 1 · 2 · · · · · k). Therefore,
 words,   Lemma
 3.5.11 (applied
a b a b
to k!, , and p instead of a, b, c and n) yields ≡ mod p (since
  k  k k k
a b
k! ≡ k! mod p). This proves Exercise 9.1.2.
k k
As a further example, here is a problem from the 12th University of Michigan
Undergraduate Mathematics Competition in 1995 ([VelWag20, Problem 28]):

Exercise 9.1.3. Let n be a positive integer. Prove that n is prime if and only if
1 1 1
there is a unique pair ( j, k ) of positive integers satisfying − = .
j k n

Solution to Exercise 9.1.3 (sketched). We shall prove the following four claims:

Claim 1: If n > 1, then there is at least one pair ( j, k ) of positive integers


1 1 1
satisfying − = .
j k n

Claim 2: If n is prime, then there is a unique pair ( j, k ) of positive inte-


1 1 1
gers satisfying − = .
j k n

Claim 3: If there is at least one pair ( j, k) of positive integers satisfying


1 1 1
− = , then n > 1.
j k n

Claim 4: If there is a unique pair ( j, k ) of positive integers satisfying


1 1 1
− = , then n is prime.
j k n

Once these four claims are proved, Exercise 9.1.3 will follow by combining Claim
2 with Claim 4. (Claims 1 and 3 serve ancillary roles in proving other claims.) So
let us prove these four claims:
[Proof of Claim 1: Assume that n > 1. Then, n − 1 and (n − 1) n are positive
1 1 1
integers, and an easy computation reveals that − = . Hence,
n−1 ( n − 1) n n
1 1 1
there is at least one pair ( j, k ) of positive integers satisfying − = (namely,
j k n
( j, k) = (n − 1, (n − 1) n)). This proves Claim 1.]
[Proof of Claim 2: Assume that n is prime. Thus, n > 1. Now, let ( j, k ) be
1 1 1
a pair of positive integers satisfying − = . We shall show that ( j, k) =
j k n
( n − 1, ( n − 1 n
) ) .

December 25, 2021


Math 235 notes page 453

1 1 1 1 1 1 1
Indeed, we have − = , so that = − < and thus j < n. Hence,
j k n n j |{z}
k j
>0
we cannot have n | j 278 . Also, from j < n, we see that n − j is a positive integer.
Also, n − j cannot be n (since n − j < n).
|{z}
>0
1 1 1 k−j
Also, = − = , so that jk = n (k − j). Now, n | n (k − j) = jk. Hence,
n j k jk
Theorem 9.1.8 (applied to p = n, a = j and b = k) yields that n | j or n | k. Thus,
we have n | k (since we cannot have n | j). In other words, k = na for some a ∈ Z.
Consider this a.
Now, recall that jk = n (k − j). In view of k = na, this rewrites as jna = n (na − j).
We can cancel n from this equality (since n > 0), and thus obtain ja = na − j. Hence,
(n − j) ( a + 1) = na − ja +n − j = na − (na − j) + n − j = n.
|{z}
=na− j

Thus, n − j | (n − j) ( a + 1) = n. Hence, n − j is a positive divisor of n (since n − j


is a positive integer).
But n is prime. Hence, the only positive divisors of are 1 and n (by the definition
of a “prime”). Thus, n − j must be 1 or n (since n − j is a positive divisor of n). Since
n − j cannot be n, we thus conclude that n − j must be 1. Hence, n − j = 1, so that
j = n − 1. Now, recall that (n − j) ( a + 1) = n. Hence, n = (n − j) ( a + 1) = a + 1,
| {z }
=1
a = n ( n − 1).
so that a = n − 1 and therefore k = n |{z}
= n −1
From j = n − 1 and k = n (n − 1), we obtain ( j, k ) = (n − 1, n (n − 1)).
Forget that we fixed ( j, k). Thus, we have proved that every pair ( j, k) of positive
1 1 1
integers satisfying − = satisfies ( j, k ) = (n − 1, n (n − 1)). Hence, there is at
j k n
most one such pair ( j, k ). Since we also know (from Claim 1) that there is at least
one such pair ( j, k ), we can thus conclude that there is a unique such pair ( j, k ).
This proves Claim 2.]
[Proof of Claim 3: Assume that there is at least one pair ( j, k) of positive integers
1 1 1 1 1 1 1
satisfying − = . Consider this pair ( j, k ). Thus, − = , so that =
j k n j k n n
1 1 1
− < . Thus, n > j ≥ 1. This proves Claim 3.]
j |{z}k j
>0
[Proof of Claim 4: Assume that there is a unique pair ( j, k ) of positive integers
1 1 1
satisfying − = . Thus, in particular, there is at least one such pair ( j, k ).
j k n
278 Proof.Assume the contrary. Thus, n | j. Hence, from Proposition 3.1.3 (b), we obtain |n| ≤ | j|
(since j 6= 0). But j and n are positive integers; thus, | j| = j and |n| = n. Hence, n = |n| ≤ | j| =
j < n, which is absurd. This contradiction shows that our assumption was false, qed.

December 25, 2021


Math 235 notes page 454

Hence, Claim 3 yields that n > 1.


However, we must prove that n is prime.
Assume the contrary. Thus, n is not a prime. Since n > 1, we thus conclude
that 1 and n are not the only positive divisors of n (by the definition of a “prime”).
In other words, there exists a positive divisor d of n that is distinct from 1 and n.
Consider this d.
Set e = n/d. Then, e = n/d ∈ Z (since d is a divisor of n) and e = n/d > 0
(since n and d are positive). Hence, e is a positive integer. Moreover, from e =
n/d, we obtain ed = n. We have d > 1 (since d is a positive integer distinct
from 1) and thus d − 1 > 0. Hence, e (d − 1) and ed (d − 1) are positive integers.
1 1 1
Thus, (e (d − 1) , ed (d − 1)) is a pair ( j, k ) of positive integers satisfying − =
j k n
1 1 1 1
(indeed, it is easy to see that − = = (since ed = n)).
e ( d − 1) ed (d − 1) ed n
However, we also know (from the proof of Claim 1) that (n − 1, (n − 1) n) is a pair
1 1 1
( j, k) of positive integers satisfying − = .
j k n
1 1 1
Thus, we have found two pairs ( j, k ) of positive integers satisfying − = :
j k n
namely, (e (d − 1) , ed (d − 1)) and (n − 1, (n − 1) n). Since we have assumed that
there is a unique such pair ( j, k ), we thus conclude that these two pairs must be
equal. In other words, we have (e (d − 1) , ed (d − 1)) = (n − 1, (n − 1) n). Hence,
e (d − 1) = n − 1 and ed (d − 1) = (n − 1) n. Now, comparing e (d − 1) = n − 1
with e (d − 1) = |{z} ed −e = n − e, we obtain n − 1 = n − e. Thus, 1 = e = n/d, so
=n
that d = n. This contradicts the fact that d is distinct from n. This contradiction
shows that our assumption was false. Hence, Claim 4 is proved.]
Combining Claim 2 with Claim 4, we conclude the claim of Exercise 9.1.3.

9.1.5. Homework set #10A: Elementary properties of primes


This homework set is optional. I will grade your solutions if you choose to write
them up, but there won’t be any points to gain.

Exercise 9.1.4. Let n be an integer. Prove that n can be represented in the form
n = u2 − v2 for some u, v ∈ Z if and only if n 6≡ 2 mod 4.

 n
Exercise 9.1.5. Let  be a positive integer. Prove that n can be represented in the
u
form n = uv − for some u, v ∈ Z satisfying v ≥ u ≥ 3 if and only if n is
2
neither a prime nor a power of 2.

The following exercise is among the first results in the deep topic of interplays
between primes and Pascal’s triangle:

December 25, 2021


Math 235 notes page 455

Exercise 9.1.6. Let pbea prime.


p
(a) Prove that p | for each k ∈ {1, 2, . . . , p − 1}.
 k 
p−1
(b) Prove that ≡ (−1)k mod p for each k ∈ {0, 1, . . . , p − 1}.
k

p −1
Exercise 9.1.7. Let p be a prime. Let k ∈ {0, 1, . . . , p − 2}. Prove that ∑ ik ≡
i =0
0 mod p.
[Hint: Exercise 9.1.6 (b) might help.]

The next exercise extends Exercise 9.1.3:

Exercise 9.1.8. Let n be a positive integer. Let u be the # of pairs ( j, k) of positive


1 1 1
integers satisfying − = .
j k n
Prove that u is the # of all integers i ∈ [n − 1] satisfying i | n2 .

9.1.6. Fermat’s little theorem


The following theorem ([19s, Theorem 2.15.1]) is known as Fermat’s Little Theorem
(often abbreviated as “FLT”):

Theorem 9.1.10 (Fermat’s Little Theorem). Let p be a prime. Let a ∈ Z.


(a) If p - a, then a p−1 ≡ 1 mod p.
(b) We always have a p ≡ a mod p.

Theorem 9.1.10 is often abbreviated “FLT” or “Little Fermat”. The word “little”
in the name of this theorem is to distinguish it from “Fermat’s Last Theorem”, a
much more difficult result only proven in the 1990s.
Note that Exercise 3.3.5 is the particular case of Theorem 9.1.10 (a) for p = 3 (and
a = n).
We will outline two proofs of Theorem 9.1.10. The first relies on the following
lemma:

Lemma 9.1.11. Let p be a prime. Then:


(a) We have ( a + b) p ≡ a p + b p mod p for any a, b ∈ Z.
(b) We have (− a) p ≡ − a p mod p for any a ∈ Z.

Proof of Lemma 9.1.11. (a) Let a, b ∈ Z. Theorem 4.3.16 (applied to x = a, y = b and

December 25, 2021


Math 235 notes page 456

n = p) yields
p 
p k p−k
( a + b) = ∑
p
a b
k =0
k
  p −1    
p p p
|{z} |{z} ∑
p −0 k p−k p− p
= a 0
b + a b + a p b|{z}
0 k =1
k p
| {z } =1 =b p | {z } | {z } = b0 =1
=1 ≡0 mod p =1
(by (119)) (since Exercise (by (124))
 9.1.6
 (a)
p
yields p| )
k
 
here, we have split off the addends for k = 0 and
for k = p from the sum
p −1
≡b +p
∑ 0ak b p−k +a p = b p + a p = a p + b p mod p.
|k=1 {z }
=0

This proves Lemma 9.1.11 (a).


(b) Let a ∈ Z. Applying Lemma 9.1.11 (a) to b = − a, we obtain ( a + (− a)) p ≡
a p + (− a) p mod p. Hence,
 p

a p + (− a) p ≡  a + (− a) = 0 p = 0 mod p (since p > 0) .


| {z }
=0

Thus, (− a) p ≡ 0 − a p = − a p mod p. This proves Lemma 9.1.11 (b).


First proof of Theorem 9.1.10. (b) Forget that we fixed a. We shall first show that
Theorem 9.1.10 (b) holds for a ≥ 0. That is, we shall prove the following claim:

Claim 1: We have a p ≡ a mod p for each a ∈ N.

[Proof of Claim 1: We proceed by induction on a:


Induction base: We have 0 p = 0 (since p is positive) and thus 0 p ≡ 0 mod p. In
other words, Claim 1 holds for a = 0.
Induction step: Let k ∈ N. Assume (as the induction hypothesis) that Claim 1
holds for a = k. We must prove that Claim 1 holds for a = k + 1.
We have assumed that Claim 1 holds for a = k. In other words, we have k p ≡
k mod p.
Now, Lemma 9.1.11 (a) (applied to a = k and b = 1) yields (k + 1) p ≡ |{z}
k p + |{z}
1p ≡
≡k mod p =1
k + 1 mod p. In other words, Claim 1 holds for a = k + 1. This completes the in-
duction step. Thus, Claim 1 is proved by induction.]
We can now prove Theorem 9.1.10 (b) in full generality:

December 25, 2021


Math 235 notes page 457

Let a ∈ Z. We must show that a p ≡ a mod p. If a ∈ N, then this follows


from Claim 1. Hence, for the rest of this proof, we WLOG assume that a ∈ / N.
Combining a ∈ Z with a ∈ / N, we find a ∈ Z \ N = {−1, −2, −3, . . .}. Hence,
− a ∈ {1, 2, 3, . . .} ⊆ N. Thus, we can apply Claim 1 to − a instead of a. As a
result, we obtain (− a) p ≡ − a mod p. However, Lemma 9.1.11 (b) yields (− a) p ≡
− a p mod p. Thus, − a p ≡ (− a) p ≡ − a mod p. Hence,

a p = (−1) (− a p ) ≡ (−1) (− a) = a mod p.


| {z }
≡− a mod p

This proves Theorem 9.1.10 (b).


(a) Assume that p - a. Theorem 9.1.10 (b) yields a p ≡ a mod p. In other  words,
p p
p | a − a. In view of a − a = a a p − 1 − 1 , this rewrites as p | a a p − 1 − 1 . Hence,
Theorem 9.1.8 (applied to b = a p − 1 − 1) yields that p | a or p | a p − 1 − 1. Since we
don’t have p | a (because we have assumed that p - a), we thus obtain p | a p−1 − 1.
In other words, a p−1 ≡ 1 mod p. Thus, Theorem 9.1.10 (a) is proved.

Remark 9.1.12. We have used Lemma 9.1.11 to prove Theorem 9.1.10 (b) above;
conversely, Lemma 9.1.11 can easily be derived from Theorem 9.1.10 (b). This
might suggest that Lemma 9.1.11 is just a one-trick tool for the proof of Theorem
9.1.10 (b). However, when properly generalized, Lemma 9.1.11 becomes much
stronger and more useful than Theorem 9.1.10 (b) can ever get! Indeed, there is
a “grown-up” version of Lemma 9.1.11, which no longer requires a and b to be
integers but rather allows them to be any two commuting elements of a ring (see
any course on abstract algebra for the meanings of these words). A down-to-
earth example of this is when a and b are two n × n-matrices with integer entries
satisfying ab = ba; the “grown-up” version of Lemma 9.1.11 (a) then says that
( a + b) p ≡ a p + b p mod p, in the sense that each entry of the matrix ( a + b) p is
congruent to the corresponding entry of a p + b p modulo p.
Thus, Lemma 9.1.11 in the form we stated it above is merely the tip of an
iceberg. Fortunately, the proof we gave for it applies almost verbatim to the
generalization (which is known as “Idiot’s Binomial Formula” or “Freshman’s
Dream”, as it allows replacing the p-th power of a sum by a sum of p-th powers
in certain situations).

9.1.7. Euler’s totient function


Our second proof of Theorem 9.1.10 will derive it from a more general result,
known as Euler’s theorem ([19s, Theorem 2.15.3]):

Theorem 9.1.13 (Euler’s theorem). Let n be a positive integer. We let φ (n) denote
the number of all i ∈ {1, 2, . . . , n} satisfying i ⊥ n. (This notation was already
used in Exercise 4.5.6.)
Let a ∈ Z be coprime to n. Then, aφ(n) ≡ 1 mod n.

December 25, 2021


Math 235 notes page 458

Theorem 9.1.13 yields Theorem 9.1.10 (a), since φ ( p) = p − 1 when p is prime


(check this!). Theorem 9.1.10 (b) follows from Theorem 9.1.10 (a) easily (one just
needs to handle the cases p | a and p - a separately). Thus, in order to obtain a
second proof of Theorem 9.1.10, we only need to establish Theorem 9.1.13. Before
we do so, let us first illustrate how it can be used on a typical contest problem:
7
Exercise 9.1.9. What is the last digit of 77 ?
c c
Notational remark: An expression of the form “ab ” always means a(b ) , not
c
ab .

Discussion of Exercise 9.1.9. The last digit of a positive integer n is n%10 (that is, the
7
remainder of n upon division by 10). So we need to compute 77 %10.
Since 7 is coprime to 10, we can apply Theorem 9.1.13 to n = 10 and a = 7. We
thus get 7φ(10) ≡ 1 mod 10. Since φ (10) = 4, this rewrites as 74 ≡ 1 mod 10. (This is
also not hard to check directly, using 72 = 49 ≡ −1 mod 10.) Hence, if we write 77
in the form 77 = 4a + b for some a, b ∈ N, then
 a
7
77 = 74a+b = |{z}
74a ·7b =  |{z}
74  · 7b ≡ |{z}
1a ·7b = 7b mod 10
a ≡1 mod 10 =1
=(74 )

7 7
and therefore 77 %10 = 7b %10. This gives us an easy way to compute 77 %10
provided that b is small enough (so we can compute 7b %10).
Now, how do we write 77 in the form 77 = 4a + b for some a, b ∈ N, with smallest
possible b ? The answer is, of course, that we take a = 77 //4 and b = 77%4
Proposition 3.3.2 (d) yields 77 = 77 //4 · 4 + 77 %4 = 4 77 //4 +
 
(because
77 %4 ). Thus, let us set a = 77 //4 and b = 77 %4. As we have seen, we have

7
77 %10 = 7b %10. It remains to compute 7b %10.
We first compute b: We have 7 ≡ −1 mod 4 and thus 77 ≡ (−1)7 = −1 mod 4, so
that 77 %4 = (−1) %4 = 3. (Of course, we could also have used Theorem 9.1.13 to
7
obtain this, in the same way as we used it to show 77 %10 = 7b %10. But powers of
−1 are easy enough to take by hand!) Hence, b = 77 %4 = 3 and thus

7 b = 73 = 72
|{z} ·7 ≡ (−1) · 7 ≡ 3 mod 10,
=49≡−1 mod 10

so that 7b %10 = 3%10 = 3. Hence,


7
77 %10 = 7b %10 = 3.
7
In other words, the last digit of 77 is 3.
See [19s, Exercise 2.15.1] for another similar application of Euler’s theorem.

December 25, 2021


Math 235 notes page 459

Theorem 9.1.13 can also be used to explain why certain rational numbers (such
2
as = 0.285714 279 ) have purely periodic decimal expansions, while others (such
7
1 1
as = 0.083 = 0.0833333 . . . or = 0.50 = 0.50000 . . .) have their periods start
12 2
only after some initial nonrepeating block. We refer [ConradE, §4] to the details of
this.280
Let us now outline a proof of Theorem 9.1.13:
Proof of Theorem 9.1.13 (sketched). (See [19s, proof of Theorem 2.15.3] for details.) It
is easy to see (using Proposition 3.4.4) that gcd (0, n) = gcd (n, n). Hence, 0 ⊥ n
holds if and only if n ⊥ n.
Set
C = {i ∈ {0, 1, . . . , n − 1} | i ⊥ n} .
A moment’s thought reveals that |C | = φ (n) 281 .

Now, define the integer


z = ∏ i. (404)
i ∈C
All factors i in the product ∏ i are coprime to n (by the definition of C); thus, the
i ∈C
product itself is also coprime to n (by Exercise 3.5.4). In other words, z ⊥ n.

279 The bar ( ) over the “285714” means that we are repeating 285714 over and over. So 0.285714 =
0.285714285714285714 . . ..
280 Here is the rule, in a nutshell: A fraction a (where a and b are two integers with b 6 = 0) has a
b
purely periodic decimal expansion if and only if b ⊥ 10 (in other words, 2 - b and 5 - b); other-
wise, it has an eventually periodic decimal expansion (which may be a finite decimal expansion,
1
such as = 0.5 = 0.50). This can be proven using Theorem 9.1.13.
2
281 Proof. The definition of C yields

|C | = (# of all i ∈ {0, 1, . . . , n − 1} satisfying i ⊥ n)


= (# of all i ∈ {0} satisfying i ⊥ n) + (# of all i ∈ {1, 2, . . . , n − 1} satisfying i ⊥ n)
| {z }

1, if 0 ⊥ n;
=
0, else

1, if n ⊥ n;
=
0, else
(since 0⊥n holds if and only if n⊥n)
!
by the sum rule, since each i ∈ {0, 1, . . . , n − 1}
satisfies either i ∈ {0} or i ∈ {1, 2, . . . , n − 1} (but not both)
(
1, if n ⊥ n;
= + (# of all i ∈ {1, 2, . . . , n − 1} satisfying i ⊥ n)
0, else
(
1, if n ⊥ n;
= (# of all i ∈ {1, 2, . . . , n − 1} satisfying i ⊥ n) +
0, else.

December 25, 2021


Math 235 notes page 460

Our plan is to prove the congruence zaφ(n) ≡ z mod n. Once it is shown, we


will be able to cancel z from this congruence (by Lemma 3.5.11, since z ⊥ n), thus
obtaining aφ(n) ≡ 1 mod n.
In order to implement this plan, we will compute the product ∏ ( ai ) in two
i ∈C
ways.
On one hand, we have

∏ (ai) = a|C| ∏ i = a|C| z = za|C| = zaφ(n) (405)


i ∈C i ∈C
|{z}
=z

(since |C | = φ (n)).
On the other hand, every i ∈ C satisfies ai ≡ ( ai ) %n mod n (since Proposition
3.3.2 (a) (applied to u = ai) yields ( ai ) %n ≡ ai mod n). Multiplying these congru-
ences over all i ∈ C, we obtain

∏ (ai) ≡ ∏ ((ai) %n) mod n. (406)


i ∈C i ∈C

Now, we claim that the product ∏ (( ai ) %n) on the right hand side of this equal-
i ∈C
ity has the same factors as the product ∏ i, just in a different order. In other words,
i ∈C
the map

C → C,
i 7→ ( ai ) %n

is bijective. In order to prove this, we must first show that this map is well-defined:

Claim 1: We have ( ai ) %n ∈ C for each i ∈ C.

Comparing this with

φ (n) = (# of all i ∈ {1, 2, . . . , n} satisfying i ⊥ n) (by the definition of φ (n))


= (# of all i ∈ {1, 2, . . . , n − 1} satisfying i ⊥ n) + (# of all i ∈ {n} satisfying i ⊥ n)
| {z }

1, if n ⊥ n;
=
0, else

(by the sum rule)


(
1, if n ⊥ n;
= (# of all i ∈ {1, 2, . . . , n − 1} satisfying i ⊥ n) + ,
0, else

we obtain
|C | = φ (n) .

December 25, 2021


Math 235 notes page 461

[Proof of Claim 1: Let i ∈ C. Proposition 3.3.2 (a) (applied to u = ai) yields that
( ai ) %n ∈ {0, 1, . . . , n − 1}.
From a ⊥ n and i ⊥ n, we obtain ai ⊥ n (by Theorem 3.5.10). In other words,
n ⊥ ai. However, Proposition 3.4.4 (e) yields gcd (n, ai ) = gcd (n, ( ai ) %n), so that
gcd (n, ( ai ) %n) = gcd (n, ai ) = 1 (since n ⊥ ai) and thus n ⊥ ( ai ) %n. In other
words, ( ai ) %n ⊥ n. Combining this with ( ai ) %n ∈ {0, 1, . . . , n − 1}, we obtain
( ai ) %n ∈ C (by the definition of C). This proves Claim 1.]
Thus, we can define a map
f : C → C,
i 7→ ( ai ) %n.
Consider this map f .
Claim 2: The map f is injective.
[Proof of Claim 2: Let i and j be two elements of C such that f (i ) = f ( j). We must
prove that i = j.
We have f (i ) = f ( j). In view of f (i ) = ( ai ) %n (by the definition of f ) and
f ( j) = ( aj) %n, this rewrites as ( ai ) %n = ( aj) %n. Because of Proposition 3.3.4
(applied to u = ai and v = aj), this entails that ai ≡ aj mod n. By Lemma 3.5.11, we
can “cancel” a from this congruence (since a ⊥ n), and obtain i ≡ j mod n. However,
both i and j belong to C and thus belong to {0, 1, . . . , n − 1} (by the definition of
C). Hence, from i ≡ j mod n, we can easily obtain that i = j 282 .
Now, forget that we fixed i and j. We thus have proven that if i and j are two
elements of C such that f (i ) = f ( j), then i = j. In other words, f is injective.]
Claim 3: The map f is a bijection.
[Proof: Claim 2 shows that f is injective. Hence, Corollary 6.2.9 (a) (applied to
X = C) shows that f is a permutation of C. Thus, f is bijective. This proves Claim
3.]
Now, we know that f is a bijection from C to C. Thus, we can substitute f (i ) for
i in the product ∏ i. So we obtain
i ∈C

∏i = ∏ f (i ) = ∏ ((ai) %n) . (407)


i ∈C i ∈C i ∈C
|{z}
=( ai )%n
(by the definition of f )

Hence, (406) becomes

∏ (ai) ≡ ∏ ((ai) %n) = ∏ i (by (407))


i ∈C i ∈C i ∈C
= z mod n.
282 Proof.Proposition 3.3.2 (c) (applied to u = j and c = i) yields i = j%n (since i ≡ j mod n and
i ∈ {0, 1, . . . , n − 1}). Also, Proposition 3.3.2 (c) (applied to u = j and c = j) yields j = j%n (since
j ≡ j mod n and j ∈ {0, 1, . . . , n − 1}). Hence, i = j%n = j.

December 25, 2021


Math 235 notes page 462

Now, (405) leads to


zaφ(n) = ∏ (ai) ≡ z = z · 1 mod n.
i ∈C
We can cancel z from this congruence (by Lemma 3.5.11, since z ⊥ n); thus, we
obtain aφ(n) ≡ 1 mod n. This proves Theorem 9.1.13.
Having proved Euler’s theorem, we can now derive Fermat’s Little Theorem
from it:
Second proof of Theorem 9.1.10 (sketched). (See [19s, §2.15.2, Proof of Theorem 2.15.1]
for details.)
(a) Let φ ( p) denote the number of all i ∈ {1, 2, . . . , p} satisfying i ⊥ p. Then,
φ ( p) = p − 1.
[Proof. We must show that there are precisely p − 1 numbers i ∈ {1, 2, . . . , p}
satisfying i ⊥ p. In other words, we must show that exactly p − 1 of the p numbers
1, 2, . . . , p are coprime to p. But this is easy: The p − 1 numbers 1, 2, . . . , p − 1 are
coprime to p (by Proposition 9.1.5), whereas the remaining number p is not coprime
to p (since gcd ( p, p) = p > 1). Thus, φ ( p) = p − 1 is proven.]
Now, assume that p - a. Thus, p ⊥ a (by Proposition 9.1.6). In other words, a ⊥ p.
Hence, Theorem 9.1.13 (applied to n = p) yields aφ( p) ≡ 1 mod p. In other words,
a p−1 ≡ 1 mod p (since φ ( p) = p − 1). This proves Theorem 9.1.10 (a).
(b) We must prove that a p ≡ a mod p. In other words, we must prove that p | a p−
a. In other words, we must prove that p | a a p−1 − 1 (since a p − a = a a p−1 − 1 ).


If p | a, then this is obvious (since p | a entails p | a | a a p−1 − 1 ). Hence, for




the rest of this proof, we WLOG assume that p - a. Thus, Theorem 9.1.10 (a) yields
a p−1 ≡ 1 mod p. In other words, p | a p−1 − 1. Hence, p | a p−1 − 1 | a a p−1 − 1 .


But as we have explained, this completes the proof of Theorem 9.1.10 (b).
The number φ (n) defined in Theorem 9.1.13 has further properties; thus, let us
introduce a name for it:

Definition 9.1.14. We define a function φ : {1, 2, 3, . . .} → N as follows: For


each n ∈ {1, 2, 3, . . .}, we let φ (n) be the number of all i ∈ {1, 2, . . . , n} that are
coprime to n. (This is precisely how φ (n) was defined in Theorem 9.1.13 and in
Exercise 4.5.6.)
This function φ is called Euler’s totient function or just φ-function.

Example 9.1.15. (a) We have φ (12) = 4, since the number of all i ∈ {1, 2, . . . , 12}
that are coprime to 12 is 4 (indeed, these i are 1, 5, 7 and 11).
(b) We have φ (13) = 12, since the number of all i ∈ {1, 2, . . . , 13} that are
coprime to 13 is 12 (indeed, these i are 1, 2, . . . , 12).
(c) We have φ (14) = 6, since the number of all i ∈ {1, 2, . . . , 14} that are
coprime to 14 is 6 (indeed, these i are 1, 3, 5, 9, 11, 13).
(d) We have φ (1) = 1, since the number of all i ∈ {1, 2, . . . , 1} that are coprime
to 1 is 1 (indeed, the only such i is 1).

December 25, 2021


Math 235 notes page 463

We will later come back to Euler’s totient function φ, to give an “explicit” for-
mula for it (using the prime factorization). For now, we observe that the sequence
(φ (1) , φ (2) , φ (3) , . . .) is Sequence A000010 in the OEIS (where, as usual, lots of
its properties and references can be found).

9.2. The Fundamental Theorem of Arithmetic


One of the leitmotifs in mathematics is the study of decompositions of objects
into smaller, simpler objects. For example, here are a few ways to decompose the
positive integer 14 into a sum of smaller positive integers:

14 = 1 + 13 = 7 + 7 = 3 + 5 + 6 = 2 + 3 + 4 + 5.

Almost all such decompositions can be decomposed further (“refined”) by breaking


up some of their addends into even smaller numbers: For example, 14 = 7 + 7 can
be “refined” by breaking up the first 7 as 2 + 5, thus obtaining the decomposition
14 = 2 + 5 + 7. The only decomposition of 14 that cannot be decomposed further is
14 = 1| + 1 +{z· · · + 1}, since 1 cannot be written as a sum of more than one positive
14 times
integer. This phenomenon clearly holds not just for 14, but for any other positive
integer n: If we decompose n into a sum of positive integers, then we can “refine”
this decomposition until we arrive at n = 1| + 1 +{z· · · + 1}.
n times
Things become more interesting if we instead try to decompose a positive integer
n into a product of positive integers. For example, for n = 2020, we have the
decompositions

2020 = 20 · 101 = 4 · 505 = 2 · 2 · 505 = 1 · 2 · 2 · 505

and many others. In particular, we can always insert a factor equal to 1 into any
such decomposition (since 1a = a for each a ∈ Z), so we can find infinitely many
such decompositions. Thus, let us restrict ourselves to considering only the de-
compositions with no factor equal to 1. By trial and error, we eventually find the
decomposition
2020 = 2 · 2 · 5 · 101,
which cannot be “refined” since the numbers 2, 2, 5, 101 are prime and thus cannot
be further decomposed. Recall that a prime number is precisely an integer p > 1
that cannot be decomposed into a product of two integers > 1. Thus, a decompo-
sition of n into a product of positive integers > 1 cannot be further decomposed
if and only if all its factors are primes. Such a decomposition (or, to be pedantic,
the list of its factors) is called a prime factorization of n. Thus, for example, the de-
composition 2020 = 2 · 2 · 5 · 101 (or, to be pedantic, the list (2, 2, 5, 101)) is a prime
factorization of 2020. Likewise, 2021 = 43 · 47 is a prime factorization of 2021.
It is worth memorizing these prime factorizations if you plan on participating in any
mathematical contests in the years 2020 and 2021, as there is a tradition in contests to

December 25, 2021


Math 235 notes page 464

involve the current year as a number in problems. For example, problem B6 on the Putnam
contest 2017 asked for the # of all 64-tuples ( x0 , x1 , . . . , x63 ) with x0 , x1 , . . . , x63 being distinct
elements of the set [2017] and satisfying 2017 | x0 + x1 + 2x2 + 3x3 + · · · + 63x63 . The
solution relied heavily on the fact that 2017 is prime. Problem A3 on the Putnam contest
2015 relied on the fact that 2015 = 5 · 13 · 31 is a prime factorization of 2015. Problem
B1 on the Putnam contest 2013 involved the number 2013, but only used the fact that it
is odd. While there are many problems in which the year number could be replaced by
any positive integer, my experience suggests that whenever some specific property of the
number is used, it is usually easy to read off that property from the prime factorization of
the number.
Now, it is natural to ask two questions: Does any positive integer n have a prime
factorization, and is it unique? It is easy to see that the answer to the first question
is “yes” (essentially because you can start with the trivial decomposition n = n
and then keep “refining” it until it is no longer possible; all you need to show is
that this cannot go on forever, but this can easily be done using a monovariant).
If you are pedantic, then the answer to the second question is “no”: For example,
the number 12 has the three prime factorizations 2 · 2 · 3, 2 · 3 · 2 and 3 · 2 · 2. But
these three prime factorizations only differ in the order of their factors; they are
not distinct in any useful sense. Formally speaking, these factorizations (written as
lists (2, 2, 3), (2, 3, 2) and (3, 2, 2)) are permutations of each other. Let us define this
notion formally:283

Definition 9.2.1. Let ( p1 , p2 , .. . , pk ) be a k-tuple. A permutation of ( p1 , p2 , . . . , pk )


means a k-tuple of the form pσ(1) , pσ(2) , . . . , pσ(k) where σ is a permutation of
the set [k]. A permutation of ( p1 , p2 , . . . , pk ) is also known as a rearrangement of
( p1 , p2 , . . . , p k ).

Informally speaking, a permutation of a k-tuple p means a k-tuple obtained from


p by rearranging its entries. Thus, two k-tuples p and q are permutations of each
other if and only if they are “equal up to order”, i.e., if they differ only in the order
of their entries.

Example 9.2.2. (a) The 4-tuple (2, 1, 1, 3) is a permutation of the 4-tuple (3, 1, 2, 1).
In fact, if we denote the 4-tuple (3, 1, 2, 1) by ( p1 , p2 , 
p3 , p4 ), then there exists

a permutation σ of the set [4] such that (2, 1, 1, 3) = pσ(1) , pσ(2) , pσ(3) , pσ(4) .
(Actually, there exist two such permutations σ: One of them sends 1, 2, 3, 4 to
3, 2, 4, 1, while the other sends 1, 2, 3, 4 to 3, 4, 2, 1.)
(b) Any k-tuple is a permutation
 of itself. Indeed,  if ( p1 , p2 , . . . , pk ) is any k-
tuple, then ( p1 , p2 , . . . , pk ) = p σ (1) , p σ (2) , . . . , p σ ( k ) if we let σ be the identity
map id : [k ] → [k ].

283 We will use the notation from Definition 7.2.1; thus, [k ] means the set {1, 2, . . . , k}.

December 25, 2021


Math 235 notes page 465

(c) Let p and q be two k-tuples. Then, p is a permutation of q if and only if


q is a permutation of p. (This follows easily from the fact that the inverse of a
permutation of [k] is again a permutation of [k ].)

Next, for the sake of consistency, let us formally repeat our above definition of a
prime factorization:
Definition 9.2.3. Let n be a positive integer. A prime factorization of n means a
tuple ( p1 , p2 , . . . , pk ) of primes such that n = p1 p2 · · · pk .

Example 9.2.4. (a) The prime factorizations of 12 are

(2, 2, 3) , (2, 3, 2) , (3, 2, 2) .

(b) If p is a prime, then the only prime factorization of p is the 1-tuple ( p).
 and i ∈ N, then the only prime factorization of p is the
p is a prime
(c) If  i

i-tuple  p, p, . . . , p. Indeed, this i-tuple clearly is a prime factorization of pi ;


| {z }
i times
the fact that it is the only such factorization follows readily from Theorem 9.2.5
(b) below.
(d) The only prime factorization of 1 is the 0-tuple ().

We are finally ready to state and prove the so-called Fundamental Theorem of Arith-
metic:
Theorem 9.2.5. Let n be a positive integer.
(a) There exists a prime factorization of n.
(b) Any two prime factorizations of n are permutations of each other.

We shall soon sketch a proof of this theorem; first, let us introduce a notation
(which will only be used in this section):
Definition 9.2.6. Let L be the set of all finite lists of positive integers. We define
a binary relation ∼ on L as follows: Given two lists p and q of positive integers,
we set p ∼ q if and only if the list p is a permutation of q.

Thus, Example 9.2.2 (a) yields (2, 1, 1, 3) ∼ (3, 1, 2, 1).


The following is easy to see:
Proposition 9.2.7. (a) The relation ∼ defined in Definition 9.2.6 is an equivalence
relation (i.e., it is transitive, reflexive and symmetric).
(b) Let ( a1 , a2 , . . . , ak ) and (b1 , b2 , . . . , b` ) be two lists of positive integers. If
( a1 , a2 , . . . , ak ) ∼ (b1 , b2 , . . . , b` ), then k = `.
(c) Let ( a1 , a2 , . . . , ak ) and (b1 , b2 , . . . , b` ) be two lists of positive integers satis-
fying ( a1 , a2 , . . . , ak ) ∼ (b1 , b2 , . . . , b` ). Then, ( a1 , a2 , . . . , ak , c) ∼ (b1 , b2 , . . . , b` , c)
for each positive integer c.

December 25, 2021


Math 235 notes page 466

Of course, nothing in Proposition 9.2.7 is specific to lists of positive integers; all


claims here are general properties of lists of any objects (and follow from general
properties of permutations, such as the fact that the composition of two permuta-
tions is a permutation).
We can now prove Theorem 9.2.5:
Proof of Theorem 9.2.5 (sketched). (a) We already outlined one way to prove Theorem
9.2.5 (a) above (viz., we start with the decomposition n = n and keep “refining” it
by decomposing factors into products, until this is no longer possible). Let me now
show a slicker proof (taken from [19s, proof of Proposition 2.13.10]). We proceed
by strong induction on n:
Induction step: Let m be a positive integer. Assume (as the induction hypothesis)
that there exists a prime factorization of n for each positive integer n < m. We must
prove that there exists a prime factorization of m.
If m = 1, then this is obvious (indeed, the 0-tuple () is a prime factorization
of m in this case, because m = 1 = (empty product)). Thus, for the rest of this
proof, we WLOG assume that m 6= 1. Hence, m > 1. Thus, Proposition 9.1.4
(applied to n = m) shows that there exists at least one prime p such that p |
m. Consider this p. Now, p > 1 (since p is prime), so that m/p < m/1 = m.
Furthermore, m/p is an integer (since p | m) and positive (since m > 1 > 0 and
p > 1 > 0). Thus, m/p is a positive integer satisfying m/p < m. Hence, our
induction hypothesis yields that there exists a prime factorization of m/p. Let
(q1 , q2 , . . . , qk ) be this prime factorization. Thus, q1 , q2 , . . . , qk are primes satisfying
m/p = q1 q2 · · · qk . Multiplying both sides of the latter equality by p, we obtain
m = pq1 q2 · · · qk . Hence, ( p, q1 , q2 , . . . , qk ) is a prime factorization of m (since p is a
prime, and since q1 , q2 , . . . , qk are primes). Thus, there exists a prime factorization
of m. This completes the induction step; thus, Theorem 9.2.5 (a) is proved.
(b) We proceed by strong induction on n:
Induction step: Let m be a positive integer. Assume (as the induction hypothesis)
that Theorem 9.2.5 (b) holds for each positive integer n < m. We must prove that
Theorem 9.2.5 (b) holds for n = m.
Let ( p1 , p2 , . . . , pk ) and (q1 , q2 , . . . , q` ) be two prime factorizations of m. We shall
show that ( p1 , p2 , . . . , pk ) ∼ (q1 , q2 , . . . , q` ) (using the notation of Definition 9.2.6).
The two lists ( p1 , p2 , . . . , pk ) and (q1 , q2 , . . . , q` ) are playing symmetric roles in
this claim (since the relation ∼ is symmetric). Hence, we can WLOG assume that
k ≤ ` (since we can otherwise swap these two lists). Assume this.
We must prove that ( p1 , p2 , . . . , pk ) ∼ (q1 , q2 , . . . , q` ). If ` = 0, then this is ob-
viously true284 . Hence, for the rest of this proof, we WLOG assume that ` 6= 0.
Therefore, ` is a positive integer. Thus, q` is well-defined.

284 Proof. Assume that ` = 0. Then, (q1 , q2 , . . . , q` ) = (q1 , q2 , . . . , q0 ) = (). Also, k ≤ ` = 0 and thus
k = 0. Hence, ( p1 , p2 , . . . , pk ) = ( p1 , p2 , . . . , p0 ) = (). But obviously, () ∼ (). In other words,
( p1 , p2 , . . . , pk ) ∼ (q1 , q2 , . . . , q` ) (since ( p1 , p2 , . . . , pk ) = () and (q1 , q2 , . . . , q` ) = ()). Hence, we
have proved that ( p1 , p2 , . . . , pk ) ∼ (q1 , q2 , . . . , q` ) under the assumption that ` = 0.

December 25, 2021


Math 235 notes page 467

We know that ( p1 , p2 , . . . , pk ) is a prime factorization of m. In other words,


( p1 , p2 , . . . , pk ) is a k-tuple of primes such that p1 p2 · · · pk = m. In other words,
p1 , p2 , . . . , pk are primes and satisfy p1 p2 · · · pk = m. Similarly, q1 , q2 , . . . , q` are
primes and satisfy q1 q2 · · · q` = m.
The number q` is a prime (since q1 , q2 , . . . , q` are primes). Thus, q` > 1, so that
q` 6= 1. Moreover, q` is a factor of the product q1 q2 · · · q` . Thus, q` | q1 q2 · · · q` =
m = p1 p2 · · · pk (since p1 p2 · · · pk = m). Hence, Proposition 9.1.9 (applied to p = q`
and ai = pi ) yields that q` | pi for some i ∈ {1, 2, . . . , k }. Consider this i. It is easy
to see that q` = pi 285 .
Now, consider the k-tuple ( p1 , p2 , . . . , pi−1 , pi+1 , pi+2 , . . . , pk , pi ) (that is, the k-
tuple obtained from ( p1 , p2 , . . . , pk ) by moving the i-th entry to the very end). This
k-tuple is a permutation of the k-tuple ( p1 , p2 , . . . , pk ) (since it is obtained by rear-
ranging entries of the latter k-tuple). In other words,

( p 1 , p 2 , . . . , p i −1 , p i +1 , p i +2 , . . . , p k , p i ) ∼ ( p 1 , p 2 , . . . , p k ) .
Since the relation ∼ is symmetric, this entails

( p 1 , p 2 , . . . , p k ) ∼ ( p 1 , p 2 , . . . , p i −1 , p i +1 , p i +2 , . . . , p k , p i ) . (408)
On the other hand, m/q` is an integer (since q` | m) and is positive (since m and
q` are positive) and satisfies m/ q` < m/1 = m. Thus, our induction hypothesis
|{z}
>1
shows that Theorem 9.2.5 (b) holds for n = m/q` . In other words, any two prime
factorizations of m/q` are permutations of each other.
Let us now find two such prime factorizations to apply this fact to. We notice the
following:

• The (k − 1)-tuple ( p1 , p2 , . . . , pi−1 , pi+1 , pi+2 , . . . , pk ) (that is, the (k − 1)-tuple


obtained from ( p1 , p2 , . . . , pk ) by removing the i-th entry) is a (k − 1)-tuple of
primes (since p1 , p2 , . . . , pk are primes) and satisfies
p1 p2 · · · pi−1 pi+1 pi+2 · · · pk = m/q`
(since
m = p 1 p 2 · · · p k = p i ( p 1 p 2 · · · p i −1 p i +1 p i +2 · · · p k )
|{z}
=q`
= q ` ( p 1 p 2 · · · p i −1 p i +1 p i +2 · · · p k )
). In other words, this (k − 1)-tuple ( p1 , p2 , . . . , pi−1 , pi+1 , pi+2 , . . . , pk ) is a
prime factorization of m/q` .
285 Proof.We know that q` is positive (since q` > 1 > 0) and divides pi (since q` | pi ). Hence, q` is a
positive divisor of pi .
The number pi is a prime (since p1 , p2 , . . . , pk are primes). Hence, the only positive divisors
of pi are 1 and pi (by the definition of a prime). Thus, q` must be either 1 or pi (since q` is a
positive divisor of pi ). Since we know that q` 6= 1, we thus conclude that q` = pi .

December 25, 2021


Math 235 notes page 468

• The (` − 1)-tuple (q1 , q2 , . . . , q`−1 ) is an (` − 1)-tuple of primes (since q1 , q2 , . . . , q`


are primes) and satisfies

q1 q2 · · · q`−1 = m/q`

(since m = q1 q2 · · · q` = q` (q1 q2 · · · q`−1 )). In other words, this (` − 1)-tuple


(q1 , q2 , . . . , q`−1 ) is a prime factorization of m/q` .

Thus, we have found two prime factorizations of m/q` : namely,

( p 1 , p 2 , . . . , p i −1 , p i +1 , p i +2 , . . . , p k ) and (q1 , q2 , . . . , q`−1 ) .

Hence, we conclude that these two prime factorizations must be permutations of


each other (since any two prime factorizations of m/q` are permutations of each
other). In other words,

( p1 , p2 , . . . , pi−1 , pi+1 , pi+2 , . . . , pk ) ∼ (q1 , q2 , . . . , q`−1 ) .

Hence, Proposition 9.2.7 (c) (applied to ( p1 , p2 , . . . , pi−1 , pi+1 , pi+2 , . . . , pk ), (q1 , q2 , . . . , q`−1 )
and pi instead of ( a1 , a2 , . . . , ak ), (b1 , b2 , . . . , b` ) and c) yields that

( p1 , p2 , . . . , pi−1 , pi+1 , pi+2 , . . . , pk , pi ) ∼ (q1 , q2 , . . . , q`−1 , pi ) .

Now, (408) becomes286

( p 1 , p 2 , . . . , p k ) ∼ ( p 1 , p 2 , . . . , p i −1 , p i +1 , p i +2 , . . . , p k , p i )
∼ (q1 , q2 , . . . , q`−1 , pi )
= (q1 , q2 , . . . , q`−1 , q` ) (since pi = q` )
= ( q1 , q2 , . . . , q ` ) .

In other words, the two prime factorizations ( p1 , p2 , . . . , pk ) and (q1 , q2 , . . . , q` ) are


permutations of each other.
Forget that we fixed ( p1 , p2 , . . . , pk ) and (q1 , q2 , . . . , q` ). We thus have shown that
any two prime factorizations ( p1 , p2 , . . . , pk ) and (q1 , q2 , . . . , q` ) of m are permu-
tations of each other. In other words, Theorem 9.2.5 (b) holds for n = m. This
completes the induction proof of Theorem 9.2.5 (b).
In Section 9.3, we will introduce p-valuations, which will allow us to get real
mileage out of Theorem 9.2.5. For now, let us show a simple application of Theorem
9.2.5 (a):

Exercise 9.2.1. Prove that there are infinitely many primes p that satisfy p ≡
2 mod 3.

286 The following manipulations tacitly use the fact that the relation ∼ is an equivalence relation.

December 25, 2021


Math 235 notes page 469

Solution to Exercise 9.2.1 (sketched). The following solution is rather similar to our
first proof of Theorem 9.1.3 above, but is somewhat complicated by the need to
keep track of the p ≡ 2 mod 3 condition.
We define a 2 mod 3-prime to mean a prime p that satisfies p ≡ 2 mod 3. Thus,
we need to show that there are infinitely many 2 mod 3-primes.
Let ( p1 , p2 , . . . , pk ) be any finite list of 2 mod 3-primes. We shall find a new
2 mod 3-prime p that is distinct from p1 , p2 , . . . , pk .
Indeed, set n = 3p1 p2 · · · pk − 1. It is easy to see that n > 0. Hence, Theorem
9.2.5 (a) shows that there exists a prime factorization of n. Let (q1 , q2 , . . . , q` ) be
this prime factorization. Thus, (q1 , q2 , . . . , q` ) is an `-tuple of primes such that
n = q1 q2 · · · q` . In other words, q1 , q2 , . . . , q` are primes and satisfy n = q1 q2 · · · q` .
We now claim that at least one of the primes q1 , q2 , . . . , q` must be a 2 mod 3-
prime.
[Proof: Assume the contrary. Thus, none of the primes q1 , q2 , . . . , q` is a 2 mod 3-
prime.
Note that n = 3p1 p2 · · · pk −1 ≡ 0 − 1 = −1 ≡ 2 mod 3. Hence, n ≡ 2 6≡ 0 mod 3,
| {z }
≡0 mod 3
so that 3 - n.
Let i ∈ {1, 2, . . . , `}. Then, qi is not a 2 mod 3-prime (since none of the primes
q1 , q2 , . . . , q` is a 2 mod 3-prime). In other words, qi 6≡ 2 mod 3 (since qi is a prime).
Moreover, qi | n (since n = q1 q2 · · · q` ) and thus qi 6≡ 0 mod 3 (because if we had
qi ≡ 0 mod 3, then we would have 3 | qi | n, which would contradict 3 - n).
However, the remainder qi %3 is either 0, 1 or 2 (since qi %3 ∈ {0, 1, 2}). Thus, qi
must be congruent to one of the three numbers 0, 1 and 2 modulo 3 (by Proposition
3.3.4, because 0%3 = 0 and 1%3 = 1 and 2%3 = 2). In other words, we have
qi ≡ 0 mod 3 or qi ≡ 1 mod 3 or qi ≡ 2 mod 3. Since we know that qi 6≡ 0 mod 3 and
qi 6≡ 2 mod 3, we thus conclude that qi ≡ 1 mod 3.
Now, forget that we fixed i. We thus have shown that qi ≡ 1 mod 3 for each
` `
i ∈ {1, 2, . . . , `}. Hence, ∏ qi ≡ ∏ 1 = 1 mod 3. Therefore, n = q1 q2 · · · q` =
i =1 |{z} i =1
≡1 mod 3
`
∏ qi ≡ 1 mod 3. This contradicts n ≡ 2 6≡ 1 mod 3. This contradiction shows that
i =1
our assumption was false. Hence, at least one of the primes q1 , q2 , . . . , q` must be a
2 mod 3-prime.]
Now we have shown that at least one of the primes q1 , q2 , . . . , q` must be a
2 mod 3-prime. In other words, there exists some j ∈ {1, 2, . . . , `} such that q j is
a 2 mod 3-prime. Consider this j. Clearly, q j | n (since n = q1 q2 · · · q` ).
Set p = q j . Thus, p is a 2 mod 3-prime (since q j is a 2 mod 3-prime) and satisfies
p = q j | n.
For each i ∈ {1, 2, . . . , k}, we have pi - −1 (since pi is a prime, so that pi > 1) and

December 25, 2021


Math 235 notes page 470

thus

n=3 p p ···p −1 ≡ 0 − 1 = −1 6≡ 0 mod pi (since pi - −1 = (−1) − 0) .


| 1 2{z }k
≡0 mod pi
(since pi | p1 p2 ··· pk )

In other words, for each i ∈ {1, 2, . . . , k }, we have pi - n and thus p 6= pi (since


p = pi would yield p = pi - n, which would contradict p | n). In other words, p is
distinct from p1 , p2 , . . . , pk .
Forget that we fixed ( p1 , p2 , . . . , pk ). Thus, for any finite list ( p1 , p2 , . . . , pk )
of 2 mod 3-primes, we have found a new 2 mod 3-prime p that is distinct from
p1 , p2 , . . . , pk . In other words, for any finite list of 2 mod 3-primes, we have found
a 2 mod 3-prime that is not in this list. Thus, there are infinitely many 2 mod 3-
primes. This solves Exercise 9.2.1.

9.3. p-valuations
9.3.1. The p-valuation of an integer
The prime factorization of a positive integer n provides an easy way to tell how
often n can be divided by p without remainder (i.e., how high a power of p divides
n): namely, as often as p appears in this prime factorization. This number is com-
monly known as the p-valuation of n. Let us define it in slightly greater generality
(for any integer n, not just positive integers) and in more detail ([19s, Definition
2.13.23]):

Definition 9.3.1. Let p be a prime.


(a) Let n be a nonzero integer. Then, v p (n) shall denote the largest m ∈ N
such that pm | n. This is well-defined (see [19s, Lemma 2.13.22] for a detailed
proof). This nonnegative integer v p (n) will be called the p-valuation (or the p-adic
valuation) of n.
(b) We extend this definition of v p (n) to the case of n = 0 as follows: Set
v p (0) = ∞, where ∞ is a new symbol. This symbol ∞ is supposed to model
the concept of “positive infinity”; in particular, we extend some of the standard
arithmetic operations to ∞ according to the following rules:

• We set k + ∞ = ∞ + k = ∞ for all integers k.

• We set ∞ + ∞ = ∞.

• For each integer k, we declare the inequalities k < ∞ and ∞ > k and k ≤ ∞
and ∞ ≥ k to be true, and the inequalities k ≥ ∞ and ∞ ≤ k and k > ∞
and ∞ < k to be false.

• If S is a nonempty set of integers, then we set min (S ∪ {∞}) = min S


(provided that min S exists).

December 25, 2021


Math 235 notes page 471

• We set min {∞} = ∞.

• If S is any set of integers, then we set max (S ∪ {∞}) = ∞.

(This being said, ∞ is not supposed to be a “first class citizen” of the number
system. In particular, differences of the form k − ∞ are not defined, since any
definition of k − ∞ would break some of the familiar rules of arithmetic. The only
operations that we shall subject ∞ to are addition, minimum and maximum.)

Note that the rules for the symbol ∞ yield that

k + ∞ = ∞ + k = max {k, ∞} = ∞ and min {k, ∞} = k

for each k ∈ Z ∪ {∞}. It is not hard to see that basic properties of inequalities
(such as “if a ≤ b and b ≤ c, then a ≤ c”) and of addition (such as “( a + b) + c =
a + (b + c)”) and of the interaction between inequalities and addition (such as “if
a ≤ b, then a + c ≤ b + c”) are still valid in Z ∪ {∞} (that is, they still hold if we
plug ∞ for one or more of the variables).287 However, of course, we cannot “cancel”
∞ from equalities (i.e., we cannot cancel ∞ from a + ∞ = b + ∞ to obtain a = b) or
inequalities.

Example 9.3.2. (a) We have v3 (18) = 2. Indeed, 2 is the largest m ∈ N such that
3m | 18 (because 32 = 9 | 18 but 33 = 27 - 18).
(b) We have v3 (14) = 0. Indeed, 0 is the largest m ∈ N such that 3m | 14
(because 30 = 1 | 14 but 31 = 3 - 14).
(c) We have v3 (51) = 1. Indeed, 1 is the largest m ∈ N such that 3m | 51
(because 31 = 3 | 51 but 32 = 9 - 51).
(d) We have v3 (0) = ∞ (by Definition 9.3.1 (b)).

Definition 9.3.1 (a) can be restated in the following more intuitive way: Given a
prime p and a nonzero integer n, we let v p (n) be the number of times we can divide
n by p without leaving Z. Definition 9.3.1 (b) is consistent with this restatement,
because we can clearly divide 0 by p infinitely often without leaving Z. From this
point of view, the following lemma should be obvious:

Lemma 9.3.3. Let p be a prime. Let i ∈ N. Let n ∈ Z. Then, pi | n if and only if


v p (n) ≥ i.

Proof of Lemma 9.3.3 (sketched). (See [19s, Lemma 2.13.25] for a detailed proof.) In
the n = 0 case, we have both pi | n and v p (n) ≥ i (since v p (n) = v p (0) = ∞ ≥ i).
Thus, WLOG assume that n 6= 0. Hence, v p (n) is defined as the largest m ∈ N
287 For algebraists: The set Z ∪ {∞} equipped with the operations max and + as “addition” and
“multiplication” and with the relation ≤ is a totally ordered commutative semiring. The same
is true if max is replaced by min. These two semirings are known as the tropical semirings over
Z. See [SpeStu09] for more about them.

December 25, 2021


Math 235 notes page 472

such that pm | n. Therefore, pv p (n) | n holds, but pv p (n)+1 | n does not. From this, it
is easy to see that pi | n holds if v p (n) ≥ i, but not if v p (n) < i. But this is precisely
the claim of Lemma 9.3.3.

Corollary 9.3.4. Let p be a prime. Let n ∈ Z. Then, v p (n) = 0 if and only if


p - n.

Proof of Corollary 9.3.4 (sketched). (See [19s, Corollary 2.13.26] for a detailed proof.)
Lemma 9.3.3 (applied to i = 0) shows that p | n if and only if v p (n) ≥ 1. In other
words, p | n if and only if v p (n) 6= 0 (since v p (n) ≥ 1 is equivalent to v p (n) 6= 0).
Taking the contrapositive of this claim, we obtain precisely Corollary 9.3.4.
Using the p-valuation, we can decompose a nonzero integer into the product of
a power of p and an integer coprime to p:

Lemma 9.3.5. Let p be a prime. Let n ∈ Z be nonzero. Then:


(a) There exists a nonzero integer u such that u ⊥ p and n = upv p (n) .
(b) If i ∈ N and w ∈ Z are such that w ⊥ p and n = wpi , then v p (n) = i.

Proof of Lemma 9.3.5 (sketched). (See [19s, Lemma 2.13.27] for a detailed proof.) The
definition of v p (n) yields v p (n) ∈ N and pv p (n) | n and pv p (n)+1 - n.
(a) Set u = n/pv p (n) ; thus, u is nonzero (since n is nonzero) and satisfies n =
upv p (n) . It remains to show that u ⊥ p. But we have ppv p (n) = pv p (n)+1 - n = upv p (n) .
Cancelling the (nonzero) factor pv p (n) from this non-divisibility, we find p - u, and
thus p ⊥ u (by Proposition 9.1.6, applied to a = u). In other words, u ⊥ p. This
proves Lemma 9.3.5 (a).
(b) Let i ∈ N and w ∈ Z be such that w ⊥ p and n = wpi . We must prove that
v p (n) = i.
Assume the contrary. Thus, v p (n) 6= i. But pi | n (since n = wpi ) and thus
v p (n) ≥ i (by Lemma 9.3.3). Hence, v p (n) > i (since v p (n) 6= i) and therefore
v p (n) ≥ i + 1. Equivalently, we have pi+1 | n (by Lemma 9.3.3, applied to i + 1
instead of i). In other words, ppi | wpi (since pi+1 = ppi and n = wpi ). Cancelling
the (nonzero) factor pi from this divisibility, we find p | w. Hence, gcd ( p, w) =
| p| = p > 1. On the other hand, gcd ( p, w) = gcd (w, p) = 1 (since w ⊥ p). These
two facts clearly contradict each other.
This contradiction shows that our assumption was false. Hence, v p (n) = i must
hold. This proves Lemma 9.3.5 (b).
The next theorem is crucial for computing and bounding p-valuations:

Theorem 9.3.6. Let p be a prime.


(a) We have v p ( ab) = v p ( a) +v p (b) for any two integers a and b.
(b) We have v p ( a + b) ≥ min v p ( a) , v p (b) for any two integers a and b.
(c) We have v p (1) = 0.

December 25, 2021


Math 235 notes page 473

(
1, if q = p;
(d) We have v p (q) = for any prime q.
0, if q 6= p

Note that Theorem 9.3.6 (a) determines v p ( ab) exactly (in terms of v p ( a) and
v p (b)), but Theorem 9.3.6 (b) merely gives a lower bound on v p ( a + b). There
is no way to improve on this, since v p ( a) and v p (b) do not uniquely determine
v p ( a + b ).
Proof of Theorem 9.3.6 (sketched). (See [19s, Theorem 2.13.28] for a more detailed proof.)
(a) Let a and b be two integers. We must prove that v p ( ab) = v p ( a) + v p (b).
If a = 0, then this boils down to ∞ = ∞, which is obvious. Thus, we WLOG
assume that a 6= 0. Likewise, we WLOG assume that b 6= 0. Hence, ab 6= 0.
Lemma 9.3.5 (a) (applied to n = a) shows that there exists a nonzero integer x
such that x ⊥ p and a = xpv p (a) . Likewise, there exists a nonzero integer y such that
y ⊥ p and b = ypv p (b) . Consider these x and y. From x ⊥ p and y ⊥ p, we obtain
xy ⊥ p (by Theorem 3.5.10). Furthermore, multiplying the equalities a = xpv p (a)
and b = ypv p (b) , we obtain
  
v p ( a) v p (b)
ab = xp yp = ( xy) pv p (a)+v p (b) .

Thus, Lemma 9.3.5 (b) (applied to n = ab, i = v p ( a) + v p (b) and w = xy) shows
that v p ( ab) = v p ( a) + v p (b). This proves Theorem 9.3.6 (a). 
(b) Let a and b be two integers. We must prove that v p ( a + b) ≥ min v p ( a) , v p (b) .
We WLOG assume that a 6= 0 and b 6= 0 (as the other cases are easy). Thus,
v p ( a) ∈ N and vp (b) ∈ N.
Let m = min v p ( a) , v p (b) . Thus, m ∈ N and v p ( a) ≥ m. Hence, Lemma
9.3.3 (applied to n = a and i = m) yields pm | a. In other words, a ≡ 0 mod pm .
Similarly, b ≡ 0 mod pm . Adding these two congruences together, we obtain a + b ≡
0 + 0 = 0 mod pm . In other words, pm | a + b. This, in turn, leads to v p ( a + b) ≥ m
(by Lemma
 9.3.3, applied to n = a + b and i = m). That is, v p ( a + b) ≥ m =
min v p ( a) , v p (b) . This proves Theorem 9.3.6 (b).
(c) This follows from Lemma 9.3.4 (applied to n = 1), since p - 1 (because | p| =
p > 1 = |1|). (
1, if q = p;
(d) Let q be a prime. We must prove that v p (q) =
0, if q 6= p.
This requires us to prove two things: First, we must show that v p ( p) = 1; second,
we must show that v p (q) = 0 if q 6= p.
Let us prove v p ( p) = 1 first. Indeed, 1 ⊥ p (by Exercise 3.5.1 (a)) and p = 1 · p1 .
Thus, Lemma 9.3.5 (b) (applied to n = p, i = 1 and w = 1) yields v p ( p) = 1.
It remains to show that v p (q) = 0 if q 6= p. Thus, let us assume that q 6= p.
Hence, Proposition 9.1.7 (applied to q and p instead of p and q) yields q ⊥ p. Also,
q = q · p0 (since p0 = 1). Therefore, Lemma 9.3.5 (b) (applied to n = q, i = 0 and
w = q) yields v p (q) = 0. This completes our proof of Theorem 9.3.6 (d).

December 25, 2021


Math 235 notes page 474

Corollary 9.3.7. Let p be a prime. Let a1 , a2 , . . . , ak be k integers. Then,


v p ( a1 a2 · · · a k ) = v p ( a1 ) + v p ( a2 ) + · · · + v p ( a k ).

Proof of Corollary 9.3.7 (sketched). (See [19s, Corollary 2.13.29] for details.) This fol-
lows straightforwardly by induction on k, using Theorem 9.3.6 (a) (as well as The-
orem 9.3.6 (c) for the induction base).
The following simple properties of p-valuations are left to the reader to prove:288

Proposition 9.3.8. Let p be a prime. Let n ∈ Z. Then, v p (|n|) = v p (n).

Corollary 9.3.9. Let p be a prime. Let a ∈ Z and k ∈ N. Then, v p ak = kv p ( a).




Corollary 9.3.10. Let p1 , p2 , . . . , pu be finitely many distinct primes. Let


a1 , a2 , . . . , au be nonnegative integers.
(a) We have v pi p1a1 p2a2 · · · puau =

ai for each i ∈ {1, 2, . . . , u}.
a1 a2 au 
(b) We have v p p1 p2 · · · pu = 0 for each prime p satisfying p ∈
/
{ p1 , p2 , . . . , p u }.

Another useful property of p-valuations is how they transform gcds into minima:

Proposition 9.3.11. Let p be a prime. Let k be a positive integer. Let n1 , n2 , . . . , nk


be k integers. Then,

v p (gcd (n1 , n2 , . . . , nk )) = min v p (n1 ) , v p (n2 ) , . . . , v p (nk ) .

We shall prove this proposition using the following innocent-looking lemma:

Lemma 9.3.12. Let a and b be two elements of N ∪ {∞}. Assume that the logical
equivalence
( a ≥ j) ⇐⇒ (b ≥ j) (409)
holds for each j ∈ N. Then, a = b.

Proof of Lemma 9.3.12. Assume the contrary. Thus, a 6= b.


Clearly, a and b play symmetric roles in our setting (indeed, they play symmetric
roles in (409), since logical equivalence is a symmetric relation). Thus, we WLOG
assume that a ≥ b (since otherwise, we can swap a with b). Combining a ≥ b with
a 6= b, we obtain a > b.
Hence, b < a ≤ ∞, so that b 6= ∞. Hence, b ∈ N and thus b + 1 > b. Hence,
the statement “b ≥ b + 1” is false. However, we have b + 1 ∈ N (since b ∈ N), and
thus (409) (applied to j = b + 1) yields the logical equivalence ( a ≥ b + 1) ⇐⇒
288 Proposition 9.3.8 is [19s, Exercise 2.13.5]. Corollary 9.3.9 is [19s, Exercise 2.13.6]. Corollary 9.3.10
is [19s, Exercise 2.13.7].

December 25, 2021


Math 235 notes page 475

(b ≥ b + 1). Therefore, the statement “a ≥ b + 1” is false (since the statement


“b ≥ b + 1” is false). In other words, we have a < b + 1. This entails that a ∈ N
(since b + 1 ∈ N). Thus, a and b are integers. Hence, from a > b, we obtain
a ≥ b + 1. However, this contradicts a < b + 1. This contradiction shows that our
assumption was false; this proves Lemma 9.3.12.
Proof of Proposition 9.3.11. Set

g = gcd (n1 , n2 , . . . , nk ) and s = min v p (n1 ) , v p (n2 ) , . . . , v p (nk ) .

Note that v p ( g) ∈ N ∪ {∞} (since the p-valuation of any integer is an element of


N ∪ {∞}) and s ∈ N ∪ {∞} (for the same reason). Our end goal is to show that
v p ( g) = s. First, we shall show the following:

Claim 1: Let j ∈ N. Then, we have the logical equivalence



v p ( g) ≥ j ⇐⇒ (s ≥ j) .

[Proof of Claim 1: Lemma 9.3.3 (applied to n = g and i = j) yields that p j | g if


and only if v p ( g) ≥ j. In other words, we have the logical equivalence
 
p j | g ⇐⇒ v p ( g) ≥ j .

(410)

On the other hand, Theorem 3.4.14 (applied to bi = ni and m = p j ) yields that we


have the following logical equivalence:
 
p j | ni for all i ∈ {1, 2, . . . , k }
 
⇐⇒ p j | gcd (n1 , n2 , . . . , nk ) . (411)

Hence, we have the following chain of logical equivalences:


 
j

v p ( g) ≥ j ⇐⇒ p | g (by (410))
 
⇐⇒ p j | gcd (n1 , n2 , . . . , nk ) (since g = gcd (n1 , n2 , . . . , nk ))
 
⇐⇒ p j | ni for all i ∈ {1, 2, . . . , k} (412)

(by (411)).
Now, let i ∈ {1, 2, . . . , k }. Then, Lemma 9.3.3 (applied to ni and j instead of n and
i) yields that p j | ni if and only if v p (ni ) ≥ j. In other words, we have the logical
equivalence  
p j | ni ⇐⇒ v p (ni ) ≥ j .

(413)
Forget that we fixed i. We thus have proved the equivalence (413) for each i ∈
{ 2, . . . , k}.
1,

December 25, 2021


Math 235 notes page 476

Now, from (412), we obtain the following chain of logical equivalences:



v p ( g) ≥ j
 
 
 
j
⇐⇒  p | ni for all i ∈ {1, 2, . . . , k }
 
 | {z } 
( p i )
⇐⇒ v (n )≥ j 
(by (413))

⇐⇒ v p (ni ) ≥ j for all i ∈ {1, 2, . . . , k }

⇐⇒ each of the k elements v p (n1 ) , v p (n2 ) , . . . , v p (nk ) is ≥ j

⇐⇒ the smallest of the k elements v p (n1 ) , v p (n2 ) , . . . , v p (nk ) is ≥ j
because for any k elements a1 , a2 , . . . , ak of N ∪ {∞} ,
 
 the statement “each of the k elements a1 , a2 , . . . , ak is ≥ j” 
 
 is equivalent to 
“the smallest of the k elements a1 , a2 , . . . , ak is ≥ j”
 
  
⇐⇒ min v p (n1 ) , v p (n2 ) , . . . , v p (nk ) ≥ j
 
| {z } 
=s
(by the definition of s)
⇐⇒ (s ≥ j) .
This proves Claim 1.]
Now, we are almost there. Claim 1 shows that the logical equivalence

v p ( g) ≥ j ⇐⇒ (s ≥ j)

holds for each j ∈ N. Thus, Lemma 9.3.12 (applied to a = v p ( g) and b = s) yields


v p ( g) = s. In view of g = gcd (n1 , n2 , . . . , nk ) and s = min v p (n1 ) , v p (n2 ) , . . . , v p (nk ) ,
this rewrites as

v p (gcd (n1 , n2 , . . . , nk )) = min v p (n1 ) , v p (n2 ) , . . . , v p (nk ) .

This proves Proposition 9.3.11.


The technique we just used in our proof of Proposition 9.3.11 is worth crys-
tallizing out, as it is often helpful in proving properties of p-valuations: In or-
der to show  that v p ( g) = s, we proved that any j ∈ N satisfies the equivalence
v p ( g) ≥ j ⇐⇒ (s ≥ j) (this was our Claim 1). In other words, in order to show
that the “numbers” v p ( g) and s are equal289 , we showed that the j ∈ N that don’t
exceed one of them are the same j ∈ N that don’t exceed the other. Thus, instead
of reasoning about these “numbers” v p ( g) and s themselves, we have argued about
what it means for a j ∈ N to satisfy v p ( g) ≥ j or s ≥ j.
289 We are putting the word “numbers” in quotation marks, since v p ( g) and s can be ∞.

December 25, 2021


Math 235 notes page 477

9.3.2. p-valuations and prime factorizations


As already mentioned, the p-valuation of a positive integer n tells us how often the
prime p appears in a prime factorization of n. Let us state this as a proposition:

Proposition 9.3.13. Let n be a positive integer. Let ( a1 , a2 , . . . , ak ) be a prime


factorization of n. Let p be a prime. Then,

(the number of times p appears in the tuple ( a1 , a2 , . . . , ak ))


= (the number of i ∈ {1, 2, . . . , k} such that ai = p)
= v p (n) .

Proof of Proposition 9.3.13 (sketched). (See [19s, Proposition 2.13.30] for details.)
From the definition of a prime factorization, we know that ( a1 , a2 , . . . , ak ) is a
tuple of primes such that n = a1 a2 · · · ak . Now, from n = a1 a2 · · · ak , we obtain
v p ( n ) = v p ( a1 a2 · · · a k ) = v p ( a1 ) + v p ( a2 ) + · · · + v p ( a k ) (by Corollary 9.3.7)
(
1, if ai = p;
= ∑ v p ( ai ) = ∑ 0, if ai 6= p
i ∈{1,2,...,k} i ∈{1,2,...,k}
| {z }

1, if a = p;
i
=
0, if a 6 = p
i
(by Theorem 9.3.6 (d),
applied to q= ai (since ai is a prime))
= (the number of i ∈ {1, 2, . . . , k} such that ai = p) · 1
+ (the number of i ∈ {1, 2, . . . , k} such that ai 6= p) · 0
= (the number of i ∈ {1, 2, . . . , k} such that ai = p)
= (the number of times p appears in the tuple ( a1 , a2 , . . . , ak )) .
This proves Proposition 9.3.13.

9.3.3. The canonical factorization


Proposition 9.3.13 allows us to expand each positive integer n “explicitly” as a
product of primes:
n = ∏ pv p (n) (414)
p prime

(where the product sign “ ∏ ” means a product over all primes p). But first, let
p prime
me explain why the product in this equality makes sense. This product is infinite
(as there are infinitely many primes), so this is not a priori obvious. Fortunately, it
is the simplest possible kind of an infinite product – one that has only finitely many
factors different from 1. Let me quickly explain the meaning of such products. I
begin by defining their additive analogues – i.e., sums that have only finitely many
addends different from 0:

December 25, 2021


Math 235 notes page 478

Definition 9.3.14. Let S be a set. Let as be a number for each s ∈ S. Assume


that only finitely many s ∈ S satisfy as 6= 0. (In other words, assume that the set
{s ∈ S | as 6= 0} is finite.) Then, the sum ∑ as is defined to be the finite sum
s∈S
∑ as . (The latter sum is already defined according to Definition 4.1.1, since it is
s∈S;
a s 6 =0
a finite sum.)

For example, the infinite sum ∑ b4/sc is well-defined by this definition,


s∈{1,2,3,...}
because only finitely many s ∈ {1, 2, 3, . . .} satisfy b4/sc 6= 0 (indeed, b4/sc 6= 0
holds only for s ∈ {1, 2, 3, 4}); its value is

∑ b4/sc = ∑ b4/sc = ∑ b4/sc


s∈{1,2,3,...} s∈{1,2,3,...}; s∈{1,2,3,4}
b4/sc6=0
= b4/1c + b4/2c + b4/3c + b4/4c = 8.

A pedantic reader may observe that Definition 9.3.14 above might possibly clash
with our old definition of finite sums (Definition 4.1.1), since it applies both to
finite and infinite sets S. However, this clash is harmless, because when S is finite,
Definition 9.3.14 agrees with Definition 4.1.1 (since a sum does not change when
vanishing addends are removed from it).
Definition 4.1.1 allows us to make sense of infinite sums when all but finitely
many of their addends are zero. Such sums are called finitely supported sums, and
satisfy many of the nice properties of finite sums (see [Grinbe15, Subsection 2.14.15]
for details). They are, in many ways, much simpler than the convergent infinite
sums of analysis; in particular, they can be computed in finite time (simply by
throwing away all the zero addends and summing the finitely many addends that
remain).
Let us now state the multiplicative analogue of Definition 9.3.14:

Definition 9.3.15. Let S be a set. Let as be a number for each s ∈ S. Assume


that only finitely many s ∈ S satisfy as 6= 1. (In other words, assume that the
set {s ∈ S | as 6= 1} is finite.) Then, the product ∏ as is defined to be the finite
s∈S
product ∏ as . (The latter product is already defined according to Definition
s∈S;
a s 6 =1
4.2.1, since it is a finite product.)

For example,
2 · 9 · 3 · 1| · 1 · 1{z· 1 · · ·}· = 2 · 9 · 3 = 54
infinitely many 1’s

(where, of course, we are using the notation a1 a2 a3 · · · for an infinite product


∏ as ).
s∈{1,2,3,...}

December 25, 2021


Math 235 notes page 479

Convention 9.3.16. Here and in the following, the symbol “ ∏ ” means a prod-
p prime
uct ranging over all primes p. This is an infinite product, but can sometimes
make sense (according to Definition 9.3.15).

Now, we can make sense of the equality (414):

Theorem 9.3.17. Let n be a nonzero integer.


(a) We have v p (n) = 0 for every prime p > |n|. (Note that “for every prime
p > |n|” is shorthand for “for every prime p satisfying p > |n|”.)
(b) The product ∏ pv p (n) has only finitely many factors different from 1,
p prime
and thus is well-defined.
(c) We have
|n| = ∏ pv p (n) .
p prime

(d) If n is positive, then


n= ∏ pv p (n) .
p prime

This expression n = ∏ pv p (n) is called the canonical factorization of n.


p prime

Proof of Theorem 9.3.17 (sketched). (a) (See [19s, Lemma 2.13.32 (a)] for details.) Let
p be a prime such that p > |n|. Then, Proposition 3.1.3 (b) yields p - n (since
| p| = p > |n|), and thus Corollary 9.3.4 yields v p (n) = 0. This proves Theorem
9.3.17 (a).
(b) (See [19s, Lemma 2.13.32 (b)] for details.) For every prime p > |n|, we have
v p (n) = 0 (by Theorem 9.3.17 (a)) and thus pv p (n) = p0 = 1. Thus, a prime p can
satisfy v p (n) 6= 0 only if p ≤ |n|. Therefore, only finitely many primes p satisfy
v p (n) 6= 0 (since only finitely many primes p satisfy p ≤ |n|). In other words, the
product ∏ pv p (n) has only finitely many factors different from 1. This proves
p prime
Theorem 9.3.17 (b).
(d) (See [19s, Corollary 2.13.33] for details.) Assume that n is positive. Theorem
9.2.5 (a) shows that there exists a prime factorization ( a1 , a2 , . . . , ak ) of n. Consider
this ( a1 , a2 , . . . , ak ). Thus, a1 , a2 , . . . , ak are primes satisfying n = a1 a2 · · · ak . For
each prime p, we have
(the number of i ∈ {1, 2, . . . , k} such that ai = p) = v p (n) (415)
(by Proposition 9.3.13). Now, consider the product a1 a2 · · · ak . This product a1 a2 · · · ak
is a product of primes, and each prime p appears in it precisely v p (n) times (by
(415)). Hence, this product equals ∏ pv p (n) . Thus, a1 a2 · · · ak = ∏ pv p (n) , so
p prime p prime
v p (n)
that n = a1 a2 · · · ak = ∏ p . This proves Theorem 9.3.17 (d).
p prime

December 25, 2021


Math 235 notes page 480

(c) (See [19s, Corollary 2.13.34] for details.) Apply Theorem 9.3.17 (d) to |n|
instead of n, and use Proposition 9.3.8 to simplify the result.
Theorem 9.3.17 (c) greatly demystifies the “multiplicative structure” of the pos-
itive integers (i.e., the way positive integers behave under multiplication), as long
as one is not interested in addition and subtraction. A rule of thumb is that, if an
exercise about integers involves no + and − signs, then Theorem 9.3.17 (c) and
the properties of p-valuations might simplify it significantly. We will see several
examples of this below. One of the basic tools here is that divisibility relations can
be reduced to inequalities between p-valuations:

Proposition 9.3.18. Let n and m be integers. Then, n | m if and only if each prime
p satisfies v p (n) ≤ v p (m).

Proof of Proposition 9.3.18 (sketched). (See [19s, Proposition 2.13.35] for details.) We
must prove the following two claims:

Claim 1: If n | m, then each prime p satisfies v p (n) ≤ v p (m).

Claim 2: If each prime p satisfies v p (n) ≤ v p (m), then n | m.

[Proof of Claim 1: Assume that n | m. In other words, there exists some integer b
such that m = nb. Consider this b. Now, each prime p satisfies
v p (m) = v p (nb) (since m = nb)
= v p (n) + v p (b) (by Theorem 9.3.6 (a), applied to a = n)
| {z }
≥0
≥ v p (n) ,
so that v p (n) ≤ v p (m). This proves Claim 1.]
[Proof of Claim 2: Assume that each prime p satisfies v p (n) ≤ v p (m). We must
prove that n | m.
If m = 0, then this is obvious. Thus, we WLOG assume that m 6= 0. Hence, for
each prime p, we have v p (m) ∈ N and thus v p (m) < ∞. In particular, v2 (m) < ∞.
We assumed that each prime p satisfies v p (n) ≤ v p (m). Thus, in particular,
v2 (n) ≤ v2 (m) < ∞, so that n 6= 0.
The statement of Claim 2 does not change if we replace n and m by |n| and
|m|, respectively (because of Proposition 3.1.3 (a) and Proposition 9.3.8). Hence, we
WLOG assume that n and m are nonnegative. Assume this. Then, n and m are
positive (since n 6= 0 and m 6= 0). Thus, Theorem 9.3.17 (d) yields

n= ∏ pv p (n) . (416)
p prime

Similarly,
m= ∏ pv p (m) . (417)
p prime

December 25, 2021


Math 235 notes page 481

We have assumed that each prime p satisfies v p (n) ≤ v p (m). In other words,
each prime p satisfies v p (m) − v p (n) ≥ 0 and therefore pv p (m)−v p (n) ∈ Z. Now, set

c= ∏ pv p (m)−v p (n) . (418)


p prime

The infinite product in this equality has only finitely many factors different from 1
(for essentially the same reason as in Theorem 9.3.17 (b)), and thus is well-defined.
Moreover, this product is an integer (since we have shown that each prime p satis-
fies pv p (m)−v p (n) ∈ Z; but this is saying that all factors of this product are integers).
Thus, c is an integer. Multiplying the equalities (416) and (418), we obtain
! !
nc = ∏ pv p (n) ∏ pv p (m)−v p (n) = ∏ pv p (m) = m (by (417)) .
p prime p prime p prime

In other words, m = nc. Hence, n | m. This completes the proof of Claim 2.]
Now, Claim 1 and Claim 2 are both proved; hence, Proposition 9.3.18 follows.
The next
 corollary says that an integer n is determined up to sign by the family
v p (n) p prime of its p-valuations for all primes p:

Corollary 9.3.19. Let n and m be two integers. Assume that

v p (n) = v p (m) for every prime p. (419)

(a) Then, |n| = |m|.


(b) If n and m are nonnegative, then n = m.

Proof of Corollary 9.3.19. (a) Each prime p satisfies v p (n) ≤ v p (m) (since (419) yields
v p (n) = v p (m)). Hence, Proposition 9.3.18 shows that n | m. However, the same
argument (with the roles of n and m interchanged) shows that m | n (since n and
m play symmetric roles in Corollary 9.3.19 (a)). Thus, Proposition 3.1.3 (c) (applied
to a = n and b = m) yields |n| = |m|. This proves Corollary 9.3.19 (a).
(b) Assume that n and m are nonnegative. Thus, |n| = n and |m| = m. However,
Corollary 9.3.19 (a) yields |n| = |m|. Hence, n = |n| = |m| = m. This proves
Corollary 9.3.19 (b).
We can also describe the gcd of several integers via p-valuations:

Proposition 9.3.20. Let n1 , n2 , . . . , nk be finitely many integers. Assume that not


all of n1 , n2 , . . . , nk are zero. Then,

gcd (n1 , n2 , . . . , nk ) = ∏ pmin{v p (n1 ),v p (n2 ),...,v p (nk )} . (420)


p prime

December 25, 2021


Math 235 notes page 482

Proof of Proposition 9.3.20. We know (from Proposition 3.4.3 (b), applied to bi = ni )


that gcd (n1 , n2 , . . . , nk ) is a positive integer. Hence, Theorem 9.3.17 (d) (applied to
n = gcd (n1 , n2 , . . . , nk )) yields

gcd (n1 , n2 , . . . , nk ) = ∏ pv p (gcd(n1 ,n2 ,...,nk ))


p prime
| {z }
= pmin{v p (n1 ),v p (n2 ),...,v p (nk )}
(since Proposition 9.3.11
yields v p (gcd(n1 ,n2 ,...,nk ))=min{v p (n1 ),v p (n2 ),...,v p (nk )})

= ∏ pmin{v p (n1 ),v p (n2 ),...,v p (nk )} .


p prime

This proves Proposition 9.3.20.


(See [19s, Proposition 2.13.40] for a different proof in the case when n1 , n2 , . . . , nk
are all nonzero.)
Another consequence of the above is saying that a congruence modulo a nonzero
integer n can be reduced to the corresponding congruences modulo all prime pow-
ers pv p (n) :

Corollary 9.3.21. Let n be a nonzero integer. Let a and b be two integers. Assume
that
a ≡ b mod pv p (n) for every prime p. (421)
Then, a ≡ b mod n.

Proof of Corollary 9.3.21 (sketched). (See [19s, Exercise 2.13.9] for details and for an
alternative proof.) We must prove that a ≡ b mod n. If a = b, then this is obvious.
Thus, we WLOG assume that a 6= b. Hence, a − b 6= 0, so that v p ( a − b) ∈ N for
every prime p.
Let p be any prime. Then, (421) yields a ≡ b mod pv p (n) . In other words, pv p (n) |
a − b. In view of Lemma 9.3.3 (applied to v p (n) and a − b instead of i and n), this
entails that v p ( a − b) ≥ v p (n). In other words, v p (n) ≤ v p ( a − b).
Now, forget that we fixed p. We thus have proven that each prime p satisfies
v p (n) ≤ v p ( a − b). In view of Proposition 9.3.18 (applied to m = a − b), this entails
that n | a − b. In other words, a ≡ b mod n. This proves Corollary 9.3.21.
The p-valuation of a positive integer n is easily read off its canonical factorization:

Corollary 9.3.22. For each prime p, let b p be a nonnegative integer. Assume that
only finitely many primes p satisfy b p 6= 0. Let n = ∏ pb p . Then,
p prime

v q ( n ) = bq for each prime q.

December 25, 2021


Math 235 notes page 483

Proof of Corollary 9.3.22 (sketched). (See [19s, Corollary 2.13.37] for the details.) We
have n = ∏ pb p ; thus, the number n has a prime factorization
p prime
 
2, 2, . . . , 2, 3, 3, . . . , 3, 5, 5, . . . , 5, . . .
| {z } | {z } | {z }
b2 times b3 times b5 times

in which each prime p appears b p times. (This is a finite list, since only finitely
many primes p satisfy b p 6= 0.) Hence, Corollary 9.3.22 follows from Proposition
9.3.13 (applied to p = q).

9.3.4. Some applications


As mentioned above, Theorem 9.3.17 reduces multiplicative questions about inte-
gers to additive questions about their p-valuations. The following exercise (which
is in itself an important result) illustrates this:

Exercise 9.3.1. Let n ∈ N. Let a and b be positive integers satisfying a ⊥ b.


Assume that ab is the n-th power of a positive integer. Prove that a and b are
n-th powers of positive integers.

Note that the word “positive” in Exercise 9.3.1 cannot be dispensed with (for a
counterexample, set a = −1 and b = −1 and n = 2).
Solution to Exercise 9.3.1. If n = 0, then Exercise 9.3.1 is easy to solve290 . Thus, for
the rest of this solution, we WLOG assume that n 6= 0. Hence, n > 0.
We shall first show the following:

Claim 1: Let p be a prime. Then, v p ( a) /n and v p (b) /n are nonnegative


integers.

[Proof of Claim 1: We have a ⊥ b; in other words, gcd ( a, b) = 1 (by the definition


of “coprime”). Thus, v p (gcd ( a, b)) = v p (1) = 0 (by Theorem 9.3.6 (c)). However,
Proposition 9.3.11 (applied to k = 2 and n1 = a and n2 = b) yields

v p (gcd ( a, b)) = min v p ( a) , v p (b) .

Hence, min v p ( a) , v p (b) = v p(gcd ( a, b)) = 0. Thus, one of the two numbers
v p ( a) and v p (b) is 0 (since min v p ( a) , v p (b) is one of the two numbers v p ( a)
290 Proof.Assume that n = 0. We have assumed that ab is the n-th power of a positive integer. In other
words, there exists a positive integer c such that ab = cn . Consider this c. Thus, ab = cn = c0
(since n = 0), so that ab = c0 = 1 and thus a | ab = 1. Hence, Proposition 3.1.3 (b) (applied
to 1 instead of b) yields | a| ≤ |1| = 1. Since a is positive, we have | a| = a, so that a = | a| ≤ 1.
Thus, a = 1 (since a is a positive integer), so that a = 1 = 10 . Hence, a is the n-th power of a
positive integer (namely, of 1). Similarly, b is the n-th power of a positive integer. Thus, a and b
are n-th powers of positive integers. Hence, we have solved Exercise 9.3.1 under the assumption
that n = 0.

December 25, 2021


Math 235 notes page 484

and v p (b)). In other words, we have v p ( a) = 0 or v p (b) = 0. Thus, we WLOG


assume that v p ( a) = 0 (since we can otherwise achieve this by swapping a with b).
However, we assumed that ab is the n-th power of a positive integer. In other
words, there exists a positive integer c such that ab = cn . Consider this c. From
ab = cn , we obtain v p ( ab) = v p (cn ) = nv p (c) (by Corollary 9.3.4, applied to c
and n instead of a and k). Also, v p (c) ∈ N (since c is a positive integer, thus a
nonzero integer). However, Theorem 9.3.6 (a) yields v p ( ab) = v p ( a) +v p (b) =
| {z }
=0
v p (b), so that v p (b) = v p ( ab) = nv p (c) and therefore v p (b) /n = v p (c) ∈ N.
Also, v p ( a) /n = 0/n = 0 ∈ N.
| {z }
=0
Now, we see that v p ( a) /n and v p (b) /n are nonnegative integers (since v p ( a) /n ∈
N and v p (b) /n ∈ N). This proves Claim 1.]
Now, recall that the integer a is positive and thus nonzero. Hence, Theorem
9.3.17 (d) (applied to a instead of n) yields

a= ∏ pv p ( a) . (422)
p prime

However, if p is any prime, then v p ( a) /n is a nonnegative integer (by Claim


1), and therefore pv p (a)/n is a well-defined positive integer (since p is a positive
integer). Moreover, if p is any prime satisfying p > | a|, then v p ( a) = 0 (by Theorem
9.3.17 (a), applied to a instead of n) and thus v p ( a) /n = 0/n = 0 and therefore
| {z }
=0
pv p (a)/n = p0 = 1. Hence, the product ∏ pv p (a)/n has only finitely many factors
p prime
different from 1 (since only finitely many primes p do not satisfy p > | a|). Thus, this
product is well-defined. Moreover, all factors of this product are positive integers
(because we have shown that if p is any prime, then pv p (a)/n is a positive integer).
Thus, this product itself is a positive integer. In other words, ∏ pv p (a)/n is a
p prime
positive integer. However,
!n
 n
∏ pv p (a)/n = ∏ p v p ( a)/n
= ∏ pv p ( a) .
p prime p prime | {z } p prime
= pv p ( a)
!n
Comparing this with (422), we obtain a = ∏ pv p (a)/n . This shows that a
p prime
is the n-th power of a positive integer (since ∏ pv p (a)/n is a positive integer).
p prime
Similarly, b is the n-th power of a positive integer. This solves Exercise 9.3.1.
Another application of p-valuations is the following simple but useful fact:

December 25, 2021


Math 235 notes page 485

Exercise 9.3.2. Let k be a positive integer. Let w be a rational number such that
wk is an integer. Prove that w is an integer.

Exercise 9.3.2 can be restated as follows: If the k-th root of an integer is rational,
then this root is an integer. In other words, if an integer is not a k-th power of an
integer, then its k-th root is irrational.
√ This makes
√ √ it completely straightforward to
check (e.g.) that the numbers 2 and 3 5 and 97 35 are irrational.
Solution to Exercise 9.3.2. If w = 0, then this is obvious. Thus, for the rest of this
solution, we WLOG assume that w 6= 0.
The number w is rational. Thus, we can write w in the form w = m/n for some
integers m and n with n 6= 0. Consider these m and n. Note that m = nw (since
w = m/n) and thus m 6= 0 (since n 6= 0 and w 6= 0).
From w = m/n, we obtain wk = (m/n)k = mk /nk . Hence, mk /nk is an integer
(since wk is an integer). Thus, nk | mk .
However, Proposition 9.3.18 (applied to nk and mk instead of n and m) shows
that nk | mk if and only if each prime p satisfies v p nk ≤ v p mk . Hence,
   
each prime p satisfies v p nk ≤ v p mk (423)

(since we have nk | mk ).
Now, let p be a prime. Then, v p (n) and v p (m) are integers (since n 6= 0 and
m 6= 0). We have v p nk = kv p (n) (by Corollary 9.3.9, applied to a = n) and


v p mk = kv p (m) (similarly). Hence,



   
kv p (n) = v p nk ≤ v p mk (by (423))
= kv p (m) .
Dividing this inequality by k, we obtain v p (n) ≤ v p (m) (since k is positive).
Forget that we fixed p. Thus, we have shown that each prime p satisfies v p (n) ≤
v p (m). According to Proposition 9.3.18, this entails that n | m. Hence, m/n is an
integer (since n is nonzero). In other words, w is an integer (since w = m/n). This
solves Exercise 9.3.2.
Another solution to Exercise 9.3.2 can be given using Corollary 3.5.17 (hint: w is
a root of the polynomial x k − wk ). We leave the details to the reader.
Here is another, slightly goofy, application of Theorem 9.3.17 (based on an idea
of Kurt Gödel):

Exercise 9.3.3. A sequence ( a1 , a2 , a3 , . . .) ∈ N∞ of nonnegative integers will be


called finitary if only
 finitely many positive integers n satisfy an 6= 0. (For exam-

ple, the sequence 1, 3, 0, 2, 0, 0, 0, . . .  is finitary, whereas the sequence


 
| {z }
infinitely many zeroes
(1, 0, 1, 0, 1, 0, . . .) (which alternates between 1s and 0s) is not.)

December 25, 2021


Math 235 notes page 486

Prove that the set of all finitary sequences of nonnegative integers is countable.
Solution to Exercise 9.3.3 (sketched). There are various ways of solving Exercise 9.3.3,
but a particularly short one can be obtained using prime factorization:
Let P = {1, 2, 3, . . .} be the set of all positive integers. Let F be the set of all
finitary sequences of nonnegative integers. We must prove that F is countable. We
shall achieve this by constructing a bijection from F to P.
Let ( p1 , p2 , p3 , . . .) = (2, 3, 5, 7, 11, . . .) be the sequence of all primes, listed in in-
creasing order with no repetitions. (This is indeed a well-defined infinite sequence,
because Theorem 9.1.3 shows that there are infinitely many primes.) Now, define a
map
α : F → P,
( a1 , a2 , a3 , . . .) 7→ p1a1 p2a2 p3a3 · · · .
(Note that the product p1a1 p2a2 p3a3 · · · in this definition is a well-defined positive
integer, since only finitely many of its factors are different from 1 (because only
finitely many positive integers n satisfy an 6= 0).) Conversely, define a map
β : P → F,

n 7 → v p1 ( n ) , v p2 ( n ) , v p3 ( n ) , . . . .

(Note that the sequence v p1 (n) , v p2 (n) , v p3 (n) , . . . in this definition is indeed
finitary, because Theorem 9.3.17 (a) entails that v pi (n) = 0 for all primes pi > |n|.)
Now, the maps α and β are mutually inverse. (Indeed, α ◦ β = id follows easily
from Theorem 9.3.17 (d), whereas β ◦ α = id follows easily from Corollary 9.3.22.)
Thus, the map α is invertible, i.e., a bijection. Hence, we have found a bijection
from F to P. Since the set P is countable, we thus conclude that F is also countable.
This solves Exercise 9.3.3.
Here is another exercise in which primes do not appear, yet are crucial for its
solution:
Exercise 9.3.4. Let a, b and c be three integers such that gcd ( a, b, c) = 1 and
c 6= 0. Prove that there is a positive integer x such that a + bx ⊥ c.
Note that the claim of Exercise 9.3.4 can also be restated as “there exists an entry
of the arithmetic progression ( a + b, a + 2b, a + 3b, . . .) that is coprime to c”. This
stands to reason, since the assumption gcd ( a, b, c) = 1 rules out the existence of a
nontrivial divisor shared by all entries of this arithmetic progression and c (where
“nontrivial” means “larger than 1”). However, this heuristic argument is not a
proof, since it is not hard to imagine that each entry of this arithmetic progression
could have some nontrivial divisor in common with c, but a different divisor de-
pending on the entry. Nevertheless, this theoretical possibility does not actually
happen, and Exercise 9.3.4 is true. However, the reasons for this are subtler than
it may appear. Before we solve this exercise, let us prove two simple but useful
lemmas:

December 25, 2021


Math 235 notes page 487

Lemma 9.3.23. Let n and m be two integers that don’t satisfy n ⊥ m. Then, there
exists a prime q that divides both n and m.

Proof of Lemma 9.3.23. Proposition 3.4.3 (a) shows that the number gcd (n, m) is a
nonnegative integer. Proposition 3.4.4 (f) (applied to a = n and b = m) yields
gcd (n, m) | n and gcd (n, m) | m.
We are in one of the following two cases:
Case 1: We have gcd (n, m) ≤ 1.
Case 2: We have gcd (n, m) > 1.
Let us first consider Case 1. In this case, we have gcd (n, m) ≤ 1. However, if we
had gcd (n, m) = 1, then we would have n ⊥ m (by the definition of “coprime”),
which would contradict the assumption that we don’t have n ⊥ m. Hence, we can-
not have gcd (n, m) = 1. Thus, gcd (n, m) 6= 1. Combining this with gcd (n, m) ≤ 1,
we obtain gcd (n, m) < 1. Therefore, gcd (n, m) = 0 (since gcd (n, m) is a non-
negative integer). Thus, 0 = gcd (n, m), so that 2 | 0 = gcd (n, m) | n and
2 | 0 = gcd (n, m) | m. In other words, 2 divides both n and m. Hence, there
exists a prime q that divides both n and m (namely, q = 2). This proves Lemma
9.3.23 in Case 1.
Let us now consider Case 2. In this case, we have gcd (n, m) > 1. Hence, Propo-
sition 9.1.4 (applied to gcd (n, m) instead of n) yields that there exists at least one
prime p such that p | gcd (n, m). Consider this p. Thus, p | gcd (n, m) | n and
p | gcd (n, m) | m. In other words, p divides both n and m. Hence, there exists a
prime q that divides both n and m (namely, q = p). This proves Lemma 9.3.23 in
Case 2.
We have now proved Lemma 9.3.23 in both Cases 1 and 2. This shows that
Lemma 9.3.23 always holds.
We note that the converse of Lemma 9.3.23 is also true: If there exists a prime q
that divides both n and m, then n and m don’t satisfy n ⊥ m. (This is pretty easy
to show; do it!)
Our next lemma is no less simple:

Lemma 9.3.24. Let S be a finite set of primes. Let q be a prime such that q ∈
/ S.
Then, q ⊥ ∏ p.
p∈S

For example, Lemma 9.3.24 (applied to S = {2, 7, 11} and q = 3) yields that
3 ⊥ 2 · 7 · 11.
Proof of Lemma 9.3.24. Write the finite set S in the form S = { p1 , p2 , . . . , pk } (where
p1 , p2 , . . . , pk are distinct). Thus, ∏ p = p1 p2 · · · pk .
p∈S
Now, let i ∈ {1, 2, . . . , k }. Then, pi ∈ { p1 , p2 , . . . , pk } = S. Hence, pi is a prime
(since S is a set of primes). Moreover, we cannot have pi = q (since pi = q would
yield pi = q ∈ / S, which would contradict pi ∈ S). Thus, the primes pi and q are
distinct. Hence, Proposition 9.1.7 (applied to p = pi ) yields pi ⊥ q.

December 25, 2021


Math 235 notes page 488

Forget that we fixed i. We thus have shown that each i ∈ {1, 2, . . . , k } satisfies
pi ⊥ q. Hence, Exercise 3.5.4 (applied to ai = pi and c = q) yields p1 p2 · · · pk ⊥ q.
In other words, q ⊥ p1 p2 · · · pk (by Proposition 3.5.4). In other words, q ⊥ ∏ p
p∈S
(since ∏ p = p1 p2 · · · pk ). This proves Lemma 9.3.24.
p∈S

We are now ready to solve Exercise 9.3.4:


Solution to Exercise 9.3.4. (The following solution is the second solution to Problem
2 in https://math.stackexchange.com/a/3128111/ ; I learnt it from a student.)
Let C be the set of all primes that divide c. This is a finite set291 . Moreover, C is
a set of primes (by the definition of C). Hence, C is a finite set of primes.
Let A be the set of all primes that divide a. The set C \ A is a subset of C, and
thus is a finite set of primes (since C is a finite set of primes).
Now, let
x = ∏ p.
p∈C \ A

Clearly, x is a positive integer. Now, I claim that a + bx ⊥ c. Obviously, once this is


proven, Exercise 9.3.4 will be solved.
So we must prove that a + bx ⊥ c.
Indeed, assume the contrary. Thus, we don’t have a + bx ⊥ c. Hence, Lemma
9.3.23 (applied to n = a + bx and m = c) shows that there exists a prime q that
divides both a + bx and c. Consider this q.
We know that q is a prime that divides c. In other words, q ∈ C (by the definition
of C). Moreover, q divides a + bx; in other words, q | a + bx. Furthermore, q > 1
(since q is a prime).
Now, we must be in one of the following two cases:
Case 1: We have q ∈ A.
Case 2: We have q ∈ / A.
Let us consider Case 1 first. In this case, we have q ∈ A. Thus, q is a prime that
divides a (by the definition of A). In particular, q | a. Now,

xb = bx = ( a + bx ) − |{z}
a ≡ 0 − 0 = 0 mod q.
| {z }
≡0 mod q ≡0 mod q
(since q| a+bx) (since q| a)

In other words, q | xb.


We cannot have q ∈ C \ A (since this would entail q ∈
/ A, which would contradict
q ∈ A). In other words, we have q ∈ / C \ A. Hence, Lemma 9.3.24 (applied to
291 Proof.Let p ∈ C. Then, p is a prime that divides c (by the definition of C). Hence, p | c.
Thus, Proposition 3.1.3 (b) (applied to p and c instead of a and b) yields | p| ≤ |c| (since c 6= 0).
However, p is prime; thus, p > 1 > 0 and therefore | p| = p. Hence, p = | p| ≤ |c| and thus
p ∈ {1, 2, . . . , |c|} (since p is a positive integer).
Forget that we fixed p. We thus have shown that p ∈ {1, 2, . . . , |c|} for each p ∈ C. In other
words, C ⊆ {1, 2, . . . , |c|}. Hence, the set C is finite (since the set {1, 2, . . . , |c|} is finite).

December 25, 2021


Math 235 notes page 489

S = C \ A) yields q ⊥ ∏ p. This rewrites as q ⊥ x (since x = ∏ p). Hence,


p∈C \ A p∈C \ A
Theorem 3.5.6 (applied to q, x and b instead of a, b and c) yields q | b (since q | xb).
Note that we also have q | a and q | c (since q divides c).
Now, for any b1 , b2 , b3 ∈ Z and m ∈ Z, we have the logical equivalence

(m | b1 and m | b2 and m | b3 ) ⇐⇒ (m | gcd (b1 , b2 , b3 ))


292 .
Applying this to b1 = a and b2 = b and b3 = c and m = q, we obtain the logical
equivalence
(q | a and q | b and q | c) ⇐⇒ (q | gcd ( a, b, c)) .
Hence, we have q | gcd ( a, b, c) (since we have q | a and q | b and q | c). In other
words, q | 1 (since gcd ( a, b, c) = 1). Thus, q is a divisor of 1. This shows that q is
either 1 or −1 (since the only divisors of 1 are 1 and −1). But this contradicts the
fact that q > 1. Thus, we have obtained a contradiction in Case 1.
Let us now consider Case 2. In this case, we have q ∈ / A. Combining this with
q ∈ C, we obtain q ∈ C \ A. Hence, q is a factor in the product ∏ p. Therefore,
p∈C \ A
q divides this product. Thus, q | ∏ p = x. Now,
p∈C \ A

a = ( a + bx ) −b |{z}
x ≡ 0 − b · 0 = 0 mod q.
| {z }
≡0 mod q ≡0 mod q
(since q| a+bx) (since q| x)

In other words, q | a. Hence, q divides a. Therefore, q is a prime that divides


a (since q is a prime). In other words, q ∈ A (by the definition of A). But this
contradicts q ∈
/ A. Thus, we have obtained a contradiction in Case 2.
We have now found contradictions in both Cases 1 and 2. Since these two cases
cover all possibilities, this shows that we always get a contradiction. Thus, our
assumption was wrong, and therefore a + bx ⊥ c is proven. This solves Exercise
9.3.4.
Next, let us illustrate the use of Corollary 9.3.21 by proving a variant of Theorem
9.1.13 (Euler’s theorem):

Let b1 , b2 , b3 ∈ Z and m ∈ Z be arbitrary. Then, we have the following chain of logical


292 Proof.

equivalences:

(m | b1 and m | b2 and m | b3 )
⇐⇒ (m | bi for all i ∈ {1, 2, 3})
⇐⇒ (m | bi for all i ∈ {1, 2, . . . , 3}) (since {1, 2, 3} = {1, 2, . . . , 3})
⇐⇒ (m | gcd (b1 , b2 , . . . , b3 )) (by Theorem 3.4.14 (applied to k = 3))
⇐⇒ (m | gcd (b1 , b2 , b3 )) (since gcd (b1 , b2 , . . . , b3 ) = gcd (b1 , b2 , b3 )) .

Thus, we have proved the equivalence (m | b1 and m | b2 and m | b3 ) ⇐⇒ (m | gcd (b1 , b2 , b3 )).

December 25, 2021


Math 235 notes page 490

Exercise 9.3.5. Let a be an integer, and let n be a positive integer. Let φ (n) be
defined as in Theorem 9.1.13. Prove that an ≡ an−φ(n) mod n.

Note that Exercise 9.3.5 competes with Theorem 9.1.13 over the claim of being
the natural generalization of Fermat’s Little Theorem: Indeed, Exercise 9.3.5 gener-
alizes Theorem 9.1.10 (b) just like Theorem 9.1.13 generalizes Theorem 9.1.10 (a).
Solution to Exercise 9.3.5 (sketched). We shall only give the main steps; see [19s, Ex-
ercise 2.16.3] for a similar solution written out in full detail.
First, let us show that an−φ(n) is an integer (in order to be sure that the congruence
an ≡ an−φ(n) mod n makes sense in the first place!). Indeed, in Theorem 9.1.13, we
have defined φ (n) to be the # of all i ∈ {1, 2, . . . , n} that satisfy i ⊥ n. Hence,

φ (n) = (# of all i ∈ {1, 2, . . . , n} that satisfy i ⊥ n) (424)


≤ (# of all i ∈ {1, 2, . . . , n}) = |{1, 2, . . . , n}| = n.

Thus, n − φ (n) ∈ N. This shows that an−φ(n) is an integer.


We must prove the congruence an ≡ an−φ(n) mod n. According to Corollary
9.3.21 (applied to an and an−φ(n) instead of a and b), it suffices therefor to show that
an ≡ an−φ(n) mod pv p (n) for every prime p.
So let us fix a prime p. Our goal is thus to show that

an ≡ an−φ(n) mod pv p (n) . (425)

Proposition 9.1.6 yields that we have either p | a or p ⊥ a. Hence, we are in one


of the following two cases:
Case 1: We have p | a.
Case 2: We have p ⊥ a.
Let us first consider Case 1. In this case, we have p | a. Our goal, as we remember,
is to prove (425). We shall achieve this by showing that both an and an−φ(n) are
congruent to 0 modulo pv p (n) .
Indeed, the difference rule (Theorem 7.1.8) yields

(# of all i ∈ {1, 2, . . . , n} that don’t satisfy i ⊥ n)


= (# of all i ∈ {1, 2, . . . , n}) − (# of all i ∈ {1, 2, . . . , n} that satisfy i ⊥ n)
| {z } | {z }
=|{1,2,...,n}|=n =φ(n)
(by (424))
= n − φ (n) . (426)

However, let us set j = v p (n). Then, v p (n) ≥ j, so that p j | n (by Lemma 9.3.3,
applied to i = j). Hence, Proposition 3.1.3 (b) readily yields p j ≤ |n|. In other
words, p j ≤ n (since p j and n are positive). Thus,

1 ≤ p1 ≤ p2 ≤ · · · ≤ p j ≤ n.

December 25, 2021


Math 235 notes page 491

This shows that the j numbers p1 , p2 , . . . , p j all belong to the set {1, 2, . . . , n}. More-
over, none of these j numbers is coprime to n (since they are all divisible by p, and
thus have the divisor p in common with n, which shows that their gcd with n is
≥ p). Hence, these j numbers p1 , p2 , . . . , p j all belong to the set of all i ∈ {1, 2, . . . , n}
that don’t satisfy i ⊥ n. Hence, this set has at least j many elements (because the j
numbers p1 , p2 , . . . , p j are distinct). In other words,

(# of all i ∈ {1, 2, . . . , n} that don’t satisfy i ⊥ n) ≥ j.

In view of (426), this rewrites as n − φ (n) ≥ j.


Now, p1 = p | a, so that v p ( a) ≥ 1 (by Lemma 9.3.3, applied to 1 and a instead
of i and n). Corollary 9.3.9 (applied to k = n − φ (n)) yields
 
v p an−φ(n) = (n − φ (n)) v p ( a) ≥ n − φ (n) ≥ j.
| {z }
≥1

In view of Lemma 9.3.3 (applied to j and an−φ(n) instead of i and n), this entails
that p j | an−φ(n) . In other words, an−φ(n) ≡ 0 mod p j . Hence,

an = |an−{zφ(n}) · aφ(n) ≡ 0 · aφ(n) = 0 ≡ an−φ(n) mod p j .


≡0 mod p j

In other words, an ≡ an−φ(n) mod pv p (n) (since j = v p (n)). Thus, (425) is proved in
Case 1.
Let us now consider Case 2. In this case, we have p ⊥ a. In other words, a ⊥ p.
We shall now show that aφ(n) ≡ 1 mod pv p (n) . Once this is proved, the claim (425)
will quickly follow.
It is tempting to obtain aφ(n) ≡ 1 mod pv p (n) by applying Theorem 9.1.13. How-
ever, this is not so easy, since we don’t know whether a ⊥ n; we only know that the
weaker statement a ⊥ p is true. We need to work around this.
Fortunately, Exercise 9.3.4 is here to help. We set i = v p (n). Then, v p (n) ≥ i,
so that pi | n (by Lemma 9.3.3). Furthermore, Exercise 3.5.5 yields a1 ⊥ pi (since
a ⊥ p). In other words, a ⊥ pi . Hence, it is easy to see that gcd a, pi , n = 1 293 .
Thus, Exercise 9.3.4 (applied to b = pi and c = n) yields that there is a positive
integer x such that a + pi x ⊥ n. Consider this x. Set b = a + pi x. Thus, b − a = pi x
293 Proof.Let m = gcd a, pi , n . Then, m is a common divisor of a, pi and n (by the definition of a


gcd). Hence, m | a and m | pi and m | n. However, Theorem 3.4.7 (applied to b = pi ) yields that
we have the following logical equivalence:
    
m | a and m | pi ⇐⇒ m | gcd a, pi .

Thus, m | gcd a, pi (since m | a and m | pi ). Thus, we have m | gcd a, pi = 1 (since a ⊥ pi ).


 

Since m is nonnegative (because we defined m as a gcd), this entails m = 1. Thus, gcd a, pi , n =




m = 1.

December 25, 2021


Math 235 notes page 492

is divisible by pi ; in other words, b ≡ a mod pi . Hence, bφ(n) ≡ aφ(n) mod pi , so that


aφ(n) ≡ bφ(n) mod pi .
Now, b = a + pi x ⊥ n; hence, Theorem 9.1.13 (applied to b instead of a) yields
bφ(n) ≡ 1 mod n. This entails bφ(n) ≡ 1 mod pi (by Proposition 3.2.6 (e), since pi | n).
However, aφ(n) ≡ bφ(n) ≡ 1 mod pi . In other words, aφ(n) ≡ 1 mod pv p (n) (since
i = v p (n)).
Now,
an = an−φ(n) · φ(n)
|a {z } ≡ an−φ(n) · 1 = an−φ(n) mod pv p (n) .
≡1 mod pv p (n)

Thus, (425) is proved in Case 2.


Hence, we have proved (425) in both Cases 1 and 2. This shows that (425) always
holds. As explained above, this completes the solution to Exercise 9.3.5.
The above solution to Exercise 9.3.5 might appear clunky with its two cases, its
rough (analysis-style) estimates of n − φ (n) (in Case 1), and its somewhat unmoti-
vated use of Exercise 9.3.4. However, it illustrates several important techniques.
The first technique is the passage from proving a congruence modulo n to prov-
ing a congruence modulo pv p (n) (via Corollary 9.3.21). This is called working locally
(where “locally” means “focusing on a single prime”), and has the advantage that
pv p (n) behaves “nicer” than the (a priori) arbitrary positive integer n. In our specific
case, we profited from this passage by being able to apply Proposition 9.1.6 and use
p-valuations (whereas there is no analogue of Proposition 9.1.6 for n instead of p).
There are many other ways in which working locally can be useful; for example,
if we want to show that some two integers are coprime, then (by Lemma 9.3.23) it
suffices to show that every prime fails to divide at least one of them. Other appli-
cations of working locally are enabled by the Chinese remainder theorem, which we
shall discuss further below.
The second technique is the trick that allowed us to apply Theorem 9.1.13 in Case
2: We could not apply Theorem 9.1.13 directly to a, since a may fail to satisfy a ⊥ n;
thus, we instead applied Theorem 9.1.13 to a new integer b that we constructed
tactically to satisfy b ⊥ n (so that it satisfies the assumption of Theorem 9.1.13)
while being congruent to a modulo pi (so that it could act as a stand-in for a for the
purpose of proving a congruence modulo pi ). Thus, so to speak, we have “snuck”
a into Theorem 9.1.13 under the “disguise” of b. The “moral” of the story is that
all is not lost when a theorem does not immediately apply; often it is possible to
tweak the objects until it does apply to them. (Of course, we were lucky to have
Exercise 9.3.4 available when it came to tweaking a. It would have been much
harder otherwise...)

9.3.5. Factorials and their p-valuations


Next, we shall study a very special case of p-valuations: those of the factorials. In
other words, we shall compute v p (n!) for any n ∈ N and any prime p:

December 25, 2021


Math 235 notes page 493

Theorem 9.3.25 (de Polignac’s formula). Let p be a prime. Let n ∈ N. Then,


 
n
v p (n!) = ∑ i
.
i ≥1 p
 
n
(The summation sign “ ∑ ” is shorthand for “ ∑ ”. The sum ∑ i
in this
i ≥1 i ∈{1,2,3,...} i ≥1 p
equality is well-defined according to Definition 9.3.14, since it has only finitely
many nonzero addends.)

For example, applied to n = 5 and p = 2, Theorem 9.3.25 predicts that


         
5 5 5 5 5
v2 (5!) = ∑ i = 1 + 2 + 3 + 4 + · · ·
i ≥1 2
2 2 2 2
| {z } | {z } | {z } | {z }
=2 =1 =0 =0
= 2 + 1 + 0| + 0{z+ · ·}· = 2 + 1 = 3.
=0

This is easily confirmed (since 5! = 120 = 23 · 3 · 5).


We shall give only a brief outline of the proof of Theorem 9.3.25, since this proof
can be found in many places. (In particular, Theorem 9.3.25 is [Grinbe16, Theorem
1.3.3]. Moreover, it appears in an equivalent form in [19s, Exercise 2.17.2 (c)]294 .)
The proof of Theorem 9.3.25 hinges on two lemmas:295
jnk n
Lemma 9.3.26. Let n ∈ N. Let k be a positive integer. Then, = ∑ [ k | i ].
k i =1

Proof of Lemma 9.3.26 (sketched). (See [19s, Exercise 2.17.2 (a)] for details296 .) Each
n
addend of the sum ∑ [k | i ] is either 0 or 1. Namely, an addend [k | i ] is 1 if i is a
i =1

 
n
294 Indeed, [19s, Exercise 2.17.2 (c)] says that v p (n!) = ∑ n//pi instead of v p (n!) = ∑ i
.
i ≥1 i ≥1 p
However,
  this is equivalent, since an easy application of Proposition 3.3.5 yields that n//pi =
n
for any i ∈ N.
pi
295 We are using the Iverson bracket notation (Definition 4.3.19) again.

296 but notice that [19s, Exercise 2.17.2 (a)] talks about n//k instead of n (which, however, is the
j k
k jnk
same number, since an easy application of Proposition 3.3.5 shows that n//k = )
k

December 25, 2021


Math 235 notes page 494

multiple of k, and 0 otherwise. Hence,


n
∑ [k | i] = (# of integers i ∈ {1, 2, . . . , n} that are multiples of k ) · 1
i =1
+ (# of integers i ∈ {1, 2, . . . , n} that are not multiples of k) · 0
= (# of integers i ∈ {1, 2, . . . , n} that are multiples of k)
 
since there are precisely n//k many
= n//k
multiples of k among the integers i ∈ {1, 2, . . . , n}
jnk
=
k
(by an easy application of Proposition 3.3.5). This proves Lemma 9.3.26.

Lemma 9.3.27. Let p be a prime. Let n be a nonzero integer. Then, v p (n) =


∑ pi | n .
 
i ≥1

Proof of Lemma 9.3.27 (sketched). (See [19s, Exercise 2.17.2 (b)] for details.) Let k =
v p (n). Then, k is the largest m ∈ N such that pm | n (by the definition of v p (n)).
Hence, pk | n but pk+1 - n. Thus, the k numbers p1 , p2 , . . . , pk divide n, but none
of the numbers pk+1 , pk+2 , pk+3 , . . . does. In other words, the statement pi | n holds
for each i ∈ {1, 2, . . . , k}, but is false for each i ∈ {k + 1, k + 2, k + 3, . . .}. Hence,
the truth value pi | n equals 1 for each i ∈ {1, 2, . . . , k }, but equals 0 for each
i ∈ {k + 1, k + 2, k + 3, . . .}. Therefore, the sum ∑ pi | n has k addends equal to
 
i ≥1
1, while  remaining addends are 0. Therefore, this sum equals k. In other words,
 i all
∑ p | n = k = v p (n). This proves Lemma 9.3.27.
i ≥1

It is now easy to prove Theorem 9.3.25:


Proof of Theorem 9.3.25 (sketched). (See [19s, Exercise 2.17.2 (c)] for details.) From
n! = 1 · 2 · · · · · n, we obtain

v p (n!) = v p (1 · 2 · · · · · n) = v p (1) + v p (2) + · · · + v p (n)


(by Corollary 9.3.7, applied to k = n and ai = i )
n n h i n h i
= ∑ v p (m) = ∑ ∑ pi | m = ∑ ∑ p j | m
m =1 | {z } m =1 i ≥1 m =1 j ≥1
= ∑ [ pi | m ]
i ≥1
(by Lemma 9.3.27)

(here, we have renamed the summation index i as j)


n h i
= ∑ ∑ pj | m . (427)
j ≥1 m =1

December 25, 2021


Math 235 notes page 495

(In the last step of this computation, we have interchanged the two summation
n
signs “ ∑ ” and “ ∑ ”. Make sure you understand why this is legitimate!297 ) But
m =1 j ≥1
each positive integer j satisfies
  n h
n i  
pj
= ∑ p j
| i by Lemma 9.3.26, applied to k = p j
i =1
n h i
= ∑ pj | m (428)
m =1

(here, we have renamed the summation index i as m). Thus, (427) becomes
n h    
i n n
v p (n!) = ∑ ∑ p | m = ∑
j
= ∑
j ≥1 m =1 pj i ≥1 p
i
| ${z % } j≥1
n
=
pj
(by (428))

(here, we have renamed the summation index j as i). This proves Theorem 9.3.25.

Theorem 9.3.25 tends to be useful whenever it comes to proving divisibilities


involving factorials. The following is perhaps the simplest application:

Exercise 9.3.6. Let n, m ∈ N. Prove that n!m! | (n + m)!.

We shall give two solutions to Exercise 9.3.6: one using binomial coefficients,
and one using p-valuations. The first solution is shorter and neater, but the second
illustrates a generalizable method.
First solution to Exercise 9.3.6. We have m ≤ n + m (since (n + m) − m = n ≥ 0).
Hence, Theorem 4.3.8 (applied to n + m and m instead of n and k) yields
 
n+m (n + m)! (n + m)!
= = (since (n + m) − m = n) .
m m! · ((n + m) − m)! m! · n!

However,
  Theorem 4.3.15 (applied  to n + m and m instead of n and k) yields
n+m n+m (n + m)! (n + m)!
∈ Z. In view of = , this rewrites as ∈ Z. In
m m m! · n! m! · n!
other words, m! · n! | (n + m)!. In other words, n!m! | (n + m)! (since m! · n! = n!m!).
This solves Exercise 9.3.6.

297 It is not always legitimate to interchange two infinite sums, even if both are well-defined. Fortu-
n
nately, one of our two summation signs – viz., “ ∑ ” – is a finite sum.
m =1

December 25, 2021


Math 235 notes page 496

Second solution to Exercise 9.3.6 (sketched). Proposition 9.3.18 (applied to n!m! and
(n + m)! instead of n and m) shows that we have n!m! | (n + m)! if and only if
each prime p satisfies v p (n!m!) ≤ v p ((n + m)!). Thus, it suffices to show that each
prime p satisfies v p (n!m!) ≤ v p ((n + m)!).
Let us show this. Let p be a prime. We must prove that v p (n!m!) ≤ v p ((n + m)!).
Theorem 9.3.25 (applied to n + m instead of n) yields
 
n+m
v p ((n + m)!) = ∑ . (429)
i ≥1 pi

Also, Theorem 9.3.6 (a) (applied to a = n! and b = m!) yields


v p (n!m!) = v p (n!) + v p (m!)
| {z } | {z }
n m
$ % $ %
=∑ =∑
i ≥1 p i i ≥1 p i
(by Theorem 9.3.25) (by Theorem 9.3.25)
   
n m
= ∑ pi
+∑ i . (430)
i ≥1 i ≥1 p

Recall that our goal is to prove that v p (n!m!) ≤ v p ((n + m)!). In view of (429)
and (430), this is equivalent to proving that
     
n m n+m
∑ i + ∑ pi ≤ ∑ pi .
i ≥1 p i ≥1 i ≥1

This would be easy if we knew that we have


     
n m n+m
+ i ≤ for each i ∈ N.
pi p pi
Fortunately, this is indeed the case: We can show that buc + bvc ≤ bu + vc for
n m
any two reals u and v 298 . Applying this to u = i and v = i , we obtain the
p p
inequality
         
n m n m n+m n m n+m
+ i ≤ + i = since i + i =
pi p pi p pi p p pi
for each i ∈ N. Summing these inequalities over all i ∈ {1, 2, 3, . . .}, we obtain
     
n m n+m
∑ pi + pi ≤ ∑ pi .
i ≥1 i ≥1
298 Proof.(See [Grinbe16, Proposition 1.1.13] for a detailed proof.) Let u and v be two reals. We
have buc ≤ u (by the definition of buc) and bvc ≤ v. Adding these two inequalities together,
we obtain buc + bvc ≤ u + v. Hence, buc + bvc is an integer that is ≤ u + v (since buc + bvc
is clearly an integer). But bu + vc is the largest such integer (by the definition of bu + vc).
Therefore, buc + bvc ≤ bu + vc, qed.

December 25, 2021


Math 235 notes page 497

In view of
       
n m n m
∑ p i
+ i
p
= ∑ i + ∑ i = v p (n!m!) (by (430))
i ≥1 i ≥1 p i ≥1 p

and  
n+m
∑ pi
= v p ((n + m)!) (by (429)) ,
i ≥1

this rewrites as v p (n!m!) ≤ v p ((n + m)!). But this is precisely what we wanted to
show. Hence, Exercise 9.3.6 is solved again.
Let us prove something less straightforward using de Polignac’s formula. For
example, let us prove the following ([Grinbe15, Exercise 3.25]):

(2a)! (2b)!
Exercise 9.3.7. Let a, b ∈ N. Prove that ∈ Z.
a!b! ( a + b)!

Better yet, let us prove a more general result:

Exercise 9.3.8. Let n ∈ N. Let q1 , q2 , . . . , qn be n positive integers such that


1 1 1
+ +···+ ≤ 1. Let a1 , a2 , . . . , an be n nonnegative integers. Prove that
q1 q2 qn

( q1 a1 ) ! · ( q2 a2 ) ! · · · · · ( q n a n ) !
q1 −1
∈ Z.
( a1 ! ) · ( a 2 ! ) q2 −1 · · · · · ( a n ! ) q n −1 · ( a 1 + a 2 + · · · + a n ) !

Note that Exercise 9.3.7 is a particular case of Exercise 9.3.8 (namely, the case for
n = 2 and q1 = 2 and q2 = 2 and a1 = a and a2 = b). Thus, solving Exercise 9.3.8
will automatically solve Exercise 9.3.7.
Before we solve Exercise 9.3.8, we pave our way with a lemma about floors (which
will play a similar role to the inequality buc + bvc ≤ bu + vc in our above second
solution to Exercise 9.3.6):

Lemma 9.3.28. Let n ∈ N. Let q1 , q2 , . . . , qn be n positive integers such that


1 1 1
+ +···+ ≤ 1. Let u1 , u2 , . . . , un be n reals. Then,
q1 q2 qn
n n
∑ b qi ui c ≥ ∑ ( q i − 1) b u i c + b u1 + u2 + · · · + u n c .
i =1 i =1

There are various ways to prove this lemma. A particularly easy one proceeds
by WLOG assuming that each of u1 , u2 , . . . , un belongs to the half-open interval
[0, 1) (because subtracting an integer from any single ui changes both sides of the

December 25, 2021


Math 235 notes page 498

inequality in question by the same amount299 ). In this case, Lemma 9.3.28 quickly
boils down to the following:

Lemma 9.3.29. Let n ∈ N. Let q1 , q2 , . . . , qn be n positive integers such that


1 1 1
+ +···+ ≤ 1. Let u1 , u2 , . . . , un be n nonnegative reals. Then,
q1 q2 qn
n
∑ b q i u i c ≥ b u1 + u2 + · · · + u n c .
i =1

Proof of Lemma 9.3.29. It is easy to see that Lemma 9.3.29 holds for n = 0 300 .

Hence, for the rest of this proof, we WLOG assume that we don’t have n = 0.
Hence, n > 0 (since n ∈ N).
Let k = bu1 + u2 + · · · + un c. Thus, k is an integer (since the floor of any real
is an integer). Furthermore, the sum u1 + u2 + · · · + un is nonnegative (since its
addends u1 , u2 , . . . , un are nonnegative). In other words, u1 + u2 + · · · + un ≥ 0.
From this, we easily see that k ≥ 0 301 .
k
Now, I claim that at least one j ∈ {1, 2, . . . , n} satisfies u j ≥ .
qj
k
[Proof: Assume the contrary. Hence, no j ∈ {1, 2, . . . , n} satisfies u j ≥ . In other
qj
k k
words, each j ∈ {1, 2, . . . , n} satisfies u j < . Adding these n inequalities u j <
qj qj

299 This technique is rather similar to the periodicity argument we used in our second solution to
Exercise 1.1.3 above (in Subsection 4.7.2).
300 Proof. Assume that n = 0. Then, u + u + · · · + u = u + u + · · · + u = (empty sum) = 0, so
1 2 n 1 2 0
that bu1 + u2 + · · · + un c = b0c = 0. Also, from n = 0, we obtain
n 0
∑ bqi ui c = ∑ bqi ui c = (empty sum) = 0 ≥ 0 = bu1 + u2 + · · · + un c
i =1 i =1

(since bu1 + u2 + · · · + un c = 0). Thus, we have proved Lemma 9.3.29 under the assumption
that n = 0. Qed.
301 Proof. We have 0 ≤ u + u + · · · + u (since u + u + · · · + u ≥ 0). Thus, 0 is an integer that is
1 2 n 1 2 n
≤ u1 + u2 + · · · + u n .
Recall that bu1 + u2 + · · · + un c was defined as the largest integer that is ≤ u1 + u2 + · · · + un .
Hence, if m is an integer that is ≤ u1 + u2 + · · · + un , then bu1 + u2 + · · · + un c ≥ m. Applying
this to m = 0, we obtain bu1 + u2 + · · · + un c ≥ 0 (since 0 is an integer that is ≤ u1 + u2 + · · · +
un ). Hence, k = bu1 + u2 + · · · + un c ≥ 0.

December 25, 2021


Math 235 notes page 499

(for j ∈ {1, 2, . . . , n}) together, we obtain


n n
k
∑ uj < ∑ qj (since n > 0)
j =1 j =1
 
k k k 1 1 1
= + +···+ = k· + +···+
q1 q2 qn q1 q2 qn
| {z }
≤1
≤ k·1 (since k ≥ 0)
= k.
$ % $ %
n n n n
However, (1) (applied to x = ∑ u j ) yields ∑ uj ≤ ∑ uj < ∑ u j + 1.
j =1 j =1 j =1 j =1
$ %
n n n
Hence, ∑ uj ≤ ∑ u j < k. In view of ∑ u j = u1 + u2 + · · · + un , this rewrites
j =1 j =1 j =1
as bu1 + u2 + · · · + un c < k. But this contradicts bu1 + u2 + · · · + un c = k. This
contradiction shows that our assumption was false. Hence, we have proved that at
k
least one j ∈ {1, 2, . . . , n} satisfies u j ≥ .]
qj
k
Thus, we know that at least one j ∈ {1, 2, . . . , n} satisfies u j ≥ . Consider this
qj
k
j. Multiplying both sides of the inequality u j ≥ by q j , we obtain q j u j ≥ k (since
qj
q j is positive). That is, k ≤ q j u j . Hence, k is an integer that is ≤ q j u j (since k is an
integer). Hence, it easily follows that q j u j ≥ k 302 .
 

Furthermore, recall again that u1 , u2 , . . . , un are nonnegative. Hence, it is easy to


see that
b qi ui c ≥ 0 for each i ∈ {1, 2, . . . , n} (431)

302 Proof.
 
Recall that q j u j was defined as the largest integer that is ≤ q j u j . Hence, if m is an integer
   
that is ≤ q j u j , then q j u j ≥ m. Applying this to m = k, we obtain q j u j ≥ k (since k is an
integer that is ≤ q j u j ).

December 25, 2021


Math 235 notes page 500

n
303 . From this, it easily follows that ∑ bqi ui c ≥ q j u j 304 .
 
Hence,
i =1

n
∑ b qi ui c ≥
 
q j u j ≥ k = b u1 + u2 + · · · + u n c .
i =1

This proves Lemma 9.3.29.


Let us now derive Lemma 9.3.28 from Lemma 9.3.29:
Proof of Lemma 9.3.28. For each i ∈ {1, 2, . . . , n}, we set vi = bui c and wi = ui −
bui c. Thus, v1 , v2 , . . . , vn are n integers305 . Furthermore, the reals w1 , w2 , . . . , wn are
nonnegative306 . Hence, Lemma 9.3.29 (applied to wi instead of ui ) yields
n
∑ b q i w i c ≥ b w1 + w2 + · · · + w n c . (432)
i =1

However, it is easy to see that each i ∈ {1, 2, . . . , n} satisfies the equality

b q i u i c = b q i wi c + q i v i (433)

303 Proof of (431): Let i ∈ {1, 2, . . . , n}. Then, ui is nonnegative (since u1 , u2 , . . . , un are nonnegative).
Hence, qi ui is nonnegative (since qi is positive (because q1 , q2 , . . . , qn are n positive integers)). In
other words, qi ui ≥ 0. That is, 0 ≤ qi ui . Thus, 0 is an integer that is ≤ qi ui .
Recall that bqi ui c was defined as the largest integer that is ≤ qi ui . Hence, if m is an integer
that is ≤ qi ui , then bqi ui c ≥ m. Applying this to m = 0, we obtain bqi ui c ≥ 0 (since 0 is an
integer that is ≤ qi ui ). This proves (431).
304 Proof. We have

n
∑ ∑ ∑
 
b qi ui c = b qi ui c = q j u j + b qi ui c
i =1 i ∈{1,2,...,n} i ∈{1,2,...,n};
| {z }
|{z} i6= j ≥0
= ∑ (by (431))
i ∈{1,2,...,n}

(here, we have split off the addend for i = j from the sum)
∑ 0 = qj uj .
   
≥ qj uj +
i ∈{1,2,...,n};
i6= j
| {z }
=0

305 Proof. Let i ∈ {1, 2, . . . , n}. It is clear that b x c is an integer for each x ∈ R. Applying this to x = ui ,
we conclude that bui c is an integer. In other words, vi is an integer (since vi = bui c).
Forget that we fixed i. We thus have shown that vi is an integer for each i ∈ {1, 2, . . . , n}. In
other words, v1 , v2 , . . . , vn are n integers.
306 Proof. Let i ∈ {1, 2, . . . , n }. Applying (1) to x = u , we obtain b u c ≤ u < b u c + 1. Hence,
i i i i
bui c ≤ ui , so that ui − bui c ≥ 0. Now, wi = ui − bui c ≥ 0. In other words, wi is nonnegative.
Forget that we fixed i. We thus have shown that wi is nonnegative for each i ∈ {1, 2, . . . , n}.
In other words, w1 , w2 , . . . , wn are nonnegative.

December 25, 2021


Math 235 notes page 501

307 . Hence,
n n n n
∑ b qi ui c = ∑ (bqi wi c + qi vi ) = ∑ b q i wi c + ∑ qi vi
i =1 i =1 i =1 i =1
| {z }
=bqi wi c+qi vi | {z }
(by (433)) ≥bw1 +w2 +···+wn c
(by (432))
n
≥ b w1 + w2 + · · · + w n c + ∑ q i v i . (434)
i =1

On the other hand, it is easy to see that


n
b u 1 + u 2 + · · · + u n c = b w1 + w2 + · · · + w n c + ∑ v i (435)
i =1

307 Proof of (433): Let i ∈ {1, 2, . . . , n}. Adding the two equalities wi = ui − bui c and vi = bui c
together, we obtain wi + vi = (ui − bui c) + bui c = ui .
However, qi is an integer (since q1 , q2 , . . . , qn are n integers), and vi is an integer (since
v1 , v2 , . . . , vn are n integers). Thus, the product qi vi of these two integers must also be an in-
teger. In other words, qi vi ∈ Z. Therefore, (163) (applied to y = qi wi and k = qi vi ) yields
bqi wi + qi vi c = bqi wi c + qi vi . In view of qi wi + qi vi = qi (wi + vi ) = qi ui , this rewrites as
| {z }
= ui
bqi ui c = bqi wi c + qi vi . Qed.

December 25, 2021


Math 235 notes page 502

308 . On the other hand,


n n
∑ ( q i − 1) b ui c = ∑ ( q i − 1) v i .
i =1 i =1
|{z}
= vi
(since vi =bui c
(by the definition of vi ))

n
308 Proof of (435): The sum ∑ vi is an integer (since its addends v1 , v2 , . . . , vn are n integers). In other
i =1
n n n
words, ∑ vi ∈ Z. Therefore, (163) (applied to y = ∑ wi and k = ∑ vi ) yields
i =1 i =1 i =1
$ % $ %
n n n n
∑ wi + ∑ v i = ∑ wi + ∑ vi .
i =1 i =1 i =1 i =1

In view of
n n n n
∑ wi +∑ vi = ∑ (ui − bui c) + ∑ bui c
i =1 i =1 i =1 i =1
|{z} |{z}
=ui −bui c =bui c
(by the definition of wi ) (by the definition of vi )
n n
= ∑ |(ui − bu{z
i c + b ui c) = ∑ ui
i =1 i =1
}
= ui
= u1 + u2 + · · · + u n ,

this rewrites as $ %
n n
b u1 + u2 + · · · + u n c = ∑ wi + ∑ vi .
i =1 i =1
n
In view of ∑ wi = w1 + w2 + · · · + wn , this rewrites as
i =1

n
b u 1 + u 2 + · · · + u n c = b w1 + w2 + · · · + w n c + ∑ v i .
i =1

Qed.

December 25, 2021


Math 235 notes page 503

Adding (435) to this equality, we obtain


n
∑ ( q i − 1) b u i c + b u1 + u2 + · · · + u n c
i =1
n n
= ∑ ( q i − 1 ) v i + b w1 + w2 + · · · + w n c + ∑ v i
i =1 i =1
n n
= b w1 + w2 + · · · + w n c + ∑ v i + ∑ ( q i − 1 ) v i
i =1 i =1
| {z }
n
= ∑ (vi +(qi −1)vi )
i =1
n
= b w1 + w2 + · · · + w n c + ∑ ( v i + ( q i − 1 ) v i )
i =1
| {z }
= qi vi
n
= b w1 + w2 + · · · + w n c + ∑ q i v i .
i =1

In light of this equality, we can rewrite (434) as


n n
∑ b q i u i c ≥ ∑ ( q i − 1) b u i c + b u1 + u2 + · · · + u n c .
i =1 i =1

This proves Lemma 9.3.28.


At last, we can solve Exercise 9.3.8:
Solution to Exercise 9.3.8. Let p be a prime. We shall prove that
 
v p ( a 1 ! ) q1 −1 · ( a 2 ! ) q2 −1 · · · · · ( a n ! ) q n −1 · ( a 1 + a 2 + · · · + a n ) !
≤ v p ((q1 a1 )! · (q2 a2 )! · · · · · (qn an )!) .

Indeed, the n numbers q1 − 1, q2 − 1, . . . , qn − 1 are nonnegative integers (since


q1 , q2 , . . . , qn are n positive integers). Hence, ( a1 !)q1 −1 , ( a2 !)q2 −1 , . . . , ( an !)qn −1 are n
 q −1
integers. Thus, Corollary 9.3.7 (applied to n and a j ! j instead of k and a j ) yields
 
v p ( a 1 ! ) q1 −1 · ( a 2 ! ) q2 −1 · · · · · ( a n ! ) q n −1
     
q1 −1 q2 −1 q n −1
= v p ( a1 ! ) + v p ( a2 ! ) + · · · + v p ( an !)
n   q −1 
= ∑ v p aj ! j . (436)
j =1

Now, let j ∈ {1, 2, . . . , n}. Then, q j is a positive integer (since q1 , q2 , . . . , qn are


n positive integers). Hence, q j − 1 ∈ N. Thus, Corollary 9.3.9 (applied to a j ! and

December 25, 2021


Math 235 notes page 504

q j − 1 instead of a and k) yields


  q −1   
v p aj ! j = qj − 1 v p aj !
| {z }
aj
$ %
=∑
i ≥1 p i
(by Theorem 9.3.25,
applied to a j instead of n)
aj  aj
   
∑ ∑

= qj − 1 = qj − 1 . (437)
i ≥1 pi i ≥1 pi

Forget that we fixed j. We thus have proved (437) for each j ∈ {1, 2, . . . , n}. Thus,
(436) becomes
 
v p ( a 1 ! ) q1 −1 · ( a 2 ! ) q2 −1 · · · · · ( a n ! ) q n −1
n   q j −1  n  aj
 
= ∑ v p aj ! = ∑ ∑ qj − 1
j =1 | {z $ %} j=1 i≥1 pi
aj | {z }
= ∑ ( q j −1 ) n
i ≥1 pi =∑ ∑
i ≥1 j =1
(by (437))
n  aj
 
= ∑ ∑ qj − 1
pi
. (438)
i ≥1 j =1

Theorem 9.3.6 (a) (applied to a = ( a1 !)q1 −1 · ( a2 !)q2 −1 · · · · · ( an !)qn −1 and b =


( a1 + a2 + · · · + an )!) yields
 
q1 −1 q2 −1 q n −1
v p ( a1 ! ) · ( a2 ! ) · · · · · ( an !) · ( a1 + a2 + · · · + a n ) !
 
= v p ( a1 !)q1 −1 · ( a2 !)q2 −1 · · · · · ( an !)qn −1 + v p (( a1 + a2 + · · · + an )!)
| {z $ % } | $ {z }
a + a + · · · + a
%
n aj =∑
1 2 n
= ∑ ∑ ( q j −1 ) i
i ≥1 j =1 pi i ≥1 p
(by (438)) (by Theorem 9.3.25,
applied to a1 + a2 +···+ an instead of n)
n  aj a1 + a2 + · · · + a n
   
= ∑ ∑ q j − 1 pi + ∑ pi
i ≥1 j =1 i ≥1
n !
 aj a1 + a2 + · · · + a n
  
= ∑ ∑ q j − 1 pi + pi
i ≥1 j =1
n !
a1 + a2 + · · · + a n
  
ai
= ∑ ∑ ( q i − 1) p s + ps
(439)
s ≥1 i =1

(here, we have renamed the summation indices i and j of the two sums as s and i,
respectively).

December 25, 2021


Math 235 notes page 505

On the other hand, (q1 a1)!, (q2 a2 )!, . . . , (qn an )! are n integers. Thus, Corollary
9.3.7 (applied to n and q j a j ! instead of k and a j ) yields

v p ((q1 a1 )! · (q2 a2 )! · · · · · (qn an )!)


= v p ((q1 a1 )!) + v p ((q2 a2 )!) + · · · + v p ((qn an )!)
n n 
qj aj

=∑ =∑ ∑

v p qj aj !
j =1 | ${z %} j =1 i ≥1 pi
qj aj | {z }
aj %
| {z } $
=∑ n
i ≥1 pi =∑ ∑ = qj ·
(by Theorem 9.3.25, i ≥1 j =1 pi
applied to q j a j instead of n) qj aj aj
(since =q j · )
p i pi
n  aj
 n  
ai
= ∑ ∑ qj · i = ∑ ∑ qi · p s
i ≥1 j =1 p s ≥1 i =1
| % {z }
ai a1 a2 an
$ $ %
n
≥ ∑ ( q i −1) + + +···+
i =1 ps ps ps ps
ai
(by Lemma 9.3.28, applied to ui = )
ps
 
here, we have renamed the summation indices i and j
of the two sums as s and i, respectively
n    !
ai a1 a2 an
≥ ∑ ∑ ( q i − 1) s + s + s + · · · + s
s ≥1 i =1
p p p p
n !
a1 + a2 + · · · + a n
  
ai
= ∑ ∑ ( q i − 1) s +
s ≥1 i =1
p ps
a1 + a2 + · · · + a n
 
a1 a2 an
since s + s + · · · + s = for any s ≥ 1
p p p ps
 
q1 −1 q2 −1 q n −1
= v p ( a1 ! ) · ( a2 ! ) · · · · · ( an !) · ( a1 + a2 + · · · + a n ) !

(by (439)).
Forget that we fixed p. We thus have shown that each prime p satisfies
 
v p ( a 1 ! ) q1 −1 · ( a 2 ! ) q2 −1 · · · · · ( a n ! ) q n −1 · ( a 1 + a 2 + · · · + a n ) !
≤ v p ((q1 a1 )! · (q2 a2 )! · · · · · (qn an )!) .

Thus, Proposition 9.3.18 (applied to ( a1 !)q1 −1 · ( a2 !)q2 −1 · · · · · ( an !)qn −1 · ( a1 + a2 + · · · + an )!


and (q1 a1 )! · (q2 a2 )! · · · · · (qn an )! instead of n and m) entails that

( a 1 ! ) q1 −1 · ( a 2 ! ) q2 −1 · · · · · ( a n ! ) q n −1 · ( a 1 + a 2 + · · · + a n ) !
| (q1 a1 )! · (q2 a2 )! · · · · · (qn an )!.

December 25, 2021


Math 235 notes page 506

In other words,

( q1 a1 ) ! · ( q2 a2 ) ! · · · · · ( q n a n ) !
q1 −1
∈Z
( a1 ! ) · ( a 2 ! ) q2 −1 · · · · · ( a n ! ) q n −1 · ( a 1 + a 2 + · · · + a n ) !

(since ( a1 !)q1 −1 · ( a2 !)q2 −1 · · · · · ( an !)qn −1 · ( a1 + a2 + · · · + an )! is positive and thus


nonzero). This solves Exercise 9.3.8.
As we already mentioned, Exercise 9.3.7 is a particular case of Exercise 9.3.8.
However, Exercise 9.3.7 can also be proved algebraically, via binomial identities.
(See [Grinbe15, Exercise 3.25 (b)] for such a proof309 , and [Grinbe15, Exercise 3.25]
(2a)! (2b)!
for further properties of .) I am not aware of a similar solution to
a!b! ( a + b)!
Exercise 9.3.8.

9.3.6. Homework set #10B: More about primes and numbers


Again, this homework set is optional.

Exercise 9.3.9. Let n ∈ Z be nonzero. Prove the following:


(a) The product ∏ v p (n) + 1 is well-defined, since only finitely many of
p prime
its factors are different from 1.
(b) We have



(the number of positive divisors of n) = v p (n) + 1
p prime

and


(the number of divisors of n) = 2 v p (n) + 1 .
p prime

The next exercise extends the notion of the p-adic valuation of an integer to a
rational number:

Exercise 9.3.10. Fix a prime p. For each nonzero rational number r, define an
integer w p (r ) (called the extended p-adic valuation of r) as follows: We write r
in the form r = a/b for two nonzero integers a and b, and we set w p (r ) =
v p ( a) − v p (b). (It also makes sense to set w p (0) = ∞, but we shall not concern
ourselves with this border case in this exercise.)

309 In (2a)! (2b)!


more detail: The number is what is called T ( a, b) in [Grinbe15, Exercise 3.25].
a!b! ( a + b)!
(2a)! (2b)!
Thus, [Grinbe15, Exercise 3.25 (b)] (applied to m = a and n = b) shows that ∈N⊆
a!b! ( a + b)!
Z.

December 25, 2021


Math 235 notes page 507

(a) Prove that this is well-defined – i.e., that w p (r ) does not depend on the
precise choice of a and b satisfying r = a/b.
(b) Prove that w p (n) = v p (n) for each nonzero integer n.
(c) Prove that w p ( ab) = w p ( a) + w p (b) for any two nonzero rational numbers
a and b. 
(d) Prove that w p ( a + b) ≥ min w p ( a) , w p (b) for any two nonzero rational
numbers a and b if a + b 6= 0.
(e) Prove that r = ∏ pw p (r) for any positive rational number r. (This is a
p prime
generalization of the canonical factorization to rational numbers.)

The following exercise is a generalization of Exercise 1.1.4:

Exercise 9.3.11. Let n and u be positive integers. Let a1 , a2 , . . . , au be any integers.


Set au+1 = a1 . Assume that

ai | ain+1 for each i ∈ [u] .

Set m = nu−1 + nu−2 + · · · + n0 . Prove that

a1 a2 · · · a u | ( a1 + a2 + · · · + a u ) m .

The next two exercises are parts of what is known as the lifting-the-exponent
lemma:

Exercise 9.3.12. Let p be a nonnegative integer (not necessarily prime). Let a and
b be two integers such that a ≡ b mod p.
(a) Prove that a p ≡ b p mod p2 .
i i i
(b) Prove that a p ≡ b p mod pi+1 for each i ∈ N. (Keep in mind that a p means
i
a( p ) .)

Exercise 9.3.13. Let p be a prime. Let a and b be two integers such that a ≡ b 6≡
0 mod p. Let n be a positive integer.
(a) Prove that v p ( an − bn ) ≥ v p ( a − b) + v p (n).
(b) Prove that v p ( an − bn ) = v p ( a − b) + v p (n) if p 6= 2.
(c) Prove that v p ( an − bn ) = v p ( a − b) + v p (n) if p = 2 and a ≡ b mod 4.
(d) Find an example where p = 2 and a ≡ b mod 2 and v p ( an − bn ) >
v p ( a − b ) + v p ( n ).

See https://brilliant.org/wiki/lifting-the-exponent or [AndDos12, §3.5]


or [Chen20, OTIS Excerpts, Chapter 13] or [Parvar11] for applications of Exercise
9.3.13.
The next two exercises are connected to p-valuations of factorials:

December 25, 2021


Math 235 notes page 508

Exercise 9.3.14. Let p be a prime. Let k ∈ N. Let N = pk − 1. Let


c ∈ 1, 2, . . . , pk . Prove that


 
0 1 k −1
v p (( Nc)!) = c p + p + · · · + p − k.

Exercise 9.3.15. Let n ∈ N be odd. Let m = (n − 1) /2. Let k ∈ N. Let


a1 , a2 , . . . , ak be nonnegative integers.
(a) Prove that the number
(na1 )! (na2 )! · · · (nak )!
a1 !a2 ! · · · ak ! · (( a1 + a2 )!)m (( a2 + a3 )!)m · · · (( ak−1 + ak )!)m (( ak + a1 )!)m

is an integer.
(b) Show that this integer furthermore is divisible by nk−bk/2c when n is prime
and a1 , a2 , . . . , ak are positive.

The next exercise gives yet another variation on Fermat’s Little Theorem:

Exercise 9.3.16. Let a ∈ Z and n ∈ N. Prove that


n −1  
n! | ∏ an − ak .
k =0

n −1
This might sound familiar to algebraists: Indeed, if a is prime, then ∏ an − ak is the

k =0
order of the general linear group GLn (Fa ) over the finite field Fa , whereas n! is the order of
the symmetric group Sn . Thus, if a is prime, then Exercise 9.3.16 follows from Lagrange’s
theorem, as the symmetric group Sn embeds as a subgroup into GLn (Fa ) (via the embed-
ding that identifies each permutation with its permutation matrix). More generally, this
argument can be made when a is a power of a prime (not necessarily a prime itself), since
there is a finite field of size a in this case. However, this slick argument does not work when
a is not a power of a prime. I am not aware of any way how to generalize it to arbitrary a;
it appears to be a dead end, at least if solving Exercise 9.3.16 for general a is the goal.
The following exercise is an analogue of Proposition 9.3.11 for lowest common
multiples310 :

Exercise 9.3.17. Let p be a prime. Let k be a positive integer. Let n1 , n2 , . . . , nk be


k integers. Then,

v p (lcm (n1 , n2 , . . . , nk )) = max v p (n1 ) , v p (n2 ) , . . . , v p (nk ) .

310 See Section 3.6 for the definition of lowest common multiples and their most important properties.

December 25, 2021


Math 235 notes page 509

The following exercise is Problem B3 from the Putnam contest 2003:

Exercise 9.3.18. Let n ∈ N. Prove that


n  j n k
n! = ∏ lcm 1, 2, . . . ,
k
.
k =1

See [Chen20, OTIS Excerpts, Chapter 13] and [AndDos10, Chapter 3] and [AndDos12,
Chapter 3] for more about p-valuations.
The next exercise expands on the idea of Exercise 9.2.1:

Exercise 9.3.19. Prove the following:


(a) There are infinitely many primes p that satisfy p ≡ 3 mod 4.
(b) There are infinitely many primes p that satisfy p ≡ 5 mod 6.

We note that Exercise 9.2.1 and both parts of Exercise 9.3.19 are particular cases
of Dirichlet’s theorem, which says that if a and b > 0 are two coprime integers,
then there are infinitely many primes p that satisfy p ≡ a mod b. This theorem is
deep and difficult (all known proofs use some kind of analysis, often complex); the
three particular cases we just mentioned are among the few cases that have known
simple proofs.
The next exercise generalizes Exercise 9.1.7:

Exercise 9.3.20. Let p be a prime. Let k ∈ N be such that k is not a positive


p −1
multiple of p − 1. Prove that ∑ ik ≡ 0 mod p.
i =0

The next exercise is a fundamental property of the Euler totient function, origi-
nally found by Gauss:

Exercise 9.3.21. For any positive integer n, we let φ (n) denote the number of all
i ∈ {1, 2, . . . , n} satisfying i ⊥ n.
Prove that
∑ φ (d) = n for any positive integer n.
d|n

Here, the summation sign “ ∑ ” means a sum over all positive divisors d of n.
d|n
(For example, ∑ φ (d) = φ (1) + φ (3) + φ (5) + φ (15).)
d|15

The next exercise is somewhat similar to Exercise 9.3.1: It says that any equality
of the form ab = cd, where a, b, c, d are integers, can be “explained” by decomposing
a, b, c, d further into products.

December 25, 2021


Math 235 notes page 510

Exercise 9.3.22. Let a, b, c, d be four integers such that ab = cd. Prove that there
exist four integers x, y, z, w such that

a = xy, b = zw, c = xz, d = yw.

The next exercise is one of the simplest forms of what is known as the Chinese
Remainder Theorem:

Exercise 9.3.23. Let m and n be two positive integers. Prove that the map

{0, 1, . . . , mn − 1} → {0, 1, . . . , m − 1} × {0, 1, . . . , n − 1} ,


i 7→ (i%m, i%n)

is a bijection if and only if m and n are coprime.

The Chinese Remainder Theorem has several more advanced forms, but even
Exercise 9.3.23 has many uses. Here is just one application:

Exercise 9.3.24. For any positive integer n, we let φ (n) denote the number of all
i ∈ {1, 2, . . . , n} satisfying i ⊥ n.
Prove that φ (mn) = φ (m) · φ (n) for any two coprime positive integers m and
n.

Exercise 9.3.24 is known as the multiplicativity of the Euler totient function. One of
its consequences is the following “explicit” formula for φ (n):

Exercise 9.3.25. Let n be a positive integer. Let φ (n) denote the number of all
i ∈ {1, 2, . . . , n} satisfying i ⊥ n. Prove that
 
  1
φ (n) = ∏ ( p − 1) p v p (n)−1
= n· ∏ 1− .
p prime; p prime;
p
p|n p|n

Finally, a complex-looking but not particularly difficult exercise:

Exercise 9.3.26. Assume that p is no longer required to be a prime in Definition


9.3.1, but is merely assumed to be an integer > 1. Which of the above proper-
ties of p-valuations remain true, and which become false? Specifically, analyze
Lemma 9.3.3, Corollary 9.3.4, Lemma 9.3.5, Theorem 9.3.6, Proposition 9.3.11 and
Exercise 9.3.17.

December 25, 2021


Math 235 notes page 511

A. Discussion of homework questions


A.1. Homework set #0 discussion
The following are discussions of the problems on homework set #0 (Section 1.1).
I distinguish “discussion” from “solution” in that a solution is a (usually rather
rigorous) mathematical proof while a “discussion” is an (often informal) piece of
writing that (at least hopefully) explains how a solution can be obtained. Thus, a
discussion can be both less than a solution (as it can omit certain straightforward
arguments that a solution would have to include) and more than a solution (as
it can talk about the motivation behind the solution and about how similar prob-
lems can be solved). I hope my discussions will be more instructive than pure
(unmotivated) solutions would be, while still being sufficiently rigorous that you
won’t have much trouble turning them into full solutions. As always, there is no
guarantee that I will succeed at these goals. Let me know of any unclarities and
errors!

A.1.1. Discussion of Exercise 1.1.1


Discussion of Exercise 1.1.1. The obvious thing to do against such a problem is to
check small values of n and see what the corresponding q’s are. This is somewhat
complicated by the fact that for some n’s, there are several q’s that work. Here is a
table:
n values of q
2 2
4 3, 4
6 6
8 8, 9
10 10
12 12
(You don’t need a computer to create this table; it is easy to do these calculations
by “casting out squares”: Indeed, basic number theory (of which we will probably
see more as this course progresses) says that for any two nonzero integers a and b,
we have the equivalence
 
a2 b is a perfect square ⇐⇒ (b is a perfect square) .

311 Hence, if we have a product of nonzero integers and we want to know whether
this product is a square, we can “cancel” any squares from this product. Thus, for
1! · 2! · · · · · (2 · 2)!
example, we can see that is not a perfect square by observing
3!
311 To wit, the “⇐=” direction of this equivalence is obvious, while the “=⇒” direction is easiest to
prove using the uniqueness of prime decomposition.

December 25, 2021


Math 235 notes page 512

that
1! · 2! · · · · · (2 · 2)! 1! · 2! · 3! · 4!
= 1! · |{z}
= |{z} 2! · |{z}
4! = 1 · 1 · 2 · 1 · 2 · 3 · 4
2! 3!
=1 =1·2 =1·2·3·4
2 2
= 2 · 3 · 4 ∼ 3,

where in the last step we have “cancelled” the perfect squares 22 and 42 . If you
“cancel” strategically, you can do these computations fairly quickly, as any two
successive factorials k! and (k + 1)! mostly “cancel” each other.)
Based on the above table, it appears that q = n always does the job (although
sometimes there is a second value that also does it). So we need to prove that

1! · 2! · · · · · (2n)!
is a perfect square. (440)
n!
To do this, we shall try to combine as many factors as we can into perfect squares
(inspired by our above “cancelling” strategy). To wit, the numerator of our fraction
is

1! · 2! · · · · · (2n)! = (1! · 2!) · (3! · 4!) · · · · · ((2n − 1)! · (2n)!)


   
n n 
= ∏ (2k − 1)! · (2k)!  = ∏ 

( 2k − 1 ) ! · ( 2k − 1 ) ! · 2k
  
| 
k =1 k =1
| {z } {z }
=(2k−1)!·2k =((2k−1)!)2
!
n   n n
= ∏ ((2k − 1)!)2 · 2k = ∏ ((2k − 1)!)2 · ∏ (2k)
k =1 k =1 k =1
| {z }
n
=2n ∏ k
k =1
! !
n n n
= ∏ ((2k − 1)!)2 · 2n ∏ k = ∏ ((2k − 1)!)2 · 2n n!.
k =1 k =1 k =1
|{z}
=n!

Dividing this by n!, we find


! ! !2
n n
1! · 2! · · · · · (2n)!
n!
= ∏ ((2k − 1)!)2 · 2n = ∏ (2k − 1)! · 2n/2 .
k =1 k =1

The right hand side is a perfect square (since n is even, so that 2n/2 ∈ Z). Thus,
(440) is proved, and the problem is solved.312
[Remark: This exercise is a puzzle I found on reddit.
The claim (440) can also be proved by a straightforward induction on n.
312 See [Grinbe15, Exercise 3.5 (c)] for this argument in more detail.

December 25, 2021


Math 235 notes page 513

If neither n nor n + 1 is a perfect square, then n is the only q ∈ {1, 2, . . . , 2n} for
1! · 2! · · · · · (2n)!
which is a perfect square. I don’t know of a nice and simple proof
q!
of this, but a somewhat laborious proof (using a result of Erdös) can be found at
https://math.stackexchange.com/a/3325448/ .]

A.1.2. Discussion of Exercise 1.1.2


Discussion of Exercise 1.1.2. This exercise has appeared in various places (e.g., it was
Exercise 8 on the 5th Virginia Tech Regional Mathematics Contest). I gave a detailed
solution in [Grinbe15, Proposition 2.64], so here I will mostly comment on how the
sausage is made. Note that the sequence (t0 , t1 , t2 , . . .) appears in the OEIS as
Sequence A005246.
Since the sequence (t0 , t1 , t2 , . . .) is defined recursively, it is reasonable to guess
that its properties are best proved by induction. More precisely, strong induction
is the best thing to try, since the recursive definition of tn refers not just to tn−1 but
also to the previous two values tn−2 and tn−3 .
A strong induction needs no induction base – although this often comes at the
price that a few “edge” cases have to be considered separately within the induction
step. We shall see this now.
(a) We proceed by strong induction on n.
Induction step: Let m ≥ 2 be an integer. Assume (as induction hypothesis) that the
claim of Exercise 1.1.2 (a) holds for all n < m (meaning, of course, for all integers
n ≥ 2 satisfying n < m). We must prove that the claim of Exercise 1.1.2 (a) also
holds for n = m. In other words, we must prove that tm+2 = 4tm − tm−2 .
We want to reduce this to our induction hypothesis, which says things like
tm+1 = 4tm−1 − tm−3 and tm = 4tm−2 − tm−4 and so on. So we need to get rid
of “ts with high indices” – that is, in our case, tm+2 . We achieve this by rewriting
1 + t m +1 t m
tm+2 as (a consequence of the recursive definition of our sequence). So,
t m −1
the equality we must prove (namely, tm+2 = 4tm − tm−2 ) rewrites as follows:

(tm+2 = 4tm − tm−2 )


 
1 + t m +1 t m
⇐⇒ = 4tm − tm−2
t m −1
⇐⇒ (1 + tm+1 tm = (4tm − tm−2 ) tm−1 )
⇐⇒ (1 + tm+1 tm = 4tm tm−1 − tm−2 tm−1 )
⇐⇒ (1 = 4tm tm−1 − tm+1 tm − tm−2 tm−1 )

(where in the last step we brought the tm+1 tm term to the right hand side so it
could join the rather similar terms there). The 4tm tm−1 − tm+1 tm on the right hand
side rewrites as tm (4tm−1 − tm+1 ); but this looks familiar! Indeed, our induction
hypothesis (applied to n = m − 1) yields tm+1 = 4tm−1 − tm−3 , so that 4tm−1 −

December 25, 2021


Math 235 notes page 514

tm+1 = tm−3 . We can now continue our above chain of equivalent transformations
of our goal:

(1 = 4tm tm−1 − tm+1 tm − tm−2 tm−1 )


 

⇐⇒ 1 = tm (4tm−1 − tm+1 ) −tm−2 tm−1 


 
| {z }
= t m −3
⇐⇒ (1 = tm tm−3 − tm−2 tm−1 ) .

But the equality 1 = tm tm−3 − tm−2 tm−1 follows from the very definition of tm ,
1 + t m −1 t m −2
which (as we recall) says tm = . So we have reduced the equality in
t m −3
question (that is, tm+2 = 4tm − tm−2 ) to an equality we know to be true. We now
need to walk this argument backwards and we have our induction step.
Did you spot the gap? You can see that there is a gap, since we have never used
the base values (t0 = t1 = t2 = 1). But it is not hard to see that the problem would
not remain true if the base values were replaced by arbitrary numbers. Something
has to give.
The problem is that we applied the induction hypothesis to n = m − 1. But
the induction hypothesis said that Exercise 1.1.2 (a) holds for all integers n ≥ 2
satisfying n < m. Thus, in order to apply it to n = m − 1, we need to know that
m − 1 is an integer satisfying m − 1 ≥ 2 and m − 1 < m. Of course, m − 1 is
an integer and satisfies m − 1 < m. But m − 1 ≥ 2 is not automatically satisfied;
it holds for m ≥ 3, but not for m = 2. Thus, we need to treat the m = 2 case
separately. So much for a strong induction not needing an induction base! (Of
course, technically it is true: We are not doing an induction base; we are just special-
casing a special case in the induction step. But the difference is just organizational.)
So we need to verify the claim of Exercise 1.1.2 (a) for m = 2. This means
verifying that t4 = 4t2 − t0 . This is not the most challenging part of the problem,
so I stop here.
One last thing about (a): If you look again at the above induction, you might
notice that we only ever applied the induction hypothesis to n = m − 1. This
means that we did not need the “strength” of strong induction; we can just as well
restate the argument as a (standard) induction on n. The case m = 2 then becomes
an actual (de-jure, not just de-facto) induction base. I think the resulting proof is a
little bit easier to write up.
(b) We will separately prove the two statements that

tn is positive for each integer n ≥ 0 (441)

and that
tn is an integer for each integer n ≥ 0. (442)
To be pedantic, (441) does not even have to be proved, since it is implicit in the
problem statement (“a sequence (t0 , t1 , t2 , . . .) of positive rational numbers”). (The

December 25, 2021


Math 235 notes page 515

reason why I put the “positive” in the statement is to pre-empt any question about
1 + t n −1 t n −2
“what happens if the expression has a zero in the denominator?”. If
t n −3
we know that all entries of the sequence are positive, then of course there cannot
be any zero denominators.) Just for the sake of completeness: The reason that tn is
positive for each integer n ≥ 0 is that the sequence (t0 , t1 , t2 , . . .) was defined recur-
sively with three positive base values (t0 , t1 , t2 are all positive) and a recursive rule
1 + t n −1 t n −2
(tn = ) that produces a positive tn when given positive tn−1 , tn−2 , tn−3 .
t n −3
So to speak, the sequence (t0 , t1 , t2 , . . .) never has a chance to escape the positive
numbers. To make this argument formal (which you don’t need to do on any con-
tests, given how trivial it is), you can argue by strong induction, similarly to how
1 + t n −1 t n −2
we are soon going to prove (442) (but using the recursive rule tn =
t n −3
instead of part (a)).
Let us now prove (442). We proceed by strong induction on n.
Induction step: Fix an integer m ≥ 0, and we assume (as induction hypothesis)
that (442) holds for all n < m. We must now prove that (442) holds for n = m. In
other words, we must prove that tm is an integer.
First assume that m ≥ 4. Then, m − 2 ≥ 2; thus, we can apply Exercise 1.1.2
(a) to n = m − 2, and thus obtain tm = 4tm−2 − tm−4 . The induction hypothesis
then yields that tm−2 and tm−4 are integers (since m − 2 and m − 4 are integers
≥ 0 and satisfy m − 2 < m and m − 4 < m), and so tm is an integer as well (since
tm = 4tm−2 − tm−4 ). So we are done with the induction step in the case when m ≥ 4.
It remains to cover the remaining cases. These are the cases when m < 4, that is,
m ∈ {0, 1, 2, 3}. In other words, we need to show that t0 , t1 , t2 , t3 are integers. This
is straightforward (and has been already done in the problem statement). Thus the
induction step is complete. Hence, (442) is proved.
(Note that this was a real strong induction: We applied the induction hypothesis
to two different values of n, none of which was m − 1.)
Having proved (441) and (442), we are done with Exercise 1.1.2 (b).

A.1.3. Discussion of Exercise 1.1.3


Discussion of Exercise 1.1.3. This equality is known as Hermite’s identity
 for floor
 func-
n −1 k
tions. The “trick” is simply to express every addend of the sum ∑ x + explic-
k =0 n
itly in terms of as few parameters as possible. Here is the solution in full detail:
Solution to Exercise 1.1.3. Let g = bnx c. Then, (1) (applied to nx instead of x) yields
bnx c ≤ nx < bnx c + 1. In view of g = bnx c, this rewrites as g ≤ nx < g + 1.
Let q and r be the quotient and the remainder obtained when g is divided by n.
Thus, g = qn + r and q ∈ Z and r ∈ {0, 1, . . . , n − 1}.

December 25, 2021


Math 235 notes page 516


k
Now, we shall prove explicit formulas for the values x + for k ∈ {0, 1, . . . , n − 1}.
n
Namely:

• For any k ∈ {0, 1, . . . , n − r − 1}, we have


 
k
x+ = q. (443)
n

• For any k ∈ {n − r, n − r + 1, . . . , n − 1}, we have


 
k
x+ = q + 1. (444)
n

[Proof of (443): Let k ∈ {0, 1, . . . , n − r − 1}. Thus, k ≥ 0 and k ≤ n − r − 1. From


k ≤ n − r − 1, we obtain k + r + 1 ≤ n.  
k k
We shall prove that q ≤ x + < q + 1 (since this will quickly entail x + = q).
n n
In order to do so, we shall show that qn ≤ nx + k < (q + 1) n.
Indeed, r ≥ 0, so that qn ≤ qn + r = g ≤ nx ≤ nx + k (since k ≥ 0). Also,

r + 1} ≤ qn + n = (q + 1) n.
nx +k < g +1 + k = qn + r + 1 + k = qn + k| +{z
|{z} |{z}
< g +1 =qn+r ≤n

Combining qn ≤ nx + k with this, we obtain the chain of inequalities qn ≤ nx + k <


nx + k
(q + 1) n. Dividing this chain by n, we find q ≤ < q + 1. Hence, the integer
n
nx + k
q is ≤ , but the next integer q + 1 no longer is. Thus, q is the largest integer
n    
nx + k nx + k nx + k
≤ . In other words, q = (by the definition of ). In other
n   n n
k nx + k k
words, q = x + (since = x + ). This proves (443).]
n n n
[Proof of (444): Let k ∈ {n − r, n − r + 1, . . . , n − 1}. Thus, k ≥ n − r and k ≤ n − 1.
From k ≥ n − r, we obtain k + r ≥ n, so that n ≤ k + r.  
k k
We shall prove that q + 1 ≤ x + < q + 2 (since this will quickly entail x + =
n n
q + 1). In order to do so, we shall show that (q + 1) n ≤ nx + k < (q + 2) n.
Indeed, combining

n ≤ qn + k + r = qn + r +k ≤ nx + k
(q + 1) n = qn + |{z}
| {z }
≤ k +r = g≤nx

with

|{z} k < g + 1 + n − 1 = g +n = qn + |{z}


nx + |{z} r +n < qn + n + n = (q + 2) n,
|{z}
< g +1 ≤ n −1 =qn+r ≤ n −1< n

December 25, 2021


Math 235 notes page 517

we obtain the chain of inequalities (q + 1) n ≤ nx + k < (q + 2) n. Dividing this


nx + k nx + k
chain by n, we find q + 1 ≤ < q + 2. Hence, the integer q + 1 is ≤ ,
n n
nx + k
but the next integer q + 2 no longer is. Thus, q + 1 is the largest integer ≤ .
    n
nx + k nx + k
In other words, q + 1 = (by the definition of ). In other words,
  n n
k nx + k k
q+1 = x+ (since = x + ). This proves (444).]
n n n
Now, r ∈ {0,1, . . . , n − 1}, so that n − r ∈ {1, 2, . . . , n}. Thus, we can split the
n −1 k
sum ∑ x + at k = n − r. We thus obtain313
k =0 n

n −1   n −r −1   n −1  
k k k
∑ x+
n
= ∑ x+
n
+ ∑ x+
n
k =0 k =0 | {z } k=n−r | {z }
=q = q +1
(by (443)) (by (444))
n −r −1 n −1
= ∑ q + ∑ ( q + 1)
k =0 k = n −r
| {z } | {z }
=(n−r )q =r ( q +1)
(since this sum has n−r addends) (since this sum has r addends)
= (n − r ) q + r (q + 1) = qn + r = g = bnx c .

This solves the exercise.


With some experience, the above solution will appear straightforward. The deci-
sive step was to introduce q and r; 
but this was not unmotivated. Indeed, the first
n −1 k 0
addend of the sum ∑ x + is x + = b x c = q, and all other addends are
k =0 n n
either q or q + 1. The question that remains is which of them are q and which are
q + 1; but it soon becomes clear that the remainder of g divided by n decides this.
Thus the above solution.

A.1.4. Discussion of Exercise 1.1.4


Discussion of Exercise 1.1.4. The following solution is probably the easiest one to
find, but not the nicest or the most generalizable one. More on this after the solu-
tion.
2
Solution to Exercise 1.1.4. Expanding ( a + b + c)n +n+1 will yield a sum of monomi-
als of the form ai b j ck with i, j, k being nonnegative integers satisfying i + j + k =
n −1
 
313 Keep k
in mind that the sum ∑ x+ will be empty if r = 0. An empty sum equals 0 by
k = n −r n
definition.

December 25, 2021


Math 235 notes page 518

n2 + n + 1. (Indeed, the multinomial theorem yields the exact result, but we don’t
need it; all we need is that it is some sum of such monomials.) Thus, in order
2
to prove that abc divides ( a + b + c)n +n+1 , it will suffice to show that abc divides
each of these monomials ai b j ck . So let us do this.
Let us fix three nonnegative integers i, j, k satisfying i + j + k = n2 + n + 1. We
must prove that abc | ai b j ck .
If all of i, j, k are nonzero (thus ≥ 1), then this is true for obvious reasons. Thus,
we WLOG assume that i, j, k are not all nonzero. So at least one of i, j, k is zero.
Now abc | ai b j ck is no longer obvious, but we can try to use our assumptions
a | bn and b | cn and c | an to our advantage. These assumptions allow us to “trade”
a bn for an a, or a cn for a b, or an an for a c in the term ai b j ck . We hope that by
a few such “trades”, we can transform ai b j ck into a monomial where each of a, b, c
appears at least once (whence the monomial is divisible by abc).
Which “trades” we need to make depends on the values of i, j, k. We distinguish
between two cases:
Case 1: Exactly one of i, j, k is zero.
Case 2: Exactly two of i, j, k are zero.
(These are the only possibilities, because we already know that at least one of
i, j, k is zero, whereas the condition i + j + k = n2 + n + 1 rules out the possibility
that all of i, j, k are zero).
Let us first consider Case 1. In this case, exactly one of i, j, k is zero.
Notice the cyclic symmetry in the problem: If we cyclically permute a, b, c (that
is, replace a, b, c by b, c, a, respectively) and simultaneously cyclically permute i, j, k,
then neither the assumptions nor the claim of the problem change. Thus, we can
cyclically permute the numbers i, j, k at will (as long as we remember to permute
a, b, c along with them). By doing so, we can always guarantee that i = 0 (because
we know that at least one of the three numbers i, j, k is zero, and we can bring this
number to the front by a cyclic permutation). Thus, WLOG assume that i = 0.
Hence, j and k are nonzero (since exactly one of i, j, k is zero). In other words, j ≥ 1
and k ≥ 1. Our monomial ai b j ck thus has no a, but at least one b and at least one c
in it.
We now want to “trade” a bn for an a, or, if this is impossible (because we don’t
have a bn ), to “trade” n copies of cn for b’s and then trade the resulting bn for an a.
We need to be careful not to “sell” all our b’s in the trade, so we should “trade” bn
only if we have at least one b left after that – i.e., if j ≥ n + 1. Thus, we distinguish
between the following two subcases:
Subcase 1.1: We have j ≥ n + 1.
Subcase 1.2: We have j < n + 1.
In Subcase 1.1, we have j ≥ n + 1. Hence, bn+1 | b j . But a | bn . Multiplying
this divisibility by b, we find314 ab | bn b = bn+1 | b j . Also, c | ck (since k ≥ 1).

314 We are using the following basic fact of number theory here: If x and y are two integers satisfying
x | y, then xb | yb.

December 25, 2021


Math 235 notes page 519

Multiplying these two divisibilities315 , we obtain ( ab) c | b j ck . Hence, abc = ( ab) c |


b j ck | ai b j ck . Thus, abc | ai b j ck is proved in Subcase 1.1.
Let us next consider Subcase 1.2. In this case, we have j < n + 1. Hence, j ≤
n (since j and n are integers). Now, recall that i + j + k = n2 + n + 1, so that
2
n2 + n + 1 = |{z} i + j +k ≤ n + k, so that k ≥ n2 + 1. Therefore, cn +1 | ck . But
|{z}
=0 ≤n
2
we can take the divisibility b | cn to the n-th power316 , and obtain bn | (cn )n = cn .
2 2 2
Hence, a | bn | cn . Multiplying this divisibility by c, we obtain ac | cn c = cn +1 | ck .
Also, b | b j (since j ≥ 1). Multiplying the preceding two divisibilities, we obtain
( ac) b | ck b j . Thus, abc = ( ac) b | ck b j = b j ck | ai b j ck . Thus, abc | ai b j ck is proved in
Subcase 1.2.
We have now proved abc | ai b j ck in all of Case 1. It remains to deal with Case 2.
So let us consider Case 2. In this case, exactly two of i, j, k are zero. The same
“cyclic symmetry” argument as in Case 1 lets us WLOG assume that i and j are
zero. Thus, i + j + k = 0 + 0 + k = k, so that k = i + j + k = n2 + n + 1. Hence,
2 2 2
ck = cn +n+1 = cn cn c. As in Subcase 1.2, we can see that a | cn . Also, we know
2
that b | cn . Multiplying these two divisibilities, we find ab | cn cn . Multiplying this
2
further by c, we find abc | cn cn c = ck | ai b j ck . Thus, abc | ai b j ck is proved in Case 2.
This completes our proof of abc | ai b j ck . As explained above, this solves the
problem.
Now, a few words about the ideas behind the problem. It is a slight gener-
alization of an olympiad problem from Norway (Abelkonkurransen 1998-99 final
problem 2b). As the above solution reveals, it is not much of a number theory
problem; it is a combinatorial problem about “trading exponents” in a monomial,
wrapped in number-theoretical packaging. At the core is the following fact: If you
have a monomial ai b j ck with i + j + k = n2 + n + 1 (treating a, b, c as formal vari-
ables rather than specific numbers), and you are allowed to trade a bn for an a, a
cn for a b, or an an for a c, then you can always (choosing your trades strategically)
wind up with a monomial that contains each of a, b, c at least once. (You can think
of a, b, c as three different currencies that can only be exchanged for one another at
a loss.)
This fact can be generalized to k (rather than 3) currencies; Fedor Petrov has
proved this generalization in https://mathoverflow.net/questions/198605/ .

A.1.5. Discussion of Exercise 1.1.5


Discussion of Exercise 1.1.5. Let me outline two solutions:
First solution to Exercise 1.1.5 (sketched). This is the “gotcha” solution.
315 This means we are using the following fact from number theory: If x, y, u, v are four integers
satisfying x | y and u | v, then xu | yv.
316 This is, again, a consequence of a standard fact from number theory: If x and y are two integers

such that x | y, then x n | yn .

December 25, 2021


Math 235 notes page 520

Let M1 be our mountain ridge. Imagine, in a parallel universe, a second moun-


tain ridge M2 , which has the same shape and length as M1 and initially has the
same lemmings as M1 at the same positions as on M1 , walking in the same di-
rections as on M1 and with the same speed as on M1 . However, they interact
differently: When two M2 -lemmings meet, they just walk through one another
like ghosts (as opposed to M1 -lemmings, which “bounce off” one another). For
example, if M1 and M2 initially look like this:

→ ←
− ←
− −
→ ←

1 2 3 4 5

then after the first “lemming collision” they will look as follows:

−−→ ←
− −
→ ←

M1 : 1 2 3 4 5 ;
−−
← → ←
− −
→ ←

M2 : 2 1 3 4 5 .

Now the key observation is the following:

Observation 1: At any moment in time, the multiset of the positions of


all M1 -lemmings on the M1 -ridge is the same as the multiset of the
positions of all M2 -lemmings on the M2 -ridge.

In other words, if we don’t distinguish between the specific lemmings, then we


never see a difference between M1 and M2 .
Why is Observation 1 true? Roughly speaking317 , it is true because it is true at
the onset (by definition of M2 ), it remains true as long as there are no collisions
(since the only difference between M1 and M2 is the rule for collisions), and it
remains true through each collision (since the collision rules on M1 and on M2 do
not depend on the identities of the individual lemmings colliding, and their results
differ only if one distinguishes between the lemmings318 ). Thus, Observation 1
never has any chance to become false.
317 We shall not formalize this argument, as it would require a lot of busywork even to formally
define what it means for a lemming to walk along the ridge, and to ensure that the positions of
the lemmings are actually well-defined at any time. From a rigorous point of view, these things
do need to be verified!
(If you are wondering why, ponder the following variant of the exercise. Assume that the
ridge is a circle instead of a line segment, and that the lemmings double their speeds after every
“collision”. Assume further that you start out with two lemmings that have just bounced off one
another. Say they collide after 1 minute. After this collision, their speeds double, so they collide
1 1
again after another minute. Then their speeds double again, so they collide after another
2 4
minute. And so on... Thus, the lemmings keep running around the ridge all the way up to
1 1 1
the 2-minute mark (since 1 + + + + · · · = 2). But what happens afterwards – say, after
2 4 8
3 minutes? This has no well-defined answer; our rules of collision simply do not define any
behavior outside of the time interval [0, 2).
This is rather similar to finite-time blow-up of solutions to some different equations.)
318 To be fully honest, we need to first observe that the speeds of all lemmings remain constant and

equal throughout the ordeal, both on M1 and M2 (because collisions never change the speeds).

December 25, 2021


Math 235 notes page 521

But the M2 -lemmings are much easier to analyze than the M1 -lemmings. After
all, collisions don’t matter on M2 . Thus, each M2 -lemming keeps walking in the
direction it has always been walking. As a consequence, each M2 -lemming even-
tually falls off the cliff (since the speeds are constant and nonzero, and the ridge is
finite). In other words, there are eventually no lemmings on M2 any more. Accord-
ing to Observation 1, this means that there are eventually no lemmings on M1 any
more. In other words, each M1 -lemming eventually falls off the cliff. This solves
the exercise.
Note that the above solution shows something better than the exercise asked for:
Namely, it shows that if the ridge has length d and the speed of each lemming is v,
then there will be no lemmings on the ridge after time d/v. Indeed, this is clearly
what happens on M2 (since each M2 -lemming just walks with speed v in a fixed
direction), and therefore (by Observation 1) is also what happens on M1 .
The next proof does not (at least directly) show this stronger result, but is prob-
ably easier to come up with:
Second solution to Exercise 1.1.5 (sketched). Consider the initial state. If the leftmost
lemming is walking left, then it will reach the left cliff undisturbed and fall off
it. If the leftmost lemming is walking right, then it will either reach the right cliff
undisturbed and fall off it, or it will collide with another lemming and bounce
off, which will then send it moving left and eventually falling off the left cliff
(undisturbed, since there won’t be any other lemming for it to collide with; it will
stay the leftmost lemming on the ridge until it falls). In either case, the leftmost
lemming will eventually fall off the cliff. After this happens, another lemming will
become the leftmost lemming, and thus (by the same argument) will also eventually
fall off the cliff. Repeat this argument once for each lemming (strictly speaking, this
means arguing by induction). This shows that eventually, all lemmings will have
fallen off the cliff (although it does not offer a good bound on how soon).

A.1.6. Discussion of Exercise 1.1.6


Discussion of Exercise 1.1.6. This is a particular case of [18s-hw2s, Exercise 7]. (More
precisely, part (a) is the particular case of [18s-hw2s, Exercise 7] for n = 40 and
s = 10, whereas part (b) is the particular case of [18s-hw2s, Exercise 7] for n = 26
and s = 10.)
Let us introduce notations that cover both parts (a) and (b). Let n and s be two
even positive integers. Assume that we have n/2 white socks and n/2 black socks
hanging on a clothesline, in some order. We are looking to pick s consecutive socks

When two lemmings collide at equal speeds, the result is the same on M1 and on M2 as long as
you don’t distinguish between the lemmings: You still have two lemmings walking in the same
directions at the same speeds. The only difference is that the two lemmings have traded places
on M1 .

December 25, 2021


Math 235 notes page 522

on the clothesline such that s/2 of them are black and the other s/2 white. We shall
refer to such a pick as a balanced pick. (Let’s not call it “color-balanced” for brevity.)
Thus, part (a) claims that we can find a balanced pick if n = 40 and s = 10, whereas
part (b) claims that we can find a balanced pick if n = 26 and s = 10.
We shall prove a more general claim ([18s-hw2s, Exercise 7]). Namely, we shall
prove the following:

Claim 1: Set q = n//s and r = n%s (where we are using the notations //
and % introduced in Definition 3.3.1). Assume that there is no balanced
pick. Then, r ≥ 2q and s > 2q + r.

Claim 1 will solve part (a) of our problem, since r ≥ 2q is violated for n = 40 and
s = 10; it will also solve part (b), since s > 2q + r is violated for n = 26 and s = 10.
[Proof of Claim 1: We have s/2 ∈ Z (since s is even). Also, q and r are the quotient
and the remainder of division of n by s (since q = n//s and r = n%s). Thus, q ∈ Z,
r ∈ {0, 1, . . . , s − 1} and n = qs + r. From r ∈ {0, 1, . . . , s − 1}, we obtain r < s.
Thus, s > r.
We must prove that r ≥ 2q and s > 2q + r. If q = 0, then this is obvious (because
r ≥ 0 and s > r). Hence, we WLOG assume that q 6= 0. Thus, q ≥ 1. Therefore,
n = q s + |{z} r ≥ s, so that n − s + 1 ≥ 1.
|{z}
≥1 ≥0
Number the socks by 1, 2, . . . , n in the order in which they appear on the clothes-
line. For any m ∈ N, let [m] denote the m-element set {1, 2, . . . , m}.
For each i ∈ [n − s + 1], define the integer

bi = (the number of black socks among socks i, i + 1, . . . , i + s − 1) − s/2. (445)

(This is indeed an integer, because s/2 ∈ Z.) Then, each i ∈ [n − s + 1] satisfies

1
bi = (the number of black socks among socks i, i + 1, . . . , i + s − 1)
2
1
− (the number of white socks among socks i, i + 1, . . . , i + s − 1) .
2
(446)

(This comes from the fact that each sock is either black or white; see [18s-hw2s,
solution to Exercise 7] for a detailed proof.)
The equality (446) shows that if we invert the colors of all socks (simultaneously),
then all the numbers b1 , b2 , . . . , bn−s+1 change signs. Hence, we can WLOG assume
that b1 ≥ 0 (since otherwise, we can invert the colors of all socks, and then b1 will
change sign). Assume this.
Note that each i ∈ [n − s + 1] satisfies

(the number of black socks among socks i, i + 1, . . . , i + s − 1) = bi + s/2 (447)

(by (445)).

December 25, 2021


Math 235 notes page 523

For each i ∈ [n − s + 1], we have bi 6= 0 (because if we had bi = 0, then the s


consecutive socks i, i + 1, . . . , i + s − 1 would form a balanced pick; but this would
contradict our assumption that there is no balanced pick). Thus, b1 , b2 , . . . , bn−s+1
are nonzero integers. Furthermore,
| bi + 1 − bi | ≤ 1 for all i ∈ [(n − s + 1) − 1]
319 .
Hence, Proposition 2.2.4 (applied to g = 1 and h = n − s + 1) shows that bi > 0
for all i ∈ [n − s + 1]. Since the bi are integers, this shows that
bi ≥ 1 for all i ∈ [n − s + 1] . (448)
Now, let g be the number of black socks among the r socks qs + 1, qs + 2, . . . , qs +
r. Thus, clearly, 0 ≤ g ≤ r.
Recall that the total number of black socks on the clothesline is n/2. Thus,
n/2 = (the total number of black socks)
= (the number of black socks among socks 1, 2, . . . , n)
= (the number of black socks among socks 1, 2, . . . , qs + r )
(since n = qs + r )
= (the number of black socks among socks 1, 2, . . . , s)
+ (the number of black socks among socks s + 1, s + 2, . . . , 2s)
+ (the number of black socks among socks 2s + 1, 2s + 2, . . . , 3s)
+···
+ (the number of black socks among socks (q − 1) s + 1, (q − 1) s + 2, . . . , qs)
+ (the number of black socks among socks qs + 1, qs + 2, . . . , qs + r )
q −1
= ∑ (|the number of black socks among{z socks hs + 1, hs + 2, . . . , (h + 1) s})
h =0
=bhs+1 +s/2
(by (447))
+ (the number of black socks among socks qs + 1, qs + 2, . . . , qs + r )
| {z }
=g
 
q −1  
= ∑  bhs+1 +s/2 + g
 
h =0
 | {z } 
≥1
(by (448))
q −1
≥ ∑ (1 + s/2) + g = q + qs/2 + g.
h =0
| {z }
=q(1+s/2)
=q+qs/2
319 Proof.Compare the definitions of bi and bi+1 , and observe that the s socks i, i + 1, . . . , i + s − 1
differ from the s socks i + 1, i + 2, . . . , i + s in at most one sock. (See [18s-hw2s, solution to
Exercise 7] for the details.)

December 25, 2021


Math 235 notes page 524

Hence,
q + qs/2 + g ≤ |{z}
n /2 = (qs + r ) /2 = qs/2 + r/2.
=qs+r
Subtracting qs/2 from both sides of this inequality, we find
q + g ≤ r/2. (449)
Hence, r/2 ≥ q + g ≥ q, so that r ≥ 2q.
|{z}
≥0
It remains to prove that s > 2q + r. From n = qs + r, we obtain n − r = qs. Thus,
(the number of black socks among socks n − r + 1, n − r + 2, . . . , n)
= (the number of black socks among socks qs + 1, qs + 2, . . . , n)
= (the number of black socks among socks qs + 1, qs + 2, . . . , qs + r )
(since n = qs + r )
= g.
But there is a sock n − s + 1 on our clothesline (since n − s + 1 ≥ 1). Let p be the
number of black socks among the s − r socks n − s + 1, n − s + 2, . . . , n − r. Thus,
clearly, p ≤ s − r.
From (447), we obtain
(the number of black socks among socks n − s + 1, n − s + 2, . . . , n)
= bn−s+1 +s/2 ≥ 1 + s/2.
| {z }
≥1
(by (448))

Hence,
1 + s/2
≤ (the number of black socks among socks n − s + 1, n − s + 2, . . . , n)
= (the number of black socks among socks n − s + 1, n − s + 2, . . . , n − r )
| {z }
=p
+ (the number of black socks among socks n − r + 1, n − r + 2, . . . , n)
| {z }
=g
= p + g ≤ (s − r ) + (r/2 − q) = s − r/2 − q.
|{z} |{z}
≤ s −r ≤r/2−q
(by (449))

Subtracting s/2 from both sides of this inequality, we find 1 ≤ s/2 − r/2 − q, so that
s/2 − r/2 − q ≥ 1 > 0. Multiplying this inequality by 2, we obtain s − r − 2q > 0,
so that s > 2q + r. This completes the proof of Claim 1.]
Thus, Exercise 1.1.6 is solved.
[Remark: I have heard that Claim 1 is an “if and only if”: If we don’t have r ≥ 2q
and s > 2q + r, then there exists a way to place n/2 black and n/2 white socks
on a clothesline such that there is no balanced pick. I don’t currently remember a
proof.]

December 25, 2021


Math 235 notes page 525

A.1.7. Discussion of Exercise 1.1.7


Discussion of Exercise 1.1.7. The solution is short:

bc (b − c) (b + c) + ca (c − a) (c + a) + ab ( a − b) ( a + b)
= ( a − b) ( a − c) (b − c) ( a + b + c) .

But how to find this? There are several options. The easiest approach is by
identifying and factoring out divisors. The most elementary implementation of
this approach is the following. We treat b and c as constants, and consider our
polynomial as a polynomial in the single variable a. Recall that if a polynomial in a
variable x has a root x0 , then this polynomial is divisible by the linear polynomial
x − x0 . Now, the polynomial

P ( a) := bc (b − c) (b + c) + ca (c − a) (c + a) + ab ( a − b) ( a + b)

has root b, since

P (b) = bc (b − c) (b + c) + cb (c − b) (c + b) + bb (b − b) (b + b)
| {z }
=0
= bc (b − c) (b + c) + cb (c − b) (c + b) = bc ((b − c) + (c − b)) (b + c) = 0.
| {z }
=0

Thus, it is divisible by a − b. For the same reason, it is divisible by a − c. Occam’s


Razor thus suggests that it is divisible by the product ( a − b) ( a − c) as well320 . By
P ( a)
polynomial long division, we can find the quotient to be
( a − b) ( a − c)
 
2 2 2 2
b + ab − c − ac = a (b − c) + b − c = ( a + b + c) (b − c) .
| {z }
=(b+c)(b−c)

And thus P ( a) = ( a − b) ( a − c) ( a + b + c) (b − c).


There are other ways to find this as well. The probably nicest one is using deter-
minants: Recall that the determinant of a matrix does not change if we subtract a

320 Algebraists will not need Occam’s Razor here: They know that the ring of polynomials in the
three variables a, b, c over (say) Q is a unique factorization domain (this holds more generally
for any polynomial ring over a field), and therefore a polynomial divisible by two coprime
polynomials like a − b and a − c must necessarily be divisible by their product. But justifying
this without using abstract algebra is not easy. (Our approach of treating b and c as constants,
in particular, makes this argument rather slippery, because b and c might be equal and then
the polynomials a − b and a − c are no longer coprime.) Fortunately, we don’t need to justify
this step in order to solve the problem – it is merely used to find a factorization of a specific
polynomial, which, once found, can be proved by direct computation.

December 25, 2021


Math 235 notes page 526

multiple of a column from another column. Now,

bc (b − c) (b + c) +ca (c − a) (c + a) + ab ( a − b) ( a + b)
| {z } | {z } | {z }
= b2 − c2 = c2 − a2 = a2 − b2
     
= bc b2 − c2 + ca c2 − a2 + ab a2 − b2
 
a3 a 1
= b3 c − bc3 + c3 a − ca3 + a3 b − ab3 = det  b3 b 1 
 
c3 c 1
(by the definition of the determinant)
 
a3 − c2 a a 1 here, we subtracted the c2 -multiple
 

= det  b3 − c2 b b 1  of the second column


   
3 2
c −c c c 1 from the first column
 
a3 − c2 a a − c 1
 
here, we subtracted the c-multiple
= det  b3 − c2 b b − c 1  of the third column
   
c3 − c2 c c − c 1 from the second column
 
a ( a + c) ( a − c) a − c 1  
here we just rewrote the
= det  b (b + c) (b − c) b − c 1 
entries of the matrix
0 0 1
 
a ( a + c) ( a − c) − b (b + c) ( a − c) a − c 1
= det  b (b + c) (b − c) − b (b + c) (b − c) b − c 1 
0 0 1
 
here, we subtracted the b (b + c) -multiple
of the second column from the first column
 
( a + b + c) ( a − b) ( a − c) a − c 1  
here we just rewrote the
= det  0 b−c 1 
entries of the matrix
0 0 1
= ( a + b + c) ( a − b) ( a − c) · (b − c) · 1
 
since the determinant of a triangular matrix equals
the product of its diagonal entries
= ( a − b) ( a − c) (b − c) ( a + b + c) .
This way of solving the exercise is suggestive of some generalizations (see [Grinbe15,
Exercise 6.16] for one of them).
Finally, let me notice that factoring a polynomial over Q (that is, into irreducible
polynomials with rational coefficients) is an algorithmically solvable problem – in
the sense that there are algorithms that can be used to solve it mechanically. The
first algorithm was probably found by Kronecker [Edward05, Essay 1.4]. Most
computer algebra systems have this algorithm implemented. Thus, the problem
becomes trivial if one has access to a computer. However, the manual solution-

December 25, 2021


Math 235 notes page 527

finding strategies shown above have other uses.

A.1.8. Discussion of Exercise 1.1.8


Discussion of Exercise 1.1.8. (a) This is problem A1 in the 4th QEDMO (2007); the
first of the following two solutions is copied from the model solutions (German),
while the second (simpler) solution has been suggested by one of you (name with-
held for FERPA).
Both solutions rely on the following two important properties of absolute values:

• If x, y ∈ R, then
| xy| = | x | · |y| . (450)

• The triangle inequality: If x, y ∈ R, then

| x | + |y| ≥ | x + y| . (451)

Both of these properties are easily verified by case distinction.


First solution to Exercise 1.1.8 (a). The inequality (451) (applied to x = b − c and
y = c − a) yields

|b − c| + |c − a| ≥ |(b − c) + (c − a)| = |(−1) ( a − b)|


(since (b − c) + (c − a) = b − a = (−1) ( a − b))
= |−1| · | a − b| (by (450))
|{z}
=1
= | a − b| . (452)

The same reasoning (but with the variables cyclically permuted) yields

|c − a| + | a − b| ≥ |b − c| and (453)
| a − b| + |b − c| ≥ |c − a| . (454)

(Note that at least one of these three inequalities is an equality. The best way to see
this is to imagine the three numbers a, b, c as points on the real axis; then, one of
the three lies between the two others, and then the corresponding inequality is an
equality. But we won’t need this.)
Now, b2 − c2 = (b + c) (b − c), so that

b2 − c2 = |(b + c) (b − c)| = |b + c| · |b − c| (by (450))


| {z }
=b+c
(since b+c≥0)
= (b + c) · |b − c| = b · |b − c| + c · |b − c| .

December 25, 2021


Math 235 notes page 528

Again, the same reasoning (but with the variables cyclically permuted) yields

c2 − a2 = c · | c − a | + a · | c − a | and

a2 − b2 = a · | a − b | + b · | a − b | .

Adding up these three equalities, we find

b2 − c2 + c2 − a2 + a2 − b2
= (b · |b − c| + c · |b − c|) + (c · |c − a| + a · |c − a|) + ( a · | a − b| + b · | a − b|)
= a · (|c − a| + | a − b|) +b · (| a − b| + |b − c|) +c · (|b − c| + |c − a|)
| {z } | {z } | {z }
≥|b−c| ≥|c− a| ≥| a−b|
(by (453)) (by (454)) (by (452))
≥ a · |b − c| + b · |c − a| + c · | a − b|

(here we have multiplied three inequalities with a, b, c, respectively; this was al-
lowed since a, b, c are nonnegative). In view of

ca − ab}
| {z + − bc}
|ab {z + bc − ca}
| {z
=(− a)(b−c) =(−b)(c− a) =(−c)( a−b)

= |(− a) (b − c)| + |(−b) (c − a)| + |(−c) ( a − b)|


| {z } | {z } | {z }
=|− a|·|b−c| =|−b|·|c− a| =|−c|·| a−b|
(by (450)) (by (450)) (by (450))
= |− a| · |b − c| + |−b| · |c − a| + |−c| · | a − b|
|{z} |{z} |{z}
=a =b =c
= a · |b − c| + b · |c − a| + c · | a − b| ,

this rewrites as

b2 − c2 + c2 − a2 + a2 − b2 ≥ |ca − ab| + | ab − bc| + |bc − ca| .

This solves Exercise 1.1.8 (a).


Second solution to Exercise 1.1.8 (a). The inequality we are trying to prove is sym-
metric in a, b and c, in the sense that permuting a, b and c in any way does not
change it (check this!). Thus, we can WLOG assume that a ≤ b ≤ c (since we can al-
ways achieve this by permuting a, b and c so that the smallest of a, b and c becomes
a, the second-smallest becomes b and the largest becomes c). Assume this. From
a ≤ b ≤ c, we obtain a2 ≤ b2 ≤ c2 (since a, b, c are nonnegative). Furthermore, mul-
tiplying both sides of the inequality b ≤ c by a, we obtain ab ≤ ac (since a is non-
negative). Similarly, from a ≤ b, we obtain ca ≤ cb. Now, ab ≤ ac = ca ≤ cb = bc,
so that ab ≤ ca ≤ bc.

December 25, 2021


Math 235 notes page 529

Now, we can get rid of the absolute value signs in the problem. Indeed, we have
b2 ≤ c , so that b − c ≤ 0 and thus b − c = − b − c = c − b2 . Likewise,
2 2 2 2 2 2 2 2


c − a2 = c2 − a2 (since a2 ≤ c2 ) and a2 − b2 = b2 − a2 (since a2 ≤ b2 ) and


2

|ca − ab| = ca − ab (since ab ≤ ca) and | ab − bc| = bc − ab (since ab ≤ bc) and


|bc − ca| = bc − ca (since ca ≤ bc). Hence,

b2 − c2 + c2 − a2 + a2 − b2
| {z } | {z } | {z }
= c2 − b2 = c2 − a2 = b2 − a2
 
= c2 − b2 + c2 − a2 + b2 − a2 = 2 c2 − a2
= 2 (c + a) (c − a) (455)

and

|ca − ab| + | ab − bc| + |bc − ca|


| {z } | {z } | {z }
=ca− ab =bc− ab =bc−ca
= ca − ab + bc − ab + bc − ca = 2 (bc − ab)
= 2b (c − a) . (456)

But we need to prove that

|ca − ab| + | ab − bc| + |bc − ca| ≤ b2 − c2 + c2 − a2 + a2 − b2 .

In view of (456) and (455), this rewrites as

2b (c − a) ≤ 2 (c + a) (c − a) . (457)

Thus, it remains to prove (457). But this is easy to check directly: We have b ≤ c ≤
c + a (since a ≥ 0), thus 2b ≤ 2 (c + a). We can multiply both sides of this inequality
a ≥ c − c = 0), and thus obtain 2b (c − a) ≤ 2 (c + a) (c − a).
by c − a (since c − |{z}
≤c
This proves (457); thus, Exercise 1.1.8 (a) is solved.
[Remark: The first solution to Exercise 1.1.8 (a) is longer, but it has a redeeming
quality: It generalizes to n variables instead of 3. The corresponding result is that
if a1 , a2 , . . . , an are n nonnegative reals, then
n n
∑ | a i −1 a i − a i a i +1 | ≤ ∑ a2i − a2i+1 ,
i =1 i =1

where we set a0 = an and an+1 = a1 .]


(b) No. For a simple counterexample, set a = b = 1 and c = −1. In this case, the
left hand side becomes 4 while the right hand side is 0 (since a2 = b2 = c2 ).

December 25, 2021


Math 235 notes page 530

A.1.9. Discussion of Exercise 1.1.9


Discussion of Exercise 1.1.9. This is an exercise on modular arithmetic and the pi-
geonhole principle.321 Indeed, let bi = a1 + a2 + · · · + ai for each i ∈ {0, 1, . . . , n}.
Thus, b0 is an empty sum, so that b0 = 0. Recall that the remainder of an integer u
upon division by n is denoted by u%n. Now, the n + 1 remainders

b0 %n, b1 %n, b2 %n, . . . , bn %n

are n + 1 elements of the n-element set {0, 1, . . . , n − 1} (since they are remainders
upon division by n), and thus at least two of them must be equal (by the Pigeonhole
Principle)322 . In other words, there exist two integers u and v with 0 ≤ u < v ≤ n
and bu %n = bv %n. Consider these u and v. From u < v, we obtain u + 1 ≤ v (since
u and v are integers). Also, 0 ≤ u, thus 1 ≤ u + 1 ≤ v ≤ n. Hence, both u + 1 and
v belong to {1, 2, . . . , n}.
The integers bv and bu leave the same remainder when divided by n (since
bv %n = bu %n); thus, bv ≡ bu mod n (by Proposition 3.3.4, applied to bv and bu
instead of u and v). In other words, n | bv − bu . In view of

bv − bu = ( a1 + a2 + · · · + a v ) − ( a1 + a2 + · · · + a u )
|{z} |{z}
= a1 + a2 +···+ av = a1 + a2 +···+ au
(by the definition of bv ) (by the definition of bu )
= a u +1 + a u +2 + · · · + a v (since u < v) ,
this rewrites as n | au+1 + au+2 + · · · + av . Hence, there exist some p, q ∈ {1, 2, . . . , n}
with p ≤ q and n | a p + a p+1 + · · · + aq (namely, p = u + 1 and q = v). This solves
Exercise 1.1.9.

A.2. Homework set #1 discussion


The following are discussions of the problems on homework set #1 (Section 3.7).

A.2.1. Discussion of Exercise 3.7.1


Discussion of Exercise 3.7.1. We shall give two solutions, and then sketch two more.
The first is a fairly straightforward strong induction argument whose induction
step proceeds by removing the largest element w from S and observing that the
remaining part S \ {w} of S is a subset of {1, 2, . . . , n − k } (because the k-lacunarity
condition forces any element of S \ {w} to be ≤ w − k and therefore ≤ n − k). There
is a bit of busywork involved in ensuring that n − k is still an element of N (so that
the induction hypothesis can be applied). Here are the full details, for the skeptics:
321 And it appears in many places as an example for the use of the pigeonhole principle (e.g., in
[Bruald09, §3.1, Application 3] or – in a weaker form – in [Engel98, Chapter 4, Example E3]).
322 We are using the following form of the Pigeonhole Principle here: If g , g , . . . , g are m elements
1 2 m
of a (fixed) n-element set, and if we have m > n, then at least two of the m elements g1 , g2 , . . . , gm
must be equal. (This is our Corollary 6.1.4 with slightly different notations.)

December 25, 2021


Math 235 notes page 531

First solution to Exercise 3.7.1. Forget that we fixed n and S. We thus need to prove
the following claim:
Claim 1: Let n ∈ N. Let S be a k-lacunar subset of {1, 2, . . . , n}. Then,
n+k−1
|S| ≤ .
k
[Proof of Claim 1: We apply strong induction on n:
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that Claim 1
holds for all n < m. We must prove that Claim 1 holds for n = m.
Note that k ≥ 1 (since k is a positive integer), so that m + |{z}
k −1 ≥ m + 1 − 1 =
≥1
m+k−1 m+k−1
m ≥ 0. Hence, ≥ 0, so that 0 ≤ . Also, m − k < m (since k > 0).
k k
We have assumed (as the induction hypothesis) that Claim 1 holds for all n <
m. In other words, if n ∈ N satisfies n < m, and if S is a k-lacunar subset of
{1, 2, . . . , n}, then
n+k−1
|S| ≤ . (458)
k
Now, let us prove that Claim 1 holds for n = m. Let S be a k-lacunar subset of
{1, 2, . . . , m}. We shall show that
m+k−1
|S| ≤ . (459)
k
m+k−1
If |S| = 0, then this is definitely true (since we have 0 ≤ ). Thus, we
k
WLOG assume that |S| 6= 0. Hence, the set S is nonempty. Also, the set S is
finite (since it is a subset of the finite set {1, 2, . . . , m}). Therefore, Proposition 2.1.2
shows that the set S has a maximum. Let w be this maximum. Thus, w ∈ S ⊆
{1, 2, . . . , m}. Hence, 1 ≤ w ≤ m, so that m ≥ 1. Now, |{z} m +k − 1 ≥ 1 + k − 1 = k,
≥1
m+k−1 m+k−1
so that ≥ 1. Therefore, if |S| = 1, then |S| = 1 ≤ (since
k k
m+k−1
≥ 1), and thus (459) is proved in this case. Hence, we WLOG assume
k
that |S| 6= 1. But w ∈ S, so that |S \ {w}| = |S| − 1 6= 0 (since |S| 6= 1). In other
words, the set S \ {w} is nonempty.
Now, each g ∈ S \ {w} satisfies g ≤ w − k 323 and therefore g ≤ |{z}w −k ≤ m − k
≤m
and consequently g ∈ {1, 2, . . . , m − k } (since g ∈ S \ {w} ⊆ S ⊆ {1, 2, . . . , m}
323 Proof.Let g ∈ S \ {w}. Thus, g 6= w and g ∈ S \ {w} ⊆ S. But each s ∈ S satisfies s ≤ w (since w
is the maximum of S). Applying this to s = g, we obtain g ≤ w (since g ∈ S). Hence, w − g ≥ 0,
so that |w − g| = w − g.
Recall that the set S is k-lacunar. In other words, every two distinct elements u, v ∈ S satisfy
|u − v| ≥ k (by the definition of “k-lacunar”). Applying this to u = w and v = g, we obtain
|w − g| ≥ k (since w and g are distinct (because g 6= w)). In other words, w − g ≥ k (since
|w − g| = w − g). Thus, w ≥ g + k and therefore g ≤ w − k. Qed.

December 25, 2021


Math 235 notes page 532

entails g ≥ 1) 324 . In other words, S \ {w} ⊆ {1, 2, . . . , m − k }. But recall that the
set S \ {w} is nonempty; thus, there exists some x ∈ S \ {w}. Consider this x. We
have x ∈ S \ {w} ⊆ {1, 2, . . . , m − k}, so that 1 ≤ x ≤ m − k, thus m − k ≥ 1 ≥ 0
and therefore m − k ∈ N.
Furthermore, it is easy to see that any subset of a k-lacunar subset is itself k-
lacunar; hence, the set S \ {w} is k-lacunar (because it is a subset of the k-lacunar
set S). Thus, S \ {w} is a k-lacunar subset of {1, 2, . . . , m − k } (since S \ {w} ⊆
{1, 2, . . . , m − k}). Hence, (458) (applied to m − k and S \ {w} instead of n and S)
yields
(m − k) + k − 1 m−1
|S \ {w}| ≤ = .
k k
Now, recall that |S \ {w}| = |S| − 1, so that

m−1 m+k−1
|S| = |S \ {w}| +1 ≤ +1 = .
| {z } k k
m−1

k
Thus, (459) is proved.
Forget that we fixed S. We thus have showed that if S is a k-lacunar subset of
m+k−1
{1, 2, . . . , m}, then |S| ≤ . In other words, Claim 1 holds for n = m. This
k
completes the induction step; thus, Claim 1 is proved.]
The second solution of Exercise 3.7.1 is more direct, and relies on the following
basic fact of enumerative combinatorics (known as the sum rule): If S1 , S2 , . . . , Sk are
k disjoint finite sets, then the set S1 ∪ S2 ∪ · · · ∪ Sk is finite and satisfies

| S1 ∪ S2 ∪ · · · ∪ S k | = | S1 | + | S2 | + · · · + | S k | . (460)

(Note that “disjoint” means “pairwise disjoint”; i.e., the k sets S1 , S2 , . . . , Sk are said
to be disjoint if and only if every two distinct elements i and j of {1, 2, . . . , k } satisfy
Si ∩ S j = ∅.) Note that this is a generalization of Theorem 2.3.6 to multiple (not
just 2) disjoint sets.
Second solution to Exercise 3.7.1. For each i ∈ {1, 2, . . . , k }, we define a set

Si = { s + i | s ∈ S } .

Roughly speaking, Si is just the set S shifted to the right by a distance of i (on the
real axis). Hence, Si has the same size as S; that is, we have

| Si | = | S | for each i ∈ {1, 2, . . . , k } . (461)

324 Weare here following the convention that {1, 2, . . . , m − k} is the empty set when m − k ≤ 0.
(Although we shall soon see that we don’t have m − k ≤ 0.)

December 25, 2021


Math 235 notes page 533

Furthermore, the sets S1 , S2 , . . . , Sk are subsets of the set {2, 3, . . . , n + k } 325 .


Hence, their union S1 ∪ S2 ∪ · · · ∪ Sk is a subset of {2, 3, . . . , n + k } as well. There-
fore,

|S1 ∪ S2 ∪ · · · ∪ Sk | ≤ |{2, 3, . . . , n + k}|


(because if A is a subset of a finite set B, then | A| ≤ | B|)
= n + k − 1.

On the other hand, since S is k-lacunar, it is easy to see that the k sets S1 , S2 , . . . , Sk
are disjoint326 . Hence, (460) yields

k k
| S1 ∪ S2 ∪ · · · ∪ S k | = | S1 | + | S2 | + · · · + | S k | = ∑ | Si | = ∑ | S | = k · | S | .
i =1 i =1
|{z}
=|S|
(by (461))

Therefore,
k · |S| = |S1 ∪ S2 ∪ · · · ∪ Sk | ≤ n + k − 1.
n+k−1
Dividing both sides of this inequality by k, we find |S| ≤ . This solves
k
Exercise 3.7.1 again.

325 Proof.We must show that Si ⊆ {2, 3, . . . , n + k } for each i ∈ {1, 2, . . . , k}. Let us do this.
So let i ∈ {1, 2, . . . , k}. Thus, 1 ≤ i ≤ k.
Let z ∈ Si . Thus, z ∈ Si = {s + i | s ∈ S}, so that z = s + i for some s ∈ S. Consider this
s. We have s ∈ S ⊆ {1, 2, . . . , n}, so that 1 ≤ s ≤ n. Now, z = |{z} i ≥ 1 + 1 = 2 and
s + |{z}
≥1 ≥1
z = |{z} i ≤ n + k. Combining these two inequalities, we obtain 2 ≤ z ≤ n + k and thus
s + |{z}
≤n ≤k
z ∈ {2, 3, . . . , n + k }.
Forget that we fixed z. We thus have shown that z ∈ {2, 3, . . . , n + k } for each z ∈ Si . In other
words, Si ⊆ {2, 3, . . . , n + k }. This completes our proof.
326 Proof. We must prove that S ∩ S = ∅ for every two distinct elements i and j of {1, 2, . . . , k }.
i j
Thus, let i and j be two distinct elements of {1, 2, . . . , k }. We must prove that Si ∩ S j = ∅.
We WLOG assume that i ≤ j (since otherwise, we can swap i with j). Hence, j − i ≥ 0. Thus,
| j − i | = j − i.
Let t ∈ Si ∩ S j . Thus, t ∈ Si ∩ S j ⊆ Si = {s + i | s ∈ S}. In other words, there exists some
s ∈ S such that t = s + i. Consider this s. From t = s + i, we obtain t − i = s ∈ S. Similarly,
t − j ∈ S. Moreover, i 6= j (since i and j are distinct) and thus t − i 6= t − j. Hence, the elements
t − i and t − j of S are distinct.
Recall that the set S is k-lacunar. In other words, every two distinct elements u, v ∈ S satisfy
|u − v| ≥ k (by the definition of “k-lacunar”). Applying this to u = t − i and v = t − j, we obtain
|(t − i ) − (t − j)| ≥ k. In other words, | j − i | ≥ k (since (t − i ) − (t − j) = j − i). In other words,
j − i ≥ k (since | j − i | = j − i). Therefore, j ≥ i + k > k (since i > 0). On the other hand, from
j ∈ {1, 2, . . . , k}, we obtain j ≤ k. This contradicts j > k.
Forget that we fixed t. We thus have obtained a contradiction for each t ∈ Si ∩ S j . Hence, there
exists no t ∈ Si ∩ S j . In other words, Si ∩ S j is an empty set. That is, Si ∩ S j = ∅. This completes
our proof.

December 25, 2021


Math 235 notes page 534

Third solution to Exercise 3.7.1 (sketched). This was suggested by one of the students.
We let q = (n − 1) //k, and we subdivide the set {1, 2, . . . , n} into q + 1 integer
intervals

I0 = {1, 2, . . . , k } ,
I1 = {k + 1, k + 2, . . . , 2k } ,
I2 = {2k + 1, 2k + 2, . . . , 3k } ,
...,
Iq−1 = {(q − 1) k + 1, (q − 1) k + 2, . . . , qk } ,
Iq = {qk + 1, qk + 2, . . . , n} .

Each of these q + 1 intervals I0 , I1 , . . . , Iq has length ≤ k (indeed, all but Iq have


length exactly k, whereas Iq has length n − qk ≤ k). Therefore, each i ∈ {0, 1, . . . , q}
satisfies
|S ∩ Ii | ≤ 1 (462)
(because otherwise, the set S ∩ Ii would contain at least two distinct elements u and
v, but then these two elements would satisfy u, v ∈ S and |u − v| < k, which would
contradict the assumption that S is k-lacunar). But the sum rule (460) yields

(S ∩ I0 ) ∪ (S ∩ I1 ) ∪ · · · ∪ S ∩ Iq
q q
= |S ∩ I0 | + |S ∩ I1 | + · · · + S ∩ Iq = ∑ ||S {z
∩ Ii | ≤ ∑ 1
i =0 i =0
}
≤1
(by (462))
n−1 n−1 n−1
   
= q+1 ≤ +1 since q = (n − 1) //k = ≤
k k k
n+k−1
= .
k

But S ⊆ {1, 2, . . . , n} and therefore S = (S ∩ I0 ) ∪ (S ∩ I1 ) ∪ · · · ∪ S ∩ Iq (since the
intervals I0 , I1 , . . . , Iq cover the entire set {1, 2, . . . , n}). Hence,
 n+k−1
|S| = (S ∩ I0 ) ∪ (S ∩ I1 ) ∪ · · · ∪ S ∩ Iq ≤ .
k
This solves Exercise 3.7.1 again.
Hint to a fourth solution to Exercise 3.7.1. This was suggested by one of the students.
This time I will be really terse, since formalizing this would take a while. We say
that the k-lacunar subset S is left-flush if it has the form

{1, k + 1, 2k + 1, 3k + 1, . . . , pk + 1}

for some p ∈ N ∪ {−1} (this allows p = −1, in which case S will be the empty
set). In other words, the k-lacunar subset S is left-flush if its smallest element is

December 25, 2021


Math 235 notes page 535

as small as possible (that is, 1), its second-smallest element is as small as possible
(that is, k + 1, because S has to be k-lacunar), its third-smallest element is as small
n+k−1
as possible (that is, 2k + 1), etc.. It is easy to see that the inequality |S| ≤
k
holds when the k-lacunar subset S is left-flush. Now, it remains to show that
we can transform any k-lacunar subset into a left-flush k-lacunar subset without
changing its size. But it is fairly clear how to do this: Just keep decreasing the
smallest element until no longer possible (i.e., until it hits 1); then do the same
with the second-smallest element (which will end up at k + 1 because the subset
must remain k-lacunar); then do the same with the third-smallest element; and so
on.

A.2.2. Discussion of Exercise 3.7.2


Discussion of Exercise 3.7.2. This is a classical problem (see, e.g., [Vorobi02, Chap-
ter 2, §12] or [Gunder10, Exercise 376] or https://artofproblemsolving.com/
community/c6h63078p376755 ).
The solution is rather similar to the solution we gave for Exercise 3.4.1 (b); but
first we need a lemma:
Lemma A.2.1. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Let a, b ∈ N be such
that a > 0 and a ≤ b. Then, gcd ( f a , f b ) = gcd ( f a , f b−a ).

Proof of Lemma A.2.1. From a > 0, we obtain a ≥ 1 and thus a − 1 ∈ N. Hence,


Exercise 2.2.3 (applied to n = b − a and m = a − 1) yields

f (b−a)+(a−1)+1 = f b−a f a−1 + f (b−a)+1 f (a−1)+1


| {z }
= fa
≡0 mod f a
≡ f b−a f a−1 + f (b−a)+1 0 = f b−a f a−1 mod f a .

In view of (b − a) + ( a − 1) + 1 = b, this rewrites as f b ≡ f b−a f a−1 mod f a . Hence,


Proposition 3.4.4 (d) (applied to f a , f b and f b−a f a−1 instead of a, b and c) yields

gcd ( f a , f b ) = gcd ( f a , f b−a f a−1 ) . (463)

But Exercise 3.5.2 (applied to n = a − 1) yields f a−1 ⊥ f (a−1)+1 (since a − 1 ∈ N).


In other words, f a−1 ⊥ f a . According to Proposition 3.5.4, this yields f a ⊥ f a−1 .
Hence, Proposition 3.5.18 (applied to f a , f b−a and f a−1 instead of a, b and c) yields
gcd ( f a , f b−a f a−1 ) = gcd ( f a , f b−a ). Thus, (463) becomes

gcd ( f a , f b ) = gcd ( f a , f b−a f a−1 ) = gcd ( f a , f b−a ) .

This proves Lemma A.2.1.

December 25, 2021


Math 235 notes page 536

We can now step to the actual solution to Exercise 3.7.2:


Solution to Exercise 3.7.2 (sketched). We use strong induction on n + m:
Induction step: Let k ∈ N. Assume (as the induction hypothesis) that Exercise
3.7.2 is true for n + m < k. We must prove that Exercise 3.7.2 is true for n + m = k.
Let us do this now, renaming n, m as a, b in order to match the notations from the
proof of Theorem 3.4.5.
So let a, b ∈ N be such that a + b = k. We must show that gcd ( f a , f b ) = f gcd(a,b) .
Note that a and b play symmetric roles in this claim327 , and thus can be swapped
at will. By swapping a and b if necessary, we can ensure that a ≤ b. Hence, we
WLOG assume that a ≤ b. Thus, b − a ∈ N.
Definition 2.2.1 easily shows that all the Fibonacci numbers f 0 , f 1 , f 2 , . . . are non-
negative328 . Thus, f gcd(a,b) is nonnegative.
It is easy to see that our claim gcd ( f a , f b ) = f gcd(a,b) holds if a = 0 329 . Thus,
we are done if a = 0. Hence, we WLOG assume that a 6= 0. Therefore, a > 0 (since
a ∈ N). Thus, a + b > b, so that b < a + b = k.
But our induction hypothesis says that Exercise 3.7.2 is true for a + b < k. Hence,
we can apply Exercise 3.7.2 to b − a instead of b (since b − a ∈ N and a + (b − a) =
b < k). We thus obtain
gcd ( f a , f b−a ) = f gcd(a,b−a) . (464)
But we have gcd ( a, b − a) = gcd ( a, b) (this has already been proved during our
proof of Theorem 3.4.5). Furthermore, Lemma A.2.1 yields

gcd ( f a , f b ) = gcd ( f a , f b−a ) = f gcd(a,b−a) (by (464))


= f gcd(a,b) (since gcd ( a, b − a) = gcd ( a, b)) .

Now, forget that we fixed a, b. We thus have shown that any a, b ∈ N satisfying
a + b = k satisfy gcd ( f a , f b ) = f gcd(a,b) . Renaming the variables a and b as n and
m in this statement, we obtain the following: Any n, m ∈ N satisfying n + m = k
satisfy gcd ( f n , f m ) = f gcd(n,m) . In other words, Exercise 3.7.2 is true for n + m = k.
This completes the induction step. Thus, Exercise 3.7.2 is solved.
327 because Proposition 3.4.4 (b) yields gcd ( a, b) = gcd (b, a) and gcd ( f a , f b ) = gcd ( f b , f a )
328 Strictlyspeaking, this can be proved by strong induction.
329 Proof. Assume that a = 0. Then, gcd ( a, b ) = b (this has already been proved during our above

proof of Theorem 3.4.5) and thus b = gcd ( a, b). Furthermore, from a = 0, we obtain f a = f 0 = 0
and therefore

gcd ( f a , f b ) = gcd (0, f b )


= gcd ( f b , 0) (by Proposition 3.4.4 (b))
= | fb | (by Proposition 3.4.4 (a))
= f gcd(a,b) (since b = gcd ( a, b))
 
= f gcd(a,b) since f gcd(a,b) is nonnegative ,

qed.

December 25, 2021


Math 235 notes page 537

A.2.3. Discussion of Exercise 3.7.3


Discussion of Exercise 3.7.3. Exercise 3.7.3 is a classic (see, e.g., [Gunder10, Exercise
22 and the paragraph thereafter]). Part (a) is a simple induction, while part (b)
follows from part (a). Here is the solution in detail:
Solution to Exercise 3.7.3. (a) We proceed by induction on n:
0
Induction base: The definition of F0 yields F0 = 22 + 1 = 21 + 1 = 3. Comparing
this with F0 F1 · · · F−1 +2 = 1 + 2 = 3, we obtain F0 = F0 F1 · · · F−1 + 2. In other
| {z }
=(empty product)=1
words, Exercise 3.7.3 (a) holds for n = 0.
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that Exercise
3.7.3 (a) holds for n = m. We must prove that Exercise 3.7.3 (a) holds for n = m + 1.
In other words, we must prove that Fm+1 = F0 F1 · · · Fm + 2.
Our induction hypothesis says that Exercise 3.7.3 (a) holds for n = m. In other
words, Fm = F0 F1 · · · Fm−1 + 2. Solving this for F0 F1 · · · Fm−1 , we obtain
 m 
2
F0 F1 · · · Fm−1 = Fm −2 = 2 + 1 − 2
|{z}
m
=22 +1
(by the definition of Fm )
m
= 22 − 1. (465)
m +1
Now, the definition of Fm+1 yields Fm+1 = 22 + 1, so that
 m +1  m +1 m
 
Fm+1 − 2 = 22 + 1 − 2 = 22 − 1 = 22 ·2 − 1 since 2m+1 = 2m · 2 .
c
But we know that ab·c = ab for any a, b, c ∈ N. Applying this to a = 2, b = 2m
m
 m 2
and c = 2, we find 22 ·2 = 22 . Hence,

m ·2
 m 2  m  m 
22 − 1 = 22 − 1 = 22 − 1 22 + 1

(since a2 − 1 = ( a − 1) ( a + 1) for any a ∈ R). Hence,


 m  m 
2m ·2 2 2
Fm+1 − 2 = 2 −1 = 2 −1 2 +1 .

Comparing this with


 m  m 
F0 F1 · · · Fm = F0 F1 · · · Fm−1 · Fm = 22 − 1 22 + 1 ,
| {z } |{z}
m
=22 −1 =22m +1
(by (465))

December 25, 2021


Math 235 notes page 538

we find Fm+1 − 2 = F0 F1 · · · Fm . In other words, Fm+1 = F0 F1 · · · Fm + 2. This is


precisely what we needed to prove. Thus, the induction step is complete, and
Exercise 3.7.3 (a) is solved.
(b) Let n and m be two distinct nonnegative integers. We must prove that
gcd ( Fn , Fm ) = 1.
Note that gcd ( Fn , Fm ) = gcd ( Fm , Fn ) (by Proposition 3.4.4 (b)). Hence, our sit-
uation is symmetric in n and m. Thus, we can WLOG assume that n ≥ m (since
otherwise, we can swap n with m). Assume this. Then, n > m (since n and m are
distinct and satisfy n ≥ m). Hence, m < n, so that m ≤ n − 1 (since m and n are
integers). Thus, m ∈ {0, 1, . . . , n − 1}, so that Fm is one of the factors in the product
F0 F1 · · · Fn−1 . Hence, Fm | F0 F1 · · · Fn−1 ; in other words, F0 F1 · · · Fn−1 ≡ 0 mod Fm .
Exercise 3.7.3 (a) yields Fn = F0 F1 · · · Fn−1 +2 ≡ 0 + 2 = 2 mod Fm . Thus, Proposi-
| {z }
≡0 mod Fm
tion 3.4.4 (d) (applied to a = Fm , b = Fn and c = 2) yields gcd ( Fm , Fn ) = gcd ( Fm , 2).
m m
But the definition of Fm yields Fm = 22 + 1. From 2m > 0, we conclude that 22
m m
is divisible by 2, so that 22 ≡ 0 mod 2. Hence, Fm = |{z} 22 +1 ≡ 0 + 1 = 1 mod 2.
≡0 mod 2
In view of Exercise 3.3.2 (d), this shows that Fm is odd. In other words, 2 - Fm . From
this, it easily follows that gcd ( Fm , 2) = 1 330 . Hence,

gcd ( Fn , Fm ) = gcd ( Fm , Fn ) = gcd ( Fm , 2) = 1.

This solves Exercise 3.7.3 (b).

A.2.4. Discussion of Exercise 3.7.4


Discussion of Exercise 3.7.4. This is clearly a followup to Exercise 1.1.1, meant to
1! · 2! · · · · · (2n)!
illustrate that can be a perfect square not just when n is even but
q!
also for some odd values of n. In order to solve this, we fix some n ∈ N, and we
recall the equality
!
n
1! · 2! · · · · · (2n)! = ∏ ((2k − 1)!)2 · 2n n! (466)
k =1

330 Proof.Proposition 3.4.4 (f) yields gcd ( Fm , 2) | Fm and gcd ( Fm , 2) | 2. But gcd ( Fm , 2) is a nonneg-
ative integer (by Proposition 3.4.3 (a)). Hence, from gcd ( Fm , 2) | 2, we conclude that gcd ( Fm , 2)
is a nonnegative divisor of 2. Since the only nonnegative divisors of 2 are 1 and 2, we thus have
either gcd ( Fm , 2) = 1 or gcd ( Fm , 2) = 2. But gcd ( Fm , 2) = 2 is impossible, since this would
yield 2 = gcd ( Fm , 2) | Fm , which would contradict 2 - Fm . Hence, the only option that remains
is gcd ( Fm , 2) = 1.

December 25, 2021


Math 235 notes page 539

that was proved in our solution to Exercise 1.1.1. (Our proof of this equality made
no use of the assumption that n be even.) Thus, for each integer n ≥ 2, we have
 
n
2
∏ ((2k − 1)!) · 2n n!
1! · 2! · · · · · (2n)!
= k =1 (by (466))
( n + 1) ! ( n + 1) !
!
n
n!
= ∏ ((2k − 1)!)2 · 2n ·
k =1
|{z}
2
( n + 1) !
=(2(n−1)/2 ) ·2 | {z }
1
=
n+1
!
n 2
 1
= ∏ ((2k − 1)!)2 · 2(n−1)/2 · 2 ·
k =1
n+1
! !2
n
2
= ∏ ((2k − 1)!) · 2(n−1)/2 · n + 1
k =1
! !2
n
2(n−1)/2
= ∏ ((2k − 1)!) · n + 1 ·2 (n + 1) . (467)
k =1
| {z }
a perfect square when n is odd
(indeed, the denominator n+1
is cancelled by the (2n−1)!
factor in the product)

1! · 2! · · · · · (2n)!
Now, we want to find odd positive integers n for which is a
( n + 1) !
perfect square. If n ≥ 2 is such an integer, then (466) suggests that 2 (n + 1) should
be a perfect square331 . In other words, we should have 2 (n + 1) = u2 for some
u2 u2
u ∈ Z. Solving this equation for n, we obtain n = − 1. For to be an
2 2
integer, u should be even (check this!), so that u = 2v for some v ∈ Z. Thus,
u2 (2v)2
n= −1 = − 1 = 2v2 − 1.
2 2
1! · 2! · · · · · (2n)!
So we have shown that is a perfect square whenever n ≥ 2 is
( n + 1) !
an integer of the form n = 2v2 − 1 for some v ∈ Z. It is clear that any integer of
this form is odd, and furthermore there are infinitely many integers of this form
that are ≥ 2. Thus, there are infinitely many odd positive integers n for which
1! · 2! · · · · · (2n)!
is a perfect square (namely, all integers of the form n = 2v2 − 1
( n + 1) !
for v ∈ Z satisfying v ≥ 2).

331 At least this is a sufficient condition. (It is also necessary, but this needs a bit more thought.)

December 25, 2021


Math 235 notes page 540

A.2.5. Discussion of Exercise 3.7.5


Discussion of Exercise 3.7.5. This is a generalization of Exercise 1.1.3 (which can be
recovered by setting m = 1). But we will solve this using Exercise 1.1.3 (so we will
not get a new solution to Exercise 1.1.3). We will use the following basic property
of sums:
Proposition A.2.2. Let S be a finite set. Let S1 , S2 , . . . , Sm be m subsets of S,
where m ∈ N. Assume that these subsets S1 , S2 , . . . , Sm are disjoint (i.e., we have
Si ∩ S j = ∅ for any two distinct elements i and j of {1, 2, . . . , m}) and their union
is S. Let as be a number for each s ∈ S. Then,

∑ as = ∑ as + ∑ as + · · · + ∑ as .
s∈S s ∈ S1 s ∈ S2 s ∈ Sm

Proposition A.2.2 is a slightly rewritten version of [Grinbe15, (26)] (with n re-


named as m).
We will also use the following simple property of floors:
Proposition A.2.3. Let x ∈ R and k ∈ Z. Then, b x + k c = b x c + k.
The proof of Proposition A.2.3 can be found in [Grinbe16, proof of Proposition
1.1.10]. (The definition of the floor of a number given in [Grinbe16] is a bit different
from the one we gave; but [Grinbe16, Corollary 1.1.6] shows that the two definitions
are equivalent.)
Solution to Exercise 3.7.5. The interval {0, 1, . . . , mn − 1} can be written as the union
of the m disjoint intervals

{0, 1, . . . , n − 1} ,
{n, n + 1, . . . , 2n − 1} ,
{2n, 2n + 1, . . . , 3n − 1} ,
...,
{(m − 1) n, (m − 1) n + 1, . . . , mn − 1}

(each containing exactly n numbers). Hence, Proposition A.2.2 shows that the sum

December 25, 2021


Math 235 notes page 541

mn−1
 
k
∑ x+ can be split into m smaller sums as follows:
k =0 n

mn−1  
k
∑ x+ n
k =0
n −1   2n−1   3n−1   mn−1  
k k k k
= ∑ x+ + ∑ x+ + ∑ x+ +···+ ∑ x+
k =0
n k=n
n k=2n
n k=(m−1)n
n
 
 
 
 
 
m −1 ( i +1) n −1   m −1 n −1 
k k + in 
= ∑ ∑ x + = ∑ ∑ x +
 
n n
 
i =0 i =0 k =0  |
| k=in {z
{z } 
k 
} 
k + in
$ %
n −1 = x +i +
= ∑ x+ n
k =0 n
(here, we have substituted k+in
for k in the sum)
m −1 n −1   m −1
k
= ∑ ∑ x+i+
n
= ∑ bnx + ni c
i =0 i =0
|k=0
| {z }
{z } =bnx c+ni
=bn( x +i )c (by Proposition A.2.3,
(by Exercise 1.1.3, applied to nx and ni instead of x and k)
applied to x +i instead of x)
m −1 m −1 m −1 m −1
= ∑ (bnx c + ni ) = ∑ bnxc + ∑ ni = m bnxc + n ∑ i
i =0
| {z } |i={z
i =0 0
} i =0
| {z }
=mbnx c m −1 =0+1+···+(m−1)
=n ∑ i =1+2+···+(m−1)
i =0

= m bnx c + n (1 + 2 + · · · + (m − 1))
| {z }
(m − 1) ((m − 1) + 1)
=
2
(by (9), applied to m−1 instead of n)
(m − 1) ((m − 1) + 1) n ( m − 1)
= m bnx c + n = m bnx c + m
| {z2 } 2
( m − 1) m n ( m − 1)
=n =m
2 2
n ( m − 1)
 
= m bnx c + .
2

This solves Exercise 3.7.5.

December 25, 2021


Math 235 notes page 542

A.2.6. Discussion of Exercise 3.7.6


Discussion of Exercise 3.7.6. This is a straightforward strong induction proof, similar
to the solution of Exercise 3.3.6. We apply strong induction on n:
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that Exercise
3.7.6 holds for all n < m. We must prove that Exercise 3.7.6 for n = m. In other
words, we must prove that

f m ≡ f m%5 · 3m//5 mod 5. (468)

If m < 5, then we can see this easily from m%5 = m and m//5 = 0. Thus,
we WLOG assume that m ≥ 5. Hence, m − 2 and m − 1 are nonnegative integers.
Since these two nonnegative integers m − 2 and m − 1 are < m, we can thus apply
Exercise 3.7.6 to n = m − 2 and to n = m − 1 (by our induction hypothesis). We
thus obtain
f m−1 ≡ f (m−1)%5 · 3(m−1)//5 mod 5
and
f m−2 ≡ f (m−2)%5 · 3(m−2)//5 mod 5.
Adding these two congruences, we obtain

f m−1 + f m−2 ≡ f (m−1)%5 · 3(m−1)//5 + f (m−2)%5 · 3(m−2)//5 mod 5.

This rewrites as

f m ≡ f (m−1)%5 · 3(m−1)//5 + f (m−2)%5 · 3(m−2)//5 mod 5 (469)

(since the recursive definition of the Fibonacci sequence yields f m = f m−1 + f m−2 ).
Our goal is now to deduce (468) from this congruence. In order to do so, it suffices
to show that

f (m−1)%5 · 3(m−1)//5 + f (m−2)%5 · 3(m−2)//5 ≡ f m%5 · 3m//5 mod 5 (470)

(because then, combining (469) with (470) will immediately yield (468) by the tran-
sitivity of congruence).
The proof of (470) is an easy case distinction. Indeed, Proposition 3.3.2 (a) (ap-
plied to n = 5 and u = m) yields that m%5 ∈ {0, 1, 2, 3, 4} and m%5 ≡ m mod 5.
Symmetry of congruence yields m ≡ m%5 mod 5 (since m%5 ≡ m mod 5). Since
m%5 ∈ {0, 1, 2, 3, 4}, we are in one of the following five cases:
Case 1: We have m%5 = 0.
Case 2: We have m%5 = 1.
Case 3: We have m%5 = 2.
Case 4: We have m%5 = 3.
Case 5: We have m%5 = 4.
Before I get to any of these cases, let me say a few generalities. We want to know
how the numbers k//5 and k%5 change when an integer k is incremented (i.e.,
increased by 1). The answer is fairly easy:

December 25, 2021


Math 235 notes page 543

Observation 1: When an integer k is incremented, its quotient k//5 upon


division by 5 stays the same unless 5 | k + 1, in which case k//5 also
increases by 1.

Observation 2: When an integer k is incremented, its remainder k%5


upon division by 5 increases by 1 unless 5 | k + 1, in which case k%5
changes from 4 to 0.

We leave the proofs of these two observations to the reader.332 Observation 1 entails
that (
(m − 1) //5, if 5 - m;
m//5 = (471)
(m − 1) //5 + 1, if 5 | m
and (
(m − 2) //5, if 5 - m − 1;
(m − 1) //5 = (472)
(m − 2) //5 + 1, if 5 | m − 1.
With these equalities in hand, let us analyze the above five cases.
We begin with Case 1. In this case, we have m%5 = 0. Thus, m ≡ m%5 = 0 mod 5.
m −1 ≡ 0 − 1 ≡ 4 mod 5 and |{z}
Thus, |{z} m −2 ≡ 0 − 2 ≡ 3 mod 5. From these
≡0 mod 5 ≡0 mod 5
three congruences, it easily follows (using Proposition 3.3.2 (c)) that m%5 = 0
and (m − 1) %5 = 4 and (m − 2) %5 = 3. Let us next express (m − 1) //5 and
(m − 2) //5 through m//5. Indeed, m%5 = 0 entails 5 | m, hence m//5 =
(m − 1) //5 + 1 (because of (471)). Solving this for (m − 1) //5, we obtain (m − 1) //5 =
m//5 − 1. Furthermore, (m − 1) %5 = 4 6= 0 entails 5 - m − 1 and therefore
(m − 1) //5 = (m − 2) //5 (by (472)). Thus, (m − 2) //5 = (m − 1) //5 = m//5 −
1. Now,

f (m−1)%5 · 3| (m−{z1)//5} + f (m−2)%5 · 3| (m−{z2)//5}


| {z } | {z }
= f4 =3m//5−1 = f3 =3m//5−1
(since (m−1)//5=m//5−1) (since (m−2)//5=m//5−1)
(since (m−1)%5=4) (since (m−2)%5=3)

= f 4 ·3m//5−1 + f 3 ·3m//5−1 = 3 · 3m//5−1 + 2 · 3m//5−1 = (3 + 2) ·3m//5−1


|{z} |{z} | {z }
=3 =2 ≡0 mod 5
≡ 0 mod 5.

Comparing this with

f ·3m//5 = f 0 ·3m//5 = 0 ≡ 0 mod 5,


|m%5
{z } |{z}
= f0 =0
(since m%5=0)

we obtain f (m−1)%5 · 3(m−1)//5 + f (m−2)%5 · 3(m−2)//5 ≡ f m%5 · 3m//5 mod 5. Thus,


we have proved (470) in Case 1.
332 We won’t actually use Observation 2; we stated it only for the sake of completeness.

December 25, 2021


Math 235 notes page 544

Next, let us handle Case 2. In this case, we have m%5 = 1. Thus, m ≡ m%5 =
m −1 ≡ 1 − 1 = 0 mod 5 and |{z}
1 mod 5. Thus, |{z} m −2 ≡ 1 − 2 ≡ 4 mod 5.
≡1 mod 5 ≡1 mod 5
From these three congruences, it easily follows (using Proposition 3.3.2 (c)) that
m%5 = 1 and (m − 1) %5 = 0 and (m − 2) %5 = 4. Let us next express (m − 1) //5
and (m − 2) //5 through m//5. Indeed, m%5 = 1 6= 0 entails 5 - m, hence
m//5 = (m − 1) //5 (because of (471)). Solving this for (m − 1) //5, we obtain
(m − 1) //5 = m//5. Furthermore, (m − 1) %5 = 0 entails 5 | m − 1 and therefore
(m − 1) //5 = (m − 2) //5 + 1 (by (472)). Thus, (m − 2) //5 = (m − 1) //5 −1 =
| {z }
=m//5
m//5 − 1. Now,

f (m−1)%5 · 3| (m−{z1)//5} + f (m−2)%5 · 3| (m−{z2)//5}


| {z } | {z }
= f0 =3m//5 = f4 =3m//5−1
(since (m−1)//5=m//5) (since (m−2)//5=m//5−1)
(since (m−1)%5=0) (since (m−2)%5=4)

= f 0 ·3m//5 + f 4 ·3m//5−1 = 3 · 3m//5−1 = 3m//5 ≡ 3m//5 mod 5.


|{z} |{z}
=0 =3

Comparing this with

f ·3m//5 = f 1 ·3m//5 = 3m//5 ≡ 3m//5 mod 5,


|m%5
{z } |{z}
= f1 =1
(since m%5=1)

we obtain f (m−1)%5 · 3(m−1)//5 + f (m−2)%5 · 3(m−2)//5 ≡ f m%5 · 3m//5 mod 5. (Actu-


ally, this holds even as an equality, not just as a congruence; i.e., the two sides are
equal.) Thus, we have proved (470) in Case 2.
We leave it to the reader to prove (470) in the remaining three cases. (In all of
these three cases, just as in Case 2, the congruence (470) holds as an equality, not
just as a congruence.)

A.2.7. Discussion of Exercise 3.7.7


Discussion of Exercise 3.7.7. Theorem 3.4.5 yields that there exist integers x ∈ Z and
y ∈ Z such that gcd ( a, b) = xa + yb. Consider these x and y, and denote them
by x 0 and y0 . (We do not want to call them x and y, since they are not the x and
y we are looking for.) Thus, x 0 and y0 are integers satisfying gcd ( a, b) = x 0 a + y0 b.
Hence, gcd ( a, b) = x 0 a + y0 b = x 0 a − (−y0 ) b.
If x 0 and −y0 are positive, then we are already done (since we can just take x = x 0
and y = −y0 ). But x 0 and −y0 might not be positive yet. The trick is now to modify
x 0 and −y0 in such a way that they become positive but the difference x 0 a − (−y0 ) b
is unchanged. (This is the same technique that we used in the solution to Exercise
3.8.5.)
How can we modify x 0 and −y0 in a way that x 0 a − (−y0 ) b is unchanged? A
simple way to do so is to add b to x 0 and subtract a from y0 (because this causes

December 25, 2021


Math 235 notes page 545

x 0 a − (−y0 ) b to become ( x 0 + b) a − (− (y0 − a)) b, which is still the same as x 0 a −


(−y0 ) b). More generally, we can pick any d ∈ Z and add db to x 0 and subtract da
from y0 . Obviously, if we pick d large enough, then this will cause x 0 and −y0 to
become positive (since b and a are positive), and we will be done.
− x 0 y0
 
Let us make this more explicit: Pick any integer d such that d > max , .
b a
(Such a d clearly  exists, since the integers are unbounded from above.) Then, we
− x 0 y0 − x0

have d > max , ≥ . Multiplying this inequality by b, we obtain
b a b 
− x 0 y0  y0
0 0
bd > − x (since b > 0), so that x + bd > 0. Furthermore, d > max , ≥ .
b a a
Multiplying this inequality by a, we obtain ad > y0 (since a > 0), so that −y0 + ad >
0. Now, we know that x 0 + bd and −y0 + ad are positive integers (since x 0 + bd > 0
and −y0 + ad > 0) and satisfy
gcd ( a, b) = x 0 + bd a − −y0 + ad b
 

(because ( x 0 + bd) a − (−y0 + ad) b = x 0 a + y0 b = gcd ( a, b)). Hence, there exist


positive integers x and y such that gcd ( a, b) = xa − yb (namely, x = x 0 + bd and
y = −y0 + ad). This solves Exercise 3.7.7.

A.2.8. Discussion of Exercise 3.7.8


Discussion of Exercise 3.7.8. Exercise 3.7.8 is a twist on the well-known fact that ev-
ery nonnegative integer has a unique base-3 representation (i.e., a unique repre-
sentation in the form bm 3m + bm−1 3m−1 + · · · + b0 30 for some m ∈ N and some
b0 , b1 , . . . , bm ∈ {0, 1, 2} with bm 6= 0). A proof of the latter can be found, e.g., in
[Newste20, §7.3, subsection on “Application: tests for divisibility”] or in [Dudley12,
Section 13, Theorem 3]. (See also [BecGeo10, §7.1], where the same proof is given
for the more familiar base-10 representation.) The solution to Exercise 3.7.8 that we
shall outline below is inspired by the proof of this fact.
Solution to Exercise 3.7.8 (sketched). In the following, a balanced ternary expression of
an integer a will mean a way to express a in the form
a = 3m + bm−1 3m−1 + bm−2 3m−2 + · · · + b0 30
with m ∈ N and b0 , b1 , . . . , bm−1 ∈ {0, 1, −1}. Thus, we must prove that any positive
integer a has a unique balanced ternary expression.
Let us first prove that no positive integer has more than one such expression. To
do so, we shall show the following lemma:
Lemma A.2.4. Let k ∈ N. If (c0 , c1 , . . . , ck ) and (d0 , d1 , . . . , dk ) are two (k + 1)-
tuples of elements of {0, 1, −1} satisfying

ck 3k + ck−1 3k−1 + · · · + c0 30 = dk 3k + dk−1 3k−1 + · · · + d0 30 , (473)


then (c0 , c1 , . . . , ck ) = (d0 , d1 , . . . , dk ).

December 25, 2021


Math 235 notes page 546

Proof of Lemma A.2.4. We shall prove Lemma A.2.4 by induction over k.


Induction base: Lemma A.2.4 holds for k = 0 (because if k = 0, then (473) simpli-
fies to c0 30 = d0 30 , which clearly implies c0 = d0 and thus (c0 ) = (d0 )).
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that Lemma
A.2.4 holds for k = m − 1. We must prove that Lemma A.2.4 holds for k = m.
Our induction hypothesis says that Lemma A.2.4 holds for k = m − 1. In other
words, if (c0 , c1 , . . . , cm−1 ) and (d0 , d1 , . . . , dm−1 ) are two m-tuples of elements of
{0, 1, −1} satisfying

cm−1 3m−1 + cm−2 3m−2 + · · · + c0 30 = dm−1 3m−1 + dm−2 3m−2 + · · · + d0 30 ,

then
( c 0 , c 1 , . . . , c m −1 ) = ( d 0 , d 1 , . . . , d m −1 ) . (474)
Now, we need to prove that Lemma A.2.4 holds for k = m. So let (c0 , c1 , . . . , cm )
and (d0 , d1 , . . . , dm ) be two (m + 1)-tuples of elements of {0, 1, −1} satisfying

c m 3 m + c m − 1 3 m − 1 + · · · + c 0 30 = d m 3 m + d m − 1 3 m − 1 + · · · + d 0 30 . (475)

Then,

dm 3m + dm−1 3m−1 + · · · + d0 30 = dm 3m + dm−1 3m−1 + · · · + d1 31 +d0 |{z}


30
| {z }
=1
=3·(dm 3m−1 +dm−1 3m−2 +···+d1 30 )
≡0 mod 3
≡ 0 + d0 · 1 = d0 mod 3

and similarly
cm 3m + cm−1 3m−1 + · · · + c0 30 ≡ c0 mod 3.
Hence,

c 0 ≡ c m 3 m + c m − 1 3 m − 1 + · · · + c 0 30
= dm 3m + dm−1 3m−1 + · · · + d0 30 (by (475))
≡ d0 mod 3.

But c0 and d0 both are elements of {0, 1, −1}, and thus can only be congruent
modulo 3 if they are equal333 . Thus, from c0 ≡ d0 mod 3, we obtain c0 = d0 . Thus,
c0 30 = d0 30 . Subtracting the latter equality from the equality (475), we obtain

cm 3m + cm−1 3m−1 + · · · + c1 31 = dm 3m + dm−1 3m−1 + · · · + d1 31 .

Dividing both sides of this new equality by 3, we find

cm 3m−1 + cm−1 3m−2 + · · · + c1 30 = dm 3m−1 + dm−1 3m−2 + · · · + d1 30 .

333 Indeed, it is easy to check that no two distinct elements of {0, 1, −1} are congruent modulo 3.

December 25, 2021


Math 235 notes page 547

Consequently, we can apply (474) to (c1 , c2 , . . . , cm ) and (d1 , d2 , . . . , dm ) instead of


(c0 , c1 , . . . , cm−1 ) and (d0 , d1 , . . . , dm−1 ). As a result, we obtain (c1 , c2 , . . . , cm ) =
(d1 , d2 , . . . , dm ). Together with c0 = d0 , this yields (c0 , c1 , . . . , cm ) = (d0 , d1 , . . . , dm ).
Forget that we fixed (c0 , c1 , . . . , cm ) and (d0 , d1 , . . . , dm ). We thus have shown that
if (c0 , c1 , . . . , cm ) and (d0 , d1 , . . . , dm ) are two (m + 1)-tuples of elements of {0, 1, −1}
satisfying (475), then (c0 , c1 , . . . , cm ) = (d0 , d1 , . . . , dm ). In other words, Lemma
A.2.4 holds for k = m. The induction step is thus complete, and Lemma A.2.4 is
proven.
Now, using Lemma A.2.4, we can easily conclude that no positive integer has

December 25, 2021


Math 235 notes page 548

more than one balanced ternary expression.334


It remains to prove that every positive integer a has some balanced ternary ex-
pression. We shall prove this by strong induction over a.
Induction step: Let b be a positive integer. Assume (as the induction hypothesis)
that every positive integer a satisfying a < b has some balanced ternary expression.
We must now show that b has some balanced ternary expression.

334 Proof.
Assume the contrary. Thus, some positive integer a has two different balanced ternary
expressions
a = 3k + ck−1 3k−1 + ck−2 3k−2 + · · · + c0 30 (476)
and
a = 3 m + d m − 1 3 m − 1 + d m − 2 3 m − 2 + · · · + d 0 30 . (477)
Consider this a and these two expressions. We WLOG assume that m ≤ k (otherwise, we could
just switch the roles of the two expressions). We set ck = 1; thus, (476) rewrites as

a = ck 3k + ck−1 3k−1 + · · · + c0 30 . (478)

We also set dm = 1; thus, (477) rewrites as

a = dm 3m + dm−1 3m−1 + · · · + d0 30 . (479)

We furthermore set dm+1 = 0, dm+2 = 0, . . ., dk = 0 (that is, we set di = 0 for each i ∈


{m + 1, m + 2, . . . , k}). Thus,

dk 3k + dk−1 3k−1 + · · · + d0 30
 
 
=  d k 3 k + d k − 1 3 k − 1 + · · · + d m + 1 3 m + 1  + d m 3 m + d m − 1 3 m − 1 + · · · + d 0 30
 
|{z} |{z} | {z }
=0 =0 =0
(since m ≤ k)
   
= 0 · 3k + 0 · 3k−1 + · · · + 0 · 3m+1 + dm 3m + dm−1 3m−1 + · · · + d0 30
| {z }
=0
m m −1
= d m 3 + d m −1 3 + · · · + d0 30 .

Hence, (479) rewrites as


a = dk 3k + dk−1 3k−1 + · · · + d0 30 . (480)
Thus, from (478), we have

ck 3k + ck−1 3k−1 + · · · + c0 30 = a = dk 3k + dk−1 3k−1 + · · · + d0 30

(by (480)). Lemma A.2.4 thus shows that (c0 , c1 , . . . , ck ) = (d0 , d1 , . . . , dk ) (since (c0 , c1 , . . . , ck )
and (d0 , d1 , . . . , dk ) are two (k + 1)-tuples of elements of {0, 1, −1}). Hence, in particular, we
have ck = dk . In other words, dk = ck = 1 6= 0. If we had m < k, then we would have dk = 0
(since we have set dm+1 = 0, dm+2 = 0, . . ., dk = 0), which would contradict dk 6= 0. Thus, we
cannot have m < k. Hence, we have m ≥ k, and therefore m = k (since m ≤ k). Now,

( c0 , c1 , . . . , c k ) = ( d0 , d1 , . . . , d k ) = ( d0 , d1 , . . . , d m ) (since k = m) .

As a consequence, the two expressions (476) and (477) are identical; this contradicts our assump-
tion that they be different. This contradiction proves that our assumption was wrong, qed.

December 25, 2021


Math 235 notes page 549

If b < 3, then b clearly has a balanced ternary expression (since 1 = 30 is a bal-


anced ternary expression of 1, whereas 2 = 31 − 30 is a balanced ternary expression
of 2). Thus, for the rest of this proof, we WLOG assume that b ≥ 3.
Theorem 3.1.8 (applied to n = 3 and u = b) yields that there exists a unique pair
( r ) ∈ Z × {0, 1, . . . , 3 − 1} such that b = q · 3 + r. Consider this pair (q, r ). From
q,
(q, r ) ∈ Z × {0, 1, . . . , 3 − 1}, we obtain q ∈ Z and r ∈ {0, 1, . . . , 3 − 1} = {0, 1, 2},
so that 0 ≤ r ≤ 2 < 3. Now,
b = q · 3 + r = 3q + |{z}
r < 3q + 3 = 3 (q + 1) ,
<3

so that 3 (q + 1) > b ≥ 3. Dividing this inequality by 3, we find q + 1 > 1, thus


q > 0. Hence, q ≥ 1 (since q ∈ Z). Thus, q is a positive integer. Hence, q + 1 is a
r ≥ 3q > q (since q > 0), thus q < b.
positive integer, too. Moreover, b = 3q + |{z}
≥0
Recall that our induction hypothesis says that every positive integer a satisfying
a < b has some balanced ternary expression. We can apply this to a = q (since q is
a positive integer and satisfies q < b). Thus, we conclude that q has some balanced
ternary expression. Let
q = 3 k + c k − 1 3 k − 1 + c k − 2 3 k − 2 + · · · + c 0 30 (481)
be this balanced ternary expression. But recall that r ∈ {0, 1, 2}; thus we are in one
of the following three cases:
Case 1: We have r = 0.
Case 2: We have r = 1.
Case 3: We have r = 2.
Let us first consider Case 1. In this case, we have r = 0. Hence,
 
r = 3q = 3 3k + ck−1 3k−1 + ck−2 3k−2 + · · · + c0 30
b = 3q + |{z} (by (481))
=0
=3 k +1
+ c k − 1 3 k + c k − 2 3 k − 1 + · · · + c 0 31
= 3k+1 + ck−1 3k + ck−2 3k−1 + · · · + c0 31 + 0 · 30 .
This is clearly a balanced ternary expression of b. Hence, we have shown that b has
some balanced ternary expression in Case 1.
Let us next consider Case 2. In this case, we have r = 1. Hence,
b = 3q + |{z}
r = 3q + 1
=1
 
= 3 3k + ck−1 3k−1 + ck−2 3k−2 + · · · + c0 30 +1 (by (481))
| {z }
=3k+1 +ck−1 3k +ck−2 3k−1 +···+c0 31

= 3k+1 + ck−1 3k + ck−2 3k−1 + · · · + c0 31 + |{z}


1
= 1 · 30
k +1 k k −1 1 0
=3 + c k −1 3 + c k −2 3 + · · · + c0 3 + 1 · 3 .

December 25, 2021


Math 235 notes page 550

This is clearly a balanced ternary expression of b. Hence, we have shown that b has
some balanced ternary expression in Case 2.
Finally, let us consider Case 3. In this case, we have r = 2. Thus, b = 3q + |{z}
r =
=2
3q + 2, so that b + 1 = (3q + 2) + 1 = 3q + 3 = 3 (q + 1). But now, from q > 0, we
obtain q + 1 < 3q + 1 < 3q + 2 = b. Recall that our induction hypothesis says that
every positive integer a satisfying a < b has some balanced ternary expression. We
can apply this to a = q + 1 (since q + 1 is a positive integer and satisfies q + 1 < b).
Thus, we conclude that q + 1 has some balanced ternary expression. Let

q + 1 = 3` + d`−1 3`−1 + d`−2 3`−2 + · · · + d0 30 (482)

be this balanced ternary expression. Then,


 
b + 1 = 3 (q + 1) = 3 3` + d`−1 3`−1 + d`−2 3`−2 + · · · + d0 30 (by (482))
= 3`+1 + d`−1 3` + d`−2 3`−1 + · · · + d0 31 ,
so that

b = 3`+1 + d`−1 3` + d`−2 3`−1 + · · · + d0 31 − 1


= 3`+1 + d`−1 3` + d`−2 3`−1 + · · · + d0 31 + (−1) · 30 .
This is again a balanced ternary expression of b. Hence, we have shown that b has
some balanced ternary expression in Case 3.
Thus, in all three cases, we have shown that b has some balanced ternary expres-
sion. Hence, this statement always holds. This completes the induction step.
Now, we have shown that every positive integer a has some balanced ternary
expression. But previously, we have shown that no positive integer has more than
one balanced ternary expression. Combining these two results, we conclude that
every positive integer a has a unique balanced ternary expression. In other words,
every positive integer a can be uniquely expressed in the form

a = 3m + bm−1 3m−1 + bm−2 3m−2 + · · · + b0 30

where m is a nonnegative integer, and where b0 , b1 , . . . , bm−1 ∈ {0, 1, −1}. This


solves Exercise 3.7.8.
[Remark: The above proof of existence of a balanced ternary expression is one
of several possible approaches. Let me sketch two others, found by students in a
different class I taught a while ago:

• Second approach: Prove that if k ∈ N and if a is a positive integer satisfying


1
a ≤ · 3k , then a has a balanced ternary expression which begins335 with a
2
335 Wesay that a balanced ternary expression of the form a = 3m + bm−1 3m−1 + bm−2 3m−2 + · · · + b0 30
begins with 3m .

December 25, 2021


Math 235 notes page 551

power of 3 that is smaller than 3k . This can be proven by induction on k.


1 1
In the induction step, you assume that a ≤ · 3k+1 . If a ≤ · 3k as well,
2 2
1
then the induction hypothesis finishes the proof; otherwise, you have · 3k <
2
1 k +1 k 1 k
a ≤ · 3 , and thus a − 3 ≤ · 3 , which means that you can apply the
2 2
induction hypothesis to a − 3k instead of a (unless a − 3k = 0, but in this
case you are done anyway). This gives you a balanced ternary expression of
a − 3k which begins with a power of 3 that is smaller than 3k . Now, either
add it to 3k or subtract it from 3k (depending on whether a − 3k = a − 3k or
a − 3k = − a − 3k ) to obtain a balanced ternary expression of a that begins


with 3k . This finishes the induction step.


• Third approach: Let a be a positive integer. We want to find a balanced ternary
expression of a.
Start with any way of writing a in the form a = cn 3n + cn−1 3n−1 + · · · + c0 30 ,
where cn , cn−1 , . . . , c0 are some integers which are ≥ −1. (For instance, you
can take n = 0 and c0 = a. Alternatively, you can take the usual ternary
representation336 of a.) Now, we shall gradually transform this representation
of a into one where cn , cn−1 , . . . , c0 are all in {0, 1, −1}.
How do we do this? We pick any i for which ci ≥ 2, and then we subtract
3 from ci while at the same time adding 1 to ci+1 337 . (For instance, if

we had a = · · · + 4 · 37 + 5 · 36 + · · · , and we take i = 6, then it becomes


a = · · · + 5 · 37 + 2 · 36 + · · · .) Of course, a single step like this does not
guarantee us that all ci are in {0, 1, −1}. However, we can perform steps like
this repeatedly, and none of the steps changes the value of the sum cn 3n +
cn−1 3n−1 + · · · + c0 (because we have added 1 to ci+1 while subtracting 3
from ci , and thus cn 3n + cn−1 3n−1 + · · · + c0 has changed by 1 · 3i+1 − 3 · 3i =
3i+1 − 3i+1 = 0). Each of these steps decreases the sum of the ci by 2 (indeed,
we subtract 3 from one of them and add 1 to another). Since this sum cannot
decrease by 2 indefinitely (after all, it is bounded from below by (n + 1) · (−1),
since there are n + 1 of the ci ’s and each of them is ≥ −1), this means that our
process will come to an end – at some point, we just won’t be able to make a
step anymore; this means that none of our ci will be ≥ 2, and that means that
what we will have then is a balanced ternary expression of a.
Did you spot the mistake? It is subtle, because it is true that our process
will come to an end. But my argument is not correct: I claimed that the
sum is bounded from below by (n + 1) · (−1). But n is not fixed; sometimes
it grows during the algorithm (when we gain a new “digit”), and “being
336 “Ternary representation” means “base-3 representation”.
337 Ifci+1 does not exist (that is, if i = n), then we change n to n + 1 and set ci+1 = 1. (That is,
we essentially extend the representation by one more “digit”, similarly to what happens to the
usual decimal representation of 999 when we add 1 to 999.)

December 25, 2021


Math 235 notes page 552

bounded from below by a bound that keeps moving down” is not “being
bounded from below”. I hope that this tripwire I inserted makes clear why
the termination of the algorithm is not obvious. Here is one way to fix the
argument: Each of the steps decreases the sum of the ci by 2, while increasing
n by at most 1. So it decreases n + (c0 + c1 + · · · + cn ) by at least 2 − 1 = 1.
And n + (c0 + c1 + · · · + cn ) is really bounded from below, namely by −1
(because each of the ci is ≥ −1), which shows that it cannot decrease by at
least 1 indefinitely.

On another note, balanced ternary representation once seemed to have a bright


future in computing.]

A.2.9. Discussion of Exercise 3.7.9


Discussion of Exercise 3.7.9. This exercise is Exercise 26 in Chapter 8 of Engel’s book
[Engel98] (although Engel forgets to require the entries of the table to be distinct,
which is important for the validity of the exercise). The following solution is essen-
tially taken from [Engel98]; I am not aware of any other solution.
Solution to Exercise 3.7.9 (sketched). We proceed by induction on m + n.
Induction base: Exercise 3.7.9 holds for m + n = 0 (because in this case we must
have m = 0 and n = 0 and therefore p = 0 and q = 0, so that pq = 0).
Induction step: Let k ∈ N. Assume (as the induction hypothesis) that Exercise
3.7.9 holds for m + n = k. We must prove that Exercise 3.7.9 holds for m + n = k + 1.
So let p, q, m, n ∈ N be such that p ≤ m and q ≤ n and m + n = k + 1. Let T be
an m × n-table of integers, with all entries distinct. Mark some of the entries in T
with a cyan marker and some with a red marker, as described in the statement of
the exercise. We must show that at least pq entries of T are marked twice (i.e., with
both colors).
Let us first simplify our language. We shall call an entry cyan if it is marked cyan,
and red if it is marked red. We shall say that an entry is 1-marked if it is marked
exactly once (i.e., either cyan or red, but not both). We shall say that an entry is
2-marked if it is marked twice. Thus, we must show that at least pq entries of T are
2-marked.
If T has no 1-marked entries, then this is easy to check338 . Hence, we WLOG
assume that T has at least one 1-marked entry. Hence, the set of all 1-marked
entries of T is nonempty; this set is also finite (obviously). Thus, this set has a

338 Proof.Assume that T has no 1-marked entries. Hence, every cyan entry of T is 2-marked (since
otherwise it would be 1-marked, but T has no 1-marked entries). However, exactly pn entries of
the table T are cyan (since T has n columns, and exactly p entries in any column are cyan). All
of these pn entries are therefore 2-marked (since every cyan entry of T is 2-marked). This entails
that at least pn entries of T are 2-marked. Therefore, at least pq entries of T are 2-marked (since
n ≥ pq). But this is precisely what we wanted to show.
p |{z}
≥q

December 25, 2021


Math 235 notes page 553

maximum339 . In other words, the largest 1-marked entry of T exists. Let M be this
largest 1-marked entry. Since M is 1-marked, this entry M is either cyan or red but
not both. In other words, we are in one of the following two cases:
Case 1: The entry M is cyan but not red.
Case 2: The entry M is red but not cyan.
Let us consider Case 1. In this case, the entry M is cyan but not red. Recalling the
definitions of the cyan and red markings, we can restate this as follows: The entry
M is one of the p largest entries in its column, but not one of the q largest entries
in its row. Let R denote the row of T that contains M. Thus, M is not one of the q
largest entries of R (since M is not one of the q largest entries in its row). Hence, the
q largest entries of R are larger than M, and therefore cannot be 1-marked (since M
is the largest 1-marked entry of T). But the q largest entries of R are red (because
they are the q largest entries in a row of T), and thus must be either 1-marked or
2-marked. Since we have just shown that they cannot be 1-marked, we conclude
that they must be 2-marked. So we have shown that the q largest entries of R are
2-marked.
Note that p > 0 (since otherwise, T would not have any cyan entries at all; but we
know that the entry M is cyan). Thus, p ≥ 1, so that p − 1 ∈ N. Also, p − 1 ≤ m − 1
(since p ≤ m).
Let us now remove the row R from the m × n-table T. The result is an (m − 1) ×
n-table T 0 . Note that the table T 0 and the row R have no entries in common (since
the entries of T are all distinct). Also, all entries of the table T 0 are distinct (for the
same reason). Let us pause this proof for an example:
Example A.2.5. For this example,  let m = 4 and  n = 4 and p = 2 and
1 2 11 9
 12 4 3 8 
q = 2, and let T be the m × n-table   5 6 13 7 . Then, the cyan entries

10 14 16 15
are 10, 12, 6, 14, 13, 16, 9, 15, whereas the red entries are 9, 11, 8, 12, 7, 13, 15, 16.
Thus, the 2-marked entries are 9, 12, 13, 15, 16, whereas the 1-marked entries are
6, 7, 8, 10, 11, 14. Hence, M (the largest 1-marked entry) is 14. This entry M = 14
is cyan, so we are in Case  1. The row Rcontaining the entry M = 14 is the last
1 2 11 9
row of T. Hence, T 0 =  12 4 3 8 .
5 6 13 7

We do not copy the cyan and red markings from T to T 0 , but instead we mark
some of the entries in T 0 as follows: In each column of T 0 , we mark the p − 1 largest
entries with a cyan marker. In each row of T 0 , we mark the q largest entries with a
red marker. Since we have (m − 1) + n = m + n} −1 = k + 1 − 1 = k, our induction
| {z
= k +1
339 Here we are using the Extremal Principle – specifically, the version thereof that says that any
nonempty finite set of integers has a largest element (i.e., a maximum). This is exactly the claim
of Proposition 2.1.2.

December 25, 2021


Math 235 notes page 554

hypothesis shows that we can apply Exercise 3.7.9 to m − 1, p − 1 and T 0 instead of


m, p and T. Thus we conclude that at least ( p − 1) q entries of T 0 are marked twice.
In other words, at least ( p − 1) q entries of T 0 are 2-marked.
Now, we shall show that every entry of T 0 that is 2-marked in T 0 is also 2-marked
in T. Indeed, we have the following two observations:

• Every entry of T 0 that is cyan in T 0 is also cyan in T. (Indeed, if an entry of


T 0 is cyan in T 0 , then it is one of the p − 1 largest entries in its column in T 0 .
Therefore, it must be one of the p largest entries in its column in T (since its
column in T differs from its column in T 0 only in having one extra entry). In
other words, it must be cyan in T.)

• Every entry of T 0 that is red in T 0 is also red in T. (Indeed, if an entry of T 0


is red in T 0 , then it is one of the q largest entries in its row in T 0 . Therefore,
it must be one of the q largest entries in its row in T (since its row in T is a
copy of its row in T 0 ). In other words, it must be red in T.)

Combining these two observations, we conclude that every entry of T 0 that is 2-


marked in T 0 is also 2-marked in T. But recall that at least ( p − 1) q entries of T 0 are
2-marked in T 0 . All these entries are therefore also 2-marked in T (since every entry
of T 0 that is 2-marked in T 0 is also 2-marked in T). Thus, we have found ( p − 1) q
entries that are 2-marked in T. Additionally, we know of another set of q entries
that are 2-marked in T: namely, the q largest entries of R are 2-marked in T. These
two sets of entries are disjoint, since the entries in the former set all come from T 0
while the entries in the latter set all come from the row R (and since the table T 0
and the row R have no entries in common). Hence, by combining these two sets
of entries, we obtain at least ( p − 1) q + q entries that are 2-marked in T. Thus, at
least ( p − 1) q + q entries of T are 2-marked. In other words, at least pq entries of
T are 2-marked (since ( p − 1) q + q = pq). Thus, in Case 1, we have shown that at
least pq entries of T are 2-marked.
An analogous argument (with the roles of m and n interchanged, the roles of p
and q interchanged, and the roles of rows and columns interchanged) proves the
same result in Case 2.
Thus, in both cases, we have shown that at least pq entries of T are 2-marked. In
other words, at least pq entries of T are marked twice.
Now, forget that we fixed m, n, p, q and T. We thus have shown that if p, q, m, n ∈
N and T are as defined in the exercise, and if m + n = k + 1, then at least pq entries
of T are marked twice (where the coloring is defined as in the statement of the
exercise). In other words, Exercise 3.7.9 holds for m + n = k + 1. This completes
the induction step. Thus, Exercise 3.7.9 is solved.

December 25, 2021


Math 235 notes page 555

A.2.10. Discussion of Exercise 3.7.10


Discussion of Exercise 3.7.10. I have taken Exercise 3.7.10 (a) from [Grinbe08, Auf-
gabe 1.27], where it is solved by a double induction (i.e., an induction nested within
the induction step of another induction)340 . I will sketch two solutions to Exercise
3.7.10.
Before we come to the solutions, let us agree on a few notations that will be used
in all of them:

• A bit shall mean an element of {0, 1}.

• We will never use the notation ab for the product of two numbers a and
b. Instead, we will denote this product by a · b. This will allow us to use
the notation ab for things like the bitstring ( a, b) without worrying about
ambiguity.

First solution to Exercise 3.7.10 (sketched). A subsequence of a bitstring a1 a2 . . . an is


defined to be a bitstring of the form ai1 ai2 . . . aim , where i1 , i2 , . . . , im are elements
of {1, 2, . . . , n} satisfying i1 < i2 < · · · < im . In other words, a subsequence of a
bitstring a is a bitstring obtained from a by removing some (possibly none or all)
entries. For example, the bitstring 011 has eight subsequences: the empty bitstring,
the one-letter bitstrings 0, 1, 1, the two-letter bitstrings 01, 01 and 11, and the en-
tire bitstring 011. Some of these subsequences are equal as bitstrings (e.g., the two
01s), but we shall nevertheless distinguish between them. More generally: We shall
distinguish two subsequences ai1 ai2 . . . aim and a j1 a j2 . . . a jm of a bitstring a1 a2 . . . an
whenever the respective m-tuples (i1 , i2 , . . . , im ) and ( j1 , j2 , . . . , jm ) are distinct (even
if the bitstrings ai1 ai2 . . . aim and a j1 a j2 . . . a jm are equal).
A bitstring will be called a comb if it has the form 0 11 . . . 1} . In other words, it
| {z
some nonzero
number of 1’s
is called a comb if it has at least 2 entries, its first entry is a 0, and all its remaining
entries are 1s.

340 Here is a very brief outline of this proof: Given a bitstring a, let n a denote the number of 0s in a
(that is, the number of entries of a equal to 0), and let k a denote the number of 1s in a. Induct
on k a . Within the induction step, induct on n a . We must prove that any sequence of moves that
can be applied successively to a must have an end. To this end, we consider the first entry of
a. If this first entry is 1, then this 1 will never be involved in any move (since a move can only
involve a 1 that has a 0 in front of it) and will never move away from its first position; thus, we
can as well pretend it does not exist, and thus our claim reduces to the situation with one fewer
1 (to which we can apply the induction hypothesis). On the other hand, if the first entry of a
is 0, then our sequence of moves (if long enough) will eventually result in this 0 being involved
in a move (since otherwise, we can as well pretend it does not exist, which again reduces the
problem to the induction hypothesis). Once this happens, the first entry becomes 1, so we are
back in the first case. When fleshing out this proof, keep in mind that we are doing an induction
within an induction; make sure to clarify which of the two induction hypotheses is being used
at which point!

December 25, 2021


Math 235 notes page 556

If a is a bitstring, then an a-comb will mean a subsequence of a that is a comb. The


comb number of a bitstring a is defined as the number of a-combs.341 For example,
the comb number of the bitstring 001011 is 17, because there are exactly seventeen
001011-combs (namely, eight copies of 01, seven copies of 011 and two copies of
0111).
We now make the following crucial observation:
Claim 1: When we apply a move to an bitstring a, the comb number of a
decreases by 1.
[Proof of Claim 1 (sketched): Let us consider a move that changes a bitstring a to
a new bitstring a0 . We must prove that the comb number of a0 equals the comb
number of a minus 1.
The move that changes a to a0 looks as follows:
a = . . . 01 . . . → . . . 100 . . . = a0
(where the two “. . .” parts remain unchanged). We shall refer to the two consec-
utive entries 01 of a that are being replaced by the move, as well as to the three
consecutive entries 100 of a0 that replace them, as mobile; all other entries of the
bitstrings a and a0 will be called frozen. We furthermore notice that the two mobile
entries of a form an a-comb (of the form 01); we call this specific a-comb trivial, and
we call all other a-combs (including all other a-combs of the form 01) nontrivial.
Now, to each nontrivial a-comb, we shall assign a certain a0 -comb. We do this as
follows:
• If a nontrivial a-comb contains none of the two mobile entries, then it remains
an a0 -comb after the move (even though its entries can shift their positions:
namely, each entry that is to the right of the mobile entries gets moved by one
step).
• If a nontrivial a-comb contains the mobile 1 but not the mobile 0, then it
remains an a0 -comb after the move (even though the mobile 1 moves one step
to the left, and the frozen entries to its right move one step to the right).
• If a nontrivial a-comb contains the mobile 0 but not the mobile 1 (and thus
begins with the mobile 0, because a 0 in a comb must necessarily be the first
entry of the comb), then we turn it into an a0 -comb by replacing the mobile 0
in a by the first of the two mobile 0s in a0 .
• If a nontrivial a-comb contains both mobile entries (and thus begins with
them, because a 0 in a comb must necessarily be the first entry of the comb),
then we turn it into an a0 -comb by replacing these two entries with the second
of the two mobile 0s in a0 . We note that the result is indeed a valid a0 -comb
(because the a-comb we started with was nontrivial, and thus contained not
only the two mobile entries but also at least one further entry).
341 Recallthat we are distinguishing two subsequences that differ in their positions in a, even if they
are equal as bitstrings.

December 25, 2021


Math 235 notes page 557

Thus, we have transformed each nontrivial a-comb into an a0 -comb. This trans-
formation is easily seen to be a 1-to-1 correspondence, because an a0 -comb cannot
contain more than one mobile entry (check this!). Hence,

(the number of nontrivial a-combs) = the number of a0 -combs .




Therefore,

the number of a0 -combs = (the number of nontrivial a-combs)




= (the number of a-combs) − 1.


In other words, the comb number of a0 equals the comb number of a minus 1. This
proves Claim 1.]
We can now easily solve part (a) of Exercise 3.7.10: If we apply a sequence of
moves (successively) to a bitstring a, then the comb number of the bitstring de-
creases by 1 during each move (by Claim 1). But the comb number (being a non-
negative integer) cannot keep decreasing by 1 indefinitely342 . Thus, our sequence
of moves cannot be infinite. This solves Exercise 3.7.10 (a).
(b) Let a be any bitstring. Let c a denote the comb number of a. Let k a denote the
number of 1s in a (that is, the number of entries of a that are equal to 1). Let n a
denote the number of 0s in a.
Let a◦ be an immovable bitstring obtained from a by performing moves until
no more moves are possible. We shall show that a◦ is uniquely determined by a
(without knowing the specific sequence of moves used to construct it).
Indeed, we first observe that a◦ must have the form 11 . . . 100 . . . 0 (that is, some
number of 1s followed by some number of 0s). Indeed, if it didn’t, then it would
have two consecutive entries 01 (check this!), and thus a move could be applied to
it; but this would contradict the fact that it is immovable.
Furthermore, any move leaves the number of 1s in a bitstring unchanged. Hence,
the number of 1s in a◦ equals the number of 1s in a (since a◦ was obtained from a
by a sequence of moves). But the latter number is k a (by definition of k a ). Hence,
the number of 1s in a◦ is k a .
The bitstring a◦ has no comb (since a◦ has the form 11 . . . 100 . . . 0). In other
words, the comb number of a◦ is 0. But the comb number of a is c a . But we know
that a◦ was obtained from a by a sequence of moves, and we know (from Claim 1)
that each move decreases the comb number of the bitstring by 1. Thus, the sequence
of moves that transformed a into a◦ must have contained precisely c a many moves
(because the comb number of a was c a , but the comb number of a◦ is 0). Since each
move increases the number of 0s in the bitstring by 1, we thus conclude that a◦ has
precisely c a more 0s than a has. In other words, the number of 0s in a◦ is n a + c a
(since a has n a many 0s).
Now we know that a◦ has the form 11 . . . 100 . . . 0, but we also know that the
number of 1s in a◦ is k a and that the number of 0s in a◦ is n a + c a . Hence, we know
342 Infact, any strictly decreasing sequence of nonnegative integers is finite (and its length cannot
surpass its first element plus 1).

December 25, 2021


Math 235 notes page 558

exactly how the bitstring a◦ looks like: It consists of k a many 1s, followed by n a + c a
many 0s. This shows that a◦ is uniquely determined by a (without knowing the
specific sequence of moves used to construct it).
It remains to show that the number of moves needed to reach a◦ is also uniquely
determined by a. But this is clear, since we have already seen that this number of
moves is c a . Exercise 3.7.10 (b) is thus completely solved.
Second solution to Exercise 3.7.10 (sketched). If a = a1 a2 . . . an is a bitstring and b is an
element of {0, 1}, then ba shall denote the bitstring ba1 a2 . . . an (that is, the bitstring
obtained by inserting b at the front of a). For example, if a = 1011 and b = 0, then
ba = 01011.
For any bitstring a, we let ones a denote the number of 1s in a (that is, the number
of entries of a that are equal to 1). (This was denoted by k a in the previous proof.)
For example, ones (01001) = 2. It is clear that any bitstring c satisfies

ones (1c) = 1 + ones c (483)

and
ones (0c) = ones c. (484)
Also, we let ε denote the empty bitstring; then,

ones ε = 0. (485)

Notice that the formulas (485), (484) and (483) (taken together) can be used to
compute the integers ones a for all bitstrings a. In fact, a bitstring a is either empty
(in which case ones a is determined by (485)), or begins with a 0 (in which case we
can use (484) to express ones a through ones c for a shorter bitstring c), or begins
with a 1 (in which case we can use (483) to express ones a through ones c for a
shorter bitstring c). Moreover, these formulas provide a unique way of computing
ones a (because for each bitstring a, only one of these three formulas has ones a on
its left hand side). Thus, if we forget how we originally defined ones a, then we
can use the formulas (485), (484) and (483) as a recursive definition of the integers
ones a for every bitstring a.
We notice that the two formulas (484) and (483) can be combined into a single
formula using the Iverson bracket notation (Definition 4.3.19): For any bitstring c
and any b ∈ {0, 1}, we have

ones (bc) = [b = 1] + ones c. (486)

(Indeed, this boils down to (484) when b = 0, and boils down to (483) when b = 1.
Since b is either 0 or 1, we thus conclude that (486) always holds.)
For any bitstring a, we let zeros a denote the number of 0s in a (that is, the
number of entries of a that are equal to 0). (This was denoted by n a in the previous
proof.) For example, zeros (01001) = 3. It is clear that any bitstring c satisfies

zeros (1c) = zeros c (487)

December 25, 2021


Math 235 notes page 559

and
zeros (0c) = 1 + zeros c. (488)
Also, the empty bitstring ε satisfies

zeros ε = 0. (489)

Again, the formulas (489), (488) and (487) (taken together) can be used as a recur-
sive definition of the integers zeros a for every bitstring a.
We notice that the two formulas (488) and (487) can be combined into a single
formula using the Iverson bracket notation: For any bitstring c and any b ∈ {0, 1},
we have
zeros (bc) = [b = 0] + zeros c. (490)
(Indeed, this boils down to (488) when b = 0, and boils down to (487) when b = 1.
Since b is either 0 or 1, we thus conclude that (490) always holds.)
We shall now define another integer load a for any bitstring a. We define it
recursively, by setting
load ε = 0 (491)
and
load (0c) = load c + 2ones c − 1 (492)
and
load (1c) = load c (493)
for any bitstring c. This is a valid definition of load a, for the same reason as
why the formulas (485), (484) and (483) provide a valid recursive definition of the
integers ones a for every bitstring a.

December 25, 2021


Math 235 notes page 560

Example A.2.6. Here is an example of how load a is computed:

load (010001) = load (10001) + 2| ones{z


(10001)
} −1 (by (492))
| {z }
=load(0001) = 22 = 4
(by (493))
= load (0001) +4 − 1
| {z }
=load(001)+2ones(001) −1
(by (492))

= load (001) + 2| ones (001)


{z } −1 + 4 − 1
| {z }
=load(01)+2ones(01) −1 =21 =2
(by (492))

= load (01) + 2| ones (01)


{z } −1 + 2 − 1 + 4 − 1
| {z }
=load(1)+2ones(1) −1 =21 =2
(by (492))

= load (1) + 2| ones (1)


{z } −1 + 2 − 1 + 2 − 1 + 4 − 1
| {z }
=load(1ε) =21 =2
=load ε
(by (493))

| {z }ε +2 − 1 + 2 − 1 + 2 − 1 + 4 − 1
= load
=0
= 2 − 1 + 2 − 1 + 2 − 1 + 4 − 1 = 6.

We notice that

load a is a nonnegative integer for every bitstring a. (494)

Indeed, this is clear from the recursive definition of load a, since the 2ones c − 1 on
the right hand side of (492) is always a nonnegative integer (because ones c ≥ 0
and thus 2ones c − 1 ≥ 20 − 1 = 0).
We notice that the two formulas (492) and (493) can be combined into a single
formula using the Iverson bracket notation: For any bitstring c and any b ∈ {0, 1},
we have
load (bc) = load c + [b = 0] · (2ones c − 1) . (495)
(Indeed, this boils down to (492) when b = 0, and boils down to (493) when b = 1.
Since b is either 0 or 1, we thus conclude that (495) always holds.)
We now claim that when we apply a move to a bitstring a,

• the number load a decreases by 1,

• the number ones a stays unchanged, and

• the number zeros a increases by 1.

December 25, 2021


Math 235 notes page 561

We shall state this claim in a slightly more formal way. First, we define a notation:
We shall use the notation “a → b” to say that a bitstring b is obtained by applying
a move to a bitstring a. Now, we claim the following:

Claim 1: Let a and b be two bitstrings such that a → b. Then, load b =


load a − 1 and ones b = ones a and zeros b = zeros a + 1.

We will prove this in the following rewritten form:

Claim 2: Let d be a bitstring. Let k ∈ N, and let b1 , b2 , . . . , bk be any


elements of {0, 1}. Then,

load (bk bk−1 . . . b1 100d) = load (bk bk−1 . . . b1 01d) − 1

and
ones (bk bk−1 . . . b1 100d) = ones (bk bk−1 . . . b1 01d)
and
zeros (bk bk−1 . . . b1 100d) = zeros (bk bk−1 . . . b1 01d) + 1.

[Proof of Claim 2: We shall prove Claim 2 by induction on k:


Induction base: For the base case, we need to prove that Claim 2 holds for k = 0. In
other words, we need to prove that load (100d) = load (01d) − 1 and ones (100d) =
ones (01d) and zeros (100d) = zeros (01d) + 1 (since the list bk bk−1 · · · b1 is empty
when k = 0). But this is an easy matter of computation: The bitstrings 100d and 01d
clearly have the same number of 1s (namely, each of them has exactly one more 1
than d). In other words, ones (100d) = ones (01d). Furthermore, the bitstring 100d
has exactly one more 0 than the bitstring 01d (since the former bitstring has two
more 0s than d, while the latter bitstring has one more 0 than d). In other words,
zeros (100d) = zeros (01d) + 1. Next, we notice that the bitstrings 0d and d have
the same number of 1s; in other words, ones (0d) = ones d. On the other hand, the
number of 1s in the bitstring 1d is larger than the number of 1s in the bitstring d by
exactly 1; in other words, ones (1d) = ones d + 1. Now,

load (01d) = load (1d) + 2| ones (1d)


{z } −1 (by (492), applied to c = 1d)
| {z }
=load d =2ones d+1
(by (493), (since ones(1d)=ones d+1)
applied to c=d)

= load d + 2ones d+1 − 1. (496)

December 25, 2021


Math 235 notes page 562

But

load (100d) = load (00d) (by (493), applied to c = 00d)


= load (0d) + 2| ones (0d)
{z } −1 (by (492), applied to c = 0d)
| {z }
=load d+2ones d −1 =2ones d
(by (492), (since ones(0d)=ones d)
applied to c=d)

= load d + 2ones d − 1 + 2ones d − 1 = load d + 2| · 2{z


ones d
} −2
=2ones d+1
 
= load d + 2ones d+1 − 2 = load d + 2ones d+1 − 1 −1 = load (01d) − 1.
| {z }
=load(01d)
(by (496))

Thus, we have shown that load (100d) = load (01d) − 1 and ones (100d) = ones (01d)
and zeros (100d) = zeros (01d) + 1. In other words, Claim 2 holds for k = 0.
Induction step: Let ` ∈ N. Assume (as the induction hypothesis) that Claim 2
holds for k = `. We must prove that Claim 2 holds for k = ` + 1.
Let b1 , b2 , . . . , b`+1 be any elements of {0, 1}. We must show that

load (b`+1 b` . . . b1 100d) = load (b`+1 b` . . . b1 01d) − 1 (497)

and
ones (b`+1 b` . . . b1 100d) = ones (b`+1 b` . . . b1 01d) (498)
and
zeros (b`+1 b` . . . b1 100d) = zeros (b`+1 b` . . . b1 01d) + 1. (499)
The induction hypothesis says that Claim 2 holds for k = `. Hence, we have

load (b` b`−1 . . . b1 100d) = load (b` b`−1 . . . b1 01d) − 1 (500)

and
ones (b` b`−1 . . . b1 100d) = ones (b` b`−1 . . . b1 01d) (501)
and
zeros (b` b`−1 . . . b1 100d) = zeros (b` b`−1 . . . b1 01d) + 1. (502)
Let c = b` b`−1 . . . b1 100d and c0 = b` b`−1 . . . b1 01d. Thus, the three equalities
(500), (501) and (502) can be rewritten as

load c = load c0 − 1

(503)

and
ones c = ones c0

(504)
and
zeros c = zeros c0 + 1.

(505)

December 25, 2021


Math 235 notes page 563

Now, b`+1 ∈ {0, 1}. Hence, (490) (applied to b = b`+1 ) yields


zeros (b`+1 c) = [b`+1 = 0] + zeros c. (506)
The same argument (applied to c0 instead of c) yields
zeros b`+1 c0 = [b`+1 = 0] + zeros c0 .
 
(507)
Hence, (506) becomes
= [b`+1 = 0] + zeros c0 +1

zeros (b`+1 c) = [b`+1 = 0] + | {z }c
zeros
| {z }
=zeros(c0 )+1 =zeros(b`+1 c0 )
(by (505)) (by (507))
= zeros b`+1 c0 + 1.

(508)
Furthermore, (486) (applied to b = b`+1 ) yields
ones (b`+1 c) = [b`+1 = 1] + ones c. (509)
The same argument (applied to c0 instead of c) yields
ones b`+1 c0 = [b`+1 = 1] + ones c0 .
 
(510)
Hence, (509) becomes
0

| {z }c = [b`+1 = 1] + ones c
ones (b`+1 c) = [b`+1 = 1] + ones
=ones(c0 )
(by (504))
= ones b`+1 c0

(511)
(by (510)).
Finally, (495) (applied to b = b`+1 ) yields
load (b`+1 c) = load c + [b`+1 = 0] · (2ones c − 1) . (512)
The same argument (applied to c0 instead of c) yields
 0

load b`+1 c0 = load c0 + [b`+1 = 0] · 2ones(c ) − 1 .
 
(513)

Hence, (512) becomes


load (b`+1 c) = | {z }c
load + [b`+1 = 0] · (2ones c − 1)
| {z }
=load(c0 )−1 0
(by (503)) =2ones(c ) −1
(by (504))
 0

= load c0 − 1 + [b`+1 = 0] · 2ones(c ) − 1

 0

= load c0 + [b`+1 = 0] · 2ones(c ) − 1 −1

| {z }
=load(b`+1 c0 )
(by (513))
= load b`+1 c0 − 1.

(514)

December 25, 2021


Math 235 notes page 564

Now, recall that

b`+1 c
|{z} = b`+1 b` b`−1 . . . b1 100d = b`+1 b` . . . b1 100d
=b` b`−1 ...b1 100d

and
b`+1 c0
|{z} = b`+1 b` b`−1 . . . b1 01d = b`+1 b` . . . b1 01d.
=b` b`−1 ...b1 01d

In light of these two equalities, we can rewrite the three equalities (514), (511) and
(508) as
load (b`+1 b` . . . b1 100d) = load (b`+1 b` . . . b1 01d) − 1
and
ones (b`+1 b` . . . b1 100d) = ones (b`+1 b` . . . b1 01d)
and
zeros (b`+1 b` . . . b1 100d) = zeros (b`+1 b` . . . b1 01d) + 1.
But these are precisely the three equalities (497), (498) and (499). So the latter three
equalities are proved.
Now, forget that we fixed b1 , b2 , . . . , b`+1 . We thus have proved the equalities
(497), (498) and (499) for any ` + 1 elements b1 , b2 , . . . , b`+1 of {0, 1}. In other words,
Claim 2 holds for k = ` + 1. This completes the induction step, so that Claim 2 is
proved.]
[Proof of Claim 1: We have a → b. In other words, the bitstring b is obtained
by applying a move to a (by the definition of the notation “a → b”). In other
words, the bitstring b is obtained from a by picking two consecutive entries 01
and replacing them by 100. In other words, there exist some k, ` ∈ N and some
elements b1 , b2 , . . . , bk , d1 , d2 , . . . , d` of {0, 1} such that

a = bk bk−1 . . . b1 01d1 d2 . . . d` (515)

and
b = bk bk−1 . . . b1 100d1 d2 . . . d` (516)
(indeed, bk , bk−1 , . . . , b1 are the entries of a to the left of the two consecutive entries
01 that are being replaced, whereas d1 , d2 , . . . , d` are the entries of a to the right of
these two consecutive entries 01). Consider these k, ` and these b1 , b2 , . . . , bk , d1 , d2 , . . . , d` .
Claim 2 (applied to d = d1 d2 . . . d` ) yields

load (bk bk−1 . . . b1 100d1 d2 . . . d` ) = load (bk bk−1 . . . b1 01d1 d2 . . . d` ) − 1

and
ones (bk bk−1 . . . b1 100d1 d2 . . . d` ) = ones (bk bk−1 . . . b1 01d1 d2 . . . d` )
and

zeros (bk bk−1 . . . b1 100d1 d2 . . . d` ) = zeros (bk bk−1 . . . b1 01d1 d2 . . . d` ) + 1.

December 25, 2021


Math 235 notes page 565

In view of (515) and (516), these three equalities rewrite as load b = load a − 1 and
ones b = ones a and zeros b = zeros a + 1. This proves Claim 1.]
Next, we introduce a notation for chains of moves. Namely, if a0 , a1 , . . . , ak are
several bitstrings343 , then the notation “a0 → a1 → · · · → ak ” shall mean that every
i ∈ {1, 2, . . . , k} satisfies ai−1 → ai (that is, every bitstring in the chain a0 → a1 →
· · · → ak is obtained from the preceding one by a move). Now, from Claim 1, we
can easily derive the following:
Claim 3: Let a0 , a1 , . . . , ak be bitstrings such that a0 → a1 → · · · → ak .
Then, load ( ak ) = load ( a0 ) − k and ones ( ak ) = ones ( a0 ) and zeros ( ak ) =
zeros ( a0 ) + k.
[Proof of Claim 3: This is straightforward to prove by induction on k (using Claim
1 in the induction step). Alternatively, we can proceed as follows: For each i ∈
{1, 2, . . . , k}, we have ai−1 → ai (since a0 → a1 → · · · → ak ), and therefore Claim 1
(applied to a = ai−1 and b = ai ) yields
load ( ai ) = load ( ai−1 ) − 1 (517)
and
ones ( ai ) = ones ( ai−1 ) (518)
and
zeros ( ai ) = zeros ( ai−1 ) + 1. (519)
Now, combining the equalities (518) for all i ∈ {1, 2, . . . , k}, we obtain
ones ( ak ) = ones ( ak−1 ) = ones ( ak−2 ) = · · · = ones ( a0 ) .
Hence, ones ( ak ) = ones ( a0 ) is proved. Furthermore, the telescope principle (specif-
ically, an application of Theorem 4.1.16) yields
k
∑ (load (ai ) − load (ai−1 )) = load (ak ) − load (a0 ) ,
i =1

so that
k k
load ( ak ) − load ( a0 ) = ∑ (|load (ai ) −{zload (ai−1 ))} = ∑ (−1)
i =1 i =1
=−1
(by (517))
= k · (−1) = −k.
Therefore, load ( ak ) = load ( a0 ) − k. Finally, the telescope principle (specifically, an
application of Theorem 4.1.16) yields
k
∑ (zeros (ai ) − zeros (ai−1 )) = zeros (ak ) − zeros (a0 ) ,
i =1
343 Note that the notation ai stands for a bitstring, not for a single entry of a bitstring here.

December 25, 2021


Math 235 notes page 566

so that
k k
zeros ( ak ) − zeros ( a0 ) = ∑ |(zeros (ai ) −{zzeros (ai−1 ))} = ∑ 1
i =1 i =1
=1
(by (519))
= k · 1 = k.

In other words, zeros ( ak ) = zeros ( a0 ) + k. This completes the proof of Claim 3.]
We can now reap the consequences of Claim 3:

Claim 4: Let a be any bitstring. Let a0 , a1 , . . . , ak be bitstrings such that


a0 → a1 → · · · → ak and a0 = a. Then, k ≤ load a.

[Proof of Claim 4: Claim 3 yields load ( ak ) = load ( a0 ) − k and ones ( ak ) =


ones ( a0 ) and zeros ( ak ) = zeros ( a0 ) + k. But (494) (applied to ak instead of a)
shows that load ( ak ) is a nonnegative integer. Hence, load ( ak ) ≥ 0. In view of
load ( ak ) = load ( a0 ) − k = load a − k (since a0 = a), this rewrites as load a − k ≥ 0.
In other words, k ≤ load a. This proves Claim 4.]
Next, a few more notations. A bitstring shall be called immovable if no move can
be applied to it. A bitstring shall be called sorted if it has the form

11 . . . 1}
| {z 00 . . . 0}
| {z .
some number of 1s some number of 0s

Here, “some number” is allowed to mean “0”; thus, for example, 111 and 00 and
the empty bitstring ε are sorted.
It is easy to see that each sorted bitstring is immovable (since it contains no two
consecutive entries 01). Now, we claim that the converse is true as well:

Claim 5: Let a be any immovable bitstring. Then, a is sorted and satisfies


load a = 0.

[Proof of Claim 5: This is easy to see in a few moments of thought, but since we
have made a habit of proving everything by induction in this solution, let us prove
Claim 5 by induction as well.
The length ` (c) of a bitstring c is defined as the number of its entries. For ex-
ample, the bitstring 010 has length ` (010) = 3. Now, we shall prove Claim 5 by
induction on ` ( a):
Induction base: It is easy to see that Claim 5 holds for ` ( a) = 0. 344 This

completes the induction base.


Induction step: Let m ∈ N. Assume (as the induction hypothesis) that Claim 5
holds for ` ( a) = m. We must prove that Claim 5 holds for ` ( a) = m + 1.

344 Indeed, if ` ( a) = 0, then a is the empty bitstring ε, and thus a is sorted (since ε is sorted) and
satisfies load a = load ε = 0.

December 25, 2021


Math 235 notes page 567

Our induction hypothesis says that Claim 5 holds for ` ( a) = m. In other words,
if a is any immovable bitstring satisfying ` ( a) = m, then
a is sorted and satisfies load a = 0. (520)
Now, let us prove that Claim 5 holds for ` ( a) = m + 1. Let a be an immovable
bitstring such that ` ( a) = m + 1. Then, a is not the empty bitstring (since a has
length ` ( a) = m + 1 > m ≥ 0). Hence, a has a well-defined first entry. In other
words, we can write a in the form a = ba0 for some b ∈ {0, 1} and some bitstring
a0 . Moreover, from a = ba0 , we see that the length of a is exactly by 1 larger than
the length of a0 (since b is a single entry). In other words, ` ( a) = ` ( a0 ) + 1. Hence,
` ( a0 ) = ` ( a) − 1 = m (since ` ( a) = m + 1).
Recall that the bitstring a is immovable. In other words, no move can be applied
to a (by the definition of “immovable”). Hence, the bitstring a contains no two
consecutive entries 01 (because if it would contain two such consecutive entries,
then we could apply a move to a that would replace these entries by 100; but this
would contradict the preceding sentence). Thus, in particular, the bitstring a cannot
begin with 01.
But the bitstring a contains the bitstring a0 as a contiguous segment (since a =
ba ). Hence, the bitstring a0 is immovable345 . Thus, a0 is an immovable bitstring
0

satisfying ` ( a0 ) = m. Hence, (520) (applied to a0 instead of a) yields that a0 is


sorted and satisfies load ( a0 ) = 0.
Now, b ∈ {0, 1}. Hence, we are in one of the following two cases:
Case 1: We have b = 0.
Case 2: We have b = 1.
Let us first consider Case 1. In this case, we have b = 0. Thus, a = |{z} b a0 = 0a0 .
=0
Recall that the bitstring a cannot begin with 01. In other words, the bitstring 0a0
cannot begin with 01 (since a = 0a0 ). However, if the bitstring a0 would begin with a
1, then the bitstring 0a0 would begin with 01, which would contradict the previous
sentence. Thus, the bitstring a0 cannot begin with a 1.
But recall that the bitstring a0 is sorted. Thus, if a0 contains any 1, then a0 must
begin with a 1. Since a0 cannot begin with a 1 (as we have just shown), we thus
conclude that a0 cannot contain any 1. Therefore, all entries of a0 are 0s. Thus,
a0 = 00 . . . 0}
| {z . Therefore,
some number of 0s

a=0 a0
|{z} =0 00 . . . 0}
| {z = 00 . . . 0}
| {z .
= 00 . . . 0}
| {z
some number of 0s some number of 0s
some number of 0s

Assume the contrary. Thus, the string a0 is not immovable. In other words, some move can
345 Proof.

be applied to a0 (by the definition of “immovable”). Hence, the bitstring a0 contains two con-
secutive entries 01 (since any move requires two consecutive entries 01). Therefore, the bitstring
a contains two consecutive entries 01 as well (since the bitstring a contains the bitstring a0 as a
contiguous segment). This contradicts the fact that the bitstring a contains no two consecutive
entries 01. Hence, our assumption was wrong, qed.

December 25, 2021


Math 235 notes page 568

Therefore, the bitstring a is sorted. Furthermore, ones ( a0 ) = 0 (since a0 cannot


contain any 1). From a = 0a0 , we obtain
0
load a = load 0a0 = load a0 + 2ones(a ) − 1 by (492), applied to c = a0
  

= load a0 + 2| 0{z since ones a0 = 0


  
− 1}
| {z }
=0 =0
= 0 + 0 = 0.

Thus, in Case 1, we have shown that the bitstring a is sorted and satisfies load a = 0.
Let us next consider Case 2. In this case, we have b = 1. Thus, a = |{z} b a0 = 1a0 .
=1
Hence, the bitstring a is sorted346 . Moreover, from a = 1a0 , we obtain

load a = load 1a0 = load a0 by (493), applied to c = a0


  

= 0.

Thus, in Case 2, we have shown that the bitstring a is sorted and satisfies load a = 0.
Hence, in each of the two Cases 1 and 2, we have shown that the bitstring a is
sorted and satisfies load a = 0. Thus, this always holds.
Now, forget that we fixed a. We thus have proved that if a is any immovable
bitstring satisfying ` ( a) = m + 1, then a is sorted and satisfies load a = 0. In other
words, Claim 5 holds for ` ( a) = m + 1. This completes the induction step. Thus,
Claim 5 is proved.]
Using Claim 3 and Claim 5, we can now easily see the following:

Claim 6: Let a be any bitstring. Let a0 , a1 , . . . , ak be bitstrings such that


a0 → a1 → · · · → ak and a0 = a. Assume that the bitstring ak is
immovable. Then,
k = load a
and
ak = 11 . . . 1}
| {z 00 . . . 0}
| {z .
ones a many 1s zeros a+load a many 0s

346 Proof. The bitstring a0 is sorted. In other words, a0 has the form a0 =
11 . . . 1}
| {z 00 . . . 0}
| {z (by the definition of “sorted”). Hence,
some number of 1s some number of 0s

a=1 a0
|{z} =1 11 . . . 1}
| {z 00 . . . 0}
| {z .
= 11 . . . 1}
| {z 00 . . . 0}
| {z
some number of 1s some number of 0s
some number of 1s some number of 0s

Therefore, the bitstring a also has the form 11 . . . 1}


| {z 00 . . . 0}
| {z . In other words, a is
some number of 1s some number of 0s
sorted (by the definition of “sorted”).

December 25, 2021


Math 235 notes page 569

[Proof of Claim 6: Claim 3 yields load ( ak ) = load ( a0 ) − k and ones ( ak ) =


ones ( a0 ) and zeros ( ak ) = zeros ( a0 ) + k. Furthermore, Claim 5 (applied to ak in-
stead of a) yields that ak is sorted and satisfies load ( ak ) = 0. Comparing load ( ak ) =
load ( a0 ) − k with load ( ak ) = 0, we obtain load ( a0 ) − k = 0. Thus, load ( a0 ) = k.
Hence, k = load ( a0 ) = load a (since a0 = a).
The bitstring ak is sorted. In other words, ak has the form

11 . . . 1}
| {z 00 . . . 0}
| {z
some number of 1s some number of 0s

(by the definition of “sorted”). In other words, there exist numbers p, q ∈ N such
that
ak = 11 . . . 1} 00
| {z . . . 0} .
| {z (521)
p many 1s q many 0s

Consider these p and q.


From (521), we see that the bitstring ak has exactly p many 1s. In other words,
the number of 1s in ak is p. In other words, ones ( ak ) = p. Hence, p = ones ( ak ) =
ones ( a0 ) = ones a (since a0 = a).
Furthermore, from (521), we see that the bitstring ak has exactly q many 0s. In
other words, the number of 0s in ak is q. In other words, zeros ( ak ) = q. Hence,
q = zeros ( ak ) = zeros ( a0 ) + k = zeros a + load a (since a0 = a and k = load a).
Thus, we know that p = ones a and q = zeros a + load a. Hence, the equality
(521) rewrites as
ak = 11 . . . 1}
| {z 00
| {z. . . 0} .
ones a many 1s zeros a+load a many 0s

This completes the proof of Claim 6.]


Solving the exercise is now just a matter of translating Claims 4 and 6 back:
(a) Let us start with a bitstring a, and consider a sequence of moves that can be
applied successively to it. We must prove that this sequence must have an end.
We shall prove a stronger claim: namely, that this sequence cannot have more than
load a moves.
Indeed, assume the contrary. Thus, this sequence has more than load a moves.
This means that we can apply more than load a moves consecutively starting at
a. Hence, in particular, we can apply load a + 1 moves consecutively starting at a.
Let a0 , a1 , . . . , aload a+1 denote the bitstrings obtained in this process (starting with
a itself). Thus, a0 → a1 → · · · → aload a+1 and a0 = a. Now, Claim 4 (applied
to k = load a + 1) yields load a + 1 ≤ load a, which is absurd. This contradiction
shows that our assumption was wrong. Hence, our claim (that our sequence of
moves cannot have more than load a moves) is proved. This solves Exercise 3.7.10
(a).
(b) Let a◦ be an immovable bitstring obtained from a by performing moves until
no more moves are possible. We must prove that this bitstring a◦ is uniquely
determined by a (independently of the sequence of moves used to obtain it). We

December 25, 2021


Math 235 notes page 570

must also show that the number of moves used to obtain a◦ from a is uniquely
determined by a.
We have assumed that a◦ is obtained from a by performing moves. Let a0 , a1 , . . . , ak
be the bitstrings obtained in this sequence of moves (starting with a and ending
with a◦ ). Thus, a0 → a1 → · · · → ak and a0 = a and ak = a◦ . Note that the number
of moves used to obtain a◦ from a through this sequence is k.
Now, the bitstring a◦ is immovable. In other words, the bitstring ak is immovable
(since ak = a◦ ). Hence, Claim 6 yields that

k = load a

and
ak = 11 . . . 1}
| {z 00 . . . 0}
| {z .
ones a many 1s zeros a+load a many 0s

Thus,
a◦ = ak = 11 . . . 1}
| {z 00 . . . 0}
| {z .
ones a many 1s zeros a+load a many 0s

This equality shows that a◦ is uniquely determined by a (since the right hand side
of this equality is clearly uniquely determined by a). Furthermore, k is uniquely
determined by a (since k = load a). In other words, the number of moves used to
obtain a◦ from a is uniquely determined by a (since the number of moves used to
obtain a◦ from a is k). Thus, Exercise 3.7.10 (b) is solved.
[Remark: The first and the second solution to Exercise 3.7.10 given above differ
mostly in their presentation. At their core, they are doing the same thing. For
example, the comb number of a bitstring a (as defined in the first solution) is pre-
cisely the number load a (as defined in the second solution). Thus, Claim 1 in the
first solution is equivalent to Claim 1 in the second. The proofs of the two Claims
1 are different, but the way they are used is also the same except for the presen-
tation. The main difference is that the first solution involved some combinatorial
handwaving (in defining a 1-to-1 correspondence between nontrivial a-combs and
a0 -combs) while the second instead relied on rigorous induction arguments. This
allowed the first solution to be shorter, at the (probable) expense of readability. I
think of the two solutions as more or less the same argument, with the first solution
being how a combinatorialist would write it up, while the second solution is how
a computer scientist would write it up.]

A.3. Homework set #2 discussion


The following are discussions of the problems on homework set #2 (Section 4.5).

A.3.1. Discussion of Exercise 4.5.1


Discussion of Exercise 4.5.1. Here is the probably most direct solution:

December 25, 2021


Math 235 notes page 571

Solution to Exercise 4.5.1. Let i ∈ {1, 2, . . . , n}. Then, ai is an odd integer (since
a1 , a2 , . . . , an are n odd integers). Thus, Exercise 3.3.2 (d) (applied to u = ai ) yields
that ai ≡ 1 mod 2. In other words, 2 | ai − 1. In other words, there exists an integer
ci such that ai − 1 = 2ci . Consider this ci .
Forget that we fixed i. Thus, for each i ∈ {1, 2, . . . , n}, we have constructed an
integer ci such that ai − 1 = 2ci . Hence, for each i ∈ {1, 2, . . . , n}, we have

ai = 2ci + 1 (522)

December 25, 2021


Math 235 notes page 572

(since ai − 1 = 2ci ). Now,


a a + a 2 a 3 + · · · + a n −1 a n + a n a 1
|1 2 {z }
n −1
= ∑ a k a k +1
k =1
n −1
= ∑ ak
|{z}
a k +1 + a n
|{z}
a1
|{z}
k =1
|{z}
=2ck +1 =2ck+1 +1 =2cn +1 =2c1 +1
(by (522)) (by (522)) (by (522)) (by (522))
n −1
= ∑ (|2ck + 1) {z
(2ck+1 + 1) + (2cn + 1) (2c1 + 1)
k =1
} | {z }
=4ck ck+1 +2ck +2ck+1 +1 =4cn c1 +2cn +2c1 +1
n −1
= ∑ (4ck ck+1 + 2ck + 2ck+1 + 1) + 4cn c1 + 2cn + 2c1 + 1
k =1
n −1 n −1 n −1 n −1
= ∑ 4ck ck+1 + ∑ 2ck + ∑ 2ck+1 + ∑ 1 + 4cn c1 + 2cn + 2c1 + 1
k =1 k =1 k =1 k =1
| {z }
n
= ∑ 2ck
k =2
(here, we have substituted k
for k+1 in the sum)
n −1 n −1 n n −1
= ∑ 4ck ck+1 + ∑ 2ck + ∑ 2ck + 4cn c1 + 2cn + 2c1 + ∑ 1 + 1
k =1 k =1 k =2
|k=1 {z }
n
= ∑ 1= n ·1= n
k =1
n −1 n −1 n
= ∑ 4ck ck+1 +4cn c1 + ∑ 2ck + 2cn + ∑ 2ck + 2c1 +n
|k=1 {z } |k=1 {z } k =2
| {z }
n −1 n n
=4 ∑ c k c k +1 = ∑ 2ck = ∑ 2ck
k =1 k =1 k =1
n n
=2 ∑ c k =2 ∑ c k
k =1 k =1
n −1 n n
=4 ∑ ck ck+1 + 4cn c1 + 2 ∑ ck + 2 ∑ ck + n
k =1 k =1 k =1
n −1 n
=4 ∑ ck ck+1 + 4cn c1 + 4 ∑ ck + n
k =1 k =1
!
n −1 n
=4 ∑ c k c k +1 + c n c 1 + ∑ c k +n ≡ 0 + n = n mod 4.
k =1 k =1
| {z }
≡0 mod 4
This solves Exercise 4.5.1.
Several variants of the above solution exist. One way to simplify it would be to

December 25, 2021


Math 235 notes page 573

discard multiples of 4 the moment they appear (rather than, as we did, at the end
of the computation). This is allowed because of (40). Another simplification can be
obtained by “making the sum cyclic”: Namely, we WLOG assume that n ≥ 1 (since
the case n = 0 is trivial). We set an+1 = a1 and cn+1 = c1 . Then,
n n +1
∑ c k +1 = ∑ ck (here, we have substituted k for k + 1 in the sum)
k =1 k =2
n n n
= n +1 = ∑ c k + c 1 = ∑ c k .
∑ ck + c|{z} (523)
k =2 k =2
= c1 k =1

Furthermore, the equality (522) holds not only for all i ∈ {1, 2, . . . , n}, but also for
i = n + 1 (since an+1 = a1 and cn+1 = c1 ). Therefore, we can apply (522) to each
i ∈ {1, 2, . . . , n + 1}. Now,
a 1 a 2 + a 2 a 3 + · · · + a n −1 a n + a n a 1
|{z}
= a n +1
= a 1 a 2 + a 2 a 3 + · · · + a n −1 a n + a n a n +1
n n
= ∑ ak
|{z}
a k +1 = ∑ (|2ck + 1) {z
(2ck+1 + 1)
k =1 k =1
|{z} }
=2ck +1 =2ck+1 +1 =4ck ck+1 +2ck +2ck+1 +1
(by (522)) (by (522))
n n n n n
= ∑ (4ck ck+1 + 2ck + 2ck+1 + 1) = ∑ 4ck ck+1 + ∑ 2ck + ∑ 2ck+1 + ∑1
k =1 k =1 k =1 k =1 k =1
| {z } | {z } | {z } |{z}
n n n = n ·1= n
= 4 ∑ c k c k +1 =2 ∑ c k =2 ∑ c k +1
k =1 k =1 k =1
n
=2 ∑ c k
k =1
(by (523))
n n n n n
= 4 ∑ c k c k +1 + 2 ∑ c k + 2 ∑ c k + n = 4 ∑ c k c k +1 + 4 ∑ c k + n
k =1 k =1 k =1 k =1 k =1
!
n n
=4 ∑ c k c k +1 + ∑ c k +n ≡ 0 + n = n mod 4.
k =1 k =1
| {z }
≡0 mod 4

Note how much simpler the computation has become after we integrated the last
addend an a1 into the sum.

A.3.2. Discussion of Exercise 4.5.2


Solution to Exercise 4.5.2. (a) Let x and y be positive integers satisfying ab = xa + yb.
We shall derive a contradiction.
We have a | a (b − x ) = ab − ax = by (since ab = xa + yb = ax + by). But a ⊥ b
(since a and b are coprime). Hence, Theorem 3.5.6 (applied to c = y) yields a | y.

December 25, 2021


Math 235 notes page 574

Hence, y ≥ a 347 . Multiplying this inequality by b, we obtain yb ≥ ab (since b is


positive).
Also, xa is positive (since x and a are positive). Hence, xa > 0. Therefore,
xa +yb > yb ≥ ab. This contradicts ab = xa + yb.
|{z}
>0
Forget that we fixed x and y. We thus have obtained a contradiction for any two
positive integers x and y satisfying ab = xa + yb. Hence, there do not exist such
integers. This solves Exercise 4.5.2 (a).
(b) Exercise 4.5.2 (a) shows that there do not exist any positive integers x and y
satisfying ab = xa + yb. In other words:

Claim 1: If x and y are two positive integers satisfying ab = xa + yb, then


a contradiction ensues.

Now, let x, y ∈ N be such that ab − a − b = xa + yb. We shall derive a contradic-


tion.
Indeed, x + 1 and y + 1 are two positive integers (since x, y ∈ N) and satisfy

ab = |ab −{za − b} + a + b = xa + yb + a + b = ( x + 1) a + (y + 1) b.
= xa+yb

Thus, Claim 1 (applied to x + 1 and y + 1 instead of x and y) yields a contradiction.


Forget that we fixed x, y. We thus have found a contradiction for any two integers
x, y ∈ N satisfying ab − a − b = xa + yb. Thus, there do not exist such integers.
This solves Exercise 4.5.2 (b).

A.3.3. Discussion of Exercise 4.5.3


Solution to Exercise 4.5.3. We have gcd (n, m) = 1 (since n and m are coprime). Thus,
ugcd(n,m) = u1 = u.
Exercise 3.4.1 (b) (applied to a = n and b = m) yields gcd (un − 1, um − 1) =
ugcd(n,m) − 1 = |u − 1| (since ugcd(n,m) = u). But each integer v satisfies |v| = ±v.
Applying this to v = u − 1, we find |u − 1| = ± (u − 1).
On the other hand, it is easy to see that un − 1 | unm − 1. Indeed, the simplest
way to prove this is as follows: Clearly, un ≡ 1 mod un − 1 (since un − 1 | un − 1).
Hence, Proposition 3.2.7 (applied to un , 1, un − 1 and m instead of a, b, n and k)
yields (un )m ≡ 1m mod un − 1. In view of (un )m = unm and 1m = 1, this rewrites as
unm ≡ 1 mod un − 1. In other words, un − 1 | unm − 1.
The same argument (with the roles of n and m interchanged) yields um − 1 |
u − 1. In other words, um − 1 | unm − 1 (since mn = nm).
mn

347 Proof.We have a | y and y 6= 0 (since y is positive). Hence, Proposition 3.1.3 (applied to y instead
of b) yields that | a| ≤ |y|. But |y| = y (since y is positive) and | a| = a (since a is positive). Hence,
a = | a| ≤ |y| = y. In other words, y ≥ a.

December 25, 2021


Math 235 notes page 575

Hence, Theorem 3.4.9 (applied to a = un − 1, b = um − 1 and c = unm − 1) yields

(un − 1) (um − 1) | gcd (un − 1, um − 1) · (unm − 1)


| {z }
=|u−1|=±(u−1)
nm
= ± ( u − 1) · ( u − 1) | (u − 1) · (unm − 1) .

This solves Exercise 4.5.3.

A.3.4. Discussion of Exercise 4.5.4


Exercise 4.5.4 (b) is a well-known result (due to Hermite in 1889) and rather popular
on mathematical contests; in particular, it appeared as Problem B2 on the Putnam
contest 2000, and as Problem 4 on the 40th Virginia Tech Regional Mathematics
Contest 2018.
Solution to Exercise 4.5.4. (a) We are in one of the following two cases:
Case 1: We have m = 0.
Case 2: We have m > 0.
Let usfirst consider / N,
Case 1. In this case, we have m = 0. Hence, m − 1 = −1 ∈
n−1

so that = 0 (by an application of (118)). Comparing this with
m−1
   
m n 1 n
m ·
= |{z} = 0,
n m n m
=0

n−1
   
m n
we obtain = . Thus, Exercise 4.5.4 (a) is solved in Case 1.
n m m−1
Let us now consider Case 2. In this case, we have m > 0. Hence, m ≥ 1 (since
m ∈ N), so that m − 1 ∈ N. Hence, (117) yields

n−1 (n − 1) ((n − 1) − 1) ((n − 1) − 2) · · · ((n − 1) − (m − 1) + 1)


 
=
m−1 ( m − 1) !
( n − 1) ( n − 2) ( n − 3) · · · ( n − m + 1)
= . (524)
( m − 1) !
On the other hand, (117) yields

n ( n − 1) ( n − 2) · · · ( n − m + 1) n ( n − 1) ( n − 2) · · · ( n − m + 1)
 
n
= =
m m! m · ( m − 1) !

December 25, 2021


Math 235 notes page 576

m
(since m! = m · (m − 1)!). Multiplying both sides of this equality by , we find
n
m n ( n − 1) ( n − 2) · · · ( n − m + 1)
 
m n
= ·
n m n m · ( m − 1) !
1 n ( n − 1) ( n − 2) · · · ( n − m + 1)
= ·
( m − 1) ! | {zn }
=(n−1)(n−2)(n−3)···(n−m+1)
1
= · ( n − 1) ( n − 2) ( n − 3) · · · ( n − m + 1)
( m − 1) !
( n − 1) ( n − 2) ( n − 3) · · · ( n − m + 1)
= .
( m − 1) !

n−1
   
m n
Comparing this with (524), we obtain = . Thus, Exercise 4.5.4 (a)
n m m−1
is solved in Case 2.
We have now solved Exercise 4.5.4 (a) in both Cases 1 and 2. This completes the
solution to Exercise 4.5.4 (a).
n−1
   
m n
(b) Exercise 4.5.4 (a) yields = . Multiplying both sides of this
 n m −1
m
n n−1
equality by n, we obtain m =n . But Theorem 4.3.15 (applied to n − 1
m m− 1 
n−1 n−1
 
and m − 1 instead of n and k) yields ∈ Z. In other words, is
  m − 1 m − 1
 
n n
an integer. Also, is an integer (for similar reasons). Now, from m =
m m
n−1 n−1
     
n
n , we obtain n | m (since is an integer). Hence, Theorem
m−1 m  m− 1  
n n
3.4.11 (applied to a = n, b = m and c = ) yields n | gcd (n, m) · .
m m
But n 6= 0 (since n > 0). Hence, Proposition 3.1.3 (d) (applied to a = n and   b=
n
    gcd (n, m) ·
n n m
gcd (n, m) · ) yields that n | gcd (n, m) · if and only if ∈
m   m n
n
gcd (n, m) ·  
m n
Z. Therefore, ∈ Z (since n | gcd (n, m) · ). Therefore,
n m
 
n
  gcd (n, m) ·
gcd (n, m) n m
= ∈ Z.
n m n

This solves Exercise 4.5.4 (b).

December 25, 2021


Math 235 notes page 577

A.3.5. Discussion of Exercise 4.5.5


Exercise 4.5.5 is a result of Erdös and Szekeres [ErdSze78, (1)]; it later re-appeared
in Crux Mathematicorum as problem 1915 and in https://artofproblemsolving.
com/community/c6h770 .
Solution to 
Exercise
 4.5.5.
 We note that
  iandj play symmetric roles in Exercise 4.5.5
n n n n
(since gcd , = gcd , ). Hence, we can WLOG assume that
i j j i
i ≤ j (since otherwise, we can swap i with j). Furthermore, j ≤ n (since j < n) and
i ≥ 0 (since i is positive). Now, we claim that
n−i
     
n j n
= . (525)
j i i j−i
[Proof of (525): The equality (525) is a particular case of the trinomial revision
formula ([Grinbe15, Proposition 3.23]), which we will eventually see in this course.
However, let us give a quick proof for it here: We have i ≤ j, thus j − i ≥ 0 and
therefore j − i ∈ N. Also, j −i ≤ n − i ≤ n (since i ≥ 0) and n − i ∈ N (since
|{z}
≤n
i ≤ j ≤ n). Now, comparing
n−i (n − i )!
   
n n!
= ·
i j−i i! · (n − i )! ( j − i )! · ((n − i ) − ( j − i ))!
| {z } | {z }
n! (n − i )!
= =
i! · (n − i )! ( j − i )! · ((n − i ) − ( j − i ))!
(by Theorem 4.3.8, (by Theorem 4.3.8,
applied to k=i) applied to n−i and j−i
instead of n and k)
n!
=
i! · ( j − i )! · ((n − i ) − ( j − i ))!
n!
=
i! · ( j − i )! · (n − j)!
(since (n − i ) − ( j − i ) = n − j)
with
  
n j n! j! n!
= · = ,
j i j! · (n − j)! i! · ( j − i )! i! · ( j − i )! · (n − j)!
| {z } |{z}
n! j!
= =
j! · (n − j)! i! · ( j − i )!
(by Theorem 4.3.8, (by Theorem 4.3.8,
applied to k= j) applied to j and i
instead of n and k)

n−i
     
n j n
we obtain = . This proves (525).]
j i i j−i

December 25, 2021


Math 235 notes page 578

n−i
      
n j n
Next, we observe that all four binomial coefficients , , and
j i i j−i
that appear in (525) belong to Z (because of Theorem 4.3.15). Hence, (525) entails
    
n n j
| . (526)
i j i
Furthermore, (117) yields

n ( n − 1) ( n − 2) · · · ( n − i + 1)
 
n 1
= = · n ( n − 1) ( n − 2) · · · ( n − i + 1)
i i! i!
1 i −1
= · ∏ (n − k) . (527)
i! k=0

The same argument (applied to j instead of n) yields

1 i −1

j
= · ∏ ( j − k) . (528)
i i! k=0

But we have j −k < n − k for each k ∈ {0, 1, . . . , i − 1}. We can multiply


|{z}
<n
these i inequalities, since each of the factors involved is positive (indeed, each
k ∈ {0, 1, . . . , i − 1} satisfies j − |{z}
k > j − i ≥ 0 and |{z}
n −k > j − k > 0). Thus,
<i >j
we obtain
i −1 i −1
∏ ( j − k) < ∏ (n − k) . (529)
k =0 k =0
(Note that this is a strict inequality, because i > 0. In fact, if i was 0, then both sides
of (529) would be empty products and thus would be equal. Trivial as it sounds,
but this is a nontrivial pitfall in working with strict inequalities.)
Now, (528) yields

1 i −1 1 i −1
  
j n
= · ∏ ( j − k) < · ∏ (n − k) = (530)
i i! k=0 i! k=0 i
| {z }
i −1
< ∏ (n−k)
k =0
(by (529))

1
(by (528)). (Note that we have tacitly used the fact that > 0 here.)
i!
Also, each of the factors j − k on the right hand side of (528) is positive (because
for each k ∈ {0, 1, . . . , i − 1}, we have j − |{z}
k > j − i ≥ 0). Thus, the entire right
< i 
j j
hand side of (528) is positive. Therefore, > 0, so that 6= 0. From (530), we
i i

December 25, 2021


Math 235 notes page 579

        
n j n n n
obtain > > 0, so that 6= 0. Hence, gcd , is a positive
i i i i j
integer (by Proposition 3.4.3 (b)).    
n n
Recall that we must prove that gcd , > 1. Indeed, assume the
    i j    
n n n n
contrary. Hence, gcd , ≤ 1, so that gcd , = 1 (since
    i j i  j  
n n n n
gcd , is a positive integer). In other words, ⊥ . Combin-
i j    i j
n j
ing this with (526), we conclude that | (by Theorem 3.5.6, applied to
     i i  
n n j n
a= ,b= and c = ). Hence, Proposition 3.1.3 (b) (applied to a =
i  j   i      i
j n j j n j
and b = ) yields ≤ (since 6= 0). Since > > 0, we
  i   i  i
 i i i
n n j j
have = and = . Thus,
i i i i
     
n n j j
= ≤ = ,
i i i i
  
n j
which contradicts > . This contradiction shows that our assumption was
i i
false. Hence, Exercise 4.5.5 is solved.

A.3.6. Discussion of Exercise 4.5.6


Discussion of Exercise 4.5.6. We shall be very terse; a detailed solution can be found
in [19s]. (Exercise 4.5.6 (a) is [19s, Exercise 2.14.4], while Exercise 4.5.6 (b) is [19s,
Exercise 2.14.5].)
(a) Assume that n > 2. Let T be the set of all i ∈ {1, 2, . . . , n} satisfying i ⊥ n.
Then, | T | = φ (n) (by the definition of φ (n)). We thus must prove that | T | is even.
The main idea is to match each i ∈ T with n − i, in a similar vein as we matched
every positive divisor of n with its complement in the solution to Exercise 3.8.3.
Here is how this works in a bit more detail: We first notice that n > 1 (since
n > 2); hence, n does not satisfy n ⊥ n. Thus, n ∈ / T, so we could just as well
have defined T as the set of all i ∈ {1, 2, . . . , n − 1} satisfying i ⊥ n. Furthermore,
n/2 ∈/ T (because we have n > 2, and thus, even if n/2 is an integer, then n/2 is
not coprime to n). Hence, each i ∈ T satisfies i 6= n/2. Therefore, we can split the
set T into two disjoint subsets X and Y defined by
X = {i ∈ T | i < n/2} and Y = {i ∈ T | i > n/2} .
These subsets X and Y are disjoint and their union is X ∪ Y = T; thus, | T | =
| X | + |Y |. Hence, if we can show that | X | = |Y |, then it will follow that | T | is even
(as desired).

December 25, 2021


Math 235 notes page 580

In order to show that | X | = |Y |, we need to find a bijection from X to Y. But


such a bijection is easy to construct: Namely, the two maps

X → Y, i 7→ n − i

and
Y → X, i 7→ n − i
are easily seen to be well-defined (because gcd (i, n) = gcd (n − i, n) for each i ∈ Z,
and because i < n/2 holds if and only if n − i > n/2) and mutually inverse (since
n − (n − i ) = i for each i ∈ Z); thus, they are bijections. Hence, we conclude that
| X | = |Y |, so that | T | = | X | + |Y | = |Y | + |Y | = 2 · |Y |, and therefore | T | is even.
|{z}
=|Y |
In other words, φ (n) is even; this solves Exercise 4.5.6 (a).
(b) This can be solved using Gauss’s “doubling trick”, which we have already
seen when solving Exercise 4.1.2. To wit, let us assume that n > 1. Let T be the set
1
of all i ∈ {1, 2, . . . , n} satisfying i ⊥ n. Then, we must prove that ∑ i = nφ (n).
i∈T 2
But notice that n ∈ / T (as we already saw in the solution to Exercise 4.5.6 (a) above);
thus, the map
T → T, i 7→ n − i
is easily seen to be well-defined (because gcd (i, n) = gcd (n − i, n) for each i ∈ Z)
and therefore a bijection (since it is its own inverse). Hence, we can substitute n − i
for i in the sum ∑ i. We thus obtain ∑ i = ∑ (n − i ). Now, Gauss’s “doubling
i∈T i∈T i∈T
trick” tells us that

2· ∑i = ∑i+ ∑i = ∑ i + ∑ (n − i )
i∈T i∈T i∈T i∈T i∈T
|{z}
= ∑ ( n −i )
i∈T

= n − i )) = ∑ n = n | T | = nφ (n)
∑ |(i + ({z
i∈T i∈T
}
=n

1
(since the definition of φ (n) yields | T | = φ (n)). Therefore, ∑ i = nφ (n). This
i∈T 2
solves Exercise 4.5.6 (b).

A.3.7. Discussion of Exercise 4.5.7


Discussion of Exercise 4.5.7. Exercise 4.5.7 is [AndTet18, Problem E25]. Here is a
sketch of the solution:
n fk
Let us fix a positive integer n, and compute the finite sum S (n) := ∑ .
k =2 f k −1 f k +1

December 25, 2021


Math 235 notes page 581

Indeed, each k ≥ 1 satisfies f k+1 = f k + f k−1 (by the definition of the Fibonacci
sequence) and thus f k = f k+1 − f k−1 and therefore

fk f − f k −1 1 1
= k +1 = − . (531)
f k −1 f k +1 f k −1 f k +1 f k −1 f k +1

Now,
n n   n n
fk 1 1 1 1
S (n) = ∑ = ∑ − = ∑ − ∑
f 1 f k +1
k=2 | k−{z k =2
f k −1 f k +1 f
k =2 k −1
f
k =2 k +1
}
1 1
= −
f k −1 f k +1
(by (531))
n −1 n +1
1 1
= ∑ fk − ∑ fk
|k={z 1
} |k={z3
}
n +1 1 1 1 n +1 1 1 1
=∑ − − =∑ − −
k =1 f k f n f n +1 k =1 f k f1 f2
 
here, we have substituted k for k − 1 in the first sum,
and substituted k for k + 1 in the second sum
! !
n +1 n +1
1 1 1 1 1 1
= ∑ − − − ∑ − −
k =1
f k f n f n + 1 k =1
f k f1 f2
1 1 1 1
= + − − . (532)
f1 f2 fn f n +1
∞fk
The sum we are looking for is ∑ = lim S (n). But (532) makes this
k =2 f k −1 f k +1 n→∞
limit easy to compute: As n goes to ∞, the Fibonacci numbers f n go to ∞ as well348 ,
1 1
and thus goes to 0, whence also goes to 0. Now,
fn f n +1
∞  
fk 1 1 1 1
∑ f k−1 f k+1 = nlim
→∞
S (n) = lim
n→∞ f 1
+ − −
f 2 f n f n + 1
(by (532))
k =2
 
1 1 1 1
= + since and go to 0 as n goes to ∞
f1 f2 fn f n +1
1 1
= + (since f 1 = 1 and f 2 = 1)
1 1
= 2.
348 There are various ways to see this. For example, it is easy to check that the sequence ( f 2 , f 3 , f 4 , . . .)
is a strictly increasing sequence of positive integers, and thus goes to ∞. Alternatively, one can
use Theorem 2.3.1 to see not only that f n goes to ∞ (since ϕn → ∞ whereas ψn → 0), but also to
see how exactly f n grows (viz., exponentially).

December 25, 2021


Math 235 notes page 582

This solves the exercise.


A few remarks about the computation (532) are in order. First, why did we
n −1 1 n +1 1 1 1 n −1 1 1 1
rewrite ∑ as ∑ − − instead of ∑ + + ? Because the for-
k =1 f k k =1 f k fn f n +1 k =3 f k f1 f2
mer works for every positive integer n, whereas the latter would only work for
n ≥ 3. Second, there is a reason why we introduced the finite sum S (n) instead
∞ fk
of working with the infinite sum ∑ ; indeed, while it is possible to per-
k =2 f k −1 f k +1
form a computation analogous to (532) on the level of infinite  sums, this would


1 1
require some nontrivial justification (e.g., in order to rewrite ∑ − as
k =2 f k −1 f k +1
∞ 1 ∞ 1 ∞ 1 ∞ 1
∑ − ∑ , we would need to prove that both sums ∑ and ∑
k =2 f k −1 k =2 f k +1 k =2 f k −1 k =2 f k +1
converge). In general, infinite sums are not worth the headache when they can be
avoided this easily.

A.3.8. Discussion of Exercise 4.5.8


Discussion of Exercise 4.5.8. Exercise 4.5.8 (a) is (part of) [Grinbe15, Exercise 3.3 (b)]
(and known as the “hockey-stick identity” or the “upper summation formula for
binomial coefficients”), whereas Exercise 4.5.8 (b) is [18f-hw2s, Exercise 4] (more
precisely, it is a generalization of the latter exercise to arbitrary complex n, but the
first two solutions of the latter exercise given in [18f-hw2s] are still valid in this
generality).
However, you can probably solve both parts by the telescope principle349 or by
induction350 before you have opened these references.

A.3.9. Discussion of Exercise 4.5.9


Discussion of Exercise 4.5.9. Here is the idea: Rewrite (16) as
√ !n √ !n
1 1+ 5 1 1− 5
fn = √ −√ .
5 2 5 2

Now apply the binomial


√ formula on the right hand side, and cancel the addends
with odd powers of 5.
Here is the argument in detail:

       
349 To i i+1 i k n
wit, part (a) uses = − , while part (b) uses (−1) =
k  k+1 k+1 k
n−1 n−1
  
(−1)k − (−1)k−1 . (Both of these equalities follow from Theorem 4.3.7.)
k k−1
350 Induction on n for part (a), and induction on m for part (b).

December 25, 2021


Math 235 notes page 583

√ √
1+ 5 1− 5
Solution to Exercise 4.5.9. Let n ∈ N. Let ϕ = and ψ = be the two
2 2
solutions of the quadratic equation X 2 − X − 1 = 0. Then, Theorem 2.3.1 yields
√ !n √ !n
1 n 1 n 1 1+ 5 1 1− 5
fn = √ ϕ − √ ψ = √ −√
5 5 5 2 5 2
| {z } | {z }
 √ n  √ n
1+ 5 1− 5
= =
2n 2n
√ √ !
1+ 5 1− 5
since ϕ = and ψ =
2 2
 √ n  √ n 
1 1+ 5 1 1− 5
= √ · −√ ·
5 2n 5 2n
| {z } | {z }
1 √ n 1 √ n
=√ · (1+ 5 ) =√ · (1− 5 )
5·2 n 5·2 n
 n  n
1 √  1 √ 
=√ · 1| +{z 5} − √ ·  1| −{z 5} 
 
5 · 2n √ 5 · 2n √
= 5+1 =− 5+1
1 √ n 1  √ n
=√ · 5+1 −√ · − 5+1
5 · 2n | {z } 5 · 2n |  {z }
n n √ k n−k n n √ k n−k
=∑ ( 5) 1 =∑ ( − 5) 1
k =0 k k =0 k
(by Theorem√ 4.3.16, (by Theorem√ 4.3.16,
applied to x = 5 and y=1) applied to x =− 5 and y=1)
n   √ k n    √ k
1 n 1 n
=√
5 · 2n
· ∑ k
5 n−k
1|{z} − √ − 5
5 · 2n
· ∑1|{z}
k
n−k

k =0 =1 k =0
√ k =1
{z } |
=(−1)k ( 5)
n   √ k n   √ k
1 n 1 n
= √ ·∑ 5 − √ ·∑ (−1) k
5
5 · 2n k =0 k 5 · 2n k =0 k
!
n   √ k n   √ k
1 n n
=√ · ∑ 5 −∑ (−1)k 5 . (533)
5·2 n
k =0
k k =0
k

December 25, 2021


Math 235 notes page 584

But
n   
n √ k n  
n √ k
∑ k 5 − ∑ k (− 1 ) k
5
k =0 k =0
n    √ k   √ k 
n n
= ∑ 5 − (−1) k
5
k =0 |
k k
  {z }
n   √ k
= 1−(−1)k ( 5)
k
n  
n  √ k
= ∑ 1 − (−1)k 5 .
k =0
k

Comparing this with


2n+1  
n   √ k
∑ k 1 − (−1) k
5
k =0
n  
n  √ k 2n+1  
n   √ k
= ∑ 1 − (−1)k 5 + ∑ 1 − (−1)k 5
k =0
k k = n +1
k
| {z }
=0
(by Proposition 4.3.4
(since k≥n+1>n))
(here, we have split the sum at n, using (84))
n  
n   √ k 2n+1   √ k
= ∑ 1 − (−1)k 5 + ∑ 0 1 − (−1)k 5
k =0
k k = n +1
| {z }
=0
n  
n  √ k
= ∑ 1 − (−1)k 5 ,
k =0
k

December 25, 2021


Math 235 notes page 585

we obtain
n   √ k n   √ k
n n
∑ k 5 − ∑ k (− 1 ) k
5
k =0 k =0
2n+1  
n  √ k
= ∑ k
1 − (−1) k
5
k =0
|{z}
= ∑
k ∈{0,1,...,2n+1}
 
n  √ k
= ∑ k
1 − (−1) k
5
k∈{0,1,...,2n+1}
   
 
n   √ k  
n   √ k
= ∑ 1 − (−1) k
5 + ∑ 1 − (−1) k
5
 
k  k 
 
k∈{0,1,...,2n+1}; k∈{0,1,...,2n+1};
| {z }  | {z } 
k is even
=1 k is odd
=−1
(since k is even) (since k is odd)
(here, we used Theorem 4.1.20)
 
n √ k  
n √ k
= ∑ k
( 1 − 1 ) 5 + ∑ k
( 1 − (− 1 )) 5
k∈{0,1,...,2n+1}; k∈{0,1,...,2n+1};
| {z } | {z }
=0 =2
k is even k is odd
n √
   
k
   
n √ k
= ∑ k
·0 5 + ∑ k
·2 5
k∈{0,1,...,2n+1}; k∈{0,1,...,2n+1};
k is even k is odd
| {z }
=0
   
n √ k √ k
  
n
= ∑ k
·2 5 =2 ∑ k
5
k∈{0,1,...,2n+1}; k∈{0,1,...,2n+1};
k is odd k is odd

n

√ 2i+1
=2 ∑ 2i + 1
5 (534)
i ∈{0,1,...,n}

(here, we have substituted 2i + 1 for k in the sum, since the map

{0, 1, . . . , n} → {k ∈ {0, 1, . . . , 2n + 1} | k is odd} ,


i 7→ 2i + 1

is a bijection351 ).

351 Thisis just saying that the odd integers in {0, 1, . . . , 2n + 1} are 1, 3, 5, . . . , 2n + 1 (and these num-
bers are all distinct).

December 25, 2021


Math 235 notes page 586

Hence, (533) becomes


!
1 n
  
n √ k n  
n √ k
fn = √ · ∑ 5 −∑ (−1)k 5
5·2 n
k =0
k k =0
k
|  {z  }
n √ 2i+1
=2 ∑ ( 5)
i ∈{0,1,...,n} 2i + 1
(by (534))
1

n
 
√ 2i+1
=√
5 · 2n
·2 ∑ 2i + 1
5
i ∈{0,1,...,n}
√ 2i+1
2

n
 5
= ∑
2n i∈{0,1,...,n 2i + 1

5
|{z} } | {z }
1 | {z
n
} √ 2i  √ 2 i
= = ( 5 ) = ( 5 ) = 5i
2n −1 =∑
i =0
n 
1 n
  
1 n n
= n −1 ∑ 5 = n −1 ∑
i
5k
2 i =0
2i + 1 2 k =0
2k + 1

(here, we have renamed the summation index i as k). Multiplying both sides of this
equality by 2n−1 , we obtain
n  
n
2 n −1
· fn = ∑ 5k .
k =0
2k + 1

This solves Exercise 4.5.9.

A.3.10. Discussion of Exercise 4.5.10


Discussion of Exercise 4.5.10. The quickest way to prove part (a) is by defining the
“Fibonacci factorial” m! F ofany  m ∈ N to be the product f 1 f 2 · · · f m , and then
n n! F
showing that if k ≤ n, then = (an analogue of Theorem 4.3.8).
k F k! F (n − k )! F
Parts (b) and (c) 
are[18f-hw3s, Exercise 4].
n
The numbers are known as Fibonomial coefficients (entering these words
k F
in Google Scholar will produce a noticeable amount of literature), and are one of
several analogues of binomial coefficients known.
A combinatorial solution to Exercise 4.5.10 (c) can be found in [BenPlo08].
For the sake of completeness, let us give a detailed solution to Exercise 4.5.10 (a)
(while detailed solutions to parts (b) and (c) can be found in [18f-hw3s, Exercise
4]):

December 25, 2021


Math 235 notes page 587

Solution to Exercise 4.5.10 (a). For each m ∈ N, define the positive integer m! F by

m! F = f 1 f 2 · · · f m . (535)

(This is indeed a positive integer, because it is easy to see that the Fibonacci num-
bers f 1 , f 2 , . . . , f m all are positive352 .)
We first show the following auxiliary fact:

Claim 1: Let n ∈ N and k ∈ N satisfy k ≤ n. Then,


 
n n! F
= .
k F k! F (n − k)! F

 [Proof
 of Claim 1: We have k ≤ n, thus n ≥ k ≥ 0 (since k ∈ N). The definition of
n
yields
k F

 
n  f n f n−1 · · · f n−k+1 , if n ≥ k ≥ 0;

= f k f k −1 · · · f 1
k F  0, otherwise
f n f n −1 · · · f n − k +1
= (since n ≥ k ≥ 0) .
f k f k −1 · · · f 1
In view of

f n f n −1 · · · f n − k +1 = ( f n f n −1 · · · f 1 ) / ( f n − k f n − k −1 · · · f 1 )
| {z } | {z }
= f 1 f 2 ··· f n = f 1 f 2 ··· f n−k
=n! F =(n−k)! F
(since n! F was defined to be f 1 f 2 ··· f n ) (since (n−k)! F was defined to be f 1 f 2 ··· f n−k )

(since ( f n f n−1 · · · f n−k+1 ) · ( f n−k f n−k−1 · · · f 1 ) = f n f n−1 · · · f 1 )


= n! F / (n − k)! F
and

f k f k−1 · · · f 1 = f 1 f 2 · · · f k = k! F (since k! F was defined to be f 1 f 2 · · · f k ) ,


this rewrites as
n! / (n − k )! F
 
n n! F
= F = .
k F k! F k! F (n − k )! F
This proves Claim 1.]
Now, let n ∈ N and k ∈ N. We must prove that
   
n n
= . (536)
k F n−k F
352 becausethe Fibonacci sequence ( f 0 , f 1 , f 2 , . . .) is weakly increasing (this is easily seen from its
recursive definition) and its entry f 1 = 1 is already positive

December 25, 2021


Math 235 notes page 588

We are in one of the following two cases:


Case 1: We have k ≤ n.
Case 2: We have k > n.
Let us first consider Case 1. In this case, we have k ≤ n. Hence, n − k ∈ N. Also,
n − k ≤ n (since k ≥ 0). Now, Claim 1 yields
 
n n! F
= (since k ≤ n) .
k F k! F (n − k )! F
On the other hand, Claim 1 (applied to n − k instead of k) yields
 
n n! F
= (since n − k ∈ N and n − k ≤ n)
n−k F (n − k)! F (n − (n − k))! F
n! F
= (since n − (n − k) = k)
(n − k)! F k! F
n! F
= .
k! F (n − k)! F
   
n n
Comparing these two equalities, we obtain = . This proves (536) in
k F n−k F
Case 1.
Let us now consider Case 2. In this case, we have k > n. Hence, we don’t have
n ≥ k ≥ 0 (since n ≥ k would contradict k > n). Also, n − k < 0 (since k > n).
  n ≥ n − k ≥ 0 (since n − k ≥ 0 would contradict n − k < 0).
Hence, we don’t have
n
The definition of yields
k F

 
n  f n f n−1 · · · f n−k+1 , if n ≥ k ≥ 0;

= f k f k −1 · · · f 1
k F  0, otherwise
=0 (since we don’t have n ≥ k ≥ 0) .
 
n
On the other hand, the definition of yields
n−k F


n
  f n f n−1 · · · f n−(n−k)+1 , if n ≥ n − k ≥ 0;

= f n−k f (n−k)−1 · · · f 1
n−k F 
0, otherwise

=0 (since we don’t have n ≥ n − k ≥ 0) .


   
n n
Comparing these two equalities, we find = . This proves (536) in
k F n−k F
Case 2.
We have now proved (536) in each of the two Cases 1 and 2. Thus, (536) always
holds. This solves Exercise 4.5.10 (a).

December 25, 2021


Math 235 notes page 589

A.4. Homework set #3 discussion


The following are discussions of the problems on homework set #3 (Section 4.8).

A.4.1. Discussion of Exercise 4.8.1


Discussion of Exercise 4.8.1. We shall first prove part (a) of Exercise 4.8.1. Then, we
will show a general result (Theorem A.4.1) that will allow us to derive parts (b)
and (c) from part (a).
Recall that
a n = 1 + a n −1 a n −2 for each integer n ≥ 2. (537)
(a) Fix n ∈ N. We claim that
ak+n ≡ ak mod an for each k ∈ N. (538)
[Proof of (538): We proceed by strong induction on k:
Induction step: Let p ∈ N. Assume (as the induction hypothesis) that (538) holds
for k < p. We must now prove that (538) holds for k = p. In other words, we must
prove that a p+n ≡ a p mod an .
n = p and thus
If n = 0, then this is obvious (because if n = 0, then p + |{z}
=0
a p+n = a p ≡ a p mod an ). Hence, for the rest of this proof, we WLOG assume that
n 6= 0. Hence, n ≥ 1 (since n ∈ N).
We have p ∈ N. Hence, we are in one of the following three cases:
Case 1: We have p = 0.
Case 2: We have p = 1.
Case 3: We have p ≥ 2.
Let us first consider Case 1. In this case, we have p = 0. Thus, a p = a0 = 0. On
the other hand, p +n = 0 + n = n, so that a p+n = an ≡ 0 mod an . This rewrites
|{z}
=0
as a p+n ≡ a p mod an (since a p = 0). Thus, a p+n ≡ a p mod an is proved in Case 1.
Let us next consider Case 2. In this case, we have p = 1. Thus, a p = a1 = 1. On
the other hand, p +n = 1 + n = n + 1, so that a p+n = an+1 . Note that n + 1 ≥ 2
|{z}
=1
(since n ≥ 1). Hence, (537) (applied to n + 1 instead of n) yields
an+1 = 1 + a(n+1)−1 a(n+1)−2 = 1 + an an−1 ≡ 1 + 0an−1 = 1 mod an .
|{z}
≡0 mod an

In view of a p+n = an+1 and a p = 1, this rewrites as a p+n ≡ a p mod an . Thus,


a p+n ≡ a p mod an is proved in Case 2.
At last, let us consider Case 3. In this case, we have p ≥ 2. Hence, p − 1 ∈ N
and p − 2 ∈ N.
We have assumed that (538) holds for k < p. Hence, we can apply (538) to
k = p − 1 (since p − 1 ∈ N and p − 1 < p). Thus, we obtain
a( p−1)+n ≡ a p−1 mod an . (539)

December 25, 2021


Math 235 notes page 590

We have assumed that (538) holds for k < p. Hence, we can apply (538) to
k = p − 2 (since p − 2 ∈ N and p − 2 < p). Thus, we obtain
a( p−2)+n ≡ a p−2 mod an . (540)
However, p ≥ 2. Hence, (537) (applied to p instead of n) yields
a p = 1 + a p −1 a p −2 . (541)
Also, n ≥ 0, so that p + n ≥ p ≥ 2. Hence, (537) (applied to p + n instead of n)
yields
a p+n = 1 + a( p+n)−1 a( p+n)−2 = 1 + a( p−1)+n a( p−2)+n
| {z } | {z }
≡ a p−1 mod an ≡ a p−2 mod an
(by (539)) (by (540))

(since ( p + n) − 1 = ( p − 1) + n and ( p + n) − 2 = ( p − 2) + n)
≡ 1 + a p−1 a p−2 = a p mod an (by (541)) .
Thus, a p+n ≡ a p mod an is proved in Case 3.
We have now proved a p+n ≡ a p mod an in each of the three Cases 1, 2 and 3.
Hence, a p+n ≡ a p mod an always holds. In other words, (538) holds for k = p. This
completes the induction step. Thus, (538) is proven.]
This solves Exercise 4.8.1 (a).
Let us now forget the sequence ( a0 , a1 , a2 , . . .) defined in Exercise 4.8.1. Instead,
we shall prove a general property of a wider class of sequences:
Theorem A.4.1. Let ( a0 , a1 , a2 , . . .) be any sequence of integers. Assume that we
have
ak+n ≡ ak mod an for any k ∈ N and n ∈ N. (542)
Then:
(a) If u, v ∈ N satisfy u | v, then au | av .
(b) For any n, m ∈ N, we have gcd ( an , am ) = agcd(n,m) .

Proof of Theorem A.4.1. We shall prove Theorem A.4.1 (b) first, since Theorem A.4.1
(a) follows easily from it. Of course, it is not much harder to prove Theorem A.4.1
(a) independently, by strong induction on v (or induction on v/u).
(b) This will be a calque of our solution to Exercise 3.4.1 (b). Why innovate when
you can just imitate?
We shall prove Theorem A.4.1 (b) by strong induction on n + m:
Induction step: Let k ∈ N. Assume (as the induction hypothesis) that Theorem
A.4.1 (b) is true for n + m < k. We must prove that Theorem A.4.1 (b) is true for
n + m = k.
So let n, m ∈ N be such that n + m = k. We must show that gcd ( an , am ) =
agcd(n,m) .
Note that n and m play symmetric roles in this claim353 , and thus can be swapped
353 because Proposition 3.4.4 (b) yields gcd ( an , am ) = gcd ( am , an ) and gcd (n, m) = gcd (m, n)

December 25, 2021


Math 235 notes page 591

at will. By swapping n and m if necessary, we can ensure that n ≤ m. Hence, we


WLOG assume that n ≤ m. Thus, m − n ∈ N.
It is easy to see that our claim gcd ( an , am ) = agcd(n,m) holds if n = 0 354 . Thus,
we are done if n = 0. Hence, we WLOG assume that n 6= 0. Therefore, n > 0 (since
n ∈ N). Thus, n + m > m, so that m < n + m = k.
But our induction hypothesis says that Theorem A.4.1 (b) is true for n + m < k.
Hence, we can apply Theorem A.4.1 (b) to m − n instead of m (since m − n ∈ N
and n + (m − n) = m < k). We thus obtain

gcd ( an , am−n ) = agcd(n,m−n) . (543)

But we have m − |{z}


n ≡ m mod n, and thus gcd (n, m − n) = gcd (n, m) (by
≡0 mod n
Proposition 3.4.4 (d), applied to a = n, b = m − n and c = m). Furthermore, (542)
(applied to m − n instead of k) yields a(m−n)+n ≡ am−n mod an (since m − n ∈ N).
In other words, am ≡ am−n mod an (since (m − n) + n = m). Hence, Proposition
3.4.4 (d) (applied to an , am and am−n instead of a, b and c) yields

gcd ( an , am ) = gcd ( an , am−n ) = agcd(n,m−n) (by (543))

= agcd(n,m) (since gcd (n, m − n) = gcd (n, m)) .

Now, forget that we fixed n, m. We thus have shown that any n, m ∈ N satisfying
n + m = k satisfy gcd ( an , am ) = agcd(n,m) . In other words, Theorem A.4.1 (b) is
true for n + m = k. This completes the induction step. Thus, Theorem A.4.1 (b) is
proved.
(a) Let us now prove Theorem A.4.1 (a). This is easy after part (b) has already
been shown:
Let u, v ∈ N be such that u | v. We must show that au | av .
We have u | v. Thus, Proposition 3.4.4 (i) (applied to a = u and b = v) yields
gcd (u, v) = |u| = u (since u ≥ 0). But Theorem A.4.1 (b) (applied to n = u and

354 Proof.Assume that n = 0. Thus, an = a0 = 0. But Proposition 3.4.4 (a) (applied to m instead
 (m) = |m| = m (since m ≥ 0). But Proposition 3.4.4 (b) yields
m, 0) = gcd
of a) yields gcd (

gcd (n, m) = gcd m, |{z}


n  = gcd (m, 0) = m. Thus, m = gcd (n, m).
=0
Also, Proposition 3.4.4 (a) (applied to am instead of a) yields gcd ( am , 0) = gcd ( am ) = | am |.
Now, Proposition 3.4.4 (b) yields

gcd ( an , am ) = gcd ( am , an ) = gcd ( am , 0) (since an = 0)


= | am | = agcd(n,m) (since m = gcd (n, m)) ,

qed.

December 25, 2021


Math 235 notes page 592

m = v) yields

gcd ( au , av ) = agcd(u,v) = | au | (since gcd (u, v) = u)


= ± au ,

so that au | gcd ( au , av ). However, Proposition 3.4.4 (f) (applied to a = au and


b = av ) yields gcd ( au , av ) | au and gcd ( au , av ) | av . Hence, au | gcd ( au , av ) | av .
This proves Theorem A.4.1 (a).
Let us now resume the solution of Exercise 4.8.1. Consider again the sequence
( a0 , a1 , a2 , . . .) defined in Exercise 4.8.1. We claim that

an ≥ 0 for each n ∈ N. (544)

[Proof of (544): This is straightforward by now. We proceed by strong induction


on n:
Induction step: Let k ∈ N. Assume (as the induction hypothesis) that (544) holds
for n < k. We must prove that (544) holds for n = k. In other words, we must prove
that ak ≥ 0.
This is clearly true if k = 0 (since a0 = 0 ≥ 0), and also is clearly true if k = 1
(since a1 = 1 ≥ 0). Hence, for the rest of this proof, we can WLOG assume that
k equals neither 0 nor 1. Hence, k ≥ 2 (since k ∈ N). Therefore, k − 2 ∈ N and
k − 1 ∈ N.
But we assumed that (544) holds for n < k. Hence, we can apply (544) to n =
k − 2 (since k − 2 ∈ N and k − 2 < k). Thus we obtain ak−2 ≥ 0. Similarly, ak−1 ≥ 0.
However, k ≥ 2. Thus, (537) (applied to n = k) yields ak = 1 + ak−1 ak−2 ≥ 1 ≥ 0.
|{z} |{z}
≥0 ≥0
This completes our induction step. Thus, (537) is proved.]
Now, we can solve parts (b) and (c) of Exercise 4.8.1:
(b) We have ak+n ≡ ak mod an for any k ∈ N and n ∈ N (by Exercise 4.8.1 (a)).
Hence, Theorem A.4.1 (a) shows that if u, v ∈ N satisfy u | v, then au | av . This
solves Exercise 4.8.1 (b).
(c) We have ak+n ≡ ak mod an for any k ∈ N and n ∈ N (by Exercise 4.8.1 (a)).
Hence, Theorem A.4.1 (b) shows that for any n, m ∈ N, we have

gcd ( an , am ) = agcd(n,m) = agcd(n,m)

(since agcd(n,m) ≥ 0 (by (544), applied to gcd (n, m) instead of n)). This solves
Exercise 4.8.1 (c).

A.4.2. Discussion of Exercise 4.8.2


Discussion of Exercise 4.8.2. Exercise 4.8.2 is a result of Dirichlet (published in 1849).
Let us give a solution using manipulation of sums.
We will need the following fact:

December 25, 2021


Math 235 notes page 593

Proposition A.4.2. Let n ∈ N, and let b be a positive integer. Then,


jnk
∑ 1 =
b
. (545)
k∈{1,2,...,n};
b|k

Proof of Proposition A.4.2 (sketched). Clearly, the sum ∑ 1 equals the number
k∈{1,2,...,n};
b|k
of all k ∈ {1, 2, . . . , n} that are multiples of b (by (60)). In other words, this sum
equals the number of all multiples of b in the set {1, 2, . . . , n}. But these multiples
are precisely 1b, 2b, 3b, . . . , (n//b) b. Hence, their number is n//b (see Definition
3.3.1 (a) for the meaning of this notation). Thus, we obtain ∑ 1 = n//b =
k∈{1,2,...,n};
b|k
jnk
(by Proposition 3.3.5, applied to n and b instead of u and n), so Proposition
b
A.4.2 is proven. (See [Grinbe16, Proposition 1.1.11] for a detailed proof.)
The next lemma is even simpler:
Lemma A.4.3. Let n be a positive integer. Let k ∈ {1, 2, . . . , n}. Then,

∑ 1 = d (k) . (546)
b∈{1,2,...,n};
b|k

Proof of Lemma A.4.3. Using (60), we see that

∑ 1
b∈{1,2,...,n};
b|k
= (the number of all b ∈ {1, 2, . . . , n} satisfying b | k) · 1
= (the number of all b ∈ {1, 2, . . . , n} satisfying b | k) . (547)

However, the numbers b ∈ {1, 2, . . . , n} satisfying b | k are precisely the positive

December 25, 2021


Math 235 notes page 594

divisors of k 355 . Hence,


(the number of all b ∈ {1, 2, . . . , n} satisfying b | k)
= (the number of all positive divisors of k) = d (k)
(since d (k ) was defined to be the number of all positive divisors of k). Thus, (547)
becomes

∑ 1 = (the number of all b ∈ {1, 2, . . . , n} satisfying b | k) = d (k ) .


b∈{1,2,...,n};
b|k

This proves Lemma A.4.3.


Now,
jnk jnk jnk
+ +···+
1 2 jnk n
= ∑ b
= ∑ ∑ 1
b∈{1,2,...,n} |{z} b∈{1,2,...,n} k ∈{1,2,...,n};
= ∑ 1 b|k
k∈{1,2,...,n}; | {z }
b|k = ∑ ∑
k ∈{1,2,...,n} b ∈{1,2,...,n };
(by (545))
b|k
(here, we have used Theorem 4.1.25
to interchange the two summation signs)

= ∑ ∑ 1 = ∑ d ( k ) = d (1) + d (2) + · · · + d ( n ) .
k∈{1,2,...,n} b∈{1,2,...,n}; k∈{1,2,...,n}
b|k
| {z }
=d(k)
(by Lemma A.4.3)

This solves Exercise 4.8.2.

A.4.3. Discussion of Exercise 4.8.3


Discussion of Exercise 4.8.3. (a) The answer is
n  
n
∑ k k = n · 2n −1 . (548)
k =0
355 Proof.It is clear that each number b ∈ {1, 2, . . . , n} satisfying b | k is a positive divisor of k. Thus,
we only need to prove the converse statement – i.e., we need to prove that each positive divisor
of k is a b ∈ {1, 2, . . . , n} satisfying b | k. In other words, we need to show that if b is a positive
divisor of k, then b ∈ {1, 2, . . . , n} and b | k.
So let us do this. Let b be a positive divisor of k. We must show that b ∈ {1, 2, . . . , n} and b | k.
We have b | k (since b is a divisor of k) and k 6= 0 (since k ∈ {1, 2, . . . , n}). Hence, Proposition
3.1.3 (b) (applied to b and k instead of a and b) yields |b| ≤ |k|. Hence, |k| ≥ |b| = b (since
b is positive). Also, k is positive (since k ∈ {1, 2, . . . , n}), so that |k| = k. Hence, k = |k| ≥ b,
thus b ≤ k ≤ n (since k ∈ {1, 2, . . . , n}). Since b is a positive integer, we thus conclude that
b ∈ {1, 2, . . . , n}. Thus, we have shown that b ∈ {1, 2, . . . , n} and b | k. As explained above, this
completes our proof.

December 25, 2021


Math 235 notes page 595

The formula (548) appears twice in [19fco]: once as [19fco, Exercise 1.3.6] (where
two proofs are given) and once again as [19fco, Corollary 1.6.5] (with a different,
combinatorial proof). We shall briefly outline the first two proofs as well as another
using derivatives of polynomials:
First proof of (548) (sketched). We WLOG assume that n 6= 0 (since the case n = 0 is
easily checked by hand). Hence, n ≥ 1, so that n − 1 ∈ N. Now,
n     n   n  
n n n k n
∑ k k = 0 0 + ∑ |{z} k
k
= ∑ n·
n k
k =0 k = 1 k =1
| {z } k | {z } 
=0 =n· n−1

n =
k−1
(by Exercise 4.5.4 (a),
applied to m=k)
n n n −1 
n−1 n−1 n−1
    
= ∑ n· =n ∑ =n ∑
k =1
k−1 k =1
k−1 k =0
k
| {z }
=2n −1
(by Corollary 4.3.17,
applied to n−1 instead of n)

(here, we have substituted k for k − 1 in the sum)


= n · 2n −1 .
This proves (548).
Second proof of (548) (sketched). We use Gauss’s “doubling trick” as in the solution
to Exercise 4.1.2: We have
n   n   n   n   n  
n n n n n
2· ∑ k = ∑k +∑k = ∑k + ∑ (n − k)
k =0
k k =0
k k =0
k k =0
k k =0
n−k
| {z  }
n
=
k
(by Theorem 4.3.10)

(here, we have substituted n − k for k in the second sum)


n   n   n     
n n n n
= ∑k + ∑ (n − k) = ∑ k + (n − k)
k =0
k k =0
k k =0 |
k k
{z   }
n
=(k+(n−k))
k
n   n   n  
n n n
= ∑ (k + (n − k)) = ∑n =n ∑ = n · 2n .
k =0
| {z } k k =0
k k =0
k
=n | {z }
=2n
(by Corollary 4.3.17)

Dividing both sides of this equality by 2, we obtain (548). This proves (548) again.

December 25, 2021


Math 235 notes page 596

Third proof of (548) (sketched). Consider polynomials in a single indeterminate x over


the real numbers. Applying Theorem 4.3.16 to y = 1, we obtain
n   n  
n k n−k n k
( x + 1) = ∑
n
x 1|{z} = ∑ x . (549)
k =0
k k =0
k
=1
(Strictly speaking, we did not literally apply Theorem 4.3.16 here, because the x
in Theorem 4.3.16 is required to be a number, not a polynomial. But Theorem
4.3.16 holds for polynomials just as well as for numbers (i.e., the x and the y in
Theorem 4.3.16 can be polynomials rather than numbers), and can be proved in
this generality just as it was proved for numbers. It is this generalized version of
Theorem 4.3.16 that we have applied above.)
Now, (549) is an equality between two polynomials in x; thus, we can take deriva-
tives on both sides. The derivative  of ( x +  1 )n is easily seen to be n ( x + 1)n−1 ,
n n k n n
whereas the derivative of ∑ x is ∑ kx k−1 (since the derivative of each
k =0 k k =0 k
x k is kx k−1 ). Hence, by taking derivatives on both sides of (549), we obtain
n  
n
n ( x + 1) n −1
= ∑ kx k−1 .
k =0
k
Substituting 1 for x in this equality, we obtain
n   n  
n n
n (1 + 1) n −1
= ∑ k 1|{z} = ∑ k
k −1
.
k
k=0 | {z } =1 k =0
k
 
n
=k
k
Hence,
  n −1
n  
n
∑ k k = n 1| {z
+ 1} = n · 2n −1 .
k =0 =2
This again proves (548).
Now, (548) has been proved (three times to boot), so Exercise 4.8.3 (a) is solved.
(b) This is similar to Exercise 4.4.3, except that the odd n has been replaced by
an even 2n. The solution is just a bit more complicated, because the 2n-th  row
 of
2n
Pascal’s triangle splits into a left “half”, a right “half”, and a lone entry in
n
the middle. Here is the argument in detail:

 to Exercise 4.8.3 (b). Corollary 4.3.17 (applied to 2n instead of n) yields


Solution
2n 2n
∑ = 22n . Hence,
k =0 k
2n   n   2n  
2n 2n 2n
2 = ∑
2n
= ∑ + ∑ (550)
k =0
k k =0
k k = n +1
k

December 25, 2021


Math 235 notes page 597

(here, we have split the sum at k = n; that is, we have applied (84) to 0, n and 2n
instead of u, v and w). But
2n   n −1  
2n 2n
∑ k
= ∑ 2n − k
k = n +1 k =0 | {z  }
2n
=
k
(since Theorem 4.3.10
(applied
 to2n instead
 of n)

2n 2n
yields = )
k 2n − k
here, we have substituted 2n − k for k in the sum,
 
 since the map {0, 1, . . . , n − 1} → {n + 1, n + 2, . . . , 2n} 
that sends each k to 2n − k is a bijection
n −1   n    
2n 2n 2n
= ∑ = ∑ −
k =0
k k =0
k n

n −1
     
n 2n 2n 2n
(since ∑ = ∑ + ). Hence, (550) becomes
k =0 k k =0 k n

n    2n 
2n 2n
2 2n
= ∑ + ∑ k
k =0
k k = n +1
|  {z  } 
n 2n 2n
=∑ −
k =0 k n
n   n     n    
2n 2n 2n 2n 2n
= ∑ +∑ − = 2· ∑ − .
k =0
k k =0
k n k =0
k n
 
n 2n
Solving this equality for ∑ , we obtain
k =0 k
n     
2n 1 2n
∑ k 2
2n
= · 2 +
n
. (551)
k =0

This already solves Exercise 4.8.3 (b). But let us simplify this a bit further (getting
1
rid of the ) when n is positive. Namely, assume that n is positive. Then, Exercise
2
2n − 1
   
n 2n
4.5.4 (a) (applied to 2n and n instead of n and m) yields = . This
2n n n−1

December 25, 2021


Math 235 notes page 598

2n − 1
   
1 2n n 1
rewrites as = (since = ). Now, (551) becomes
2 n n−1 2n 2
n       
2n 1 2n 1 2n 1 2n
∑ k = 2 · 2 + n = 2 ·2 + 2 n
2n

k =0 | {z } | {z } 
=22n−1
2n − 1

=
n−1
2n − 1
 
= 22n−1 + . (552)
n−1

Note that this is not true for n = 0. Division by 0 is not a good idea!

A.4.4. Discussion of Exercise 4.8.4


Discussion of Exercise 4.8.4. The two claims of Exercise 4.8.4 are known as “polar-
ization identities” (although the name is often shared with other similar-looking
formulas). Exercise 4.8.4 is a particular case of [Grinbe15, Exercise 6.51 parts (a)
and (b)].356 Let us give a self-contained solution here:
Solution to Exercise 4.8.4. For each p ∈ N, we let [ p] be the p-element set {1, 2, . . . , p}.
(This generalizes the definition [n] = {1, 2, . . . , n} made in Exercise 4.8.4.)
For any p ∈ {0, 1, . . . , n} and m ∈ N, we define a number
!m
S p,m := ∑ (−1) p−| I | y + ∑ xi . (553)
I ⊆[ p] i∈ I

Thus, Exercise 4.8.4 (a) is saying that Sn,m = 0 for each m ∈ {0, 1, . . . , n − 1},
whereas Exercise 4.8.4 (b) is saying that Sn,n = n!x1 x2 · · · xn . The reason why
we have introduced S p,m for general p (not just for p = n) is that we want to induct
on p. (We could just as well induct on n, but it is somewhat easier to keep n fixed.)
Now, we claim that the S p,m satisfy the following recurrence relation:

Claim 1: Let p ∈ {1, 2, . . . , n} and m ∈ N. Then,


m −1  
m m−k
S p,m = ∑ k
x p S p−1,k .
k =0

356 We
are working with numbers here rather than elements of a noncommutative ring, so the
complicated sum ∑ vσ(1) vσ(2) · · · vσ(n) from [Grinbe15, Exercise 6.51 (b)] can be simplified
σ ∈ Sn
to n!v1 v2 · · · vn .

December 25, 2021


Math 235 notes page 599

[Proof of Claim 1: First of all, both p and p − 1 belong to the set {0, 1, . . . , n} (since
p ∈ {1, 2, . . . , n}). Thus, [ p] and [ p − 1] are subsets of [n].
If I is any subset of [n], then we define a number z I by
z I : = y + ∑ xi . (554)
i∈ I

(Thus, in particular, z∅ = y + (empty sum) = y.) The definition of S p,m now yields
| {z }
=0
 m
 
 
= ∑ (−1)  y + ∑ xi 
p−| I |  
S p,m  
I ⊆[ p]  i∈ I 
| {z }
=z I
(by (554))

= ∑ (−1) p−| I | zm
I . (555)
I ⊆[ p]

Likewise, we can see that

S p−1,k = ∑ (−1)( p−1)−| I | zkI for each k ∈ N. (556)


I ⊆[ p−1]

(Indeed, this follows from the same argument that we used to prove (555), but now
applied to p − 1 and k instead of p and m.)
We shall call a subset of [ p]
• red if it contains p;
• green if it does not contain p.
Thus, each subset of [ p] is either red or green (but not both). Hence, the sum on
the right hand side of (555) can be split up as follows:

∑ (−1) p−| I | zm
I = ∑ (−1) p−| I | zm
I + ∑ (−1) p−| I | zm
I .
I ⊆[ p] I ⊆[ p]; I ⊆[ p];
I is red I is green

We shall now take a closer look at the two sums on the right hand side of this.
The green subsets I of [ p] are the subsets of [ p] that do not contain p (by the
definition of “green”). In other words, they are just the subsets of [ p] \ { p}. Since
[ p] \ { p} = [ p − 1], this means that they are just the subsets of [ p − 1]. Hence, we
can rewrite the summation sign ∑ as ∑ . So we obtain
I ⊆[ p]; I ⊆[ p−1]
I is green

∑ (−1) p−| I | zm
I = ∑ (−1) p−| I | zm
I . (557)
I ⊆[ p]; I ⊆[ p−1]
I is green

December 25, 2021


Math 235 notes page 600

The red subsets are a bit more complicated. If I is a red subset of [ p], then I
contains p (by the definition of “red”), and thus is not a subset of [ p − 1]. However,
we can obtain a subset of [ p − 1] by removing p from I. Conversely, if J is a subset
of [ p − 1], then we can obtain a red subset of [ p] by inserting p into J. Let us make
this more formal: We have two maps
{red subsets of [ p]} → {subsets of [ p − 1]} ,
I 7→ I \ { p}
and
{subsets of [ p − 1]} → {red subsets of [ p]} ,
J 7→ J ∪ { p} .
These two maps are mutually inverse; thus, they are invertible, i.e., they are bijec-
tions. In particular, the map
{subsets of [ p − 1]} → {red subsets of [ p]} ,
J 7→ J ∪ { p}
is a bijection. Hence, we can substitute J ∪ { p} for I in the sum

∑ (−1) p−| I | zm
I .
I ⊆[ p];
I is red
As a result, we obtain

∑ (−1) p−| I | zm
I = ∑ (−1) p−| J ∪{ p}| zm
J ∪{ p}
I ⊆[ p]; J ⊆[ p−1]
I is red

= ∑ (−1) p−| I ∪{ p}| zm


I ∪{ p} (558)
I ⊆[ p−1]

(here, we have renamed the summation index J as I).


We can rewrite this somewhat. Indeed, if I is a subset of [ p − 1], then p ∈ / I (since
having p ∈ I would entail p ∈ I ⊆ [ p − 1] = {1, 2, . . . , p − 1}, which is absurd) and
therefore | I ∪ { p}| = | I | + 1 and thus
(−1) p−| I ∪{ p}| = (−1) p−(| I |+1) = (−1) p−| I |−1 = − (−1) p−| I | (559)
and
 
z I ∪{ p} = y + ∑ xi by the definition of z I ∪{ p}
i ∈ I ∪{ p}
| {z }
= ∑ xi + x p
i∈ I
∈ I)
(since p/

= y + ∑ xi + x p = z I + x p . (560)
i∈ I
| {z }
=z I
(by (554))

December 25, 2021


Math 235 notes page 601

Thus, (558) becomes

∑ (−1) p−| I | zm
I
I ⊆[ p];
I is red

= ∑ (−1) p−| I ∪{ p}| zm


} | I ∪{ p}
I ⊆[ p−1]
| {z {z }
=−(−1) p−| I | =(z I + x p )m
(by (559)) (by (560))
 

m
= − (−1) p−| I | zI + xp
I ⊆[ p−1]


m
=− (−1) p−| I | z I + x p . (561)
I ⊆[ p−1]

Now, (555) yields

S p,m = ∑ (−1) p−| I | zm


I
I ⊆[ p]

= ∑ (−1) p−| I | zm
I + ∑ (−1) p−| I | zm
I
I ⊆[ p]; I ⊆[ p];
I is red I is green
| {z } | {z }
p−| I | m
=− ∑ (−1) (z I + x p ) = ∑ (−1) p−| I | zm
I
I ⊆[ p−1] I ⊆[ p−1]
(by (561)) (by (557))

∑ ∑
m
=− (−1) p−| I | z I + x p + (−1) p−| I | zm
I
I ⊆[ p−1] I ⊆[ p−1]

∑ ∑
m
= (−1) p−| I | zm
I − (−1) p−| I | z I + x p
I ⊆[ p−1] I ⊆[ p−1]
 m 
= ∑ (−1) p−| I | zm
I − zI + xp . (562)
I ⊆[ p−1]

Now, let us simplify the difference inside the big parentheses on the right hand
side. Fix a subset I of [ p − 1]. Then, Theorem 4.3.16 (applied to m, z I and x p instead
of n, x and y) yields
m
m k m − k m −1 m k m − k
     
m
= ∑ = ∑
m m−m
zI + xp zI xp zI xp + zm
I xp
k =0
k k =0
k m | {z }
0
| {z }
=1 = x p =1
(by (124))
m −1  
m k m−k
= ∑ z x
k I p
+ zm
I .
k =0

December 25, 2021


Math 235 notes page 602

Hence,
!
m −1  
m k m−k

m
zm
I − zI + xp = zm
I − z I x p + zm
I
k =0
k
m −1  
m k m−k
=− ∑ z x
k I p
. (563)
k =0

Forget that we fixed I. We thus have proved (563) for each subset I of [ p − 1].
Now, (562) becomes
 m 
S p,m = ∑ (−1) p−| I | m
zI − zI + xp
I ⊆[ p−1] | {z  }
m −1 m k m−k
=− ∑ z xp
k =0 k I
(by (563))
!
m −1 
 m −1  
m k m−k m k m−k
= ∑ (−1) p−| I | − ∑
k
zI xp = − ∑ (−1) p−| I |
∑ k
zI xp
I ⊆[ p−1] k =0 I ⊆[ p−1] k = 0
m −1  
m k m−k
=− ∑ ∑ (−1) p−| I | z x
k I p
I ⊆[ p−1] k =0
| {z }
| {z } =−(−1) p−| I |−1
m −1 =−(−1)( p−1)−| I |
= ∑ ∑
k =0 I ⊆[ p−1] (since p−| I |−1=( p−1)−| I |)

m −1   m
=− ∑ ∑ − (−1) ( p−1)−| I |
k
zkI x m
p
−k
k =0 I ⊆[ p−1]
m −1  
m k m−k
= ∑ ∑ (−1) ( p−1)−| I |
z x
k I p
k =0 I ⊆[ p−1]
m −1   m −1  
m m−k m m−k
= ∑ k
xp ∑ (−1) zI = ∑
( p−1)−| I | k
k
x p S p−1,k .
k =0 I ⊆[ p−1] k =0
| {z }
=S p−1,k
(by (556))

This proves Claim 1.]


With Claim 1 in hand, we can prove properties of the S p,m like the following by
a straightforward induction:

Claim 2: We have S p,m = 0 for each p ∈ {0, 1, . . . , n} and each m ∈


{0, 1, . . . , p − 1}.

[Proof of Claim 2: We proceed by induction on p:


Induction base: If p = 0, then there exists no m ∈ {0, 1, . . . , p − 1} (since the set
{ 1, . . . , p − 1} is empty in this case). Thus, Claim 2 is vacuously true for p = 0.
0,

December 25, 2021


Math 235 notes page 603

Induction step: Let q ∈ {0, 1, . . . , n − 1}. Assume (as the induction hypothesis)
that Claim 2 holds for p = q. We must prove that Claim 2 holds for p = q + 1.
We have assumed that Claim 2 holds for p = q. In other words, we have

Sq,m = 0 for each m ∈ {0, 1, . . . , q − 1} . (564)

Now, let m ∈ {0, 1, . . . , q}. Thus, 0 ≤ m ≤ q. Note that q + 1 ∈ {1, 2, . . . , n} (since


q ∈ {0, 1, . . . , n − 1}). Hence, Claim 1 (applied to p = q + 1) yields
m −1   m −1  
m m−k m m−k
Sq+1,m = ∑ k
xq+1 S(q+1)−1,k = ∑ x S
k q+1 q,k
(565)
k =0 k =0

(since (q + 1) − 1 = q). However, if k ∈ {0, 1, . . . , m − 1}, then k ≤ |{z}


m −1 ≤ q − 1
≤q
and therefore k ∈ {0, 1, . . . , q − 1} (since k is a nonnegative integer) and thus

Sq,k = 0 (566)

(by (564), applied to k instead of m). Hence, (565) becomes


m −1   m −1  
m m−k m m−k
Sq+1,m = ∑ k
xq+1 Sq,k = ∑
k
xq+1 0 = 0.
k =0 |{z} k =0
=0
(by (566))

Forget that we fixed m. We thus have shown that Sq+1,m = 0 for each m ∈
{0, 1, . . . , q}. In other words, Claim 2 holds for p = q + 1. This completes the
induction step. Thus, Claim 2 is proved.]
Claim 2 yields part (a) of Exercise 4.8.4 rather quickly (see below for the details).
In order to solve part (b) as well, we need another claim:

Claim 3: We have S p,p = p!x1 x2 · · · x p for each p ∈ {0, 1, . . . , n}.

[Proof of Claim 3: We proceed by induction on p:


Induction base: If p = 0, then
!0
S p,p = S0,0 = ∑ (−1)0−| I | y + ∑ xi (by the definition of S0,0 )
I ⊆[0] i∈ I
| {z }
=1
= ∑ (−1)0−| I | = ∑ (−1) 0−| I |
(since [0] = ∅)
I ⊆[0] I ⊆∅

= (−1)0−|∅| (since the only subset I of ∅ is ∅)


=1 (since 0 − |∅| = 0 − 0 = 0 is even)
= p!x1 x2 · · · x p

December 25, 2021


Math 235 notes page 604

(because p = 0 entails p!x1 x2 · · · x p = |{z}


0! x x ···x = 1). In other words,
| 1 2{z }0
=1 =(empty product)=1
Claim 3 holds for p = 0.
Induction step: Let q ∈ {0, 1, . . . , n − 1}. Assume (as the induction hypothesis)
that Claim 3 holds for p = q. We must prove that Claim 3 holds for p = q + 1.
We have assumed that Claim 3 holds for p = q. In other words, we have

Sq,q = q!x1 x2 · · · xq . (567)

Furthermore, q ∈ {0, 1, . . . , n − 1} ⊆ {0, 1, . . . , n}. Hence, each k ∈ {0, 1, . . . , q − 1}


satisfies
Sq,k = 0 (568)
(by Claim 2, applied to p = q and m = k).
Now, q + 1 ∈ {1, 2, . . . , n} (since q ∈ {0, 1, . . . , n − 1}). Hence, Claim 1 (applied
to p = q + 1 and m = q + 1) yields
(q+1)−1  
q + 1 (q+1)−k
Sq+1,q+1 = ∑ x q +1 S(q+1)−1,k
k =0
k
q  
q + 1 (q+1)−k
= ∑ x q +1 Sq,k (since (q + 1) − 1 = q)
k =0
k
q −1    
q + 1 (q+1)−k q+1
= ∑
(q+1)−q
x q +1 Sq,k + x q +1 Sq,q
k =0
k |{z} q | {z }
=0 = xq1+1 = xq+1
(by (568))
q −1    
q + 1 (q+1)−k q+1
= ∑ x q +1 0+ xq+1 Sq,q
k =0
k q
| {z }
=0
 
q+1
= xq+1 Sq,q . (569)
q
Theorem 4.3.10 (applied to q + 1 and q instead of n and k) yields
     
q+1 q+1 q+1
= = = q+1 (by (120)) .
q ( q + 1) − q 1
Hence, (569) becomes
 
q+1
Sq+1,q+1 = x q +1 Sq,q = (q + 1) xq+1 · q!x1 x2 · · · xq
q |{z}
| {z } =q!x1 x2 ··· xq
= q +1 (by (567))

= (q + 1) · q! · x1 x2 · · · xq xq+1 = (q + 1)!x1 x2 · · · xq+1 .
| {z } | {z }
=(q+1)! = x1 x2 ··· xq+1

December 25, 2021


Math 235 notes page 605

In other words, Claim 3 holds for p = q + 1. This completes the induction step.
Thus, Claim 3 is proved.]
Let us now finish the solution of Exercise 4.8.4:
(a) Let m ∈ {0, 1, . . . , n − 1}. Then, Claim 2 (applied to p = n) yields

Sn,m = 0.

But the definition of Sn,m yields


!m
Sn,m = ∑ (−1) n−| I |
y + ∑ xi .
I ⊆[n] i∈ I

Comparing these two equalities, we find


!m
∑ (−1)n−| I | y + ∑ xi = 0.
I ⊆[n] i∈ I

This solves Exercise 4.8.4 (a).


(b) Claim 3 (applied to p = n) yields

Sn,n = n!x1 x2 · · · xn .

But the definition of Sn,n yields


!n
Sn,n = ∑ (−1) n−| I |
y + ∑ xi .
I ⊆[n] i∈ I

Comparing these two equalities, we find


!n
∑ (−1)n−| I | y + ∑ xi = n!x1 x2 · · · xn .
I ⊆[n] i∈ I

This solves Exercise 4.8.4 (b).


There is an alternative solution to Exercise 4.8.4, which proceeds by expanding
the products
!m ! ! !
y + ∑ xi = y + ∑ xi y + ∑ xi · · · y + ∑ xi
i∈ I i∈ I i∈ I i∈ I

(for all I ⊆ [n]) as sums of products of y’s and xi ’s and then observing that the
“ ∑ (−1)n−| I | operator” causes all such products other than (permutations of)
I ⊆[n]
x1 x2 · · · xn to cancel each other. This argument (albeit only in the particular case
y = 0, which is a bit simpler) can be found in [18f-hw3s, solution to Exercise 6].

December 25, 2021


Math 235 notes page 606

A.4.5. Discussion of Exercise 4.8.5


Discussion of Exercise 4.8.5. Exercise 4.8.5 is an identity originally found by Euler
in 1753 ([Euler190, §11]). It has recently reappeared as the first part of AMM
problem #12022 (see [MerJoh19] for a solution) and (in a slightly rewritten form) in
[BiFoFo95, Proposition]. The solution we give below is a restatement of the solution
from [MerJoh19] (with all details expanded and with the induction replaced by a
use of the telescope principle).
Solution to Exercise 4.8.5. First of all, let us see why the fractions appearing in Exer-
cise 4.8.5 are well-defined in the first place. Indeed, all powers x1 , x2 , x3 , . . . of x are
distinct from 1 (since x ∈ R \ {1, −1}). Hence, all the numbers 1 − x1 , 1 − x2 , 1 −
x3 , . . . are nonzero. In other words, all the numbers y1 , y2 , y3 , . . . are nonzero (since
yi = 1 − xi for each integer i ≥ 1). Therefore, the denominators of the fractions
y n y n −1 · · · y n − k
in Exercise 4.8.5 are nonzero, so the fractions are well-defined. This
y k +1
shows that Exercise 4.8.5 makes sense.
For any two numbers p ∈ {0, 1, . . . , n} and k ∈ {0, 1, . . . , n} satisfying p ≥ k, we
set
y p y p −1 · · · y p − k
b p,k = (570)
y k +1
and
c p,k = y p−1 y p−2 · · · y p−k . (571)
Now, an easy computation reveals the following:

Claim 1: For any two numbers p ∈ {0, 1, . . . , n} and k ∈ {0, 1, . . . , n}


satisfying p − 1 ≥ k, we have

b p,k − b p−1,k = c p,k − c p,k+1 .

[Proof of Claim 1: Let p ∈ {0, 1, . . . , n} and k ∈ {0, 1, . . . , n} be two numbers satis-


fying p − 1 ≥ k. Then, p − 1 ≥ k ≥ 0 and p − 1 ≤ p ≤ n (since p ∈ {0, 1, . . . , n}).
Combining these two inequalities, we obtain p − 1 ∈ {0, 1, . . . , n}. Hence, b p−1,k is
well-defined. Also, p > p − 1 ≥ k; hence, b p,k and c p,k are well-defined. Finally,
p − 1 ≥ k entails p ≥ k + 1, so that k + 1 ≤ p ≤ n and therefore k + 1 ∈ {0, 1, . . . , n}.
Hence, c p,k+1 is well-defined.
Now, we have
y p y p −1 · · · y p − k 
b p,k = by the definition of b p,k
y k +1
1 1
= · y p y p −1 · · · y p − k = · y p · y p −1 y p −2 · · · y p − k
y k +1 | {z } y k +1
=y p ·y p−1 y p−2 ···y p−k

December 25, 2021


Math 235 notes page 607

and
y p−1 y( p−1)−1 · · · y( p−1)−k 
b p−1,k = by the definition of b p−1,k
y k +1
y p −1 y p −2 · · · y p − k −1 1
= = · y p −1 y p −2 · · · y p − k −1
y k +1 y k +1 | {z }
=y p−1 y p−2 ···y p−k ·y p−k−1
1 1
= · y p −1 y p −2 · · · y p − k · y p − k −1 = · y p − k −1 · y p −1 y p −2 · · · y p − k .
y k +1 y k +1
Subtracting these two equalities from one another, we obtain
1 1
b p,k − b p−1,k = · y p · y p −1 y p −2 · · · y p − k − ·y · y p −1 y p −2 · · · y p − k
y k +1 y k +1 p − k −1
1 
= · y p − y p − k −1 · y p −1 y p −2 · · · y p − k . (572)
y k +1
On the other hand, y p = 1 − x p (by the definition of y p ) and y p−k−1 = 1 − x p−k−1
(by the definition of y p−k−1 ). Subtracting these two equalities from one another, we
obtain
 
p − k −1
p
y p − y p − k −1 = (1 − x ) − 1 − x = x p − k −1 − x p
 
p − k −1
1 − x k +1

= |x {z } = y k +1 1 − y p − k −1 .
| {z } =1 − y p − k −1
= y k +1
(since yk+1 is (since y p−k−1 =1− x p−k−1 )
k
defined as 1− x ) + 1

Thus, (572) becomes


1 
b p,k − b p−1,k = · y p − y p − k −1 · y p −1 y p −2 · · · y p − k
y k +1 | {z }
= y k +1 ( 1 − y p − k −1 )
1 
= · y k +1 1 − y p − k −1 · y p −1 y p −2 · · · y p − k
y k +1

= 1 − y p − k −1 · y p −1 y p −2 · · · y p − k .
Comparing this with
c p,k − c p,k+1
|{z} | {z }
=y p−1 y p−2 ···y p−k =y p−1 y p−2 ···y p−(k+1)
(by the definition of c p,k ) (by the definition of c p,k+1 )

= y p−1 y p−2 · · · y p−k − y p−1 y p−2 · · · y p−(k+1)


| {z }
=y p−1 y p−2 ···y p−k−1
=y p−1 y p−2 ···y p−k ·y p−k−1

= y p −1 y p −2 · · · y p − k − y p −1 y p −2 · · · y p − k · y p − k −1
 
= y p −1 y p −2 · · · y p − k · 1 − y p − k −1 = 1 − y p − k −1 · y p −1 y p −2 · · · y p − k ,

December 25, 2021


Math 235 notes page 608

we obtain b p,k − b p−1,k = c p,k − c p,k+1 . This proves Claim 1.]


Another easy computation yields the following:

Claim 2: For each p ∈ {1, 2, . . . , n}, we have

b p,p−1 = c p,p−1 .

[Proof of Claim 2: Let p ∈ {1, 2, . . . , n}. Thus, both p and p − 1 belong to


{0, 1, . . . , n}. Hence, both b p,p−1 and c p,p−1 are well-defined (since p ≥ p − 1).
Comparing
y p y p−1 · · · y p−( p−1) 
b p,p−1 = by the definition of b p,p−1
y( p−1)+1
y p y p −1 · · · y 1
= = y p −1 y p −2 · · · y 1
yp

since p ≥ 1 and thus y p y p−1 · · · y1 = y p · y p−1 y p−2 · · · y1

with

c p,p−1 = y p−1 y p−2 · · · y p−( p−1) by the definition of c p,p−1
= y p −1 y p −2 · · · y 1 ,

we obtain b p,p−1 = c p,p−1 . This proves Claim 2.]


For each p ∈ {1, 2, . . . , n}, set
p −1
Sp = ∑ b p,k . (573)
k =0

Now, we claim the following:

Claim 3: For any p ∈ {1, 2, . . . , n}, we have

S p − S p−1 = 1.

[Proof of Claim 3: Fix p ∈ {1, 2, . . . , n}. Then, p ≥ 1, so that p − 1 ≥ 0. The


definition of S p yields

p −1 p −2
Sp = ∑ b p,k = b p,p−1 + ∑ b p,k (since p − 1 ≥ 0) .
k =0 k =0

Meanwhile, the definition of S p−1 yields

( p−1)−1 p −2
S p −1 = ∑ b p−1,k = ∑ b p−1,k (since ( p − 1) − 1 = p − 2) .
k =0 k =0

December 25, 2021


Math 235 notes page 609

Subtracting these two equalities from one another, we obtain


p −2 p −2 p −2 p −2
!
S p − S p −1 = b p,p−1 + ∑ b p,k − ∑ b p−1,k = b p,p−1 + ∑ b p,k − ∑ b p−1,k
k =0 k =0
|k=0 {zk=0 }
p −2
= ∑ (b p,k −b p−1,k )
k =0
p −2


= b p,p−1 + b p,k − b p−1,k .
k =0

In view of
p −2


b p,k − b p−1,k
k =0 | {z }
=c p,k −c p,k+1
(by Claim 1
(since k≤ p−2< p−1 and thus p−1≥k))
p −2 p −2
∑ ∑
  
= c p,k − c p,k+1 = −c p,k+1 − −c p,k
k =0 | {z } k =0
=(−c p,k+1 )−(−c p,k )
p −2  
here, we have renamed the

 
= −c p,i+1 − −c p,i
i =0
summation index k as i
  
= −c p,( p−2)+1 − −c p,0

by Corollary 4.1.17, applied to u = 0 and v = p − 2 and ai = −c p,i
= c p,0 − c p,( p−2)+1 = c p,0 − c p,p−1 (since ( p − 2) + 1 = p − 1) ,

this becomes
p −2
b p,p−1 + ∑ b p,k − b p−1,k = c p,p−1 + c p,0 − c p,p−1

S p − S p −1 =
|k=0
| {z }
=c p,p−1 {z }
(by Claim 2) =c p,0 −c p,p−1

= c p,0 = y p−1 y p−2 · · · y p−0 by the definition of c p,0
= (empty product) = 1.

This proves Claim 3.]


Now,
n n
∑ |S p −{zS p−1 } = ∑ 1 = n · 1 = n.

p =1 p =1
=1
(by Claim 3)

December 25, 2021


Math 235 notes page 610

Hence,
n n  
here, we have renamed the
∑ ∑ ( S s − S s −1 )

n= S p − S p −1 =
p =1 s =1
summation index p as s
= Sn − S1 − 1
|{z} |{z}
n −1 0−1
= ∑ bn,k =S0 = ∑ b0,k
k =0 k =0
(by the definition of Sn ) (by the definition of S0 )

(by Theorem 4.1.16, applied to u = 1 and v = n and as = Ss )


n −1 0−1 n −1
y n y n −1 · · · y n − k
= ∑ bn,k − ∑ b0,k = ∑ y k +1
.
k =0
|k=0{z } k =0
|{z}
y n y n −1 · · · y n − k
= =(empty sum)=0
y k +1
(by the definition of bn,k )

This solves Exercise 4.8.5.


Let us note in passing that we can prove the following generalization of Exercise
4.8.5:
Proposition A.4.4. Let n ∈ N and x ∈ R \ {1, −1}. For each i ∈ N, set yi =
1 − xi . Let m ∈ {0, 1, . . . , n}. Then,
n −1 n
y n y n −1 · · · y n − k
∑ y k +1
= ∑ y p −1 y p −2 · · · y p − m . (574)
k=m p = m +1

Exercise 4.8.5 is easily seen to be the particular case of Proposition A.4.4 for
m = 0. Our below proof of Proposition A.4.4 is a lazy adaptation of our above
solution to Exercise 4.8.5.
Proof of Proposition A.4.4. We proceed precisely as in the above solution to Exercise
4.8.5 until the point where we define S p . From that point on, we proceed as follows:
For each p ∈ {m, m + 1, . . . , n}, set
p −1
Tp = ∑ b p,k .
k=m

(Note that if m = 0, then Tp is the S p from our above solution to Exercise 4.8.5.)
Now, we claim the following:

Claim 4: For any p ∈ {m + 1, m + 2, . . . , n}, we have

Tp − Tp−1 = c p,m .

December 25, 2021


Math 235 notes page 611

[Proof of Claim 4: Fix p ∈ {m + 1, m + 2, . . . , n}. Then, p ≥ m + 1, so that


p − 1 ≥ m. Both p and p − 1 belong to the set {m, m + 1, . . . , n} (since p ∈
{m + 1, m + 2, . . . , n}). Hence, Tp and Tp−1 are well-defined. The definition of
Tp yields
p −1 p −2
Tp = ∑ b p,k = b p,p−1 + ∑ b p,k (since p − 1 ≥ m) .
k=m k=m

Meanwhile, the definition of Tp−1 yields


( p−1)−1 p −2
Tp−1 = ∑ b p−1,k = ∑ b p−1,k (since ( p − 1) − 1 = p − 2) .
k=m k=m

Subtracting these two equalities from one another, we obtain


p −2 p −2 p −2 p −2
!
Tp − Tp−1 = b p,p−1 + ∑ b p,k − ∑ b p−1,k = b p,p−1 + ∑ b p,k − ∑ b p−1,k
k=m k=m k=m k=m
| {z }
p −2
= ∑ (b p,k −b p−1,k )
k=m
p −2


= b p,p−1 + b p,k − b p−1,k .
k=m

In view of
p −2


b p,k − b p−1,k
k=m | {z }
=c p,k −c p,k+1
(by Claim 1
(since k≤ p−2< p−1 and thus p−1≥k))
p −2 p −2
∑ c p,k − c p,k+1 = ∑
  
= −c p,k+1 − −c p,k
k=m | {z } k=m
=(−c p,k+1 )−(−c p,k )
p −2  
here, we have renamed the

 
= −c p,i+1 − −c p,i
i =m
summation index k as i
  
= −c p,( p−2)+1 − −c p,m

by Corollary 4.1.17, applied to u = m and v = p − 2 and ai = −c p,i
= c p,m − c p,( p−2)+1 = c p,m − c p,p−1 (since ( p − 2) + 1 = p − 1) ,
this becomes
p −2
b p,p−1 + ∑ b p,k − b p−1,k = c p,p−1 + c p,m − c p,p−1 = c p,m .

Tp − Tp−1 =
| {z } k=m
=c p,p−1 | {z }
(by Claim 2) =c p,m −c p,p−1

December 25, 2021


Math 235 notes page 612

This proves Claim 4.]


Now,
n n n
∑ | Tp −{zTp−1 } = ∑ ∑

c p,m = y p −1 y p −2 · · · y p − m .
p = m +1 p = m +1 |{z} p = m +1
=c p,m =y p−1 y p−2 ···y p−m
(by Claim 4) (by the definition of c p,m )

Hence,
n
∑ y p −1 y p −2 · · · y p − m
p = m +1
n n  
here, we have renamed the
∑ ∑

= Tp − Tp−1 = ( Ts − Ts−1 )
p = m +1 s = m +1
summation index p as s
= Tn − T(m+1)−1
|{z} | {z }
n −1 m −1
= ∑ bn,k = Tm = ∑ bm,k
k=m k=m
(by the definition of Tn ) (by the definition of Tm )

(by Theorem 4.1.16, applied to u = m + 1 and v = n and as = Ts )


n −1 m −1 n −1
y n y n −1 · · · y n − k
= ∑ bn,k − ∑ bm,k = ∑ y k +1
.
k=m
|k=m{z } k=m
|{z}
y n y n −1 · · · y n − k
= =(empty sum)=0
y k +1
(by the definition of bn,k )

This proves Proposition A.4.4.

A.4.6. Discussion of Exercise 4.8.6


Discussion of Exercise 4.8.6. It is easy to realize that an is a multiple of n! for each
n ∈ N. (Indeed, this is clearly true for n = 0 and for n = 1, while for higher
n it follows by induction using the recursion an = n ( an−1 + (n − 1) an−2 )). In
an
other words, is an integer for each n ∈ N. This suggests that we should study
n!
a a a 
0 1 2
the sequence , , , . . . instead of the sequence ( a0 , a1 , a2 , . . .). The recur-
0! 1! 2!
sion an = n ( an−1 + (n − 1) an−2 ) (which  aholds  na≥ 2) can
for each now be easily
0 a1 a2 a n −1 a
+ n −2
n
rewritten in terms of the new sequence , , , . . . as =
0! 1! 2! n! ( n − 1) ! ( n − 2) !
(because n! = n · (n − 1)! = n (n − 1) · (n − 2)!); but this is precisely the recursion
a0 a
of the Fibonacci sequence. Its starting values = 0 and 1 = 1, too, are iden-
0! 1!
tical with those of the Fibonacci sequence. Thus, we conclude that the sequence

December 25, 2021


Math 235 notes page 613

a a1 a2 
0
, , , . . . must be the Fibonacci sequence. In other words,
0! 1! 2!
an
= fn for each n ∈ N
n!
(where ( f 0 , f 1 , f 2 , . . .) is the Fibonacci sequence). In other words,

an = n! · f n for each n ∈ N. (575)

It is easy to restate the above derivation of (575) as a rigorous proof by strong


induction on n.

A.4.7. Discussion of Exercise 4.8.7


Discussion of Exercise 4.8.7. There are many approaches to Exercise 4.8.7. The most
“systematic” approach is by showing that both sequences ( a0 , a1 , a2 , . . .) and (b0 , b1 , b2 , . . .)
are 2u, v2 − u2 -recurrent357 , and then applying Theorem 4.9.11 to obtain an ex-


plicit formula for them. But this is laborious. A simpler solution can be given using
an utterly trivial lemma:
357 Indeed, for each n ≥ 2, we have the three equalities

 an = uan−1 + vbn−1 ;
a = uan−2 + vbn−2 ;
 n −1
bn−1 = ubn−2 + van−2 .

Eliminating bn−1 and bn−2 from them (for example, by using the first equality to express bn−1
through an and an−1 , then using the second equality to express bn−2 through an−1 and an−2 ,
then substituting the resulting two expressions into the third equality), we obtain
 
an = 2uan−1 + v2 − u2 an−2 .

Thus, the sequence ( a0 , a1 , a2 , . . .) is 2u, v2 − u2 -recurrent. Similarly, the same holds for the


sequence (b0 , b1 , b2 , . . .).


A more conceptual way to show this uses the Cayley–Hamilton theorem. Namely, the recur-
sions
an = uan−1 + vbn−1 and bn = ubn−1 + van−1
can be combined into a single matrix equation
    
an u v a n −1
= .
bn v u bn − 1

We can rewrite this equation as


   
u v ai
wn = Awn−1 , where A = and wi = for each i ∈ N.
v u bi

Now, the characteristic polynomial of A is X 2 − 2uX − v2 − u2 ; thus, the Cayley–Hamilton




theorem yields A2 − 2uA − v2 − u2 I2 = 0 (where I2 is the 2 × 2 identity matrix). Thus,




   
A2 − 2uA − v2 − u2 I2 wn = 0 for each n ∈ N.
| {z }
=0

December 25, 2021


Math 235 notes page 614

Lemma A.4.5. Let a and b be two numbers. Let s = a + b and d = a − b. Then,


s+d s−d
a= and b = .
2 2
Proof of Lemma A.4.5. From s = a + b and d = a − b, we obtain

s+d ( a + b) + ( a − b) s−d ( a + b) − ( a − b)
= =a and = = b.
2 2 2 2
This proves Lemma A.4.5.
Harmless as it is, Lemma A.4.5 suggests a useful trick: Any two numbers can
be reconstructed from their sum and their difference. Sometimes, these sums and
differences are easier to handle than the original two numbers, so it can be a good
idea to work with the sum and the difference for as long as possible. Nothing is
lost when doing so, since Lemma A.4.5 allows recovering the original numbers.
Let us now solve Exercise 4.8.7 using this trick:
Solution to Exercise 4.8.7. For each n ∈ N, we define two numbers

s n = a n + bn and d n = a n − bn .

Then, for each n ∈ N, we have


sn + dn sn − dn
an = and bn = (576)
2 2
(by Lemma A.4.5, applied to an , bn , sn and dn instead of a, b, s and d).
In view of
     
A2 − 2uA − v2 − u2 I2 wn = A2 w −2u Awn − v2 − u2 I2 wn
| {z n} |{z} |{z}
= AAwn = Awn+1 = w n +1 = wn
(since Awn =wn+1 )
 
= Awn+1 −2uwn+1 − v2 − u2 wn
| {z }
= w n +2
 
= wn+2 − 2uwn+1 − v2 − u2 wn
      a 
a n +2 a n +1 n
= − 2u − v2 − u2
bn +2 bn + 1 bn
!
an+2 − 2uan+1 − v2 − u2 an

= ,
bn+2 − 2ubn+1 − v2 − u2 bn


!
an+2 − 2uan+1 − v2 − u2 an

this rewrites as = 0. In other words, an+2 − 2uan+1 −
bn+2 − 2ubn+1 − v2 − u2 bn


v2 − u2 an = 0 and bn+2 − 2ubn+1 − v2 − u2 bn = 0. Since we have shown this for each


 

n ∈ N, we thus conclude that both sequences ( a0 , a1 , a2 , . . .) and (b0 , b1 , b2 , . . .) are 2u, v2 − u2 -




recurrent. The main advantage of this argument is its generalizability (to more than two se-
quences and higher-order recurrences).

December 25, 2021


Math 235 notes page 615

Now, each integer n ≥ 1 satisfies

an = uan−1 + vbn−1 and bn = ubn−1 + van−1

(by the recursive definition of the sequences ( a0 , a1 , a2 , . . .) and (b0 , b1 , b2 , . . .)) and
therefore

sn = an + bn = uan−1 + vbn−1 + ubn−1 + van−1


|{z} |{z}
=uan−1 +vbn−1 =ubn−1 +van−1
= (u + v) (a +b ) = ( u + v ) s n −1 (577)
| n−1 {z n−1}
= s n −1
(since sn−1 was defined as an−1 +bn−1 )

and

dn = an − bn = uan−1 + vbn−1 − (ubn−1 + van−1 )


|{z} |{z}
=uan−1 +vbn−1 =ubn−1 +van−1
= (u − v) (a −b ) = ( u − v ) d n −1 . (578)
| n−1 {z n−1}
= d n −1
(since dn−1 was defined as an−1 −bn−1 )

The equality (577) holding for each n ≥ 1 shows that the sequence (s0 , s1 , s2 , . . .)
is a geometric progression with ratio u + v. Therefore,

s n = ( u + v ) n s0 for each n ∈ N. (579)


358 Likewise, we find that

d n = ( u − v ) n d0 for each n ∈ N. (580)


359

358 For the sake of completeness, here is the (entirely straightforward) proof of (579):
We shall prove (579) by induction on n:
Induction base: We have s0 = (u + v)0 s0 (since (u + v)0 s0 = s0 ). In other words, (579) holds
| {z }
=1
for n = 0.
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that (579) holds for n = m.
We must prove that (579) holds for n = m + 1.
We have assumed that (579) holds for n = m. In other words, we have sm = (u + v)m s0 .
But m + 1 ≥ 1; hence, (577) (applied to n = m + 1) yields sm+1 = (u + v) s(m+1)−1 =
| {z }
=sm =(u+v)m s0
(u + v) (u + v)m s0 = (u + v)m+1 s0 . In other words, (579) holds for n = m + 1. This completes
| {z }
=(u+v)m+1
the induction step. Thus, (579) is proved.
359 The proof of (580) is analogous to the proof of (579), once the obvious changes are made (viz., we

must use (578) instead of (577), and we must replace sk and u + v by dk and u − v, respectively).

December 25, 2021


Math 235 notes page 616

Now, for each n ∈ N, we have


sn + dn
an = (by (576))
2 
 
1 
=  sn + dn 
2
 |{z} |{z} 
n n 
=(u+v) s0 =(u−v) d0
(by (579)) (by (580))
 

1 
= (u + v)n s0 + (u − v) n
d0
 
2 |{z} |{z} 

= a0 +b0 = a0 −b0
(by the definition of s0 ) (by the definition of d0 )
1
(u + v)n ( a0 + b0 ) + (u − v)n ( a0 − b0 )

=
2
and
sn − dn
bn = (by (576))
2 
 
1 
=  sn − dn 
2
 |{z} |{z} 
=(u+v)n s0 n 
=(u−v) d0
(by (579)) (by (580))
 

1 n

= (u + v) s0 − (u − v)n d0
 
2 |{z} |{z} 

= a0 +b0 = a0 −b0
(by the definition of s0 ) (by the definition of d0 )
1
(u + v)n ( a0 + b0 ) − (u − v)n ( a0 − b0 ) .

=
2
This solves Exercise 4.8.7.

A.4.8. Discussion of Exercise 4.8.8


Discussion of Exercise 4.8.8. Our solution to Exercise 4.8.8 will rely on the following
two simple lemmas:
Lemma A.4.6. Let q ≥ −1 be a real number. Then,

bq + 1c = min {k ∈ N | k > q} . (581)

(In words: bq + 1c is the smallest nonnegative integer that is greater than q.)

December 25, 2021


Math 235 notes page 617

Proof of Lemma A.4.6. Applying (1) to x = q + 1, we find bq + 1c ≤ q + 1 < bq + 1c +


1. Thus, q + 1 < bq + 1c + 1, so that q < bq + 1c. Therefore, bq + 1c > q ≥ −1.
Also, bq + 1c is an integer (since the floor of any real number is an integer). There-
fore, from bq + 1c > −1, we obtain bq + 1c ≥ 0. Hence, bq + 1c ∈ N (since bq + 1c
is an integer). Thus, bq + 1c is a k ∈ N satisfying k > q (since bq + 1c > q). In other
words,
b q + 1c ∈ { k ∈ N | k > q } . (582)
Now, let s be any element of the set {k ∈ N | k > q}. Thus, s is a k ∈ N
satisfying k > q. In other words, s ∈ N and s > q. If we had s < bq + 1c, then
we would have s ≤ bq + 1c − 1 (since s and bq + 1c are integers), which would
entail s + 1 ≤ bq + 1c ≤ q + 1, which would contradict |{z}
s +1 > q + 1. Hence, we
>q
cannot have s < bq + 1c. Thus, we have s ≥ bq + 1c.
Forget that we fixed s. We thus have shown that s ≥ bq + 1c for every s ∈
{k ∈ N | k > q}. In other words, every element of the set {k ∈ N | k > q} is
≥ bq + 1c. In other words, bq + 1c is smaller or equal to any element of the set
{k ∈ N | k > q}. Since bq + 1c itself is an element of this set (by (582)), we thus
conclude that bq + 1c is the smallest element of this set. In other words, bq + 1c =
min {k ∈ N | k > q}. Thus, (581) is proved. In other words, we have proved
Lemma A.4.6.

Lemma A.4.7. Let m ∈ N. Then,

m = min {k ∈ N | k ≥ m} .

Proof of Lemma A.4.7. This is even more obvious than Lemma A.4.6. The number
m is an element of the set {k ∈ N | k ≥ m} (since m ∈ N and m ≥ m), but every
element of this set is ≥ m (because every element of this set is a k ∈ N satisfying
k ≥ m). Hence, the number m is the smallest element of the set {k ∈ N | k ≥ m}.
In other words, m = min {k ∈ N | k ≥ m}. This proves Lemma A.4.7.

√ to Exercise 4.8.8. Let us first fix n ∈ N. Then, 8n + 1√> 0; therefore, we
Solution
8n + 1 − 1 0−1 8n + 1 − 1
have > > −1. Hence, (581) (applied to q = ) yields
2 2 2
$√ % ( √ )
8n + 1 − 1 8n + 1 − 1
+ 1 = min k ∈ N | k > . (583)
2 2

Let us now fix k ∈ N. We shall prove the following logical equivalence:


√ !
8n + 1 − 1
( an ≤ k) ⇐⇒ k > . (584)
2

In order to do so, let us take a look at the sequence ( a0 , a1 , a2 , . . .). The sequence
( 0 , a1 , a2 , . . .) contains each positive integer i exactly i times. Thus, it contains
a

December 25, 2021


Math 235 notes page 618

the integer 1 exactly once, the integer 2 exactly twice, the integer 3 exactly thrice,
and so on. Hence, this sequence contains a total of 1 + 2 + · · · + k entries that are
≤ k. Since this sequence is furthermore weakly increasing, we know that these
1 + 2 + · · · + k entries are precisely the first 1 + 2 + · · · + k entries of the sequence
( a0 , a1 , a2 , . . .) (since otherwise, the sequence would have an entry ai > k to the left
of an entry a j ≤ k; but this would contradict the fact that the sequence is weakly
increasing). In other words, they are the entries a0 , a1 , . . . , a(1+2+···+k)−1 .
Thus we have shown that the entries of the sequence ( a0 , a1 , a2 , . . .) that are ≤ k
are precisely the entries a0 , a1 , . . . , a(1+2+···+k)−1 . In other words, an entry am of the
sequence ( a0 , a1 , a2 , . . .) is ≤ k if and only if m ∈ {0, 1, . . . , (1 + 2 + · · · + k ) − 1}. In
other words, for each m ∈ N, we have the logical equivalence

( am ≤ k) ⇐⇒ (m ∈ {0, 1, . . . , (1 + 2 + · · · + k) − 1}) .
Applying this to m = n, we obtain the following chain of equivalences:

( an ≤ k )
⇐⇒ (n ∈ {0, 1, . . . , (1 + 2 + · · · + k) − 1})
⇐⇒ ( n ≤ (1 + 2 + · · · + k ) − 1) (since n ∈ N)
⇐⇒ (n < 1 + 2 + · · · + k) (since n and 1 + 2 + · · · + k are integers)
   
k ( k + 1) k ( k + 1)
⇐⇒ n< since 1 + 2 + · · · + k =
2 2
⇐⇒ (8n < 4k (k + 1))
(here, we have multiplied both sides of our inequality by 8)
⇐⇒ (8n + 1 < 4k (k + 1) + 1)
(here, we have added 1 to both sides of our inequality)
   
⇐⇒ 8n + 1 < (2k + 1)2 since 4k (k + 1) + 1 = (2k + 1)2
√ 
⇐⇒ 8n + 1 < 2k + 1
here, we have taken the square root on both sides
 

 of the inequality; this is legitimate because 8n + 1 
and 2k + 1 are positive reals
√ 
⇐⇒ 8n + 1 − 1 < 2k
(here, we have subtracted 1 from both sides of the inequality)
√ !
8n + 1 − 1
⇐⇒ <k
2
(here, we have divided both sides of the inequality by 2)
√ !
8n + 1 − 1
⇐⇒ k> .
2

December 25, 2021


Math 235 notes page 619

Thus, the equivalence (584) is proved.


Now, forget that we fixed k. We thus have proved the equivalence (584) for each
k ∈ N. Now, an is a positive integer (since ( a0 , a1 , a2 , . . .) is a sequence of positive
integers). Hence, an ∈ N. Thus, Lemma A.4.7 (applied to m = an ) yields

an = min {k ∈ N | k ≥ an }
= min {k ∈ N | an ≤ k}
(since the statement “k ≥ an ” is equivalent to “an ≤ k”)
( √ )
8n + 1 − 1
= min k ∈ N | k >
2
since the statement “an ≤ k” is equivalent
 

 8n + 1 − 1 
to “k > ” (by (584))
2
$√ %
8n + 1 − 1
= +1 (by (583))
2
√ !
1√ 8n + 1 − 1 1√
 
1 1
= 8n + 1 + since +1 = 8n + 1 + .
2 2 2 2 2

This solves Exercise 4.8.8.


See also [Engel98, Chapter 5, Exercise 29, Second solution] for a result closely
connected to Exercise 4.8.8 (but notice that our sequence begins with a0 rather than
a1 ).

A.4.9. Discussion of Exercise 4.8.9


Discussion of Exercise 4.8.9. (a) Assume that a/b ∈ Q. We must show that f + g is a
periodic function.
We know that a and b are positive reals. Hence, a/b is a positive real as well. In
other words, a/b > 0. But we also have a/b ∈ Q; hence, we can write a/b in the
form a/b = n/m for some integers n and m 6= 0. Consider these n and m. From
n/m = a/b > 0, we conclude that the two integers n and m are nonzero and have
the same sign (i.e., are either both positive or both negative). Hence, we can WLOG
assume that n and m are positive (since otherwise, we can just replace n and m by
−n and −m, without changing n/m). Assume this. From a/b = n/m, we obtain
ma = nb. Note that ma is a positive real (since m and a are positive).
The function f is a-periodic. In other words, a is a period of f (by the definition
of “a-periodic”). Hence, Theorem 4.7.14 (c) (applied to f and m instead of u and n)
yields that ma is a period of f . But ma is a period of f if and only if every x ∈ R
satisfies f ( x ) = f ( x + ma) (by Definition 4.7.10 (a)). Hence,

every x ∈ R satisfies f ( x ) = f ( x + ma) (585)

December 25, 2021


Math 235 notes page 620

(since ma is a period of f ). The same argument (applied to g, b and n instead of f ,


a and m) shows that
every x ∈ R satisfies g ( x ) = g ( x + nb) . (586)
Now, every x ∈ R satisfies
!
( f + g) ( x ) = f (x) + g (x) = f ( x + ma) + g x + |{z}
nb
| {z } | {z }
=ma
= f ( x +ma) = g( x +nb)
(by (585)) (by (586))
= f ( x + ma) + g ( x + ma) = ( f + g) ( x + ma) .
Recall that ma is a positive real. Hence, ma is a period of f + g if and only
if every x ∈ R satisfies ( f + g) ( x ) = ( f + g) ( x + ma) (by Definition 4.7.10 (a)).
Hence, ma is a period of f + g (since we have just shown that every x ∈ R satisfies
( f + g) ( x ) = ( f + g) ( x + ma)). Therefore, the function f + g has a period (namely,
ma). In other words, this function f + g is periodic (by Definition 4.7.10 (b)). This
solves Exercise 4.8.9 (a).
(b) Assume that a/b ∈ / Q. We shall find an a-periodic function f : R → R and a
b-periodic function g : R → R such that f + g is not periodic.
The easiest way to find such f and g is to define them by setting360
hx i hx i
f (x) = ∈Z and g (x) = ∈Z
a b
for each x ∈ R. Note that each of the functions f and g only takes two different
values (namely, 0 and 1). The function f is a-periodic, since each x ∈ R satisfies
  h  
x+a x i x+a x
f ( x + a) = ∈Z = +1 ∈ Z since = +1
a a a a
hx i  x x 
= ∈Z since + 1 ∈ Z holds if and only if ∈ Z
a a a
= f (x) .
Likewise, the function g is b-periodic.
We now claim that the function f + g is not periodic. Indeed, assume the con-
trary. Thus, f + g is periodic. In other words, there exists a period d of f + g. Con-
sider this d. Since d is a period of f + g, we have ( f + g) (0) = ( f + g) (0 + d) =
( f + g) (d) = f (d) + g (d). Hence,
f (d) + g (d) = ( f + g) (0) = f (0) + g (0) = 1 + 1 = 2.
| {z } | {z }
=1 =1

Since each of f (d) and g (d) is either 0 or 1, we thus conclude that both f (d) and
g (d) must
 equal  1. Thus, in particular,
 f (d) = 1. But the definition of f yields
d d d d
f (d) = ∈ Z . Hence, ∈ Z = f (d) = 1, so that ∈ Z. Likewise, ∈ Z.
a a a b
360 We are using Definition 4.3.19.

December 25, 2021


Math 235 notes page 621

d d
Thus, we have shown that and are integers. These integers are furthermore
b a
d d
positive (since d, a and b are positive). Hence, their ratio / is a well-defined
b a
d d d d a
rational number. In other words, / ∈ Q. But this contradicts / = / Q.

b a b a b
This contradiction shows that our assumption was wrong. Hence, we have shown
that the function f + g is not periodic. This solves Exercise 4.8.9 (b).
(An alternative choice of functions f and g that results in the same conclusion
can be obtained by setting
2πx 2πx
f ( x ) = cos and g ( x ) = cos .
a b
Again, these f and g have the property that ( f + g) (d) cannot equal ( f + g) (0) = 2
d d
for d > 0, because this would cause and to be integers.)
b a

A.4.10. Discussion of Exercise 4.8.10


Discussion of Exercise 4.8.10. Exercise 4.8.10 is known as the Star of David theorem
(conjectured by Henry W. Gould in 1971 – see [Gould72] – and proved soon after
by A. P. Hillman and V. E. Hoggatt, Jr. [HilHog72]). It owes its name to the fact that
the six binomial coefficients it involves are arranged as follows on Pascal’s triangle:

n−1 n−1
   

k−1 k

   
n n
k−1 k+1

   
n+1 n+1
k k+1
(where edges have been drawn to connect binomial coefficients that appear on the
same side of the equation). It can be contrasted with the similar identity
n−1 n−1
       
n n+1 n n+1
= (587)
k−1 k+1 k k k−1 k+1
which also holds for all n, k ∈ Z. However, the latter identity (which is sometimes
also called “Star of David theorem”, as it involves the exact same six binomial
coefficients as Exercise 4.8.10) can be proved by straightforward computations (see
[19fco-hw2s, Exercise 5] for the proof), and can be generalized to
n−r n−r
       
n n+s n n+s
=
k−s k+r k k k−s k+r

December 25, 2021


Math 235 notes page 622

for any r, s ∈ Z, whereas Exercise 4.8.10 has neither a straightforward proof nor
such a generalization. This should not be very surprising: gcds are more compli-
cated than products.
This being said, let me give a solution to Exercise 4.8.10 now. It will rely on the
following lemmas:
Lemma A.4.8. Let u, v, w ∈ Z and m ∈ Z. Then, we have the following logical
equivalence:

(m | u and m | v and m | w) ⇐⇒ (m | gcd (u, v, w)) .

Proof of Lemma A.4.8. Set b1 = u and b2 = v and b3 = w. Thus, we have defined


three integers b1 , b2 , b3 . Now, we have the following chain of equivalences:
 
m | u and m | v and m | w 
|{z} |{z} |{z}
=b1 =b2 =b3
⇐⇒ (m | b1 and m | b2 and m | b3 )
  

⇐⇒ m | gcd  b1 , b2 , b3  (by Theorem 3.4.14, applied to k = 3)


|{z} |{z} |{z}
=u =v =w
⇐⇒ (m | gcd (u, v, w)) .

This proves Lemma A.4.8.


The next lemma collects some useful relations between adjacent entries in Pas-
cal’s triangle:
Lemma A.4.9. Let n and k beany  numbers. Then:
n−1 n
(a) We have n =k .
k − 1 k  
n n
(b) We have (k + 1) = (n − k) .
k + 1 k
n−1
   
n
(c) We have n = (n − k) .
k k

Proof of Lemma A.4.9. There are many ways to prove Lemma A.4.9; in particular,
each of the three parts of this lemma can be proved separately. The following line
of argument is probably thequickest:
n−1
  
n
(c) We must prove that n = (n − k) / N, then this equality is
. If k ∈
k k

December 25, 2021


Math 235 notes page 623

obvious361 . Hence, for the rest of this proof, we WLOG assume that k ∈ N. Thus,
(117) (applied to n − 1 instead of n) yields
n−1 (n − 1) ((n − 1) − 1) ((n − 2) − 2) · · · ((n − 1) − k + 1)
 
=
k k!
( n − 1) ( n − 2) ( n − 3) · · · ( n − k ) 1
= = · ( n − 1) ( n − 2) ( n − 3) · · · ( n − k ) .
k! k!
Multiplying both sides of this equality by n, we find
n−1
 
1
n = n · · ( n − 1) ( n − 2) ( n − 3) · · · ( n − k )
k k!
1
= · n · ( n − 1) ( n − 2) ( n − 3) · · · ( n − k )
k! | {z }
=n(n−1)(n−2)···(n−k)
=n(n−1)(n−2)···(n−k+1)·(n−k)
1
= · n ( n − 1) ( n − 2) · · · ( n − k + 1) · ( n − k )
k!
n ( n − 1) ( n − 2) · · · ( n − k + 1)
 
n
= (n − k) · = (n − k) .
| k!
{z } k
 
n
=
k
(by (117))

This proves Lemma A.4.9 (c).


n−1 n−1
     
n
(a) Theorem 4.3.7 yields = + . Thus,
k k−1 k
n−1 n−1
     
n
= − .
k−1 k k
Multiplying both sides of this equality by n, we obtain
n−1 n−1 n−1
         
n n
n =n − =n − n
k−1 k k k k
| {z  }
n
=(n−k)
k
(by Lemma A.4.9 (c))
       
n n n n
=n − (n − k) = (n − (n − k)) =k .
k k | {z } k k
=k
n−1
   
n
361 Proof. Assume that k ∈ / N. Then, = 0 (by (118)) and = 0 (likewise). Hence,
k k
n−1 n−1
     
n
n = 0 and (n − k) = 0. Comparing these two equalities, we obtain n =
k k k
| {z } | {z }
=0   =0
n−1
   
n n
(n − k) . Thus, we have proved n = (n − k) / N.
under the assumption that k ∈
k k k

December 25, 2021


Math 235 notes page 624

This proves Lemma A.4.9 (a).


(b) Lemma A.4.9 (a) (applied to k + 1 instead of k) yields

n−1
   
n
n = ( k + 1) .
( k + 1) − 1 k+1

Hence,

n−1 n−1
     
n
( k + 1) =n =n (since (k + 1) − 1 = k)
k+1 ( k + 1) − 1 k
 
n
= (n − k) (by Lemma A.4.9 (c)) .
k

This proves Lemma A.4.9 (b).


Solution to Exercise 4.8.10. Define seven numbers A, B, C, D, E, F and M by

n−1 n−1
     
n
A= , B= , C= ,
k−1 k k+1
       
n n+1 n+1 n
D= , E= , F= , M= .
k−1 k k+1 k

All these seven numbers A, B, C, D, E, F and M belong to Z (because of Theorem


4.3.15); in other words, they are integers. Hence, speaking of gcd ( A, C, E) and
gcd ( B, D, F ) makes sense.
We set x = gcd ( A, C, E) and y = gcd ( B, D, F ). Then, x and y are nonnegative
integers (by Proposition 3.4.3 (a)). Our goal is to show that x = y. We shall achieve
this by proving that x | y and y | x (just as in our proof of Theorem 3.4.8).
We have x | x = gcd ( A, C, E). But Lemma A.4.8 (applied to A, C, E and x instead
of u, v, w and m) shows that we have the following logical equivalence:

( x | A and x | C and x | E) ⇐⇒ ( x | gcd ( A, C, E)) .

Hence, we have ( x | A and x | C and x | E) (since we have x | gcd ( A, C, E)). The


same argument (applied to y, B, D and F instead of x, A, C and E) shows that we
have (y | B and y | D and y | F ).
Now, we shall prove a few relations between A, B, C, D, E, F and M. First, we
claim that

M − A = B; (588)
E − M = D, (589)
C + M = F. (590)

These three equalities are clear from Theorem 4.3.7 upon a look at a picture of
Pascal’s triangle, in which the entries A, B, C, D, E, F and M are arranged as

December 25, 2021


Math 235 notes page 625

follows:
A B

D M C

E F
(where each of the entries A, B, C, D, E, F is adjacent to M). 362
We also need two less trivial equalities. Namely, we claim that

− nA − (k + 1) C + (n + 1 − k) E = M. (591)

n−1
 
[Proof of (591): From A = , we obtain
k−1

n−1
   
n
nA = n =k (by Lemma A.4.9 (a))
k−1 k
| {z }
=M
= kM.

362 For the sake of completeness, here are detailed proofs of (588), (589) and (590):
Proof of (588): Theorem 4.3.7 yields

n−1 n−1
     
n
= + = A + B.
k k−1 k
| {z } | {z }
=A =B
 
n
Hence, M = = A + B, so that M − A = B. This proves (588).
k
Proof of (589): Theorem 4.3.7 (applied to n + 1 instead of n) yields

( n + 1) − 1 ( n + 1) − 1
     
n+1
= + = D + M.
k k−1 k
| {z } | {z }
   
n n
= =D = =M
k−1 k
 
n+1
Hence, E = = D + M, so that E − M = D. This proves (589).
k
Proof of (590): Theorem 4.3.7 (applied to n + 1 and k + 1 instead of n and k) yields

( n + 1) − 1 ( n + 1) − 1
     
n+1
= + = M + C = C + M.
k+1 ( k + 1) − 1 k+1
| {z } |  {z  }
 
n n
= =M = =C
k k+1
 
n+1
Hence, F = = C + M. This proves (590).
k+1

December 25, 2021


Math 235 notes page 626

 
n
From C = , we obtain
k+1
   
n n
( k + 1) C = ( k + 1) = (n − k) (by Lemma A.4.9 (b))
k+1 k
| {z }
=M
= (n − k) M.

( n + 1) − 1
   
n
Also, we have M = = (since n = (n + 1) − 1), and therefore
k k

( n + 1) − 1
   
n+1
( n + 1) M = ( n + 1) = (n + 1 − k)
k k
| {z }
=E
(by Lemma A.4.9 (c), applied to n + 1 instead of n)
= (n + 1 − k) E,

so that
(n + 1 − k) E = (n + 1) M.
Now,

nA − (k + 1) C + (n + 1 − k ) E = −kM − (n − k ) M + (n + 1) M = M.
− |{z}
| {z } | {z }
=kM =(n−k) M =(n+1) M

This proves (591).]


Next, we claim that

− nB − (n + 1 − k) D + (k + 1) F = M. (592)

[Proof of (592): We have

− n |{z}
B − (n + 1 − k ) |{z}
D + (k + 1) |{z}
F
= M− A = E− M =C + M
(by (588)) (by (589)) (by (590))
= − n ( M − A ) − ( n + 1 − k ) ( E − M ) + ( k + 1) ( C + M )
= −nM + nA − (n + 1 − k) E + (n + 1 − k) M + (k + 1) C + (k + 1) M
= (−nM + (n + 1 − k) M + (k + 1) M) − (−nA − (k + 1) C + (n + 1 − k) E)
| {z } | {z }
=2M =M
(by (591))
= 2M − M = M.

This proves (592).]


Now, we have some modular arithmetic to do.

December 25, 2021


Math 235 notes page 627

Recall that ( x | A and x | C and x | E). Hence, A ≡ 0 mod x (since x | A) and


C ≡ 0 mod x (since x | C) and E ≡ 0 mod x (since x | E). Now, (591) yields

M = −n |{z}
A − (k + 1) |{z}
C + (n + 1 − k ) |{z}
E
≡0 mod x ≡0 mod x ≡0 mod x
≡ −n · 0 − (k + 1) · 0 + (n + 1 − k) · 0 = 0 mod x.

Now, (588) yields B = M − |{z}


|{z} A ≡ 0 − 0 = 0 mod x, so that x | B. Also,
≡0 mod x ≡0 mod x
(589) yields D = E − |{z}
|{z} M ≡ 0 − 0 = 0 mod x, so that x | D. Finally, (590)
≡0 mod x ≡0 mod x
yields F = C + |{z}
|{z} M ≡ 0 + 0 = 0 mod x, so that x | F. But Lemma A.4.8
≡0 mod x ≡0 mod x
(applied to B, D, F and x instead of u, v, w and m) shows that we have the following
logical equivalence:

( x | B and x | D and x | F ) ⇐⇒ ( x | gcd ( B, D, F )) .

Hence, we have x | gcd ( B, D, F ) (since we have ( x | B and x | D and x | F )). In


other words, x | y (since y = gcd ( B, D, F )).
On the other hand, recall that (y | B and y | D and y | F ). Hence, B ≡ 0 mod y
(since y | B) and D ≡ 0 mod y (since y | D) and F ≡ 0 mod y (since y | F). Now,
(592) yields

B − (n + 1 − k ) |{z}
M = −n |{z} D + (k + 1) |{z}
F
≡0 mod y ≡0 mod y ≡0 mod y
≡ −n · 0 − (n + 1 − k) · 0 + (k + 1) · 0 = 0 mod y.

Now, (588) yields B = M − A, so that A = M − |{z}


|{z} B ≡ 0 − 0 = 0 mod y,
≡0 mod y ≡0 mod y
so that y | A. Also, (589) yields D = E − M, so that E = D + |{z}
|{z} M ≡
≡0 mod y ≡0 mod y
0 + 0 = 0 mod y, so that y | E. Finally, (590) yields F = C + M, so that C =
F − |{z}
|{z} M ≡ 0 − 0 = 0 mod y, so that y | C. But Lemma A.4.8 (applied to
≡0 mod y ≡0 mod y
A, C, E and y instead of u, v, w and m) shows that we have the following logical
equivalence:

(y | A and y | C and y | E) ⇐⇒ (y | gcd ( A, C, E)) .

Hence, we have y | gcd ( A, C, E) (since we have (y | A and y | C and y | E)). In


other words, y | x (since x = gcd ( A, C, E)).
Thus we know that x | y and y | x. Hence, Proposition 3.1.3 (c) (applied to a = x
and b = y) yields | x | = |y|. But x is nonnegative; thus, | x | = x. Similarly, |y| = y.

December 25, 2021


Math 235 notes page 628

Hence, x = | x | = |y| = y. In view of


 
 
 

     
  n 1 n n + 1
x = gcd  A , C , E  = gcd , ,
 |{z}  |{z}  |{z}  k−1 k+1 k
 n−1 n n+1 
 
= = =
k−1 k+1 k

and
 
 
 
n−1
     
  n n+1
y = gcd  |{z}
 B , D , F  = gcd , , ,
 |{z}  |{z}  k k−1 k+1
 n−1
 
n n+1 

= = =
k k−1 k+1

this rewrites as
n−1 n−1
           
n n+1 n n+1
gcd , , = gcd , , .
k−1 k+1 k k k−1 k+1
This solves Exercise 4.8.10.

A.5. Homework set #4 discussion


The following are discussions of the problems on homework set #4 (Section 4.10).

A.5.1. Discussion of Exercise 4.10.1


Discussion of Exercise 4.10.1. We shall use the following simple lemma:
Lemma A.5.1. Let a, b, c, n be four integers such that c 6= 0 and ac ≡ bc mod nc.
Then, a ≡ b mod n.

Proof of Lemma A.5.1. We have ac ≡ bc mod nc. In other words, nc | ac − bc. In other
words, nc | ( a − b) c (since ac − bc = ( a − b) c). But Proposition 3.1.5 (applied to n
and a − b instead of a and b) yields that n | a − b holds if and only if nc | ( a − b) c.
Thus, n | a − b holds (since nc | ( a − b) c holds). In other words, a ≡ b mod n. This
proves Lemma A.5.1.
Solution to Exercise 4.10.1. We know   that k! is a positive integer; hence, k! 6= 0.
n
Theorem 4.3.15 yields that ∈ Z for each n ∈ Z. Hence, the sequence
k
( a0 , a1 , a2 , . . .) is well-defined.

December 25, 2021


Math 235 notes page 629

Let v = uk!. Then, v is a positive integer (since u and k! are positive integers).
We shall now prove that every i ∈ N satisfies ai = ai+v .
Indeed, let i ∈ N. Set j = i + v. Thus, j = i + |{z}
v ≡ i mod v.
≡0 mod v
Applying (117) to n = i, we obtain
i ( i − 1) ( i − 2) · · · ( i − k + 1)
 
i
= .
k k!
Multiplying both sides of this equality by k!, we find
  k −1
i
· k! = i (i − 1) (i − 2) · · · (i − k + 1) = ∏ (i − s) . (593)
k s =0

The same argument (applied to j instead of i) yields


  k −1
j
· k! = ∏ ( j − s) . (594)
k s =0

However, for each s ∈ {0, 1, . . . , k − 1}, we have j −s ≡ i − s mod v. Mul-


|{z}
≡i mod v
tiplying these congruences for all s ∈ {0, 1, . . . , k − 1} (that is, applying (41) to
S = {0, 1, . . . , k − 1} and n = v and as = j − s and bs = i − s), we obtain
k −1 k −1
∏ ( j − s) ≡ ∏ (i − s) mod v.
s =0 s =0

In view of (593) and (594), we can rewrite this as


   
j i
· k! ≡ · k! mod v.
k k
In view of v = uk!, this rewrites as
   
j i
· k! ≡ · k! mod uk!.
k k
   
j i
Hence, Lemma A.5.1 (applied to a = ,b= , c = k! and n = u) yields that
    k k
j i
≡ mod u (since k! 6= 0).
k k    
j i
Proposition 3.3.4 (applied to u, and instead of n, u and v) shows that
    k
  k    
j i j i j
≡ mod u if and only if %u = %u. Thus, we have %u =
k k     k k     k
i j i i j
%u (since ≡ mod u). In other words, %u = %u.
k k k k k

December 25, 2021


Math 235 notes page 630

   
i j
But the definition of ai yields ai = %u. Similarly, a j = %u. Now,
    k k
i j
ai = %u = %u = a j = ai+v (since j = i + v).
k k
Forget that we fixed i. We thus have shown that every i ∈ N satisfies ai = ai+v .
In other words, the sequence ( a0 , a1 , a2 , . . .) is v-periodic (by the definition of “v-
periodic”). In other words, the sequence ( a0 , a1 , a2 , . . .) is uk!-periodic (since v =
uk!). This solves Exercise 4.10.1.

A.5.2. Discussion of Exercise 4.10.2


Discussion of Exercise 4.10.2. Exercise 4.10.2 generalizes Exercise 4.9.7 by removing
the condition x1 = 1. This extra generality is ridiculously shallow: If (y0 , y1 , y2 , . . .)
is the unique (u, v)-recurrent sequence of integers with y0 = 0 and y1 = 1, then
any (u, v)-recurrent sequence ( x0 , x1 , x2 , . . .) satisfying x0 = 0 can be written as
(λy0 , λy1 , λy2 , . . .) for an appropriate number λ (namely, for λ = x1 ), and therefore
Exercise 4.10.2 follows from Exercise 4.9.7 (applied to yi instead of xi ). Here are the
details of this argument:
Solution to Exercise 4.10.2. Define a sequence (y0 , y1 , y2 , . . .) of integers recursively
by setting

y0 = 0, y1 = 1, and
yn = uyn−1 + vyn−2 for each n ≥ 2.

Then, the sequence (y0 , y1 , y2 , . . .) is (u, v)-recurrent363 and satisfies y0 = 0 and


y1 = 1. Hence, Exercise 4.9.7 (applied to yi instead of xi ) yields that all a, b ∈ N
satisfying a | b satisfy
y a | yb . (595)
On the other hand, let λ = x1 . We claim that

xi = λyi for each i ∈ N. (596)

[Proof of (596): Let us prove (596) by strong induction on i:


Induction step: Let n ∈ N. Assume (as the induction hypothesis) that (596) holds
for i < n. We must prove that (596) holds for i = n. In other words, we must prove
that xn = λyn .
Comparing x0 = 0 with λ y0 = 0, we obtain x0 = λy0 . Hence, xn = λyn is
|{z}
=0
proved if n = 0. Thus, for the rest of this proof, we WLOG assume that n 6= 0.

363 since every n ≥ 2 satisfies yn = uyn−1 + vyn−2

December 25, 2021


Math 235 notes page 631

From λ y1 = λ = x1 , we obtain x1 = λy1 . Hence, xn = λyn is proved if n = 1.


|{z}
=1
Thus, for the rest of this proof, we WLOG assume that n 6= 1.
We now have n 6= 0 and n 6= 1. Therefore, n ≥ 2 (since n ∈ N). Hence,
yn = uyn−1 + vyn−2 (since the sequence (y0 , y1 , y2 , . . .) is (u, v)-recurrent) and xn =
uxn−1 + vxn−2 (since the sequence ( x0 , x1 , x2 , . . .) is (u, v)-recurrent).
But from n ≥ 2, we obtain n − 2 ∈ N. Also, n − 1 ∈ N (since n ≥ 2 ≥ 1).
Recall our induction hypothesis, which says that (596) holds for i < n. Hence,
(596) holds for i = n − 2 (since n − 2 ∈ N and n − 2 < n). In other words, we
have xn−2 = λyn−2 . The same argument (applied to n − 1 instead of n − 2) yields
xn−1 = λyn−1 (since n − 1 ∈ N and n − 1 < n). Hence,
xn = u xn−1 +v xn−2 = uλyn−1 + vλyn−2 = λ (uyn−1 + vyn−2 ) = λyn .
|{z} |{z} | {z }
=λyn−1 =λyn−2 =yn
(since yn =uyn−1 +vyn−2 )

In other words, (596) holds for i = n. This completes the induction step. Thus,
(596) is proved.]
Now, let a, b ∈ N satisfy a | b. We must prove that x a | xb . But (596) (applied to
i = a) yields x a = λy a . Similarly, xb = λyb . However, (595) yields y a | yb . In other
words, there exists an integer c such that yb = y a c (by Definition 3.1.2). Consider
this c. We have xb = λ yb = λy a c = x a c. Since c is an integer, we thus have
|{z} |{z}
=y a c =xa
x a | xb . This solves Exercise 4.10.2.

A.5.3. Discussion of Exercise 4.10.3


Discussion of Exercise 4.10.3. Here is one possible generalization of Exercise 4.9.2:
Proposition A.5.2. Let a and b be two numbers. Let ( x0 , x1 , x2 , . . .) and
(y0 , y1 , y2 , . . .) be two ( a, b)-recurrent sequences. Then,

xn+1 yn−1 − xn yn = (−b)n−1 ( x2 y0 − x1 y1 )

for any positive integer n.


Exercise 4.9.2 is the particular case of Proposition A.5.2 for yi = xi .
We can generalize Proposition A.5.2 even further:
Proposition A.5.3. Let a and b be two numbers. Let ( x0 , x1 , x2 , . . .) and
(y0 , y1 , y2 , . . .) be two ( a, b)-recurrent sequences. Then,

x p+1 yq − x p yq+1 = (−b)q x p−q+1 y0 − x p−q y1



(597)

for any p, q ∈ N satisfying p ≥ q.

December 25, 2021


Math 235 notes page 632

Proposition A.5.2 is the particular case of Proposition A.5.3 for p = n and q =


n − 1.
Proof of Proposition A.5.3. We shall prove (597) by induction on q (without fixing p):
Induction base: For any p ∈ N satisfying p ≥ 0, we have x p+1 y0 − x p y0+1 =
 

(−b)0 x p−0+1 y0 − x p−0 y1 (since (−b)0  x p−0+1 y0 − x p−0 y1  = x p+1 y0 − x p y0+1 ).


  
| {z } | {z } |{z} |{z}
=1 = x p +1 = x p = y 0+1
In other words, (597) holds for q = 0 (and any p ∈ N satisfying p ≥ 0).
Induction step: Let m be a positive integer. Assume (as the induction hypothesis)
that (597) holds for q = m − 1 (and any p ∈ N satisfying p ≥ m − 1). We must
prove that (597) holds for q = m (and any p ∈ N satisfying p ≥ m).
We have assumed that (597) holds for q = m − 1 (and any p ∈ N satisfying
p ≥ m − 1). In other words, we have
 
x p+1 ym−1 − x p y(m−1)+1 = (−b)m−1 x p−(m−1)+1 y0 − x p−(m−1) y1 (598)

for any p ∈ N satisfying p ≥ m − 1.


Now, let p ∈ N be such that p ≥ m. The integer m is positive; thus, m ≥ 1. Hence,
m + 1 ≥ 2. But the sequence (y0 , y1 , y2 , . . .) is ( a, b)-recurrent. In other words,
every n ≥ 2 satisfies yn = ayn−1 + byn−2 (by the definition of “( a, b)-recurrent”).
Applying this equality to n = m + 1, we obtain

ym+1 = ay(m+1)−1 + by(m+1)−2 = aym + bym−1 (599)

(since m + 1 ≥ 2).
Also, p ≥ m ≥ 1. Hence, p + 1 ≥ 2. But the sequence ( x0 , x1 , x2 , . . .) is ( a, b)-
recurrent. In other words, every n ≥ 2 satisfies xn = axn−1 + bxn−2 (by the defini-
tion of “( a, b)-recurrent”). Applying this equality to n = p + 1, we obtain

x p+1 = ax( p+1)−1 + bx( p+1)−2 = ax p + bx p−1

(since p + 1 ≥ 2). Thus,


x p+1 − ax p = bx p−1 . (600)
Now,

x p +1 y m − x p y m +1
| {z }
= aym +bym−1
(by (599))
= x p+1 ym − x p ( aym + bym−1 ) = x p+1 ym − x p aym − x p bym−1

= x p+1 − ax p ym − x p bym−1 = bx p−1 ym − x p bym−1
| {z }
=bx p−1
(by (600))

= (−b) x p ym−1 − x p−1 ym . (601)

December 25, 2021


Math 235 notes page 633

However, p ≥ m and thus p − 1 ≥ m − 1 ≥ 0 (since m ≥ 1). In other words,


p − 1 ∈ N. Also, p − 1 ≥ m − 1. Hence, we can apply (598) to p − 1 instead of p.
We thus obtain
 
m −1
x( p−1)+1 ym−1 − x p−1 y(m−1)+1 = (−b) x( p−1)−(m−1)+1 y0 − x( p−1)−(m−1) y1 .

This rewrites as

x p ym−1 − x p−1 ym = (−b)m−1 x p−m+1 y0 − x p−m y1




(since ( p − 1) + 1 = p and (m − 1) + 1 = m and ( p − 1) − (m − 1) = p − m). Thus,


(601) becomes

x p +1 y m − x p y m +1
= (−b) (−b)m−1 x p−m+1 y0 − x p−m y1
 
= (−b) x p y m −1 − x p −1 y m
| {z } | {z }
=(−b)m−1 ( x p−m+1 y0 − x p−m y1 ) =(−b)m

= (−b)m x p−m+1 y0 − x p−m y1 .




Forget now that we fixed p. We thus have shown that

x p+1 ym − x p ym+1 = (−b)m x p−m+1 y0 − x p−m y1




holds for any p ∈ N satisfying p ≥ m. In other words, (597) holds for q = m (and
any p ∈ N satisfying p ≥ m). This completes the induction step. Thus, (597) is
proved. In other words, Proposition A.5.3 is proved.
This solves Exercise 4.10.3. (An alternative proof of Proposition A.5.3 can be
given using the matrix approach, similar to our second solution to Exercise 4.9.2.)

A.5.4. Discussion of Exercise 4.10.4


Discussion of Exercise 4.10.4. There are several ways of solving this. Here is one:
Solution to Exercise 4.10.4. Fix m ∈ N. We must prove that

xn−m yn+m = xn yn − (−1)n+m xm ym (602)

for each n ∈ N satisfying n ≥ m. In other words, we must prove that (602) holds
for each integer n ≥ m.
We shall prove this by induction on n:
Induction base: Comparing xm−m ym+m = 0 with xm ym − (−1)m+m xm ym =
| {z } | {z }
= x0 =0 =1
(since m+m=2m is even)
xm ym − xm ym = 0, we obtain xm−m ym+m = xm ym − (−1)m+m xm ym . In other words,
(602) holds for n = m.

December 25, 2021


Math 235 notes page 634

Induction step: Let k be an integer satisfying k ≥ m. Assume (as the induction


hypothesis) that (602) holds for n = k. We must prove that (602) holds for n = k + 1.
Exercise 4.9.4 (applied to 1, k and k instead of b, n and m) yields

1x0 yk+k + x1 yk+k+1 = 1xk yk + xk+1 yk+1 = xk yk + xk+1 yk+1 .

Hence,

xk yk + xk+1 yk+1 = 1x0 yk+k + x1 yk+k+1 = x0 yk+k + x1 yk+k+1


= x0 y2k + x1 y2k+1 (603)

(since k + k = 2k).
From k ≥ m, we obtain k − m ∈ N. Hence, Exercise 4.9.4 (applied to 1, k − m and
k + m instead of b, n and m) yields

1x0 y(k−m)+(k+m) + x1 y(k−m)+(k+m)+1 = 1xk−m yk+m + xk−m+1 yk+m+1


= x k − m y k + m + x k − m +1 y k + m +1 .
Hence,

xk−m yk+m + xk−m+1 yk+m+1 = 1x0 y(k−m)+(k+m) + x1 y(k−m)+(k+m)+1


= x0 y(k−m)+(k+m) + x1 y(k−m)+(k+m)+1
= x0 y2k + x1 y2k+1
(since (k − m) + (k + m) = 2k). Comparing this with (603), we obtain

x k − m y k + m + x k − m +1 y k + m +1 = x k y k + x k +1 y k +1 .

In other words,

x k − m +1 y k + m +1 = x k y k + x k +1 y k +1 − x k − m y k + m . (604)

We have assumed that (602) holds for n = k. In other words, we have

xk−m yk+m = xk yk − (−1)k+m xm ym .

Hence, (604) becomes

x k − m +1 y k + m +1 = x k y k + x k +1 y k +1 − x y
| k−m{z k+m}
= xk yk −(−1)k+m xm ym
 
= xk yk + xk+1 yk+1 − xk yk − (−1)k+m xm ym
 
k+m k+m
= xk+1 yk+1 − (−1) xm ym = xk+1 yk+1 + − (−1) xm ym
| {z }
=(−1)k+m+1

= xk+1 yk+1 + (−1)k+m+1 xm ym .

December 25, 2021


Math 235 notes page 635

In view of k − m + 1 = (k + 1) − m and k + m + 1 = (k + 1) + m, we can rewrite


this as
x(k+1)−m y(k+1)+m = xk+1 yk+1 + (−1)(k+1)+m xm ym .
In other words, (602) holds for n = k + 1. This completes the induction step. Hence,
(602) is proved. In other words, Exercise 4.10.4 is solved.

A.5.5. Discussion of Exercise 4.10.5


Discussion of Exercise 4.10.5. The solution to Exercise 4.10.5 is rather similar to that
of Exercise 3.7.2, which it generalizes. We will take the lazy route and just copy the
latter solution, modifying whatever we need to modify. We begin with a lemma
that generalizes Lemma A.2.1:
Lemma A.5.4. Let u and v be two integers such that u ⊥ v. Let ( x0 , x1 , x2 , . . .) be
a (u, v)-recurrent sequence of integers with x0 = 0 and x1 = 1. Let a, b ∈ N be
such that a > 0 and a ≤ b. Then, gcd ( x a , xb ) = gcd ( x a , xb−a ).

Proof of Lemma A.5.4. From a > 0, we obtain a ≥ 1 and thus a − 1 ∈ N. Hence,


Exercise 4.9.3 (applied to u, v, b − a, a − 1 and xi instead of a, b, n, m and yi ) yields
x(b−a)+(a−1)+1 = vxb−a x a−1 + x(b−a)+1 x(a−1)+1
| {z } | {z }
= xb− a v =xa
≡0 mod x a
≡ xb−a vx a−1 + x(b−a)+1 0 = xb−a vx a−1 mod x a .
In view of (b − a) + ( a − 1) + 1 = b, this rewrites as xb ≡ xb−a vx a−1 mod x a . Hence,
Proposition 3.4.4 (d) (applied to x a , xb and xb−a vx a−1 instead of a, b and c) yields
gcd ( x a , xb ) = gcd ( x a , xb−a vx a−1 ) . (605)
But recall the claim (216) that was proved during our solution to Exercise 4.9.8.
Applying this claim (216) to n = a − 1, we obtain
x a−1 ⊥ x(a−1)+1 and v ⊥ x(a−1)+1 .

In view of ( a − 1) + 1 = a, this rewrites as


x a −1 ⊥ x a and v ⊥ xa .
Hence, Theorem 3.5.10 (applied to v, x a−1 and x a instead of a, b and c) yields
vx a−1 ⊥ x a . According to Proposition 3.5.4, this yields x a ⊥ vx a−1 . Hence,
Proposition 3.5.18 (applied to x a , xb−a and vx a−1 instead of a, b and c) yields
gcd ( x a , xb−a vx a−1 ) = gcd ( x a , xb−a ). Thus, (605) becomes
gcd ( x a , xb ) = gcd ( x a , xb−a vx a−1 ) = gcd ( x a , xb−a ) .
This proves Lemma A.5.4.

December 25, 2021


Math 235 notes page 636

We can now step to the actual solution to Exercise 4.10.5:


Solution to Exercise 4.10.5 (sketched). We use strong induction on a + b:
Induction step: Let k ∈ N. Assume (as the induction hypothesis) that Exercise
4.10.5 is true for a + b < k. We must prove that Exercise 4.10.5 is true for a + b = k.
Let us do this now.
So let a, b ∈ N be such that a + b = k. We must show that gcd ( x a , xb ) =
xgcd(a,b) .
Note that a and b play symmetric roles in this claim364 , and thus can be swapped
at will. By swapping a and b if necessary, we can ensure that a ≤ b. Hence, we
WLOG assume that a ≤ b. Thus, b − a ∈ N.
It is easy to see that our claim gcd ( x a , xb ) = xgcd(a,b) holds if a = 0 365 . Thus,
we are done if a = 0. Hence, we WLOG assume that a 6= 0. Therefore, a > 0 (since
a ∈ N). Thus, a + b > b, so that b < a + b = k.
But our induction hypothesis says that Exercise 4.10.5 is true for a + b < k.
Hence, we can apply Exercise 4.10.5 to b − a instead of b (since b − a ∈ N and
a + (b − a) = b < k). We thus obtain

gcd ( x a , xb−a ) = xgcd(a,b−a) . (606)

But we have gcd ( a, b − a) = gcd ( a, b) (this has already been proved during our
proof of Theorem 3.4.5). Furthermore, Lemma A.5.4 yields

gcd ( x a , xb ) = gcd ( x a , xb−a ) = xgcd(a,b−a) (by (606))

= xgcd(a,b) (since gcd ( a, b − a) = gcd ( a, b)) .

Now, forget that we fixed a, b. We thus have shown that any a, b ∈ N satisfying
a + b = k satisfy gcd ( x a , xb ) = xgcd(a,b) . In other words, Exercise 4.10.5 is true for
a + b = k. This completes the induction step. Thus, Exercise 4.10.5 is solved.

364 becauseProposition 3.4.4 (b) yields gcd ( a, b) = gcd (b, a) and gcd ( x a , xb ) = gcd ( xb , x a )
365 Proof.
Assume that a = 0. Then, gcd ( a, b) = b (this has already been proved during our above
proof of Theorem 3.4.5) and thus b = gcd ( a, b). Furthermore, from a = 0, we obtain x a = x0 = 0
and therefore

gcd ( x a , xb ) = gcd (0, xb )


= gcd ( xb , 0) (by Proposition 3.4.4 (b))
= | xb | (by Proposition 3.4.4 (a))
= xgcd(a,b) (since b = gcd ( a, b)) ,

qed.

December 25, 2021


Math 235 notes page 637

A.5.6. Discussion of Exercise 4.10.6


Discussion of Exercise 4.10.6. Exercise 4.10.6 is a classic exercise (see, e.g., [Engel98,
Exercise 14.38] or [Strasz65, Problem 31] or [Polya81, Problem 15.53]) that √ can be
used to illustrate various ideas. We shall generalize it by replacing 2 − 1 by
p √
g + 1 − g, where g is an arbitrary nonnegative integer. That is, we shall prove
that there exists some m ∈ N such that
p √ n √ √
g + 1 − g = m + 1 − m. (607)

This generalization does not simplify the problem, but it is so nice I couldn’t leave
it unexplored.366
So let us try to solve the generalized problem. The most straightforward ap-
proach is to try to find the m that satisfies
√ (607)√explicitly (in terms of n and g). The
function that sends each m ∈ N to m + 1 − m ∈ R is strictly decreasing (check
this!) and thus injective; hence, if there is an m ∈ N satisfying (607), then this
m is unique. Furthermore, it can be computed explicitly by solving the equation
(607) for m. More generally, for any fixed nonnegative real a ≤ 1, we can solve the
equation √ √
a = x+1− x (608)
in the unknown x ≥ 0; the solution is always

a − 1/a 2
 
x= (609)
2
p √ n
(check this!). We can apply this to a = g + 1 − g (indeed, it is easy to see
p √
that the number g + 1 − g is positive and ≤ 1; therefore, the same holds for its
n-th power a), and thus we find that the solution m is given by
p √ n p √  n !2
g+1−
g − 1/ g+1− g
m=
2
p √ n p √  n !2
g+1− g − g+1+ g
= (610)
2

(by fairly simple computations367 ). It thus remains to prove that this m is an ele-
ment of N. Thus, we must prove the following theorem:

366 See also [GelAnd17, Problem 941] or [Tomesc85, Problem 1.4] for a variant of this generalization
in which the minus signs are replaced by plus signs.
367 Specifically, we have to notice that 1/
p √  p √
g+1− g = g + 1 + g and thus
p √ n
 p √ n
1/ g+1− g = g+1+ g .

December 25, 2021


Math 235 notes page 638


Theorem A.5.5. Let g ∈ N and n ∈ N. Let λ = g + 1 − g and µ = g + 1 +
p p

g. Let
µ − λn 2
 n 
m= .
2
√ √
Then, we have m ∈ N and λn = m + 1 − m.
We will give two proofs of Theorem A.5.5 and sketch a third one. First, let us
prove an auxiliary lemma:
Lemma A.5.6. Let u and v be two numbers. Let n ∈ N. Then,
 
n k n−k
n n
(u + v) + (u − v) = 2 ∑ k
v u (611)
k∈{0,1,...,n};
k is even

and  
n k n−k
n n
(u + v) − (u − v) = 2 ∑ k
v u . (612)
k∈{0,1,...,n};
k is odd

Proof of Lemma A.5.6. We have u + v = v + u and thus


n  
n k n−k
(u + v) = (v + u) = ∑
n n
v u (613)
k =0
k

(by Theorem 4.3.16, applied to x = v and y = u). Also, u − v = (−v) + u and thus
n  
n
(u − v) = ((−v) + u) = ∑
n n
(−v)k un−k (614)
k =0
k

(by Theorem 4.3.16, applied to x = −v and y = u). Adding this equality to the

December 25, 2021


Math 235 notes page 639

equality (613), we obtain

(u + v)n + (u − v)n
n   n  
n k n−k n
= ∑ v u +∑ (−v)k un−k
k =0
k k =0
k | {z }
=(−1)k vk
n   n  
n k n−k n
= ∑ v u +∑ (−1)k vk un−k
k =0
k k =0
k
n     
n k n−k n
= ∑ k
v u +
k
k k n−k
(−1) v u
k =0 | {z }
|{z}  
= ∑ n  
k∈{0,1,...,n} = 1+(−1)k vk un−k
k
 
n 
= ∑ k
k
1 + (−1) vk un−k
k∈{0,1,...,n}
 
 
n  
∑ k  k n−k
= 1 + (−1) v u
k∈{0,1,...,n};
k  | {z } 
k is even
=1
(since k is even)
 
 
n  
∑ k  k n−k
+ 1 + (−1) v u
k∈{0,1,...,n};
k  | {z } 
k is odd
=−1
(since k is odd)
(since each k ∈ {0, 1, . . . , n} is either even or odd)
   
n n
= ∑ k
k n−k
(1 + 1) v u + ∑ k
(1 + (−1)) vk un−k
k∈{0,1,...,n}; k∈{0,1,...,n};
| {z } | {z }
=2 =0
k is even k is odd
   
n n
= ∑ k
k n−k
· 2v u + ∑ k
· 0vk un−k
k∈{0,1,...,n}; k∈{0,1,...,n};
k is even k is odd
| {z }
=0
   
n n k n−k
= ∑ k
· 2vk un−k =2 ∑ k
v u .
k∈{0,1,...,n}; k∈{0,1,...,n};
k is even k is even

This proves (611).

December 25, 2021


Math 235 notes page 640

Subtracting the equality (614) from the equality (613), we obtain


(u + v)n − (u − v)n
n   n  
n k n−k n
= ∑ v u −∑ (−v)k un−k
k =0
k k =0
k | {z }
=(−1)k vk
n   n  
n k n−k n
= ∑ v u −∑ (−1)k vk un−k
k =0
k k =0
k
n     
n k n−k n
= ∑ k
v u −
k
k k n−k
(−1) v u
k =0
|{z} |   {z }
= ∑ n  
k∈{0,1,...,n} = 1−(−1)k vk un−k
k
 
n 
= ∑ k
1 − (−1)k vk un−k
k∈{0,1,...,n}
 
 
n  
∑ k  k n−k
= 1 − (−1) v u
k∈{0,1,...,n};
k  | {z } 
k is even
=1
(since k is even)
 
 
n  
∑ (−1)k
 k n−k
+ 1 − v u
k∈{0,1,...,n};
k  | {z } 
k is odd
=−1
(since k is odd)
(since each k ∈ {0, 1, . . . , n} is either even or odd)
   
n n
= ∑ k n−k
(1 − 1) v u
k | {z }
+ ∑ (1 − (−1)) vk un−k
k | {z }
k∈{0,1,...,n}; k∈{0,1,...,n};
=0 =2
k is even k is odd
   
n n
= ∑ k
k n−k
· 0v u + ∑ k
· 2vk un−k
k∈{0,1,...,n}; k∈{0,1,...,n};
| k is even {z } k is odd

=0  
n n k n−k
= ∑ k
k n−k
· 2v u =2 ∑ k
v u .
k∈{0,1,...,n}; k∈{0,1,...,n};
k is odd k is odd

This proves (612). Thus, Lemma A.5.6 is proven.

µ − λn 2
 n 
First proof of Theorem A.5.5. We have m = ≥ 0 (since the square of
2 √ √
any real is nonnegative) and thus m + 1 ≥ 1 ≥ 0. Hence, m + 1 and m are
well-defined.

December 25, 2021


Math 235 notes page 641

p √ p √
Multiplying the equalities λ = g+1− g and µ = g+1+ g, we obtain
p √  p √  p 2 √
λµ = g+1− g g+1+ g = g + 1 − ( g )2
| {z } | {z }
=g
= g +1
= ( g + 1) − g = 1. (615)

Hence, the numbers λ andpµ are nonzero and p are each other’s inverses; in partic-

ular, λ = 1/µ. But µ = g+1+ g ≥ g + 1 ≥ 1 (since g + 1 ≥ 1); hence,
1/µ ≤ 1/1 = 1 and thus λ = 1/µ ≤ 1. Also, µ ≥ 1 > 0 and thus 1/µ > 0 and
therefore λ = 1/µ > 0. Now, µ ≥ 1 ≥ λ (since λ ≤ 1), so that µn ≥ λn (since n ≥ 0
µn − λn
and since µ > 0 and λ > 0). Therefore, µn − λn ≥ 0, so that ≥ 0. Now,
2
µ − λn 2
 n 
from m = , we obtain
2
s
√ µ − λn 2
 n 
µn − λn  √ 
m= = since x2 = | x | for each x ∈ R
2 2
n
µ −λ n 
µn − λn

= since ≥0 . (616)
2 2
2
µn − λn

Furthermore, from m = , we obtain
2
2 2
µn − λn µn + λn
 
m+1 = +1 =
2 2
2 2
a−b
 
a+b
(by the equality +1 = , which holds for any two numbers a
2 2
and b). Hence,
s
√ µ + λn 2
 n 
µn + λn  √ 
m+1 = = since x = | x | for each x ∈ R
2
2 2
µn + λn µn + λn
 
= since ≥ 0 (because µ > 0 and λ > 0) .
2 2

Subtracting the equality (616) from this equality, we find


√ √ µn + λn µn − λn
m+1− m= − = λn .
2 2
√ √
Thus, λn = m+1− m is proven. It remains to show that m ∈ N.

December 25, 2021


Math 235 notes page 642

p √ p √
From λ = g + 1 − g and µ = g + 1 + g, we obtain
p √ n p √ n
µn − λn = g+1+ g − g+1− g
n √ k p
  n−k
=2 ∑ ( g)
k | {z } |
g+1
k∈{0,1,...,n}; {z }
k is odd = gk/2
=( g+1)(n−k)/2
 p √ 
by (612), applied to u = g + 1 and v = g
 
n k/2
=2 ∑ k
g ( g + 1)(n−k)/2 .
k∈{0,1,...,n};
k is odd

Dividing both sides of this equality by 2, we find


µn − λn
 
n k/2
2
= ∑ k
g ( g + 1)(n−k)/2 . (617)
k∈{0,1,...,n};
k is odd

Thus, (616) becomes


√ µn − λn
 
n k/2
m=
2
= ∑ k
g ( g + 1)(n−k)/2 . (618)
k∈{0,1,...,n};
k is odd

Now, we make the following three claims:


√ √
Claim 1: If n is even, then there is an integer u such that m = g ·
p
g + 1 · u.
√ √
Claim 2: If n is odd, then there is an integer u such that m = g · u.

Claim 3: We always have m ∈ Z.

[Proof of Claim 1: Assume that n is even. Thus, n = 2r for some r ∈ Z. Consider


this r. We have 2r = n ≥ 0 and thus r ≥ 0. The equality (618) rewrites as

 
2r k/2
m= ∑ k
g ( g + 1)(2r−k)/2 (619)
k∈{0,1,...,2r };
k is odd

(since n = 2r).
Now, the odd elements of the set {0, 1, . . . , 2r } are 1, 3, 5, . . . , 2r − 1. In other
words, the odd elements of the set {0, 1, . . . , 2r } are the elements 2i − 1 for i ∈
{1, 2, . . . , r }. Hence, the map
{1, 2, . . . , r } → {k ∈ {0, 1, . . . , 2r } | k is odd} ,
i 7→ 2i − 1

December 25, 2021


Math 235 notes page 643

is a bijection. Thus, we can substitute 2i − 1 for k in the sum


 
2r k/2
∑ k
g ( g + 1)(2r−k)/2 .
k∈{0,1,...,2r };
k is odd

We thus obtain
 
2r k/2
∑ k
g ( g + 1)(2r−k)/2
k∈{0,1,...,2r };
k is odd
 
2r
= ∑ 2i − 1
g(2i−1)/2 ( g + 1)(2r−(2i−1))/2
i ∈{1,2,...,r }
| {z } | {z }
= g(i−1)+1/2 =( g+1)(r−i)+1/2
(since (2i −1)/2=(i −1)+1/2) (since (2r −(2i −1))/2=(r −i )+1/2)
 
2r
= ∑ 2i − 1
g(i−1)+1/2 ( g + 1)(r−i)+1/2
i ∈{1,2,...,r }
| {z } | {z }
= gi−1 g1/2 =( g+1)r−i ( g+1)1/2
(because i −1 and 1/2 are (because r −i and 1/2 are
nonnegative (since i ∈{1,2,...,r } nonnegative (since i ∈{1,2,...,r }
entails i ≥1 and thus i −1≥0)) entails i ≤r and thus r −i ≥0))
 
2r
= ∑ 2i − 1
gi−1 g1/2 ( g + 1)r−i ( g + 1)1/2
| √
i ∈{1,2,...,r } √
|{z} {z }
= g = g +1


 
2r
∑ g i −1 g ( g + 1 ) r − i g + 1
p
=
i ∈{1,2,...,r }
2i − 1
√ p
 
2r
= g· g+1· ∑ 2i − 1
g i −1 ( g + 1 ) r − i .
i ∈{1,2,...,r }

Hence, (619) becomes



 
2r k/2
m= ∑ k
g ( g + 1)(2r−k)/2
k∈{0,1,...,2r };
k is odd

 
2r
∑ g i −1 ( g + 1 ) r − i .
p
= g· g+1· (620)
i ∈{1,2,...,r }
2i − 1
 
2r
Note that the sum ∑ gi−1 ( g + 1)r−i on the right hand side of this
i ∈{1,2,...,r } 2i − 1
equality is an integer368 . Thus,
the equality (620) showsthat there  is an integer
√ √ 2r
∑ gi−1 ( g + 1)r−i ).
p
u such that m = g · g + 1 · u (namely, u =
i ∈{1,2,...,r } 2i − 1
This proves Claim 1.]
 
368 Indeed, 2r
for each i ∈ {1, 2, . . . , r }, the binomial coefficient is an integer (since Theo-
2i − 1

December 25, 2021


Math 235 notes page 644

[Proof of Claim 2: Assume that n is odd. Thus, n = 2r + 1 for some r ∈ Z.


1
Consider this r. We have 2r + 1 = n ≥ 0 and thus r ≥ − , so that r ≥ 0 (since
2
r ∈ Z). The equality (618) rewrites as


 
2r + 1 k/2
m= ∑ k
g ( g + 1)(2r+1−k)/2 (621)
k∈{0,1,...,2r +1};
k is odd

(since n = 2r + 1).
Now, the odd elements of the set {0, 1, . . . , 2r + 1} are 1, 3, 5, . . . , 2r + 1. In other
words, the odd elements of the set {0, 1, . . . , 2r + 1} are the elements 2i + 1 for
i ∈ {0, 1, . . . , r }. Hence, the map

{0, 1, . . . , r } → {k ∈ {0, 1, . . . , 2r + 1} | k is odd} ,


i 7→ 2i + 1

is a bijection. Thus, we can substitute 2i + 1 for k in the sum


 
2r + 1 k/2
∑ k
g ( g + 1)(2r+1−k)/2 .
k∈{0,1,...,2r +1};
k is odd

 
2r
rem 4.3.15 yields that ∈ Z), and the powers gi−1 and ( g + 1)r−i are integers as well
2i − 1
(since i ∈ {1, 2, .. . , r } entails i − 1 ∈ N and r − i ∈ N). Therefore, each addend of the sum
2r
∑ gi−1 ( g + 1)r−i is an integer. Hence, the sum itself is an integer as well.
i ∈{1,2,...,r } 2i −1

December 25, 2021


Math 235 notes page 645

We thus obtain
 
2r + 1 k/2
∑ k
g ( g + 1)(2r+1−k)/2
k∈{0,1,...,2r +1};
k is odd
 
2r + 1
= ∑ 2i + 1
g(2i+1)/2 ( g + 1)(2r+1−(2i+1))/2
i ∈{0,1,...,r }
| {z } | {z }
= gi+1/2 =( g+1)r−i
(since (2i +1)/2=i +1/2) (since (2r +1−(2i +1))/2=r −i)
 
2r + 1
= ∑ 2i + 1
gi+1/2 ( g + 1)r −i
i ∈{0,1,...,r }
| {z }
= gi g1/2
(because i and 1/2 are
nonnegative)
 
2r + 1 i 1/2
= ∑ 2i + 1
g g ( g + 1)r −i
i ∈{0,1,...,r } √
|{z}
= g
2r + 1 i √
 
= ∑ 2i + 1
g g ( g + 1)r −i
i ∈{0,1,...,r }

 
2r + 1 i
= g· ∑ 2i + 1
g ( g + 1)r −i .
i ∈{0,1,...,r }

Hence, (621) becomes



 
2r + 1 k/2
m= ∑ k
g ( g + 1)(2r+1−k)/2
k∈{0,1,...,2r +1};
k is odd

 
2r + 1 i
= g· ∑ 2i + 1
g ( g + 1)r −i . (622)
i ∈{0,1,...,r }
 
2r + 1 i
Note that the sum ∑ g ( g + 1)r−i on the right hand side of this
i ∈{0,1,...,r } 2i + 1
equality is an integer369 . Thus,
the equality (622)  shows  that there is an integer u
√ √ 2r + 1 i
such that m = g · u (namely, u = ∑ g ( g + 1)r−i ). This proves
i ∈{0,1,...,r } 2i + 1
Claim 2.]
 
369 Indeed, 2r + 1
for each i ∈ {0, 1, . . . , r }, the binomial coefficient is an integer (since Theo-
  2i + 1
2r + 1
rem 4.3.15 yields that ∈ Z), and the powers gi and ( g + 1)r−i are integers as well
2i + 1
(since i ∈ . . . , r } entails i ∈ N and r − i ∈ N). Therefore, each addend of the sum
 {0, 1, 
2r + 1 i
∑ g ( g + 1)r−i is an integer. Hence, the sum itself is an integer as well.
i ∈{0,1,...,r } 2i + 1

December 25, 2021


Math 235 notes page 646

[Proof of Claim 3: The integer n is either even or odd. We thus are in one of the
following two cases:
Case 1: The integer n is even.
Case 2: The integer n is odd.
n is even. Hence, Claim
Let us first consider Case 1. In this case, √the integer p

1 yields that there is an integer u such that m = g · g + 1 · u. Consider this
√ √ p
u. Squaring both sides of the equality m = g · g + 1 · u, we obtain m =
√ p 2
g · g + 1 · u = g ( g + 1) u2 ∈ Z (since g, g + 1 and u are integers). Thus,
Claim 3 is proved in Case 1.
Let us now consider Case 2. In this case, √ the integer n is odd. Hence, Claim 2

yields that there is an integer u such that m = g · u. Consider this u. Squaring
√ √ √ 2
both sides of the equality m = g · u, we obtain m = g · u = gu2 ∈ Z (since
g and u are integers). Thus, Claim 3 is proved in Case 2.
We have now proved Claim 3 in both Cases 1 and 2. Hence, Claim 3 always
holds.]
Claim 3 yields m ∈ Z. Hence, m ∈ N (since m ≥ 0). This completes the proof of
Theorem A.5.5.
Second proof of Theorem A.5.5. As in the first√proof of √
Theorem A.5.5 above, we can
n
show that m ≥ 0 and λµ = 1 and λ = m + 1 − m. It remains to show that
m ∈ N.
µ − λn 2
 n 
Multiplying both sides of the equality m = by 4, we find
2

4m = (µn − λn )2 = (µn )2 + (λn )2 −2 µn λn


| {z } | {z } | {z }
=µ2n =λ2n =λn µn =(λµ)n =1n
(since λµ=1)

1n = µ2n + λ
= µ2n + λ2n − 2 · |{z} 2n
− 2. (623)
=1
p √ p √
Now, from λ = g+1− g and µ = g+1+ g, we obtain

2n 2n
p √ 2n p √ 2n
µ +λ = g+1+ g + g+1− g
2n √ k p
  2n−k
=2 ∑ ( g )
k | {z } |
g + 1
k∈{0,1,...,2n}; {z }
k/2
=g
k is even =( g+1)(2n−k)/2
p √ !
by (611), applied to g + 1, g and 2n
instead of u, v and n
 
2n k/2
=2 ∑ k
g ( g + 1)(2n−k)/2 . (624)
k ∈{0,1,...,2n};
k is even

December 25, 2021


Math 235 notes page 647

Now, the even elements of the set {0, 1, . . . , 2n} are 0, 2, 4, . . . , 2n. In other words,
the even elements of the set {0, 1, . . . , 2n} are the elements 2i for i ∈ {0, 1, . . . , n}.
Hence, the map

{0, 1, . . . , n} → {k ∈ {0, 1, . . . , 2n} | k is even} ,


i 7→ 2i

is a bijection. Thus, we can substitute 2i for k in the sum


 
2n k/2
∑ k
g ( g + 1)(2n−k)/2 .
k∈{0,1,...,2n};
k is even

We thus obtain
 
2n k/2
∑ k
g ( g + 1)(2n−k)/2
k∈{0,1,...,2n};
k is even
 
2n
= ∑ 2i
g2i/2 ( g + 1)(2n−2i)/2
i ∈{0,1,...,n}
|{z} | {z }
| {z } = gi =( g+1)n−i
n (since 2i/2=i) (since (2n−2i )/2=n−i)
=∑
i =0
n  
2n i
= ∑ 2i
g ( g + 1) n −i . (625)
i =0

The sum on the right hand side of this equality is an integer370 ; but we shall fur-
thermore show that it is an odd integer. In other words, we shall show that
n  
2n
∑ 2i gi ( g + 1)n−i is odd. (626)
i =0

[Proof of (626): We are in one of the following two cases:


Case 1: The integer g is even.
Case 2: The integer g is odd.
Let us first consider Case 1. In this case, the integer g is even. Hence, 2 | g and

 
370 Indeed, 2n
for each i ∈ {0, 1, . . . , n}, the binomial coefficient is an integer (since Theo-
  2i
2n
rem 4.3.15 yields that ∈ Z), and the powers gi and ( g + 1)n−i are integers as well
2i
 i∈ {0, 1, . . . , n} entails i ∈ N and n − i ∈ N). Therefore, each addend of the sum
(since
n 2n i
∑ g ( g + 1)n−i is an integer. Hence, the sum itself is an integer as well.
i =0 2i

December 25, 2021


Math 235 notes page 648

g ≡ 0 mod 2. Now,
n  
2n
∑ 2i gi ( g + 1)n−i
i =0
n    
2n 2n
=∑ g i n −i
( g + 1) + g 0 ( g + 1 ) n −0
i =1
2i |{z} 2 · 0 |{z} | {z }
≡0 mod 2 | {z } =1 =( g+1)n
(since 2| g| gi 2n
(because i ≥1)) = =1
0
(by (119))
 n
n  
2n
≡ ∑ 2i
0 ( g + 1)n−i +  g +1 ≡ (0 + 1)n = 1n = 1 mod 2.
i =1
|{z}
| {z } ≡0 mod 2
=0
 
2n i n
In other words, ∑ g ( g + 1)n−i is odd. Thus, (626) is proved in Case 1.
i =0 2i
Let us now consider Case 2. In this case, the integer g is odd. Hence, g ≡ 1 mod 2,
so that g +1 ≡ 1 + 1 = 2 ≡ 0 mod 2. Now,
|{z}
≡1 mod 2
  n −i
n   n  
2n i  2n i n−i
∑ 2i
g g+1  ≡ ∑ 2i
g0
i =0 i =0
| {z }
≡0 mod 2
n −1    
2n i 2n
= ∑ 2i
g 0 n −i
|{z} +
2n
n−n
gn 0|{z}
i =0 =0 | {z } =00 =1
(since n−i ≥1 =1
(because i ≤n−1)) (by (124))
 n
n −1  
2n i
= ∑ 2i
g 0 + gn = gn =  g  ≡ 1n = 1 mod 2.
|i=0
|{z}
{z } ≡1 mod 2
=0
 
2n i n
In other words, ∑ g ( g + 1)n−i is odd. Thus, (626) is proved in Case 2.
i =0 2i
We have now proved (626) in both Cases  1 and
 2. Hence, (626) always holds.]
n 2n i
We have thus shown that the integer ∑ g ( g + 1)n−i is odd. In other words,
i =0 2i
n  
2n i
∑ 2i
g ( g + 1)n−i = 2u + 1 (627)
i =0

December 25, 2021


Math 235 notes page 649

for some integer u. Consider this u. Now, (624) becomes


  n  
2n k/2 2n i
2n 2n
µ +λ = 2 ∑ k
g ( g + 1) (2n−k)/2
=2∑
2i
g ( g + 1) n −i
k∈{0,1,...,2n}; i =0
| k is even
| {z }
{z } =2u+1
  (by (627))
n 2n i n −i
=∑ g ( g +1)
i =0 2i
(by (625))
= 2 (2u + 1) .

Now, (623) becomes

4m = µ2n + λ2n −2 = 2 (2u + 1) − 2 = 4u.


| {z }
=2(2u+1)

Cancelling the factor 4 from this equality, we find m = u. Hence, m is an integer


(since u is an integer). Since m ≥ 0, we thus obtain m ∈ N. This again completes
the proof of Theorem A.5.5.
Third proof of Theorem A.5.5 (sketched). As in the first
√ proof of √ Theorem A.5.5 above,
n
we can show that m ≥ 0 and λµ = 1 and λ = m + 1 − m. It remains to show
that m ∈ N.
Let us rename m as mn , in order to stress its dependence on n. Thus, we need to
show that mn ∈ N. Forget that we fixed n.
Now, it is not hard to see that m0 = 0 and m1 = g and m2 = 4g ( g + 1). Also, for
each n ∈ N, we have
 
 n 2
µ − λn

1 1
mn = = ( µ n − λ n )2 =  ( µ n )2 + ( λ n )2 −2 µ n λ n 

2 4 4 | {z } | {z } | {z }
=µ2n =λ2n =λn µn =(λµ)n
  n 
1  2n 2n 1  2 n  2 n n

=  µ + |{z} −2 · λµ = + λ −2·1

λ   µ
4 |{z} n
|{z} 4
=(µ2 )n =(λ2 ) =1
1 2
n 1  2  n −1 n
= µ + λ + ·1 . (628)
4 4 2
This formula looks much like (224): The right hand side is a sum of several n-
th powers multiplied by constant coefficients. This strongly suggests that our
sequence (m0 , m1 , m2 , . . .) should be ( a1 , a2 , a3 )-recurrent for some three numbers
a1 , a2 , a3 (three because there are three n-th powers on the right hand side of (628)).
How do we find these a1 , a2 , a3 ? If the formula (628) is to be an instance of (224),
then the bases of the three powers on the right hand side (628) (that is, the three

December 25, 2021


Math 235 notes page 650

numbers µ2 , λ2 and 1) should be the roots of the polynomial X 3 − a1 X 2 − a2 X − a3 .


This means that we should have
  
X − µ2 X − λ2 ( X − 1) = X 3 − a1 X 2 − a2 X − a3 .

But a straightforward computation shows that


  
X − µ2 X − λ2 ( X − 1) = X 3 − (4g + 3) X 2 + (4g + 3) X − 1.

Comparing these two equations yields a1 = 4g + 3 and a2 = − (4g + 3) and a3 = 1.


Thus, we guess that our sequence (m0 , m1 , m2 , . . .) should be (4g + 3, − (4g + 3) , 1)-
recurrent. In other words, we guess that

mn = (4g + 3) mn−1 − (4g + 3) mn−2 + mn−3 (629)

for each n ≥ 3.
Proving this guess is easy: Just rewrite the four values mn , mn−1 , mn−2 , mn−3 on
both sides of (629) using (628), and then use the equalities
 n   n −1   n −2   n −3
2 2 2 2
µ = (4g + 3) µ − (4g + 3) µ + µ ,
 n   n −1   n −2   n −3
λ2 = (4g + 3) λ2 − (4g + 3) λ2 + λ2 ,
1n = (4g + 3) 1n−1 − (4g + 3) 1n−2 + 1n−3

(which follow from the fact that µ2 , λ2 and 1 are roots of the polynomial X 3 −
(4g + 3) X 2 + (4g + 3) X − 1).
Thus, the sequence (m0 , m1 , m2 , . . .) is (4g + 3, − (4g + 3) , 1)-recurrent. Since the
first three entries of this sequence are integers (indeed, m0 = 0 ∈ Z and m1 = g ∈ Z
and m2 = 4g ( g + 1) ∈ Z), we thus conclude (by strong induction on n) that all its
entries mn are integers (since 4g + 3, − (4g + 3) and 1 are integers). In other words,
mn is an integer for all n ∈ N. Since we also know that mn ≥ 0, we thus conclude
that mn ∈ N for all n ∈ N. This proves Theorem A.5.5.
Now, let us solve Exercise 4.10.6 at last. Indeed, set g = 1. Define λ,√µ and m as
√ in
Theorem A.5.5. Then, Theorem A.5.5 yields that m ∈ N and λ = m + 1 − m.
n

But
p √ √ √
λ = g + 1 − g = | 1{z+ 1} − |{z} 1 (since g = 1)

= 2 =1

2 − 1,
=
√ n √ n √ √
so that λn = 2 − 1 . Hence, 2 − 1 = λn = m + 1 − m. Thus, we have
√ n √ √
found an m ∈ N such that 2 − 1 = m + 1 − m. This shows that such an
m exists. Thus, Exercise 4.10.6 is solved.

December 25, 2021


Math 235 notes page 651

A.5.7. Discussion of Exercise 4.10.7


Discussion of Exercise 4.10.7. Exercise 4.10.7 is Exercise 2 from the 33rd Virginia Tech
Regional Mathematics Contest. The trick is to guess the explicit formula for an ;
proving it afterwards is straightforward. The formula is the following: For each
n ∈ N, we have
an = n2 − 1. (630)
For the sake of completeness, let us give the straightforward proof of (630):
[Proof of (630): We shall prove (630) by strong induction on n:
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that (630) holds
for n < m. We must prove that (630) holds for n = m. In other words, we must
prove that am = m2 − 1.
This is certainly true if m = 0 (since a0 = −1 = 02 − 1), and is also true if m = 1
(since a1 = 0 = 12 − 1). Hence, for the rest of this proof, we WLOG assume that
m is neither 0 nor 1. Therefore, m ≥ 2 (since m ∈ N). Hence, m − 1 ∈ N and
m − 2 ∈ N.
We have assumed that (630) holds for n < m. Thus, (630) holds for n = m − 1
(since m − 1 ∈ N and m − 1 < m). In other words, we have am−1 = (m − 1)2 −
1. The same argument (applied to m − 2 instead of m − 1) shows that am−2 =
(m − 2)2 − 1 (since m − 2 ∈ N and m − 2 < m).
Now, recall that an = a2n−1 − n2 an−2 − 1 for all n ≥ 2 (by the definition of our
sequence). Applying this to n = m, we find
 2  

am = a2m−1 − m2 am−2 − 1 = (m − 1)2 − 1 − m2 (m − 2)2 − 1 − 1


   
| {z } | {z }
= m ( m −2) =(m−3)(m−1)
 
since am−1 = (m − 1)2 − 1 and am−2 = (m − 2)2 − 1
 
= (m (m − 2))2 − m2 (m − 3) (m − 1) − 1 = m2 (m − 2)2 − (m − 3) (m − 1) −1
| {z }
=1
2
= m − 1.
This completes the induction step. Thus, (630) is proved by induction.]
The formula (630) can now be applied to n = 100, resulting in a100 = 1002 − 1 =
9999.
A better question is: How would one come up with a formula like (630)? One
way is to recognize the first few entries a0 = −1, a1 = 0, a2 = 3, a3 = 8 and
a4 = 15 as 02 − 1, 12 − 1 and so on. This is arguably easier with the benefit of
hindsight. How else could one discover (630)? I think a natural way to do so
is to observe that the sequence ( a0 , a1 , a2 , . . .) grows “a lot slower than expected”.
To wit, the recurrence equation an = a2n−1 − n2 an−2 − 1 for computing an entry
an involves squaring the preceding entry an−1 ; this suggests a doubly exponential
growth (which would certainly be the case if the “−” signs were replaced by “+”

December 25, 2021


Math 235 notes page 652

signs). Yet a look at the first 10 or so entries of the sequence suggests a much
slower growth – polynomial perhaps. This is not a rigorous argument – the growth
behavior of a sequence is not determined by its first 10 entries, or by its first 1000
entries for that matter – but it is a remarkable observation that calls for explanation.
Guided by this observation, one might look for a polynomial formula for an – that
is, a polynomial P such that an = P (n) for all n ∈ N. Making the reasonable
assumption that deg P shouldn’t be too large, one can then find P using polynomial
interpolation. The result is the formula (630). Of course, this does not substitute
for a rigorous proof of (630).

A.5.8. Discussion of Exercise 4.10.8


Discussion of Exercise 4.10.8. Exercise 4.10.8 is [Galvin20, Chapter 7, Problem 2].
Fairly similar exercises appear all over the literature; see, e.g., [Engel98, Problem
14.30]. The trick is always the same: Whenever you see a quadratic irrationality
√ √
like a + b q, try to also get its conjugate a − b q (that is, the other root of the

quadratic equation X 2 = 2aX + b2 q − a2 , whose first root is a + b q) involved.

√ √ √
In the case of this exercise, the conjugate of 1 + 2 is 1 − 2, and (unlike 1 + 2)
this is a real number between −1 and 0. Thus, its n-th power
(
 √ n between 0 and 1, if n is even;
1− 2 lies (631)
between − 1 and 0, if n is odd.
 √ n  √ n
But the binomial formula can easily be used to show that 1 + 2 + 1 − 2
is an even integer – let’s call it 2u. From (631), we thus conclude that
(
 √ n between 2u − 1 and 2u, if n is even;
1+ 2 lies
between 2u and 2u + 1, if n is odd.

Hence, (
j √ n k 2u − 1, if n is even;
1+ 2 =
2u, if n is odd.
Since 2u is even and 2u − 1 is odd, the claim of the exercise thus follows.
The same argument can be used to prove the following more general result:

Theorem A.5.7. Let m, q ∈ N satisfy m2 < q < (m + 1)2 . Let n ∈ N. Then,


j √ n
 k
m+ q is even if and only if n is odd.

For the sake of completeness, here is a proof of this theorem (following the above
plan):
√ √
Proof of Theorem A.5.7. Let λ = m + q and µ = m − q.

December 25, 2021


Math 235 notes page 653

Taking square roots on all sides of the inequality chain m2 < q < (m + 1)2 , we

obtain m < q < m + 1 (since all of m, q and m + 1 are nonnegative reals). Hence,
√ √ √ √
µ = m − q < 0 (since m < q) and µ = m − q > −1 (since q < m + 1). From
µ < 0, we see that µ is negative, so that |µ| = −µ. Hence, |µ| = −µ < 1 (since
µ > −1). Thus, |µ|n ≤ 1 (since |µ| is nonnegative), so that |µn | = |µ|n ≤ 1.
√ √
From λ = m + q and µ = m − q, we obtain

√ n √ n n √ k n−k
 
n n
λ + µ = (m + q) + (m − q) = 2 ∑ ( q) m
k | {z }
k∈{0,1,...,n};
k is even =qk/2

(by (611), applied to u = m and v = q)
 
n k/2 n−k
=2 ∑ k
q m . (632)
k∈{0,1,...,n};
k is even
 
n k/2 n−k
The sum ∑ q m is an integer371 . Let us denote this integer by
k∈{0,1,...,n}; k
k is even
u. Thus,  
n k/2 n−k
u= ∑ k
q m .
k∈{0,1,...,n};
k is even
Hence, (632) rewrites as λn + µn
= 2u. Hence, 2u = λn + µn .
Now, we are in one of the following two cases:
Case 1: The integer n is even.
Case 2: The integer n is odd.
Let us first consider Case 1. In this case, the integer n is even. Hence, αn ≥ 0 for
each positive real α. Applying this to α = µ, we obtain µn ≥ 0. Thus, |µn | = µn , so
that µn = |µn | ≤ 1. Also, µ 6= 0 (since µ < 0), so that µn 6= 0 and thus µn > 0 (since
µn ≥ 0).
The integer 2u − 1 satisfies 2u − 1 ≤ λn (since 2u = λn + µn ≤ λn + 1) and
|{z}
≤1

  Then, k ∈ {0, 1, . . . , n} ⊆ N, so that k ≥ 0and


371 Proof.Let k ∈ {0, 1, . . . , n} be even.  thus
n n
k/2 ≥ 0. The binomial coefficient is an integer (since Theorem 4.3.15 yields that ∈ Z).
k k
Moreover, k/2 ∈ Z (since k is even), so that k/2 ∈ N (since k/2 ≥ 0). Hence, qk/2 is an integer.
Also, k ≤ n (since   k ∈ {0, 1, . . . , n}) and thus n − k∈ N. Hence, mn−k is an integer. Now, we
n k/2 n−k n
conclude that q m is an integer (since , qk/2 and mn−k are integers).
k k  
n k/2 n−k
Forget that we fixed k. We thus have proved that q m is an integer for each even
k  
n k/2 n−k
k ∈ {0, 1, . . . , n}. In other words, each addend of the sum ∑ q m is an integer.
k ∈{0,1,...,n}; k
k is even
Hence, the whole sum is an integer as well.

December 25, 2021


Math 235 notes page 654

λn < 2u (since 2u = λn + µn > λn ). Thus, the integer 2u − 1 is ≤ λn (since


|{z}
>0
2u − 1 ≤ λn ), while the next integer 2u is no longer ≤ λn (since λn < 2u). Therefore,
the largest integer that is ≤ λn is 2u − 1. In other words, bλn c is 2u − 1 (since bλn c
was defined as the largest integer that is ≤ λn (by the definition of a floor)). In
other words, bλn c = 2u − 1. But 2u − 1 is odd (since u is an integer). In other

words, bλjn c is odd (since bλn c = 2u − 1). In viewk of λ = m + q, this rewrites as
√ n k j √ n
follows: m+ q is odd. Thus, m + q is not even. Also, n is not odd
j √ n k
(since n is even). Thus, we conclude that m + q is even if and only if n is
j √ n k
odd (because we know that m + q is not even, and that n is not odd). In
other words, Theorem A.5.7 is proved in Case 1.
Let us now consider Case 2. In this case, the integer n is odd. Hence, αn < 0
for each negative real α. Applying this to α = µ, we obtain µn < 0 (since µ is
negative). Hence, |µn | = −µn , so that −µn = |µn | = |µ|n . But we have |µ| < 1 and
therefore |µ|n < 1 (since n ≥ 1 (because n is an odd nonnegative integer)). Hence,
−µn = |µ|n < 1. In other words, µn > −1.
The integer 2u satisfies 2u ≤ λn (since 2u = λn + µn < λn ) and λn < 2u + 1
|{z}
<0
(since 2u = λn + µn > λn + (−1) = λn − 1). Thus, the integer 2u is ≤ λn (since
|{z}
>−1
2u ≤ λn ), while the next integer 2u + 1 is no longer ≤ λn (since λn < 2u + 1).
Therefore, the largest integer that is ≤ λn is 2u. In other words, bλn c is 2u (since
bλn c was defined as the largest integer that is ≤ λn (by the definition of a floor)).
In other words, bλn c = 2u. But 2u is even (since u is an integer). In other words,

bλn c is evenk(since bλn c = 2u). In view of λ =j m + q, this rewrites as follows:
j √ n √ n k
m+ q is even. Thus, we conclude that m + q is even if and only if
j √ n k
n is odd (because we know that m + q is even, and that n is odd). In other
words, Theorem A.5.7 is proved in Case 2.
We have now proved Theorem A.5.7 in both Cases 1 and 2. Hence, the proof of
Theorem A.5.7 is complete.
Exercise 4.10.8 follows by applying Theorem A.5.7 to m = 1 and q = 2 (since
12 < 2 < (1 + 1)2 ).

A.5.9. Discussion of Exercise 4.10.9


Discussion of Exercise 4.10.9. Exercise 4.10.9 has appeared in the thread https://
artofproblemsolving.com/community/c6h49408p314696 . The following solution
is taken from said thread.
Solution to Exercise 4.10.9. We assumed that m | k + 1. Thus, there exists an integer
q such that k + 1 = mq. Consider this q.

December 25, 2021


Math 235 notes page 655

k + a n −1 a n −2
For each integer n ≥ 3, we have an = (by the definition of the
a n −3
sequence ( a0 , a1 , a2 , . . .)) and thus

a n a n −3 = k + a n −1 a n −2

and therefore
an an−3 − an−1 an−2 = k. (633)
Applying this to n = 3, we find a3 a3−3 − a3−1 a3−2 = k. In view of a3−3 = a0 = 1
and a3−1 = a2 = m and a3−2 = a1 = 1, this rewrites as a3 · 1 − m · 1 = k. Hence,
a3 · 1 = m · 1 + k = m + k, so that a3 = a3 · 1 = m + k.
Now, we will show the following:

Observation 1: Let u be an integer such that u ≥ 4. Then, ( au + au−2 ) au−3 =


( a u −2 + a u −4 ) a u −1 .

[Proof of Observation 1: We have u − 1 ≥ 3 (since u ≥ 4). Hence, (633) (applied to


n = u − 1) yields
au−1 a(u−1)−3 − a(u−1)−1 a(u−1)−2 = k.
Hence,

k = au−1 a(u−1)−3 − a(u−1)−1 a(u−1)−2 = au−1 au−4 − au−2 au−3 . (634)


| {z } | {z } | {z }
= a u −4 = a u −2 = a u −3

Also, u ≥ 4 ≥ 3. Hence, (633) (applied to n = u) yields

a u a u −3 − a u −1 a u −2 = k = a u −1 a u −4 − a u −2 a u −3

(by (634)). In other words,

a u a u −3 + a u −2 a u −3 = a u −1 a u −4 + a u −1 a u −2 .

In view of

a u −1 a u −4 + a u −1 a u −2 = a u −1 ( a u −4 + a u −2 ) = ( a u −4 + a u −2 ) a u −1 = ( a u −2 + a u −4 ) a u −1

and
a u a u −3 + a u −2 a u −3 = ( a u + a u −2 ) a u −3 ,
this rewrites as ( au + au−2 ) au−3 = ( au−2 + au−4 ) au−1 . This proves Observation 1.]
The core of our argument will be the following two observations:

Observation 2: We have an = (m + 1) an−1 − an−2 for each even integer


n ≥ 2.

Observation 3: We have an = (q + 1) an−1 − an−2 for each odd integer


n ≥ 2.

December 25, 2021


Math 235 notes page 656

[Proof of Observation 2: We shall prove Observation 2 by strong induction on n:


Induction step: Let u be an even integer such that u ≥ 2. Assume (as the induction
hypothesis) that Observation 2 holds for n < u. We must prove that Observation 2
holds for n = u. In other words, we must prove that au = (m + 1) au−1 − au−2 .
If u = 2, then this is easy to check372 . Hence, we WLOG assume that u 6= 2.
Hence, u > 2 (since u ≥ 2) and therefore u ≥ 4 (since u is an even integer). In other
words, u − 2 ≥ 2. Moreover, u − 2 is an even integer (since u is an even integer).
But our induction hypothesis says that Observation 2 holds for n < u. Hence, we
can apply Observation 2 to n = u − 2 (since u − 2 is an even integer satisfying
u − 2 ≥ 2 and u − 2 < u). Thus, we obtain
au−2 = (m + 1) a(u−2)−1 − a(u−2)−2 = (m + 1) au−3 − au−4 .
| {z } | {z }
= a u −3 = a u −4

In other words, au−2 + au−4 = (m + 1) au−3 . Now, Observation 1 yields


( a u + a u −2 ) a u −3 = ( a u −2 + a u −4 ) a u −1 = ( m + 1 ) a u −3 a u −1 . (635)
| {z }
=(m+1) au−3

But the number au−3 is positive (since ( a0 , a1 , a2 , . . .) is a sequence of positive in-


tegers) and thus nonzero; hence, we can cancel au−3 from the equality (635). We
thus find au + au−2 = (m + 1) au−1 . In other words, au = (m + 1) au−1 − au−2 . This
completes our induction step. Thus, Observation 2 is proved.]
[Proof of Observation 3: We shall prove Observation 3 by strong induction on n:
Induction step: Let u be an odd integer such that u ≥ 2. Assume (as the induction
hypothesis) that Observation 3 holds for n < u. We must prove that Observation 3
holds for n = u. In other words, we must prove that au = (q + 1) au−1 − au−2 .
If u = 3, then this is easy to check373 . Hence, we WLOG assume that u 6= 3. Also,
u 6= 2 (since u is odd), so that u > 2 (since u ≥ 2) and therefore u ≥ 3 (since u is
an integer). Combining this with u 6= 3, we obtain u > 3, and thus u ≥ 4 (since u
is an integer). In other words, u − 2 ≥ 2. Moreover, u − 2 is an odd integer (since
u is an odd integer). But our induction hypothesis says that Observation 3 holds
for n < u. Hence, we can apply Observation 3 to n = u − 2 (since u − 2 is an odd
integer satisfying u − 2 ≥ 2 and u − 2 < u). Thus, we obtain
au−2 = (q + 1) a(u−2)−1 − a(u−2)−2 = (q + 1) au−3 − au−4 .
| {z } | {z }
= a u −3 = a u −4
372 Proof.
Assume that u = 2. Thus, au = a2 = m and au−1 = a2−1 = a1 = 1 and au−2 = a2−2 =
a0 = 1. Hence, (m + 1) au−1 − au−2 = (m + 1) − 1 = m. Comparing this with au = m, we find
|{z} |{z}
=1 =1
au = (m + 1) au−1 − au−2 . Thus, au = (m + 1) au−1 − au−2 is proved under the assumption that
u = 2.
373 Proof. Assume that u = 3. Thus, a = a = m + k and a
u 3 u−1 = a3−1 = a2 = m and au−2 = a3−2 =
a1 = 1. Hence, (q + 1) au−1 − au−2 = (q + 1) m − 1 = m + mq −1 = m + (k + 1) − 1 = m + k.
|{z} |{z} |{z}
=m =1 = k +1
Comparing this with au = m + k, we find au = (q + 1) au−1 − au−2 . Thus, au = (q + 1) au−1 −
au−2 is proved under the assumption that u = 3.

December 25, 2021


Math 235 notes page 657

In other words, au−2 + au−4 = (q + 1) au−3 . Now, Observation 1 yields

( a u + a u −2 ) a u −3 = ( a u −2 + a u −4 ) a u −1 = ( q + 1 ) a u −3 a u −1 . (636)
| {z }
=(q+1) au−3

But the number au−3 is positive (since ( a0 , a1 , a2 , . . .) is a sequence of positive in-


tegers) and thus nonzero; hence, we can cancel au−3 from the equality (636). We
thus find au + au−2 = (q + 1) au−1 . In other words, au = (q + 1) au−1 − au−2 . This
completes our induction step. Thus, Observation 3 is proved.]
It is now straightforward to solve Exercise 4.10.9 by induction. Indeed, we must
show that
an is an integer (637)
for each n ∈ N. We shall prove (637) by strong induction on n:
Induction step: Let u ∈ N. Assume (as the induction hypothesis) that (637) holds
for n < u. We must prove that (637) holds for n = u. In other words, we must
prove that au is an integer. If u = 0 or u = 1, then this is clear (because a0 = 1
and a1 = 1 are integers). Thus, we WLOG assume that we have neither u = 0 nor
u = 1. Hence, we must have u ≥ 2 (since u ∈ N). Thus, u − 1 ∈ N and u − 2 ∈ N.
Our induction hypothesis readily yields that au−1 and au−2 are integers374 . Now,
we are in one of the following two cases:
Case 1: The integer u is even.
Case 2: The integer u is odd.
Let us first consider Case 1. In this case, the integer u is even. Hence, Observation
2 (applied to n = u) yields au = (m + 1) au−1 − au−2 . The right hand side of this
equality is an integer (since m, au−1 and au−2 are integers); thus, the left hand side
is an integer as well. In other words, au is an integer. Thus, we have shown that au
is an integer in Case 1.
Let us now consider Case 2. In this case, the integer u is odd. Hence, Observation
3 (applied to n = u) yields au = (q + 1) au−1 − au−2 . The right hand side of this
equality is an integer (since q, au−1 and au−2 are integers); thus, the left hand side
is an integer as well. In other words, au is an integer. Thus, we have shown that au
is an integer in Case 2.
We have now proven that au is an integer in both Cases 1 and 2. Hence, au always
is an integer. This completes the induction step. Thus, (637) is proved. In other
words, Exercise 4.10.9 is solved.
Note that we have not actually used the Hint in the above solution: We did show
that the sequence ( a0 , a1 , a2 , . . .) satisfies an ( a, b)-recurrence-like equation in which
the coefficients depend on the parity of the position (Observations 2 and 3); but
this is not the same as proving that each of the two subsequences ( a0 , a2 , a4 , a6 , . . .)
and ( a1 , a3 , a5 , a7 , . . .) is ( a, b)-recurrent for some integers a and b (as suggested
374 Proof.
Our induction hypothesis says that (637) holds for n < u. Hence, (637) holds for n = u − 2
(since u − 2 ∈ N and u − 2 < u). In other words, au−2 is an integer. The same argument (applied
to u − 1 instead of u − 2) shows that au−1 is an integer.

December 25, 2021


Math 235 notes page 658

in the Hint). However, the latter statement is true and not hard to prove: Namely,
both subsequences ( a0 , a2 , a4 , a6 , . . .) and ( a1 , a3 , a5 , a7 , . . .) are (mq + m + q − 1, −1)-
recurrent. In other words, we have

an = (mq + m + q − 1) an−2 − an−4

for each integer n ≥ 4. The proof of this fact (best made using Observations 2 and
3 alone, forgetting the original definition of our sequence) is left to the reader.

A.5.10. Discussion of Exercise 4.10.10


Discussion of Exercise 4.10.10. Exercise 4.10.10 was proposed by N. B. Vasiljev in
the Kvant journal (Kvant problem M202, posed in Kvant 5/1973, solved in Kvant
1/1974). The following solution sketch is taken from that journal (see also https:
//artofproblemsolving.com/community/c6h16467p114645 for a discussion of the
problem):
Solution to Exercise 4.10.10 (sketched). Let A a,d denote the arithmetic progression
( a, a + d, a + 2d, a + 3d, . . .) (that is, the infinite arithmetic progression with differ-
ence d and starting entry a). We thus must show that this sequence A a,d contains
a
an infinite geometric progression as a subsequence if and only if ∈ Q. In other
d
words, we must prove the following two claims:
a
Claim 1: If ∈ Q, then the arithmetic progression A a,d contains an
d
infinite geometric progression as a subsequence.

Claim 2: If the arithmetic progression A a,d contains an infinite geometric


a
progression as a subsequence, then ∈ Q.
d
a a
[Proof of Claim 1: Assume that ∈ Q. Pick an m ∈ N satisfying m > − . (Such
d d
b a + md a
an m clearly exists.) Set b = a + md. Thus, = = m ∈ Q.
+ |{z}
d d d
|{z} ∈N⊆Q
∈Q
b a a
Furthermore, = + m > 0 (since m > − ), so that b 6= 0.
d d d
b b b
We know that is a positive rational number (since > 0 and ∈ Q). Hence,
d d d
b b s
we can write in the form = for two positive integers s and r. Consider these
d d r
b s
s and r. From = , we obtain ds = br.
d r
Let q = 1 + r. Then, q = 1 + r > 1 (since r is positive), so that q is a positive
integer.

December 25, 2021


Math 235 notes page 659

Now, I claim that the geometric progression bq0 , bq1 , bq2 , bq3 , . . . is a subse-


quence of A a,d . Indeed, in order to show this, I set


 
i n = m + s q 0 + q 1 + · · · + q n −1 for each n ∈ N.

Then, in ∈ N for each n ∈ N (since m, s, q ∈ N) and we have i0 < i1 < i2 < · · ·


(this follows easily from the fact that s and q are positive). Hence, the sequence

( a + i0 d, a + i1 d, a + i2 d, a + i3 d, . . .)
is a subsequence of the sequence A a,d (since the sequence A a,d consists of the num-
bers a + id for all i ∈ N).
However, for each n ∈ N, we have
  
a+ in d = a + m + s q 0 + q 1 + · · · + q n −1 d
|{z}
=m+s(q0 +q1 +···+qn−1 )
 
0 1 n −1
= |a +{zmd} + s q + q + · · · + q d
=b
| {z }
=ds(q0 +q1 +···+qn−1 )
 
0 1 n −1
ds q + q + · · · + q
= b + |{z}
=br
 
0 1 n −1
= b+b r
|{z} q +q +···+q
= q −1
(since q=1+r)
 
= b + b ( q − 1 ) q 0 + q 1 + · · · + q n −1
| {z }
= q n −1
(by Exercise 2.1.1, applied to q instead of b)
n n
= b + b (q − 1) = bq

and thus
bqn = a + in d.
In other words,
 
bq0 , bq1 , bq2 , bq3 , . . . = ( a + i0 d, a + i1 d, a + i2 d, a + i3 d, . . .) . (638)

Now recall that ( a + i0 d, a + i1 d, a + i2 d, a + i3 d, . . .) is a subsequence of A a,d . In 


view of (638), this rewrites as follows: The geometric progression bq0 , bq1 , bq2 , bq3 , . . .
is a subsequence of A a,d . Hence, the arithmetic progression A a,d contains an infinite
geometric progression as a subsequence. This proves Claim 1.]
[Proof of Claim 2: We shall show a stronger statement: If the arithmetic progres-
sion A a,d contains a three-term geometric progression bq0 , bq1 , bq2 as a subse-

a
quence, then ∈ Q.
d

December 25, 2021


Math 235 notes page 660

Indeed, assume that the arithmetic progression A a,d contains a three-term geo-
0 1 2

metric progression bq , bq , bq as a subsequence. In other words, there exist reals
b and q and nonnegative integers i, j, k satisfying i < j < k and

bq0 = a + id, bq1 = a + jd, bq2 = a + kd.


Consider these b, q, i, j and k. Now,
     2
bq0 bq2 − bq1 = b2 q2 − b2 q2 = 0,

so that
 2
  
0 = bq0 bq2 −  bq1  = ( a + id) ( a + kd) − ( a + jd)2
 
| {z } | {z } |{z}
= a+id = a+kd = a+ jd
     
2 2 2
= (i − 2j + k) ad + ik − j d = d · (i − 2j + k) a + ik − j d .

We can cancel d from this equality (since d 6= 0), and thus obtain
 
0 = (i − 2j + k ) a + ik − j2 d.

In other words,  
(i − 2j + k) a = − ik − j2 d. (639)
If we knew that i − 2j + k 6= 0, then we could divide the equality (639) by d (i − 2j + k )
(since d 6= 0), and thus obtain
− ik − j2

a
= ∈Q (since i, j, k are integers) ,
d i − 2j + k
which would complete the proof of Claim 2. Thus, it remains to show that i − 2j +
k 6= 0.
Indeed, assume the contrary. Thus, i − 2j + k = 0, so that 2j = i + k and therefore
i+k
j= . Hence,
2
i+k 2 k−i 2
   
2
ik − j = ik − =− >0
2 2

(since k − i > 0 (because i < k)). Hence, ik − j2 6= 0. Thus, both factors ik − j2 and
d on the right hand side of (639) are nonzero (since d 6= 0). Hence, the entire right
hand side of (639) is nonzero. Thus, the left hand side is nonzero as well. That is,
(i − 2j + k) a 6= 0. But this contradicts (i − 2j + k) a = 0. This contradiction shows
| {z }
=0
that our assumption was false. Hence, i − 2j + k 6= 0 is proved, and our proof of
Claim 2 is complete.]

December 25, 2021


Math 235 notes page 661

A few words are in order about the somewhat baroque construction of m and
b in the proof of Claim 1. When the numbers a and d have the same sign and a
is nonzero, we don’t need to go through this ordeal; we can just set m = 0 and
b = a and start our geometric subsequence directly at the first entry of A a,d (that is,
start it with a). However, if a and d have different signs, then an infinite geometric
subsequence of A a,d cannot start with a, since only finitely many entries of A a,d
have the same sign as a (but a geometric subsequence starting with a would have
infinitely many such entries). Thus, we need to throw away the first few entries of
A a,d until we are only left with entries that are nonzero and have the same sign as
d. This is what m and b are for. Namely, m is the number of entries we need to
throw away, and b is the new first entry after throwing away.

A.5.11. Discussion of Exercise 4.11.6


Discussion of Exercise 4.11.6. As usual, part (b) of the exercise is hard on its own,
but becomes easy once part (a) has been solved. Part (a), meanwhile, is fairly easy
to prove by induction. Here is a detailed solution:
Solution to Exercise 4.11.6. We begin by computing the first 9 entries of our se-
quence.
From (246), we obtain x0 = 1 and x1 = 1 and x2 = 1 and x3 = 1 and x4 = 1 and
x5 = 1. Applying (247) to n = 6, we find

x 6−3 ( x 6−1 + x 6−5 ) x ( x + x1 )


x6 = = 3 5
x 6−6 x0
1 (1 + 1)
= (since x3 = 1 and x5 = 1 and x1 = 1 and x0 = 1)
1
= 2.

Applying (247) to n = 7, we find

x 7−3 ( x 7−1 + x 7−5 ) x ( x + x2 )


x7 = = 4 6
x 7−6 x1
1 (2 + 1)
= (since x4 = 1 and x6 = 2 and x2 = 1 and x1 = 1)
1
= 3.

Applying (247) to n = 8, we find

x 8−3 ( x 8−1 + x 8−5 ) x ( x + x3 )


x8 = = 5 7
x 8−6 x2
1 (3 + 1)
= (since x5 = 1 and x7 = 3 and x3 = 1 and x2 = 1)
1
= 4.

December 25, 2021


Math 235 notes page 662

We have thus computed the values of x0 , x1 , . . . , x8 . From these values, we see


immediately that x0 , x1 , . . . , x8 are integers.
We now proceed to solving both parts of the exercise.
(a) We proceed by induction on n:
Induction base: A straightforward computation shows that Exercise 4.11.6 (a)
holds for n = 8 375 .
Induction step: Let m ≥ 9 be an integer. Assume (as the induction hypothesis)
that Exercise 4.11.6 (a) holds for n = m − 1. We must prove that Exercise 4.11.6 (a)
holds for n = m.
Our induction hypothesis says that Exercise 4.11.6 (a) holds for n = m − 1. In
other words, we have

xm−1 + x(m−1)−4 + x(m−1)−8 = 6x(m−1)−3 x(m−1)−4 x(m−1)−5 .

We can rewrite this as

xm−1 + xm−5 + xm−9 = 6xm−4 xm−5 xm−6 (640)

(since (m − 1) − 4 = m − 5 and (m − 1) − 8 = m − 9 and (m − 1) − 3 = m − 4 and


(m − 1) − 5 = m − 6).
We have m ≥ 9 ≥ 6. Hence, from (247) (applied to n = m), we obtain xm =
x m −3 ( x m −1 + x m −5 )
, so that
x m −6

x m −6 x m = x m −3 ( x m −5 + x m −1 ) . (641)

We have m − 3 ≥ 6 (since m ≥ 9 = 6 + 3). Thus, from (247) (applied to n = m − 3),


we obtain
 
x(m−3)−3 x(m−3)−1 + x(m−3)−5 x (x + x m −8 )
x m −3 = = m −6 m −4
x(m−3)−6 x m −9

(since (m − 3) − 3 = m − 6 and (m − 3) − 1 = m − 4 and (m − 3) − 5 = m − 8 and


(m − 3) − 6 = m − 9). Thus,

x m −3 x m −9 = x m −6 ( x m −4 + x m −8 ) . (642)
375 Here are the details of this computation: Comparing

x 8 + x 8−4 + x 8−8 = 4 + 1 + 1 = 6
|{z} |{z} |{z}
=4 = x4 =1 = x0 =1

with
6 x 8−3 x 8−4 x8−5 = 6,
|{z} |{z} |{z}
= x5 =1 = x4 =1 = x3 =1

we obtain x8 + x8−4 + x8−8 = 6x8−3 x8−4 x8−5 . In other words, Exercise 4.11.6 (a) holds for n = 8.

December 25, 2021


Math 235 notes page 663

Now,

x m −6 ( x m + x m −4 + x m −8 )
= x 6 xm + x m −6 ( x m −4 + x m −8 )
| m−
{z } | {z }
= x m −3 ( x m −5 + x m −1 ) = x m −3 x m −9
(by (641)) (by (642))

= x m −3 ( x m −5 + x m −1 ) + x m −3 x m −9 = x m −3 ( x m −1 + x m −5 + x m −9 )
| {z }
=6xm−4 xm−5 xm−6
(by (640))
= xm−3 · 6xm−4 xm−5 xm−6 = 6xm−3 xm−4 xm−5 xm−6 . (643)

However, xm−6 is a positive rational number (since ( x0 , x1 , x2 , . . .) is a sequence


of positive rational numbers), and thus is nonzero. Hence, we can cancel xm−6 from
the equality (643). As a result, we obtain xm + xm−4 + xm−8 = 6xm−3 xm−4 xm−5 . In
other words, Exercise 4.11.6 (a) holds for n = m. This completes the induction step;
thus, Exercise 4.11.6 (a) is proved.
(b) This is a straightforward strong induction on n. 376

A.5.12. Discussion of Exercise 4.11.7


Discussion of Exercise 4.11.7. On its own, part (a) of the exercise would be pretty
hard (indeed, it stayed unsolved on math.stackexchange for a few years). But part
(b) provides the scaffolding that makes it easy. Thus, we will start by solving part
(b) this time.
376 Here is the proof in detail:
We proceed by strong induction on n.
Induction step: Fix k ∈ N. Assume (as the induction hypothesis) that Exercise 4.11.6 (b) holds
for each n ∈ N satisfying n < k. We must prove that Exercise 4.11.6 (b) holds for n = k. In other
words, we must prove that xk is an integer.
If k ≤ 8, then this is clearly true (since we have shown above that x0 , x1 , . . . , x8 are integers).
Thus, for the rest of this induction step, we WLOG assume that k > 8. Hence, k ≥ 8. Thus,
Exercise 4.11.6 (a) (applied to n = k) yields

xk + xk−4 + xk−8 = 6xk−3 xk−4 xk−5 . (644)

From k ≥ 8, we obtain k − 8 ∈ N and k − 4 ∈ N and k − 3 ∈ N and k − 5 ∈ N. Now, recall


that Exercise 4.11.6 (b) holds for each n ∈ N satisfying n < k. Hence, in particular, Exercise
4.11.6 (b) holds for n = k − 8 (since k − 8 ∈ N and k − 8 < k). In other words, xk−8 is an integer.
Similarly, we can see that xk−4 is an integer (since k − 4 ∈ N and k − 4 < k). Similarly, we can
see that xk−3 is an integer (since k − 3 ∈ N and k − 3 < k). Similarly, we can see that xk−5 is an
integer (since k − 5 ∈ N and k − 5 < k). Now, solving the equality (644) for xk , we obtain

xk = 6xk−3 xk−4 xk−5 − xk−4 − xk−8 .

This shows that xk is an integer (since all the numbers 6, xk−3 , xk−4 , xk−5 and xk−8 on the right
hand side are integers). In other words, Exercise 4.11.6 (b) holds for n = k. This completes the
induction step. Thus, Exercise 4.11.6 (b) is solved.

December 25, 2021


Math 235 notes page 664

Solution to Exercise 4.11.7. From (248), we know that a0 = 2 and a1 = 1 and a2 = 1


and a3 = 1. Thus, a0 is an integer (since a0 = 2 ∈ Z). Applying (249) to n = 4, we
find
( a 4−1 + a 4−2 ) ( a 4−2 + a 4−3 ) ( a + a2 ) ( a2 + a1 )
a4 = = 3
a 4−4 a0
(1 + 1) (1 + 1)
= (since a3 = 1 and a2 = 1 and a1 = 1 and a0 = 2)
2
= 2.
Now, let ( x0 , x1 , x2 , . . .) be the sequence defined in Exercise 4.11.6. We shall now
solve part (b) of Exercise 4.11.7 (and then derive part (a) from it).
(b) We must prove that
a n = x n +2 x n +1 x n x n −1 (645)
for each n ≥ 1. We shall prove this by strong induction on n:
Induction step: Let m ≥ 1. Assume (as the induction hypothesis) that (645) holds
for each n ≥ 1 satisfying n < m. We must prove that (645) holds for n = m. In
other words, we must prove that am = xm+2 xm+1 xm xm−1 .
If m < 5, then this can easily be checked by hand377 . Thus, for the rest of this
induction step, we WLOG assume that m ≥ 5. Hence, m − 4 ≥ 5 − 4 = 1 and
m − 2 ≥ m − 4 ≥ 1 and m − 3 ≥ m − 4 ≥ 1 and m − 1 ≥ m − 4 ≥ 1.
Our induction hypothesis says that (645) holds for each n ≥ 1 satisfying n < m.
Thus, in particular, (645) holds for n = m − 4 (since m − 4 ≥ 1 and m − 4 < m). In
other words, we have am−4 = x(m−4)+2 x(m−4)+1 xm−4 x(m−4)−1 . In other words,
a m −4 = x m −2 x m −3 x m −4 x m −5 (646)
377 Here are the details of this verification:
• We know (from the solution to Exercise 4.11.6) that x0 = 1 and x1 = 1 and x2 = 1 and
x3 = 1 and x4 = 1 and x5 = 1 and x6 = 2.
• Comparing x1+2 x1+1 x1 x1−1 = 1 with a1 = 1, we obtain a1 = x1+2 x1+1 x1 x1−1 . In
|{z} |{z} |{z} |{z}
= x3 =1 = x2 =1 =1 = x0 =1
other words, am = xm+2 xm+1 xm xm−1 holds for m = 1.
• Comparing x2+2 x2+1 x2 x2−1 = 1 with a2 = 1, we obtain a2 = x2+2 x2+1 x2 x2−1 . In
|{z} |{z} |{z} |{z}
= x4 =1 = x3 =1 =1 = x1 =1
other words, am = xm+2 xm+1 xm xm−1 holds for m = 2.
• Comparing x3+2 x3+1 x3 x3−1 = 1 with a3 = 1, we obtain a3 = x3+2 x3+1 x3 x3−1 . In
|{z} |{z} |{z} |{z}
= x5 =1 = x4 =1 =1 = x2 =1
other words, am = xm+2 xm+1 xm xm−1 holds for m = 3.
• Comparing x4+2 x4+1 x4 x4−1 = 1 with a4 = 2, we obtain a4 = x4+2 x4+1 x4 x4−1 . In
|{z} |{z} |{z} |{z}
= x6 =2 = x5 =1 =1 = x3 =1
other words, am = xm+2 xm+1 xm xm−1 holds for m = 4.
Thus, we have showed that am = xm+2 xm+1 xm xm−1 holds for m = 1, for m = 2, for m = 3 and
for m = 4. In other words, am = xm+2 xm+1 xm xm−1 holds if m < 5 (because the only integers
m ≥ 1 satisfying m < 5 are 1, 2, 3 and 4).

December 25, 2021


Math 235 notes page 665

(since (m − 4) + 2 = m − 2 and (m − 4) + 1 = m − 3 and (m − 4) − 1 = m − 5).


Our induction hypothesis says that (645) holds for each n ≥ 1 satisfying n < m.
Thus, in particular, (645) holds for n = m − 3 (since m − 3 ≥ 1 and m − 3 < m). In
other words, we have am−3 = x(m−3)+2 x(m−3)+1 xm−3 x(m−3)−1 . In other words,

a m −3 = x m −1 x m −2 x m −3 x m −4 (647)

(since (m − 3) + 2 = m − 1 and (m − 3) + 1 = m − 2 and (m − 3) − 1 = m − 4).


Our induction hypothesis says that (645) holds for each n ≥ 1 satisfying n < m.
Thus, in particular, (645) holds for n = m − 2 (since m − 2 ≥ 1 and m − 2 < m). In
other words, we have am−2 = x(m−2)+2 x(m−2)+1 xm−2 x(m−2)−1 . In other words,

a m −2 = x m x m −1 x m −2 x m −3 (648)

(since (m − 2) + 2 = m and (m − 2) + 1 = m − 1 and (m − 2) − 1 = m − 3).


Our induction hypothesis says that (645) holds for each n ≥ 1 satisfying n < m.
Thus, in particular, (645) holds for n = m − 1 (since m − 1 ≥ 1 and m − 1 < m). In
other words, we have am−1 = x(m−1)+2 x(m−1)+1 xm−1 x(m−1)−1 . In other words,

a m −1 = x m +1 x m x m −1 x m −2 (649)

(since (m − 1) + 2 = m + 1 and (m − 1) + 1 = m and (m − 1) − 1 = m − 2).


However, m ≥ 5 entails m + 2 ≥ 5 + 2 = 7 ≥ 6. Thus, (247) (applied to n = m + 2)
yields
 
x(m+2)−3 x(m+2)−1 + x(m+2)−5 x (x + x m −3 )
x m +2 = = m −1 m +1
x(m+2)−6 x m −4

(since (m + 2) − 3 = m − 1 and (m + 2) − 1 = m + 1 and (m + 2) − 5 = m − 3 and


(m + 2) − 6 = m − 4). Therefore,

x m +2 x m −4 = x m −1 ( x m +1 + x m −3 ) . (650)

Furthermore, m ≥ 5 entails m + 1 ≥ 5 + 1 = 6. Thus, (247) (applied to n = m + 1)


yields  
x(m+1)−3 x(m+1)−1 + x(m+1)−5 x ( x m + x m −4 )
x m +1 = = m −2
x(m+1)−6 x m −5
(since (m + 1) − 3 = m − 2 and (m + 1) − 1 = m and (m + 1) − 5 = m − 4 and
(m + 1) − 6 = m − 5). Therefore,

x m +1 x m −5 = x m −2 ( x m + x m −4 ) . (651)

December 25, 2021


Math 235 notes page 666

Now,

a + a = x m +1 x m x m −1 x m −2 + x m x m −1 x m −2 x m −3
| m{z−}1 | m{z−}2
= x m +1 x m x m −1 x m −2 = x m x m −1 x m −2 x m −3
(by (649)) (by (648))

= x m x m −2 x m −1 ( x m +1 + x m −3 )
| {z }
= x m +2 x m −4
(by (650))
= x m x m −2 x m +2 x m −4

and

a + a = x m x m −1 x m −2 x m −3 + x m −1 x m −2 x m −3 x m −4
| m{z−}2 | m{z−}3
= x m x m −1 x m −2 x m −3 = x m −1 x m −2 x m −3 x m −4
(by (648)) (by (647))
= x m −1 x m −3 x m −2 ( x m + x m −4 )
| {z }
= x m +1 x m −5
(by (651))
= x m −1 x m −3 x m +1 x m −5 .

Now, m ≥ 5 ≥ 4. Hence, (249) (applied to n = m) yields

( a m −1 + a m −2 ) ( a m −2 + a m −3 ) x m x m −2 x m +2 x m −4 · x m −1 x m −3 x m +1 x m −5
am = =
a x m −2 x m −3 x m −4 x m −5
 m −4 
since am−1 + am−2 = xm xm−2 xm+2 xm−4
 and am−2 + am−3 = xm−1 xm−3 xm+1 xm−5 
and am−4 = xm−2 xm−3 xm−4 xm−5
= x m +2 x m +1 x m x m −1 .

In other words, (645) holds for n = m. This completes the induction step. Thus,
(645) is proved. In other words, Exercise 4.11.7 (b) is solved.
(a) Let n ∈ N. We must prove that an is an integer. If n = 0, then this is obvious
(since we know that a0 is an integer). Thus, for the rest of this proof, we WLOG
assume that n 6= 0. Hence, n ≥ 1 (since n ∈ N).
Hence, Exercise 4.11.7 (b) yields an = xn+2 xn+1 xn xn−1 . However, for each m ∈
N, the number xm is an integer (by Exercise 4.11.6 (b), applied to m instead
of n). In other words, all entries of the sequence ( x0 , x1 , x2 , x3 , . . .) are integers.
Hence, in particular, the four numbers xn+2 , xn+1 , xn , xn−1 are integers (since these
four numbers are entries of the sequence ( x0 , x1 , x2 , x3 , . . .)). Thus, their prod-
uct xn+2 xn+1 xn xn−1 is an integer as well. In other words, an is an integer (since
an = xn+2 xn+1 xn xn−1 ). This solves Exercise 4.11.7 (a).

December 25, 2021


Math 235 notes page 667

A.5.13. Discussion of Exercise 4.11.8


Discussion of Exercise 4.11.8. Once again, the “active ingredient” in the exercise is
part (b); the other two parts will follow easily once part (b) is solved.
Solution to Exercise 4.11.8. Let ( x0 , x1 , x2 , . . .) be the sequence defined in Exercise
4.11.6.
(b) We must prove that
bn = x n + 2 x n (652)
for each n ≥ 0. We shall prove this by strong induction on n:
Induction step: Let m ≥ 0. Assume (as the induction hypothesis) that (652) holds
for each n ≥ 0 satisfying n < m. We must prove that (652) holds for n = m. In
other words, we must prove that bm = xm+2 xm .
If m < 4, then this is easy to verify directly378 . Thus, for the rest of this induction
step, we WLOG assume that m ≥ 4. Hence, m − 4 ≥ 0 and m − 3 ≥ m − 4 ≥ 0 and
m − 2 ≥ m − 4 ≥ 0 and m − 1 ≥ m − 4 ≥ 0.
Our induction hypothesis says that (652) holds for each n ≥ 0 satisfying n < m.
Thus, in particular, (652) holds for n = m − 4 (since m − 4 ≥ 0 and m − 4 < m). In
other words, we have bm−4 = x(m−4)+2 xm−4 . In other words,

bm −4 = x m − 2 x m − 4

(since (m − 4) + 2 = m − 2).
Our induction hypothesis says that (652) holds for each n ≥ 0 satisfying n < m.
Thus, in particular, (652) holds for n = m − 3 (since m − 3 ≥ 0 and m − 3 < m). In
other words, we have bm−3 = x(m−3)+2 xm−3 . In other words,

bm −3 = x m − 1 x m − 3

(since (m − 3) + 2 = m − 1).
Our induction hypothesis says that (652) holds for each n ≥ 0 satisfying n < m.
Thus, in particular, (652) holds for n = m − 2 (since m − 2 ≥ 0 and m − 2 < m). In
other words, we have bm−2 = x(m−2)+2 xm−2 . In other words,

bm −2 = x m x m − 2

(since (m − 2) + 2 = m).

378 Proof.
Assume that m < 4. We must verify that bm = xm+2 xm .
We have m ∈ {0, 1, 2, 3} (since m is an integer satisfying m ≥ 0 and m < 4).
The equalities (250) say that each of the four numbers b0 , b1 , b2 , b3 equals 1. In other words,
bk = 1 for each k ∈ {0, 1, 2, 3}. Applying this to k = m, we find bm = 1 (since m ∈ {0, 1, 2, 3}).
On the other hand, m < 4 < 6 and therefore xm = 1 (by (246), applied to n = m). Furthermore,
m + 2 < 6 (since m < 4 = 6 − 2) and therefore xm+2 = 1 (by (246), applied to n = m + 2). Now,
comparing bm = 1 with xm xm+2 = 1, we obtain bm = xm+2 xm . Qed.
|{z} | {z }
=1 =1

December 25, 2021


Math 235 notes page 668

Our induction hypothesis says that (652) holds for each n ≥ 0 satisfying n < m.
Thus, in particular, (652) holds for n = m − 1 (since m − 1 ≥ 0 and m − 1 < m). In
other words, we have bm−1 = x(m−1)+2 xm−1 . In other words,
bm −1 = x m + 1 x m − 1
(since (m − 1) + 2 = m + 1).
From m ≥ 4, we obtain m + 2 ≥ 4 + 2 = 6. Hence, (247) (applied to n = m + 2)
yields
 
x(m+2)−3 x(m+2)−1 + x(m+2)−5
x m +2 =
x(m+2)−6
x m −1 ( x m +1 + x m −3 )
= (653)
x m −4
(since (m + 2) − 3 = m − 1 and (m + 2) − 1 = m + 1 and (m + 2) − 5 = m − 3 and
(m + 2) − 6 = m − 4).
However, m ≥ 4. Thus, (251) (applied to n = m) yields
bm − 2 ( bm − 1 + bm − 3 ) x m x m −2 ( x m +1 x m −1 + x m −1 x m −3 )
bm = =
bm −4 x m −2 x m −4
 
since bm−1 = xm+1 xm−1 and bm−2 = xm xm−2
and bm−3 = xm−1 xm−3 and bm−4 = xm−2 xm−4
x (x + x m −3 )
= m −1 m +1 · x m = x m +2 x m .
x m −4
| {z }
= x m +2
(by (653))

In other words, (652) holds for n = m. This completes the induction step. Thus,
(652) is proven. In other words, Exercise 4.11.8 (b) is solved.
(a) Let n ∈ N. We must prove that bn is an integer.
Exercise 4.11.8 (b) yields bn = xn+2 xn . However, for each m ∈ N, the number
xm is an integer (by Exercise 4.11.6 (b), applied to m instead of n). In other words,
all entries of the sequence ( x0 , x1 , x2 , x3 , . . .) are integers. Hence, in particular, the
two numbers xn+2 and xn are integers (since these two numbers are entries of the
sequence ( x0 , x1 , x2 , x3 , . . .)). Thus, their product xn+2 xn is an integer as well. In
other words, bn is an integer (since bn = xn+2 xn ). This solves Exercise 4.11.8 (a).
(c) Let ( a0 , a1 , a2 , . . .) be the sequence defined in Exercise 4.11.7. Let n ≥ 1 be an
integer.
Exercise 4.11.8 (b) yields bn = xn+2 xn . Also, we have n − 1 ≥ 0 (since n ≥ 1).
Hence, Exercise 4.11.8 (b) (applied to n − 1 instead of n) yields bn−1 = x(n−1)+2 xn−1 =
xn+1 xn−1 (since (n − 1) + 2 = n + 1). Thus,
bn bn − 1 = x n +2 x n x n +1 x n −1 = x n +2 x n +1 x n x n −1 .
|{z} |{z}
= x n +2 x n = x n +1 x n −1

December 25, 2021


Math 235 notes page 669

On the other hand, Exercise 4.11.7 (b) yields

a n = x n +2 x n +1 x n x n −1 .

Comparing these two equalities, we obtain an = bn bn−1 . This solves Exercise 4.11.8
(c).

A.6. Homework set #5 discussion


The following are discussions of the problems on homework set #5 (Section 5.4).

A.6.1. Discussion of Exercise 5.4.1


Discussion of Exercise 5.4.1. We shall show a more general result (due to Hermite):
Proposition A.6.1. Let n, m ∈ Z. Then:  
n
(a) We have n + 1 − m | gcd (n + 1, m) · .
  m
gcd (n + 1, m) n
(b) If m 6= n + 1, then ∈ Z.
n+1−m m
This proposition is a sort of counterpart to Exercise 4.5.4 (b).
Proof of Proposition A.6.1. (a) Applying Lemma A.4.9 (c) to n + 1 and m instead of n
and k, we obtain
( n + 1) − 1
     
n+1 n+1
( n + 1) = ((n + 1) − m) = (n + 1 − m) .
m | {z } m m
= n +1− m

In view of (n + 1) − 1 = n, this rewrites as


   
n n+1
( n + 1) = (n + 1 − m) . (654)
m m
   
n+1 n+1
But is an integer (since Theorem 4.3.15 yields that ∈ Z). Hence,
m m
the equality (654) reveals that
 
n
n + 1 − m | ( n + 1) .
m
 
n
Thus, Theorem 3.4.11 (applied to a = n + 1 − m, b = n + 1 and c = ) yields
m
 
n
n + 1 − m | gcd (n + 1 − m, n + 1) · . (655)
m

December 25, 2021


Math 235 notes page 670

But Proposition 3.4.4 (b) (applied to a = n + 1 − m and b = n + 1) yields


 

gcd (n + 1 − m, n + 1) = gcd n + 1, n 1 − m} 
| + {z
 

=1(n+1)+(−m)

= gcd (n + 1, 1 (n + 1) + (−m))
= gcd (n + 1, −m)
 
by Proposition 3.4.4 (c),
applied to a = n + 1, b = −m and u = 1
= gcd (n + 1, m)

(by Proposition 3.4.4 (h), applied to a = n + 1 and b = m). Therefore, (655) rewrites
as  
n
n + 1 − m | gcd (n + 1, m) · .
m
This proves Proposition A.6.1 (a).
gcd (n + 1, m)
(b) Assume that m 6= n + 1. Thus, n + 1 − m 6= 0. Hence, the fraction
n+1−m
is well-defined.
But n + 1 − m 6= 0.   Proposition 3.1.3 (d) (applied to a = n 
Hence, +1−m
n n
and b = gcd (n + 1, m) · ) yields that n + 1 − m | gcd (n + 1, m) · if and
 m   m
n n
gcd (n + 1, m) · gcd (n + 1, m) ·
m m
only if ∈ Z. Therefore, ∈ Z (since
n+1−m   n+1−m
n
n + 1 − m | gcd (n + 1, m) · ). Therefore,
m
 
n
  gcd (n + 1, m) ·
gcd (n + 1, m) n m
= ∈ Z.
n+1−m m n+1−m

This proves Proposition A.6.1 (b).


Proposition A.6.1 (a) quickly yields Exercise 5.4.1:
Solution to Exercise 5.4.1. Exercise 3.5.1 (a) (applied to a = n) yields 1 ⊥ n. Accord-
ing to Proposition 3.5.4, this entails n ⊥ 1.
Proposition A.6.1 (a) (applied to ( a + 1) n and n instead of n and m) yields
 
( a + 1) n
( a + 1) n + 1 − n | gcd (( a + 1) n + 1, n) · .
n

December 25, 2021


Math 235 notes page 671

In view of

gcd (( a + 1) n + 1, n) = gcd (n, ( a + 1) n + 1)


 
by Proposition 3.4.4 (b),
applied to ( a + 1) n + 1 and n instead of a and b
= gcd (n, 1)
 
by Proposition 3.4.4 (c),
applied to n, 1 and a + 1 instead of a, b and u
=1 (since n ⊥ 1)

and
( a + 1) n + 1 − n = an + 1,
this rewrites as  
( a + 1) n
an + 1 | 1 · .
n
 
( a + 1) n
In other words, an + 1 | . This solves Exercise 5.4.1.
n
A more explicit solution of Exercise 5.4.1 is also possible: Namely, a simple
computation (using Lemma A.4.9 (c)) reveals that
     
1 ( a + 1) n ( a + 1) n ( a + 1) n + 1
= ( a + 1) −a .
an + 1 n n n

But the right hand side of this equality is


 an integer. Thus, the left hand side is an
( a + 1) n
integer as well; in other words, an + 1 | .
n  
1 ( a + 1) n
Note that Exercise 5.4.1 shows that the number is an inte-
an + 1 n
ger for any a, n ∈ N. This number is known as a Fuss-Catalan number (see, e.g.,
[Stanle15, Additional problem A14]).

A.6.2. Discussion of Exercise 5.4.2


Discussion of Exercise 5.4.2. Exercise 5.4.2 is an introduction to the so-called finite
differences of polynomials. Given a polynomial P, it is common to refer to ∆P as
the first difference of P, and to ∆m P as the m-th difference of P. These differences ∆P
and ∆m P of a polynomial P are discrete analogues of the derivatives f 0 and f (m)
of a function f . Exercise 5.4.2 barely scratches the surface of the concept; more
can be found in [GrKnPa94, §2.6 and §5.3, Trick 2] and in [19s-mt3s, Exercise 6]379 .
379 Beware of unusual notations: In [19s-mt3s, Exercise 6], I write P [ a] (rather than P ( a)) for the
value of a polynomial P at a number a (this serves to avoid it being confused for a product), and
I write P∆ for ∆P.

December 25, 2021


Math 235 notes page 672

Finite differences can be applied not just to polynomials, but also to any functions,
and in some more general form than in Exercise 5.4.2 (for example, instead of
P ( x ) − P ( x − 1) we can consider P ( x ) − P ( x − r ) for any fixed number r); they
are used a lot in numerical mathematics.
We shall give what is likely the shortest solution to Exercise 5.4.2. Various other
arguments are possible.
m
Solution to Exercise 5.4.2. (a) Write the polynomial P in the form P = ∑ ci xi for
i =0
m
some constants c0 , c1 , . . . , cm . Thus, P ( x ) = P = ∑ ci xi . Substituting x − 1 for x in
i =0
m
this equality, we obtain P ( x − 1) = ∑ ci ( x − 1)i . Now, the definition of ∆P yields
i =0

(∆P) ( x ) = P ( x ) − P ( x − 1)
| {z } | {z }
m m
= ∑ ci x i = ∑ c i ( x −1)i
i =0 i =0
m m
= ∑ c i x i − ∑ c i ( x − 1)i
i =0 i =0
m  
= ∑ ci i
x − ( x − 1) i
. (656)
i =0

Now, let us rewrite the differences xi − ( x − 1)i on the right hand side of this
equality. Namely, for each i ∈ {0, 1, . . . , m}, we have

( x − 1)i = ( x + (−1))i (since x − 1 = x + (−1))


i  
i k
= ∑ x (−1)i−k (by Theorem 4.3.16, applied to n = i and y = −1)
k =0
k
i   i −1    
i −k i i −k i k
= ∑ (−1) x = ∑ (−1)
k k
x + (−1) k−k
xi
k =0
k k =0
k | {z } k
=(−1)0 =1
|{z}
=1
(by (124))
i −1  
i k
= ∑ (−1) i −k
k
x + xi
k =0

and therefore
i −1   i −1   i
i k
i
x − ( x − 1) = −i
∑ (−1) i −k
k
x = ∑ − (−1) i −k
k
xk
k =0 k =0 | {z }
=(−1)i−k+1
i −1  
i k
= ∑ (−1) i − k +1
k
x . (657)
k =0

December 25, 2021


Math 235 notes page 673

Hence, (656) becomes


m  
(∆P) ( x ) = ∑ ci x i − ( x − 1)i
i =0 | {z  }
i −1 i k
= ∑ (−1)i−k+1 x
k =0 k
(by (657))
m i −1  
i k
= ∑ ci ∑ (−1) i − k +1
k
x . (658)
i =0 k =0

Now, we notice that the right hand side of (658) is a sum of powers x k of x
(multiplied by constants)380 . Moreover, all powers x k that appear in this sum satisfy
k ≤ m − 1 381 . Thus, the right hand side of (658) is a sum of powers x k (multiplied
by constants) with k ≤ m − 1. In other words, the right hand side of (658) is a
polynomial in x of degree ≤ m − 1. Therefore, so is the left hand side of (658). In
other words, (∆P) ( x ) is a polynomial in x of degree ≤ m − 1. In other words, the
polynomial ∆P has degree ≤ m − 1. This solves Exercise 5.4.2 (a).
(b) This follows by induction on n, using the (already solved) Exercise 5.4.2 (a)
in the induction step. Here are the details:
Forget that we fixed m and P. The following claim follows from Exercise 5.4.2
(a):

Claim 1: Let m ∈ Z. Let P be a polynomial in a single variable x.


Assume that P has degree ≤ m. Then, the polynomial ∆P has degree
≤ m − 1.
Now, we must prove the following claim:

Claim 2: Let m ∈ Z and n ∈ N. Let P be a polynomial in a single


variable x. Assume that P has degree ≤ m. Then, the polynomial ∆n P
has degree ≤ m − n.

[Proof of Claim 2: We proceed by induction on n:


Induction base: It is easy to see that Claim 2 holds for n = 0 382 .

380 Notethat a single power x k may appear multiple times in the sum.
381 Indeed,if x k appears in this sum, then k ∈ {0, 1, . . . , i − 1} for some i ∈ {0, 1, . . . , m}; but this
implies

k≤ i
|{z} −1 (since k ∈ {0, 1, . . . , i − 1})
≤m
(since i ∈{0,1,...,m})

≤ m − 1.

The polynomial ∆0 P is just equal to P (by its definition) and therefore has degree ≤ m (by
382 Proof.

assumption). In other words, the polynomial ∆0 P has degree ≤ m − 0 (since m = m − 0). In


other words, Claim 2 holds for n = 0.

December 25, 2021


Math 235 notes page 674

Induction step: Let k ∈ N. Assume (as the induction hypothesis) that Claim 2
holds for n = k. We must prove that Claim 2 holds for n = k + 1.
We have assumed that Claim 2 holds for n = k. In other words, the polynomial
∆ P has degree ≤ m − k. The definition of ∆k+1 P yields ∆k+1 P = ∆ ∆k P . But
k


Claim 1 (applied to m − k and ∆k P instead of m and P) shows that the polynomial


∆ ∆k P has degree ≤ m − k − 1 (since the polynomial ∆k P has degree ≤ m − k).
Since ∆k+1 P = ∆ ∆k P and m − k − 1 = m − (k + 1), we can rewrite this as follows:


The polynomial ∆k+1 P has degree ≤ m − (k + 1). In other words, Claim 2 holds
for n = k + 1. This completes the induction step. Thus, Claim 2 is proven.]
Having proved Claim 2, we thus have solved Exercise 5.4.2 (b).
(c) This is similar to the standard inductive proof of the Binomial Theorem (as
done, e.g., in [Grinbe15, solution to Exercise 3.6]):
We shall prove Exercise 5.4.2 (c) by induction on n:
Induction base: We have ∆0 P = P (by the definition of ∆0 P) and thus
0
 
  0
∆ P ( x ) = P ( x ) = ∑ (−1)
0 k
P ( x − k)
k =0
k
    !
0
k 0 0 0
(since ∑ (−1) P ( x − k ) = (−1) P − 0}
|x {z = P ( x )). In other words,
k =0 k | {z } 0
=1 |{z} =x
=1
Exercise 5.4.2 (c) holds for n = 0.
Induction step: Let i ∈ N. Assume (as the induction hypothesis) that Exercise
5.4.2 (c) holds for n = i. We must prove thatExercise 5.4.2
 (c) holds for n = i + 1.
The definition of ∆i+1 P yields ∆i+1 P = ∆ ∆(i+1)−1 P = ∆ ∆i P (since (i + 1) −


1 = i). Thus,
    
∆ i +1 P ( x ) = ∆ ∆ i P ( x )
   
i i
= ∆ P ( x ) − ∆ P ( x − 1) (659)

(by the definition of ∆ ∆i P ). We now want to get explicit formulas for the two


terms on the right hand side of this equality.


We have assumed that Exercise 5.4.2 (c) holds for n = i. In other words, we have
i  
  i
∆ P ( x ) = ∑ (−1)
i k
P ( x − k) . (660)
k =0
k

December 25, 2021


Math 235 notes page 675

Substituting x − 1 for x in this equality, we obtain


  i
  i
∆ P ( x − 1) = ∑ (−1)
i k
P ( x − 1 − k)
k =0
k
 
i +1  
i
= ∑ (−1)k−1 P  x − 1 − ( k − 1) 
 
k =1
k−1 | {z }
= x −k
(here, we have substituted k − 1 for k in the sum)
i +1  
i
= ∑ (−1) k −1
P ( x − k) . (661)
k =1
k−1

We want to subtract the equality (661) from the equality (660). In order for the
result to be simplifiable, it would be good to have the two summations have the
same limits. Fortunately, this is not hard to achieve: We just need to stretch the
summations to range from 0 to i + 1.  
i
To wit, we have i + 1 > i and thus = 0 (by Proposition 4.3.4, applied to
i+1
i and i + 1 instead of n and k). Now,
i +1  
i
∑ (−1) k P (x − k)
k

k =0
  i  
i k i
= (−1) i +1
P ( x − (i + 1)) + ∑ (−1) P ( x − k)
i+1 k =0
k
| {z }
=0
  i
i
= (−1) i +1
0P ( x − (i + 1)) + ∑ (−1) P ( x − k) k
| {z } k =0 k
=0
i  
k i
= ∑ (−1) P ( x − k) .
k =0
k

Comparing this with (660), we obtain


i +1
 
  i
∆ P ( x ) = ∑ (−1)
i k
P ( x − k) . (662)
k =0
k
 
i
/ N and thus
Furthermore, we have −1 ∈ = 0 (by (118), applied to i and
−1

December 25, 2021


Math 235 notes page 676

−1 instead of n and k). Now,


i +1  
i
∑ (−1) k −1
k−1
P ( x − k)
k =0
  i +1  
i i
= (−1) 0−1
P ( x − 0) + ∑ (−1) k −1
P ( x − k)
0−1 k = 1
k−1
| {z }
i
= =0
−1
i +1  
i
= (−1) 0−1
0P ( x − 0) + ∑ (−1) k −1
P ( x − k)
| {z } k =1 k−1
=0
i +1  
i
= ∑ (−1) k −1
k−1
P ( x − k) .
k =1

Comparing this with (661), we obtain


i +1  
  i
i
∆ P ( x − 1) = ∑ (−1) k −1
k−1
P ( x − k) . (663)
k =0

Now, (659) becomes


     
∆ i +1 P ( x ) = ∆ i P ( x ) − ∆ i P ( x − 1 )
i +1   i +1  
k i i
= ∑ (−1) P ( x − k ) − ∑ (−1) k −1
P ( x − k)
k =0
k k =0
k − 1
 
here, we have subtracted the equality (663)
from the equality (662)
 
i +1     
k i i
= ∑ 1 ) k −1

(−1) k P ( x − k ) − (− | {z } k − 1
P ( x − k)
k =0
=−(−1)k
i +1    i  
i 
= ∑ (−1) k
P ( x − k ) − − (−1) k
P ( x − k)
k =0 |
k k−1
  
{z }

i i
=(−1)k  +  P( x −k)
k k−1
i +1    
i i
= ∑ (−1) k
+ P ( x − k) . (664)
k =0
k k−1

December 25, 2021


Math 235 notes page 677

But each k ∈ Z satisfies


i+1−1 i+1−1
     
i+1
= +
k k−1 k
(by Theorem 4.3.7, applied to n = i + 1)
   
i i
= + (since i + 1 − 1 = i )
k−1 k
   
i i
= + . (665)
k k−1
Hence, (664) becomes
i +1    
  i i
∆ i +1
P ( x ) = ∑ (−1) k
+ P ( x − k)
k =0
k k−1
|  {z  }
i+1
=
k
(by (665))
i +1  
i+1
= ∑ (−1) k
k
P ( x − k) .
k =0

In other words, Exercise 5.4.2 (c) holds for n = i + 1. This completes the induction
step. Hence, Exercise 5.4.2 (c) is solved.
(d) Let n ∈ N satisfy n > m. Then, Exercise 5.4.2 (b) shows that the poly-
nomial ∆n P has degree ≤ m − n. But m − n < 0 (since n > m); hence, the
only polynomial that has degree ≤ m − n is the zero polynomial 0. Therefore,
the polynomial ∆n P is the zero polynomial 0 (since ∆n P has degree ≤ m − n).
In other words, ∆n P  = 0. Thus, (∆n P) ( x ) = 0. But Exercise 5.4.2 (c) yields
n n
(∆n P) ( x ) = ∑ (−1)k P ( x − k). Hence,
k =0 k
n  
k n
∑ (−1) k P (x − k) = (∆n P) (x) = 0.
k =0

This solves Exercise 5.4.2


 (d). 
i −1 m + 1
(e) Set di = (−1) for each i ∈ {1, 2, . . . , m + 1}.
i
We have m + 1 > m. Hence, Exercise 5.4.2 (d) (applied to n = m + 1) yields
m +1  
k m+1
∑ (−1) k
P ( x − k) = 0. (666)
k =0

Now, let n ≥ m + 1 be an integer. Then, substituting n for x in (666), we obtain


m +1  
k m+1
∑ (−1) k
P (n − k ) = 0.
k =0

December 25, 2021


Math 235 notes page 678

Hence,
m +1  
m+1
0= ∑ (−1) k
k
P (n − k)
k =0
!
  m +1  
m+1 m+1
= (−1) 0
0
P n − 0}
| {z + ∑ (−1) k
k
P (n − k)
k =1
| {z } | {z }
=n
=1 =−(−1)k−1
| {z }
=1
(by (119),
applied to m+1 instead of n)
m +1    m + 1
= P (n) + ∑ − (−1) k −1
k
P (n − k)
k =1
m +1  
m+1
= P (n) − ∑ (−1) k −1
k
P (n − k) ,
k =1

so that
m +1   m +1
m+1
P (n) = ∑ (−1) k −1
k
P (n − k) = ∑ dk P (n − k )
k =1 | {z } k =1
=dk  
k −1
m+1
(since dk =(−1)
k
(by the definition of dk ))
= d1 P (n − 1) + d2 P (n − 2) + · · · + dm+1 P (n − (m + 1)) .

Now, forget that we fixed n. We thus have shown that

P (n) = d1 P (n − 1) + d2 P (n − 2) + · · · + dm+1 P (n − (m + 1))

for each integer n ≥ m + 1. In other words, the sequence ( P (0) , P (1) , P (2) , . . .)
is (d1 , d2 , . . . , dm+1 )-recurrent (by the definition of “(d1 , d2 , . . . , dm+1 )-recurrent”).
This solves Exercise 5.4.2 (e).
Let us briefly state three more properties of finite differences. We will need
 a
notation: If Q is a polynomial in a single variable, and if i ∈ Z, then x ( Q) i

shall denote the coefficient of xi in Q. (For example, if Q ( x ) = x4 + 7x − 3,


then x5 ( Q) = 0 and x4 ( Q) = 1 and x3 ( Q) = 0 and x0 ( Q) = −3 and
    
 −1 
x ( Q) = 0.) Now, here are a few more properties of finite differences:
Proposition A.6.2. Let m ∈ N. Let P be a polynomial in a single variable x.
Assume that Phas degree ≤ m. Then:
m − 1 (∆P) = m ·[ x m

(a) We have x ] ( P ).
m
(b) We have [ x m−n ] (∆n P) = n! · [ x m ] ( P ).
n

December 25, 2021


Math 235 notes page 679

(c) We have
m  
m
∑ (−1) k P (x − k) = m! · [xm ] ( P) .
k

k =0

Proposition A.6.2 (a) can be proved by retracing the above solution to Exer-
cise 5.4.2 (a) and analyzing the appearances of x m−1 on the right hand side of
(658) (namely, x m−1 appears
 only
 once on this right hand side, with coefficient
m
cm (−1)m−(m−1)+1 = [ x m ] ( P) · m = m · [ x m ] ( P)). Proposition A.6.2
|{z} | {z } m−1
=[ x m ]( P) =1 | {z }
=m
(b) can be proved by induction on n using Proposition A.6.2 (a), just as we proved
Exercise 5.4.2 (b) by induction using Exercise 5.4.2 (a). Finally, Proposition A.6.2 (c)
follows by applying both Proposition A.6.2 (b) and Exercise 5.4.2 (c) to n = m (and
recalling that a polynomial having degree ≤ 0 must be a constant polynomial).

A.6.3. Discussion of Exercise 5.4.3


Discussion of Exercise 5.4.3. Here is the answer:
Proposition A.6.3. Let a, b, c ∈ N be such that c ≤ b and a ≤ b. Then,
   
a a
b (b + 1 − c)
k c
∑ b = b .
k=c (b + 1 − a)
k c

In order to prove this, we will need the following identity: If n, i, j ∈ N satisfy


j ≤ n, then
n−i
     
n j n
= . (667)
j i i j−i
This fact is a particular case of the trinomial revision formula ([Grinbe15, Proposition
3.23]), but let us give a proof of it here, seeing that we have already done most of
the work:
[Proof of (667): In the case when i ≤ j, we have already proved (667) in the solution
of Exercise 4.5.5 above (indeed, the equality (667) becomes precisely the equality
(525) in this case). Thus, for the rest of this proof, we WLOG assume that we don’t
have i ≤ j. Hence,
  i > j. Therefore, Proposition 4.3.4 (applied to i and j instead of k
j
and n) yields / N. Hence, (118)
= 0. Also, j − i < 0 (since i > j) and thus j − i ∈
i
n−i
 
(applied to n − i and j − i instead of n and k) yields = 0. Now, comparing
j−i

December 25, 2021


Math 235 notes page 680

n−i n−i
           
n j n n j n
= 0 with = 0, we obtain = . This
j i i j−i j i i j−i
|{z} | {z }
=0 =0
proves (667).]
Proof of Proposition A.6.3. First, we shall show that certain denominators are nonzero.
Indeed, we have a ≤ b < b + 1 and thus b+  1 − a > 0, so that b + 1 − a 6= 0. Further-
b
more, each k ∈ {c, c + 1, . . . , b} satisfies 6= 0 383 . Applying this to k = c, we
  k
b
obtain 6= 0 (since c ∈ {c, c + 1, . . . , b} (because c ≤ b)). Hence, we have shown
c    
b b
that all the three denominators b + 1 − a, and appearing in Proposition
k c
A.6.3 are nonzero. The fractions are therefore well-defined.
Now, let k ∈ {c, c + 1, . . . , b}. Then, c ≤ k ≤ b and thus k ≥ c ≥ 0 (since c ∈ N),
so that k ∈ N. Hence, (667) (applied to n = b, i = k and j = a) yields that
b−k
     
b a b
= (668)
a k k a−k
(since a ≤ b).    
b b
It is easy to see that both numbers and are nonzero384 . Hence, their
   a k
b b
product is nonzero. We can therefore divide the equality (668) by this
 a k
b b
product . As a result, we obtain
a k
b−k
   
a
b−k
 
k a−k 1
  =   =   . (669)
b b b a−k
k a a
Furthermore, b − k ∈ N (since k ≤ b).Thus,
 Theorem 4.3.10 (applied  to b− k and
b−k b−k b−k

a − k instead of n and k) yields = = (since
a−k (b − k) − ( a − k) b−a
383 Proof. Let k ∈ {c, c + 1, . . . , b}. Then, k ≥ c and k ≤ b. From   k ≥ c ≥ 0 (since c ∈ N), we obtain
b b!
k ∈ N. Hence, Theorem 4.3.8 (applied to n = b) yields = 6= 0 (since b! 6= 0
k k! · (b − k )!
(because b! is a positive integer)).
384 Proof. We have a ∈ N and b ∈ N and a ≤ b. Hence, Theorem 4.3.8 (applied to b and a instead of
 
b b!
n and k) yields = 6= 0 (since b! 6= 0 (because b! is a positive integer)). Also, we
a a! · (b − a)!  
b b!
have k ∈ N and k ≤ b. Hence, Theorem 4.3.8 (applied to n = b) yields = 6= 0
k k!· (b− k)!  
b b
(since b! 6= 0 (because b! is a positive integer)). Thus, we have now seen that both and
a k
are nonzero.

December 25, 2021


Math 235 notes page 681

(b − k) − ( a − k) = b − a). Hence, (669) rewrites as


 
a
b−k
 
k 1
  =   . (670)
b b b−a
k a
Forget that we fixed k. We thus have proved (670) for each k ∈ {c, c + 1, . . . , b}.
We have c ∈ {c, c + 1, . . . , b} (since c ≤ b). Hence, applying (670) to k = c, we
obtain  
a
b−c
 
c 1
  =   . (671)
b b b−a
c a
Now, summing the equality (669) over all k ∈ {c, c + 1, . . . , b}, we obtain
 
a
b b b 
b−k b−k
  
k 1 1
∑ b = ∑ b b − a = b ∑ b − a
k=c k=c k=c
k a a
1 b−c
 
i
= ∑ (672)
b i =0 b − a
a
(here, we have substituted i for b − k in the sum) .
But we have b − c ∈ N (since c ≤ b) and b − a ∈ N (since a ≤ b). Thus, Exercise
4.5.8 (a) (applied to b − c and b − a instead of n and k) yields
b−c 
b−c+1
  
i
∑ b−a
=
b−a+1
. (673)
i =0

c +1 ≥ b − b + 1 = 1 > 0, so that b − c + 1 ∈ N. Also, b −


Meanwhile, b − |{z}
≤b
a +1 ≥ b − b + 1 = 1 > 0 and thus b − a + 1 ∈ N. Hence, Exercise 4.5.4 (a)
|{z}
≤b
(applied to b − c + 1 and b − a + 1 instead of n and m) yields
b−a+1 b−c+1 b−c
   
= .
b−c+1 b−a+1 b−a
b−c+1
 
Solving this equality for , we obtain
b−a+1
b−c+1 b−c+1 b−c
   
= . (674)
b−a+1 b−a+1 b−a

December 25, 2021


Math 235 notes page 682

(Here, we have been able to divide by b − a + 1 and by b − c + 1, because both


numbers b − c + 1 and b − a + 1 are nonzero (since b − c + 1 > 0 and b − a + 1 > 0).)
Now, (673) becomes
b−c 
b−c+1 b−c+1 b−c
    
i
∑ b−a = b−a+1 = b−a+1 b−a
i =0
(by (674)). Hence, (672) becomes
 
a
b b−c 
b−c+1 b−c
  
k 1 i 1
∑ b = b ∑ b − a = ·
b b−a+1 b−a
k=c i =0
k a | {z } a
b−c+1 b−c
 
=
b−a+1 b−a
   
a a
(b + 1 − c)
b−c+1 b−c b+1−c
 
1 c c
= ·  = · =  .
|b −{z
a + 1} b b−a b+1−a b b
(b + 1 − a)
b + 1 − c | a {z c c
=   }
b+1−a a
c
= 
b
c
(by (671))

This proves Proposition A.6.3.


We note that the condition a ≤ b in Proposition A.6.3 is surprisingly crucial. If
a > b, then the claim of Proposition A.6.3 may be false even
 when the denominator
a
b k
is nonzero. Here are some examples of formulas for ∑   when a > b:
k=c b
k
• For a = b + 1, we have
   
a b+1
b b b b−c b−c
k k b+1 b+1 1
∑ b   = ∑ b   = ∑ b−k+1 ∑ i+1= = ( b + 1 ) ∑ i + 1.
k=c k=c k=c i =0 i =0
k k
 
b+1
b k
Thus, an explicit formula for ∑   (without summation signs) would
k=c b
k
n −1 1
imply an explicit formula for the so-called harmonic numbers Hn := ∑ =
i =0 i + 1

December 25, 2021


Math 235 notes page 683

1 1 1
+ + · · · + . Is there an explicit formula for the harmonic numbers? The
1 2 n
answer depends on how you define “explicit formula”. For some meanings of
this word, it has been proved that an explicit formula does not exist (see, e.g.,
https://math.stackexchange.com/a/52579/ and the references therein). But
if you accept, e.g., floor functions, then you can show that
 
Gn
Hn = Gn − (n + 1) , where
n+1
 
n + ( n + 1) !
−1
n
Gn = .
( n + 1) !
This is not hard to prove; but is there any chance for Hn to be easier to
compute using this formula than using the definition?

• For a = b + 2, we have
   
a b+2
b b b
k k ( b + 1) ( b + 2)
∑ b  = ∑ b   = ∑ ( b − k + 1) ( b − k + 2)
k=c k=c k=c
k k
b−c
( b + 1 ) ( b + 2 ) b − c +1 ( b + 1 ) ( b + 2 )
= ∑ ( i + 1) ( i + 2)
= ∑
i ( i + 1)
i =0 i =1
b − c +1
1 b−c+1
= ( b + 1) ( b + 2) ∑ i ( i + 1)
= ( b + 1) ( b + 2) ·
b−c+2
.
i =1
| {z }
b−c+1
=
b−c+2
(by (29))

Let us also list formulas for some higher values of a, in the particular case when

December 25, 2021


Math 235 notes page 684

c = 0:
 
b+2
b
k
∑ b = ( b + 1)2 ;
k =0
k
 
b+3
b
k 1
∑ b =
4
( b + 1)2 ( b + 4) ;
k =0
k
 
b+4
b
k 1  
∑ b =
18
(b + 1)2 b2 + 8b + 18 ;
k =0
k
 
b+5
b
k 1  
∑ b =
96
(b + 1)2 (b + 6) b2 + 7b + 16 ;
k =0
k
 
b+6
b
k 1  
∑ b =
600
(b + 1)2 b4 + 19b3 + 136b2 + 444b + 600 .
k =0
k

Do you see any patterns? (I’m seeing some, but no general rule.)

A.6.4. Discussion of Exercise 5.4.4


Discussion of Exercise 5.4.4. Here is the answer: For each n ∈ N, we have
 n
1 2

 2n −1
 1
q s+ − , if q 6= 0;
an = q q (675)
 n

2 s, if q = 0.

Proof of (675): We are in one of the following two cases:


Case 1: We have q = 0.
Case 2: We have q 6= 0.
Let us first consider Case 1. In this case, we have q = 0. We must show that
an = 2n s for each n ∈ N. The definition of our sequence ( a0 , a1 , a2 , . . .) shows that
an = an−1 (qan−1 + 2) for each integer n ≥ 1. Thus, for each integer n ≥ 1, we have
 

an = an−1  q an−1 + 2 = an−1 (0an−1 + 2) = an−1 · 2 = 2an−1 .


|{z} | {z }
=0 =2

December 25, 2021


Math 235 notes page 685

In other words, the sequence ( a0 , a1 , a2 , . . .) is a geometric progression with ratio 2.


Hence, for each n ∈ N, we have an = 2n a0 = 2n s. Thus, (675) is proved in Case
|{z}
=s
1.
Let us now consider Case 2. In this case, we have q 6= 0. We must prove that
  2n
2n −1 1 1
an = q s+ − (676)
q q

for each n ∈ N.
Set
1
bn = a n + (677)
q
1 1
for each n ∈ N. Thus, b0 = a0 + = s + . The definition of our sequence
|{z} q q
=s
( a0 , a1 , a2 , . . .) shows that an = an−1 (qan−1 + 2) for each integer n ≥ 1. Thus, for
each integer n ≥ 1, we have

1
bn = a n + (by the definition of bn )
q
1
= an−1 (qan−1 + 2) + (since an = an−1 (qan−1 + 2))
q
1 2
 
1 2 2  1 2
= q an−1 + 2qan−1 + 1 = (qan−1 + 1) = q · an−1 +
q| {z } q q
=(qan−1 +1)2

= q · bn2 −1 (678)

1
(since the definition of bn−1 yields an−1 + = bn−1 ).
q
From this, we can easily see that
n −1 n
bn = q 2 b02 (679)

December 25, 2021


Math 235 notes page 686

for each n ∈ N. 385 Now, for each n ∈ N, we have


1
an = bn − (by (677))
|{z} q
n n
=q2 −1 b02
(by (679))
n
1 2
  
n n 1 2n −1 1 1
= q2 −1 b02 − =q s+ − since b0 = s + .
q q q q

This proves (676). In other words, (675) is proved in Case 1.


Hence, (675) is proved in both Cases 1 and 2, thus holds in full generality.
The formula (675) can be rewritten in two further ways:

2n

 (sq + 1) − 1

, if q 6= 0;
an = q
 n

2 s, if q = 0
2 n
2n k k −1
 
= ∑ s q .
k =1
k

(The last equality sign is easy to prove using the binomial theorem.)
[Remark: The above solution is not unmotivated. The reason for defining bn =
1
an + was to complete the square on the right hand side of an = an−1 (qan−1 + 2);
q
1 1
indeed, an−1 (qan−1 + 2) + = (qan−1 + 1)2 ensures that the right hand side
q q

385 Proofof (679): Let us prove (679) by induction on n:


0 0
Induction base: We have 20 = 1 and thus q2 −1 b02 = q1−1 b01 = b01 = b0 . In other words,
|{z}
= q0 =1
0 0
b0 = q2 −1 b02 .
In other words, (679) holds for n = 0.
Induction step: Let m be a positive integer. Assume (as the induction hypothesis) that (679)
holds for n = m − 1. We must prove that (679) holds for n = m.
m −1 m −1
We have assumed that (679) holds for n = m − 1. In other words, bm−1 = q2 −1 b02 . Now,
(678) (applied to n = m) yields
 m −1 2
−1 2m −1 m −1 −1 m −1
 
2 2
bm = q · bm −1 = q · q b0 since bm−1 = q2 b02
 m −1  2  m −1  2
= q· q 2 −1 · b02
| {z } | {z }
2· 2m −1 −1 ) m −1 m
=q (
m −1 −2 m =b02·2 =b02
= q 2·2 = q 2 −2
(since 2·2m−1 =2m ) (since 2·2m−1 =2m )
2m −2 m m −1 m
= q·q ·b02 = q2 b02 .
| {z }
m −2)
=q1+(2 = q 2m −1

In other words, (679) holds for n = m. This completes the induction step. Thus, (679) is proved.

December 25, 2021


Math 235 notes page 687

1 1
becomes a square after addition of , and this reveals that the numbers bn = an +
q q
behave more predictably than the numbers an .]

A.6.5. Discussion of Exercise 5.4.5


Discussion of Exercise 5.4.5. The answer is:

an = f 2 f n for each n ≥ 1, (680)

where ( f 0 , f 1 , f 2 , . . .) is the Fibonacci sequence (as defined in Definition 2.2.1).


In order to prove this, we need a lemma:
Lemma A.6.4. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Let n, m ∈ N satisfy
n ≥ m. Then,
f n−m f n+m = f n2 − (−1)n+m f m2 .

Proof of Lemma A.6.4. The Fibonacci sequence ( f 0 , f 1 , f 2 , . . .) is (1, 1)-recurrent and


satisfies f 0 = 0. Thus, Exercise 4.10.4 (applied to a = 1 and xi = f i and yi = f i )
yields that

f n−m f n+m = f n f n − (−1)n+m f m f m = f n2 − (−1)n+m f m2 .


|{z} | {z }
= f n2 = f m2

This proves Lemma A.6.4.


Let us now prove (680):
[Proof of (680): We proceed by strong induction on n:
Induction step: Let m ≥ 1 be an integer. Assume (as the induction hypothesis)
that (680) holds for n < m. We must prove that (680) holds for n = m. In other
words, we must prove that am = f 2 f m .
This is easily checked by hand if m ∈ {1, 2, 3} (indeed, a1 = 1 = f 2 = f 2· f1 and
a2 = 1 = f 2 = f 2· f2 and a3 = 3 = f 4 = f 2· f3 ). Thus, for the rest of this proof, we
WLOG assume that m ∈ / {1, 2, 3}. Hence, m ≥ 4. Thus, the recursive definition of
our sequence ( a1 , a2 , a3 , . . .) yields

a2m−1 − a2m−2
am = . (681)
a m −3

But m ≥ 4 entails that m − 3 ≥ 1. Also, m − 3 < m. Hence, our induction hypothesis


shows that (680) holds for n = m − 3. In other words, we have am−3 = f 2 f m−3 .
Similarly, am−2 = f 2 f m−2 and am−1 = f 2 f m−1 . In view of these three equalities, we
can rewrite (681) as
f 22f m−1 − f 22f m−2
am = . (682)
f 2 f m −3

December 25, 2021


Math 235 notes page 688

However, the definition of the Fibonacci sequence yields that f n = f n−1 + f n−2 for
each n ≥ 2. Thus, f m = f m−1 + f m−2 and f m−1 = f m−2 + f m−3 . The latter equality
entails f m−3 = f m−1 − f m−2 , so that f m−1 − f m−2 = f m−3 ≥ 0 (since all Fibonacci
numbers are nonnegative) and therefore f m−1 ≥ f m−2 , so that 2 f m−1 ≥ 2 f m−2 .
Thus, we can apply Lemma A.6.4 to 2 f m−1 and 2 f m−2 instead of n and m. We thus
obtain

f 2 f m−1 −2 f m−2 f 2 f m−1 +2 f m−2 = f 22f m−1 − (−1)2 f m−1 +2 f m−2 f 22f m−2 = f 22f m−1 − f 22f m−2 .
| {z }
=1
(since 2 f m−1 +2 f m−2
is clearly even)

Therefore,
f 22f m−1 − f 22f m−2 = f 2 f m−1 −2 f m−2 f 2 f m−1 +2 f m−2 = f 2 f m−3 f 2 f m
(since 2 f m−1 + 2 f m−2 = 2 ( f m−1 + f m−2 ) = 2 f m and 2 f m−1 − 2 f m−2 = 2 ( f m−1 − f m−2 ) =
| {z } | {z }
= fm = f m −3
f 22f m−1 − f 22f m−2
2 f m−3 ). Solving this equation for f 2 f m , we obtain f 2 f m = (here, we
f 2 f m −3
are using the fact that f 2 f m−3 6= 0, which follows from 2 f m−3 ≥ 2). Comparing this
| {z }
≥1
with (682), we obtain am = f 2 f m . This completes the induction step. Thus, (680) is
proved.]
The problem is thus solved. We note that the sequence ( a1 , a2 , a3 , . . .) is Sequence
A101361 in the OEIS.

A.6.6. Discussion of Exercise 5.4.6


Discussion of Exercise 5.4.6. Exercise 5.4.6 is the Zeckendorf theorem; it appears, e.g.,
in [Grinbe18, Theorem 2.4]. The proof given in [Grinbe18, §2] is rather similar to
our proof of Theorem 5.2.1 above. (See [Grinbe18, detailed version] for a more
detailed writeup of this proof. A brief sketch also appears in [GrKnPa94, §6.6], and
a fairly similar proof is found in [Hender16]. A different – combinatorial – proof
is found in https://planetmath.org/combinatorialproofofzeckendorfstheorem
. Yet another proof is found in [Chen08].) See [Hoggat72] and [Lengye06] for two
(different!) generalizations.

A.6.7. Discussion of Exercise 5.4.7


Discussion of Exercise 5.4.7. Let us sketch the solution.
The lecturer makes the first announcement at the moment the first student is
leaving. Any student who, at this moment, has not entered the classroom yet will
be called late. The lecturer makes the second announcement when the first late

December 25, 2021


Math 235 notes page 689

student leaves386 . We claim that these two announcements are sufficient – i.e., each
student hears (at least) one of them.
Indeed, assume the contrary. Thus, there exists a student s who hears neither
the first nor the second announcement. Consider this student s. Let f be the
first student to leave the classroom, and let ` be the first late student to leave the
classroom (we assume that ` exists; the other case is even easier387 ). Now, we shall
prove that no two of the three students s, f and ` are ever together in the room.
Indeed, the student ` is late, and thus does not enter the classroom until after f
has left (by the definition of “late”). Hence, f and ` are never together in the room.
Moreover, the student s cannot have left before f (since f was first to leave), and
thus cannot have entered before f has left (since otherwise, s would have witnessed
the leaving of f , and thus would have heard the first announcement, contradicting
our definition of s). In other words, s is late. Hence, s cannot have left before `
(since ` was the first late student to leave), and thus cannot have entered before `
has left (since otherwise, s would have witnessed the leaving of `, and thus would
have heard the second announcement, contradicting our definition of s). Hence,
s has entered after ` has left. Therefore, s and ` are never together in the room.
Moreover, s and f are never together in the room (since s cannot have entered
before f has left, as we have seen above).
We have now shown that f and ` are never together in the room; that s and `
are never together in the room; and that s and f are never together in the room. In
other words, no two of the three students s, f and ` are ever together in the room.
This contradicts the assumption that among any three (distinct) students, there are
at least two that are together in the room at some moment.388 This contradiction
shows that our assumption was false. Hence, we have shown that each student
hears (at least) one of the two announcements. Thus, we have solved Exercise 5.4.7
(and, with it, solved Exercise 5.2.1 again).

A.6.8. Discussion of Exercise 5.4.8


Discussion of Exercise 5.4.8. We shall first sketch the solution, then formalize it in
detail.
Let us first restate the exercise in terms of n students and a lecturer:389

Restated exercise: Let n and k be positive integers with k ≥ 2. A lecture


is attended by n students. Each student enters the classroom once and
leaves it once (and does not come back). We know that among any k
386 or, in the case when there are no late students, at the end of class
387 In fact, if ` does not exist, then there are no late students at all, and therefore every student hears
the first announcement.
388 Here we have used the fact that the three students s, f and ` are indeed distinct (which is clear,

since no two of them are ever together in the room).


389 The assumption that “for any k distinct elements i , i , . . . , i ∈ {1, 2, . . . , n }, at least two of the k
1 2 k
intervals Ii1 , Ii2 , . . . , Iik intersect” thus becomes “among any k distinct students, there are at least
two that are together in the room at some moment”.

December 25, 2021


Math 235 notes page 690

distinct students, there are at least two that are together in the room at
some moment. The lecturer wants to make an announcement that every
student will hear. Prove that the lecturer can pick k − 1 moments at
which to make the announcement so that each student will hear it. (We
assume that the announcement takes no time – i.e., if a student leaves
at the same moment that another student enters, the lecturer can make
the announcement at this moment and both students will hear it.)

We solve this restated exercise using the following method (which generalizes
our above solution to Exercise 5.4.7):

• The lecturer makes the first announcement when the first student leaves. Any
student who, at this moment, has not entered the classroom yet will be called
late.
• The lecturer makes the second announcement when the first late student
leaves390 . Any student who, at this moment, has not entered the classroom
yet will be called doubly late.
• The lecturer makes the second announcement when the first doubly late stu-
dent leaves391 . Any student who, at this moment, has not entered the class-
room yet will be called triply late.
• And so on.

The lecturer stops this process after k − 1 announcements. We claim that each
student will have heard (at least) one of these k − 1 announcements. Indeed, if
there was a student s who hears none of them, then we could show (similarly
to how we did this in the above solution of Exercise 5.4.7) that there would be k
students no two of whom had ever been in the classroom at the same time (namely,
the student s, the first student to leave, the first late student to leave, the first
doubly late student to leave, etc.). To be fully precise, this argument would have
to be tweaked for the case when (e.g.) there are no doubly late students at all; but
this is fairly easy.
A conceptually simpler (but essentially equivalent) way to solve Exercise 5.4.8 is
by induction on k. The idea (again stated in terms of students) is to make the first
announcement when the first student leaves, and then forget about all students
who have heard this announcement. The remaining students have the property
that among any k − 1 of them, there are at least two that are together in the room at
some moment (because the first student that has left has not overlapped with any
of them); thus, by the induction hypothesis, k − 2 announcements will suffice for
them. Altogether, the lecturer will thus make 1 + (k − 2) = k − 1 announcements
and be heard by each student.
390 or,in the case when there are no late students, at the end of class
391 Again, if there are no doubly late students, then this announcement will be made at the end of
class (and likewise for all future announcements).

December 25, 2021


Math 235 notes page 691

Here is a rigorous way to state this proof:392


Solution to Exercise 5.4.8 (formal version). Forget that we fixed n, k and I1 , I2 , . . . , In .
We must solve Exercise 5.4.8. We shall proceed by induction on k.
Induction base: Let us show that Exercise 5.4.8 holds for k = 2. In other words, let
us verify the following claim:

Claim 1: Let n be a positive integer. Let I1 , I2 , . . . , In be n nonempty


finite closed intervals on the real axis. Assume that for any 2 distinct
elements i1 , i2 ∈ {1, 2, . . . , n}, at least two of the 2 intervals Ii1 , Ii2 inter-
sect. Then, there exist 2 − 1 reals a1 , a2 , . . . , a2−1 such that each of the
intervals I1 , I2 , . . . , In contains at least one of a1 , a2 , . . . , a2−1 .

[Proof of Claim 1: Write each interval Im as [ pm , qm ] for two reals pm and qm . Thus,
each m ∈ {1, 2, . . . , n} satisfies
Im = [ pm , qm ] (683)
and therefore [ pm , qm ] = Im 6= ∅ (since Im is nonempty), so that

pm ≤ qm . (684)

Let
b = min {q1 , q2 , . . . , qn } . (685)
We shall show that each of the intervals I1 , I2 , . . . , In contains b.
Indeed, let j ∈ {1, 2, . . . , n}. We shall show that b ∈ Ij .
We have
b = min {q1 , q2 , . . . , qn } ∈ {q1 , q2 , . . . , qn }
(since the minimum of a set always lies in this set). In other words, there exists
some k ∈ {1, 2, . . . , n} such that b = qk . Consider this k.
Applying (683) to m = k, we obtain Ik = [ pk , qk ]. But applying (684) to m = k, we
obtain pk ≤ qk . Hence, qk ∈ [ pk , qk ] = Ik , so that b = qk ∈ Ik .
Now, our goal is to show that b ∈ Ij . If j = k, then this follows directly from
b ∈ Ik . Thus, for the rest of this proof, we WLOG assume that j 6= k. Thus, j and k
are two distinct elements of {1, 2, . . . , n}.
Recall our assumption that for any 2 distinct elements i1 , i2 ∈ {1, 2, . . . , n}, at
least two of the 2 intervals Ii1 , Ii2 intersect. Applying this to i1 = j and i2 = k, we
conclude that at least two of the 2 intervals Ij , Ik intersect (since j, k are 2 distinct
elements of {1, 2, . . . , n}). In other words, the two intervals Ij and Ik intersect (since
the only way to pick two of the 2 intervals Ij , Ik is to pick Ij and Ik ). In other words,
Ij ∩ Ik 6= ∅.

392 Unfortunately,this is a good example of a proof that heavily increases in length and decreases
in readability when it is formalized. Arguably, it could be that it is just me formalizing it badly
(suggestions for improvement are greatly encouraged!); but it is a sad empirical fact that this
happens to most writers with most proofs in combinatorics.

December 25, 2021


Math 235 notes page 692

 
Recall that Ik = [ pk , qk ]. Also, (683) (applied to m = j) yields Ij = p j , q j . Recall
that Ij ∩ Ik 6= ∅. In other words, there exists some c ∈ Ij ∩ Ik . Consider this c.
 
From c ∈ Ij ∩ Ik ⊆ Ij = p j , q j , we obtain c ≥ p j . From c ∈ Ij ∩ Ik ⊆ Ik = [ pk , qk ],
we obtain c ≤ qk . Hence, qk ≥ c ≥ p j . Recalling that b = qk , we thus obtain
b = qk ≥ p j .
We have b = min {q1 , q2 , . . . , qn }. In other words, b is the smallest of the n
numbers q1 , q2 , . . . , qn . Hence, b ≤ qi for each i ∈ {1, 2, . . . , n}.  Applying  this to
i = j, we find b ≤ q j . Combining this with b ≥ p j , we obtain b ∈ p j , q j = Ij .
Forget that we fixed j. We thus have shown that b ∈ Ij for each j ∈ {1, 2, . . . , n}.
In other words, each of the intervals I1 , I2 , . . . , In contains b. Thus, there exists a real
a1 such that each of the intervals I1 , I2 , . . . , In contains at least one of a1 (namely,
a1 = b). In other words, there exist 2 − 1 reals a1 , a2 , . . . , a2−1 such that each of
the intervals I1 , I2 , . . . , In contains at least one of a1 , a2 , . . . , a2−1 (because 2 − 1 reals
a1 , a2 , . . . , a2−1 are the same as a single real a1 ). This proves Claim 1.]
Claim 1 is precisely the claim of Exercise 5.4.8 for k = 2; thus, Exercise 5.4.8 holds
for k = 2 (since we have proved Claim 1). This completes the induction base.
Induction step: Fix an integer ` ≥ 2. Assume (as the induction hypothesis) that
Exercise 5.4.8 holds for k = `. We must prove that Exercise 5.4.8 holds for k = ` + 1.
We have assumed that Exercise 5.4.8 holds for k = `. In other words, the follow-
ing claim holds:

Claim 2: Let n be a positive integer. Let I1 , I2 , . . . , In be n nonempty finite


closed intervals on the real axis. Assume that for any ` distinct elements
i1 , i2 , . . . , i` ∈ {1, 2, . . . , n}, at least two of the ` intervals Ii1 , Ii2 , . . . , Ii`
intersect. Then, there exist ` − 1 reals a1 , a2 , . . . , a`−1 such that each of
the intervals I1 , I2 , . . . , In contains at least one of a1 , a2 , . . . , a`−1 .

We must prove that Exercise 5.4.8 holds for k = ` + 1. In other words, we must
prove the following claim:

Claim 3: Let n be a positive integer. Let I1 , I2 , . . . , In be n nonempty


finite closed intervals on the real axis. Assume that for any ` + 1 distinct
elements i1 , i2 , . . . , i`+1 ∈ {1, 2, . . . , n}, at least two of the ` + 1 intervals
Ii1 , Ii2 , . . . , Ii`+1 intersect. Then, there exist ` reals a1 , a2 , . . . , a` such that
each of the intervals I1 , I2 , . . . , In contains at least one of a1 , a2 , . . . , a` .

[Proof of Claim 3: Write each interval Im as [ pm , qm ] for two reals pm and qm . Thus,
each m ∈ {1, 2, . . . , n} satisfies
Im = [ pm , qm ] (686)
and therefore [ pm , qm ] = Im 6= ∅ (since Im is nonempty), so that

pm ≤ qm . (687)

Let
b = min {q1 , q2 , . . . , qn } . (688)

December 25, 2021


Math 235 notes page 693

Thus, b is the smallest among the n numbers q1 , q2 , . . . , qn . Hence,

b ≤ qj for each j ∈ {1, 2, . . . , n} . (689)

We note that our situation is symmetric in the n intervals I1 , I2 , . . . , In ; that is,


we can permute these n intervals arbitrarily (as long as we accordingly permute
the n numbers p1 , p2 , . . . , pn and the n numbers q1 , q2 , . . . , qn ) without changing our
assumptions or the claim we are trying to prove. Hence, we can WLOG assume
that we have
p1 ≥ p2 ≥ · · · ≥ p n (690)
(since we can always achieve this by appropriately permuting I1 , I2 , . . . , In ). Assume
this.
We have b = min {q1 , q2 , . . . , qn } ∈ {q1 , q2 , . . . , qn } (since the minimum of a set
always belongs to this set). In other words, there exists some k ∈ {1, 2, . . . , n} such
that b = qk . Consider this k. Applying (687) to m = k, we obtain pk ≤ qk = b
(since b = qk ). Thus, there exists some i ∈ {1, 2, . . . , n} such that pi ≤ b (namely,
i = k). Let s be the smallest such i. Thus, we have ps ≤ b, but none of the numbers
p1 , p2 , . . . , ps−1 is ≤ b.
It is now easy to see that each of the intervals Is , Is+1 , . . . , In contains b 393 . If
s = 1, then Claim 3 now easily follows394 . Hence, for the rest of the proof, we
WLOG assume that s 6= 1. Hence, s > 1 (since s ∈ {1, 2, . . . , n}). Thus, s − 1 > 0,
so that s − 1 is a positive integer. Also, s ∈ {1, 2, . . . , n}, so that s ≤ n and thus
s − 1 ≤ s ≤ n. Hence, {1, 2, . . . , s − 1} ⊆ {1, 2, . . . , n}.
If u ∈ {1, 2, . . . , s − 1}, then

the intervals Iu and Ik do not intersect. (691)

[Proof of (691): Let u ∈ {1, 2, . . . , s − 1}. We must show that the intervals Iu and
Ik do not intersect.
Assume the contrary. Thus, the intervals Iu and Ik intersect. In other words,
Iu ∩ Ik 6= ∅. Hence, there exists some c ∈ Iu ∩ Ik . Consider this c. We have
c ∈ Iu ∩ Ik ⊆ Iu = [ pu , qu ] (by (686), applied to m = u). Thus, c ≥ pu , so that
393 Proof. Let j ∈ {s, s + 1, . . . , n}. We shall show that b ∈ Ij .
 
Indeed, (686) (applied to m = j) yields Ij = p j , q j . Now, j ∈ {s, s + 1, . . . , n}, so that s ≤ j ≤ n.
But (690) shows that pα ≥ p β for any two elements α and β of {1, 2, . . . , n} satisfying α ≤ β.
Applying this to α = s and β = j, we find ps ≥ p j (since s ≤ j), so that p j ≤ ps ≤ b. Hence,
 
b ≥ p j . But (689) yields b ≤ q j . Combining this with b ≥ p j , we find b ∈ p j , q j = Ij .
Forget that we fixed j. We thus have shown that b ∈ Ij for each j ∈ {s, s + 1, . . . , n}. In other
words, each of the intervals Is , Is+1 , . . . , In contains b.
394 Proof. Assume that s = 1. We have just shown that each of the intervals I , I
s s+1 , . . . , In contains b.
In view of s = 1, we can rewrite this as follows: Each of the intervals I1 , I2 , . . . , In contains b. In
other words, each of the intervals I1 , I2 , . . . , In contains at least one of the ` reals b, b, . . . , b (since
| {z }
` times
` ≥ 2 ≥ 1). Hence, there exist ` reals a1 , a2 , . . . , a` such that each of the intervals I1 , I2 , . . . , In
contains at least one of a1 , a2 , . . . , a` (namely, ai = b for each i ∈ {1, 2, . . . , `}). This proves Claim
3. Thus, Claim 3 is proved under the assumption that s = 1.

December 25, 2021


Math 235 notes page 694

pu ≤ c. We have c ∈ Iu ∩ Ik ⊆ Ik = [ pk , qk ] (by (686), applied to m = k). Thus,


c ≤ qk = b (since b = qk ). Hence, pu ≤ c ≤ b. However, pu is one of the numbers
p1 , p2 , . . . , ps−1 (since u ∈ {1, 2, . . . , s − 1}). Hence, pu is not ≤ b (since we have
shown that none of the numbers p1 , p2 , . . . , ps−1 is ≤ b). This contradicts pu ≤ b.
This contradiction shows that our assumption was false. Hence, (691) is proven.]
We recall our assumption that
!
for any ` + 1 distinct elements i1 , i2 , . . . , i`+1 ∈ {1, 2, . . . , n} ,
. (692)
at least two of the ` + 1 intervals Ii1 , Ii2 , . . . , Ii`+1 intersect

We shall now prove that

for any ` distinct elements i1 , i2 , . . . , i` ∈ {1, 2, . . . , s − 1} ,


 
. (693)
at least two of the ` intervals Ii1 , Ii2 , . . . , Ii` intersect

[Proof of (693): Let i1 , i2 , . . . , i` ∈ {1, 2, . . . , s − 1} be ` distinct elements. We must


prove that at least two of the ` intervals Ii1 , Ii2 , . . . , Ii` intersect.
Assume the contrary. Thus, no two of the ` intervals Ii1 , Ii2 , . . . , Ii` intersect.
Moreover, if g ∈ {1, 2, . . . , `}, then i g ∈ {1, 2, . . . , s − 1} (since i1 , i2 , . . . , i` ∈ {1, 2, . . . , s − 1}),
and therefore the intervals Iig and Ik do not intersect (by (691), applied to u = i g ).
In other words, none of the intervals Ii1 , Ii2 , . . . , Ii` intersects Ik .
We note that i1 , i2 , . . . , i` are ` distinct elements of {1, 2, . . . , s − 1} and therefore
are ` distinct elements of {1, 2, . . . , n} (since {1, 2, . . . , s − 1} ⊆ {1, 2, . . . , n}). We
extend the `-tuple (i1 , i2 , . . . , i` ) to an (` + 1)-tuple (i1 , i2 , . . . , i`+1 ) by setting i`+1 =
k. Thus, i1 , i2 , . . . , i`+1 are ` + 1 elements of {1, 2, . . . , n} (because i1 , i2 , . . . , i` are `
elements of {1, 2, . . . , n}, and because i`+1 = k ∈ {1, 2, . . . , n}). Furthermore, these
` + 1 elements i1 , i2 , . . . , i`+1 are distinct395 . Hence, (692) yields that at least two of
the ` + 1 intervals Ii1 , Ii2 , . . . , Ii`+1 intersect. In other words, there exist two numbers
395 Proof. Assume the contrary. Thus, two of the ` + 1 elements i1 , i2 , . . . , i`+1 are equal. In other
words, there exist two numbers α, β ∈ {1, 2, . . . , ` + 1} with α < β and iα = i β . Consider these α
and β.
We have α < β ≤ ` + 1 (since β ∈ {1, 2, . . . , ` + 1}), so that α ≤ (` + 1) − 1 (since α and ` + 1
are integers). Thus, α ≤ (` + 1) − 1 = `, so that α ∈ {1, 2, . . . , `} (since α ∈ {1, 2, . . . , ` + 1} ⊆
{1, 2, 3, . . .}). Therefore, iα is one of the ` elements i1 , i2 , . . . , i` . Hence, iα ∈ {1, 2, . . . , s − 1} (since
i1 , i2 , . . . , i` are elements of {1, 2, . . . , s − 1}). Hence, (691) (applied to u = iα ) yields that the
intervals Iiα and Ik do not intersect. In other words, Iiα ∩ Ik = ∅.
If we had β = ` + 1, then we would have

iα = i β = i`+1 (since β = ` + 1)
= k,

which would entail Iiα ∩ Ik = Ik ∩ Ik = Ik 6= ∅ (since the interval Ik is nonempty), which


would contradict Iiα ∩ Ik = ∅. Thus, we cannot have β = ` + 1. Hence, β 6= ` + 1. From
β ∈ {1, 2, . . . , ` + 1} and β 6= ` + 1, we obtain β ∈ {1, 2, . . . , ` + 1} \ {` + 1} = {1, 2, . . . , `}.
Thus, we know that α and β are two distinct elements of {1, 2, . . . , `} (since α ∈ {1, 2, . . . , `}
and β ∈ {1, 2, . . . , `} and α < β). Hence, iα 6= i β (since the ` elements i1 , i2 , . . . , i` are distinct).
This contradicts iα = i β . This contradiction shows that our assumption was wrong, qed.

December 25, 2021


Math 235 notes page 695

α, β ∈ {1, 2, . . . , ` + 1} with α < β and with the property that the intervals Iiα and
Ii β intersect. Consider these α and β.
We have α < β ≤ ` + 1 (since β ∈ {1, 2, . . . , ` + 1}), so that α ≤ (` + 1) − 1 (since α
and ` + 1 are integers). Thus, α ≤ (` + 1) − 1 = `, so that α ∈ {1, 2, . . . , `} (since α ∈
{1, 2, . . . , ` + 1} ⊆ {1, 2, 3, . . .}). Therefore, iα is one of the ` elements i1 , i2 , . . . , i` .
Hence, iα ∈ {1, 2, . . . , s − 1} (since i1 , i2 , . . . , i` are elements of {1, 2, . . . , s − 1}).
Hence, (691) (applied to u = iα ) yields that the intervals Iiα and Ik do not inter-
sect.
However, the intervals Iiα and Ii β intersect. If we had i β = k, then this would
entail that the intervals Iiα and Ik intersect; but this would contradict the fact that
the intervals Iiα and Ik do not intersect. Hence, we cannot have i β = k. Thus, we
have i β 6= k.
If we had β = ` + 1, then we would have i β = i`+1 = k, which would con-
tradict i β 6= k. Thus, we cannot have β = ` + 1. Hence, β 6= ` + 1. From
β ∈ {1, 2, . . . , ` + 1} and β 6= ` + 1, we obtain β ∈ {1, 2, . . . , ` + 1} \ {` + 1} =
{1, 2, . . . , `}.
Thus, we know that α and β are two distinct elements of {1, 2, . . . , `} (since α ∈
{1, 2, . . . , `} and β ∈ {1, 2, . . . , `} and α < β). Hence, the intervals Iiα and Iiβ do not
intersect (since no two of the ` intervals Ii1 , Ii2 , . . . , Ii` intersect). This contradicts
the fact that the intervals Iiα and Ii β intersect. This contradiction shows that our
assumption was wrong. Hence, we have shown that at least two of the ` intervals
Ii1 , Ii2 , . . . , Ii` intersect. This proves (693).]
Now, (693) shows that for any ` distinct elements i1 , i2 , . . . , i` ∈ {1, 2, . . . , s − 1},
at least two of the ` intervals Ii1 , Ii2 , . . . , Ii` intersect. Hence, we can apply Claim 2 to
s − 1 instead of n (since s − 1 is a positive integer, and since I1 , I2 , . . . , Is−1 are s − 1
nonempty finite closed intervals on the real axis). As a result, we conclude that
there exist ` − 1 reals a1 , a2 , . . . , a`−1 such that each of the intervals I1 , I2 , . . . , Is−1
contains at least one of a1 , a2 , . . . , a`−1 . Consider these ` − 1 reals a1 , a2 , . . . , a`−1 .
Extend the (` − 1)-tuple ( a1 , a2 , . . . , a`−1 ) to an `-tuple ( a1 , a2 , . . . , a` ) by setting a` =
b.
Now, it is easy to see that for each h ∈ {1, 2, . . . , n},
the interval Ih contains at least one of a1 , a2 , . . . , a` . (694)
[Proof of (694): Let h ∈ {1, 2, . . . , n}. We must prove that the interval Ih contains
at least one of a1 , a2 , . . . , a` . We are in one of the following two cases:
Case 1: We have h < s.
Case 2: We have h ≥ s.
Let us first consider Case 1. In this case, we have h < s. Thus, h ≤ s − 1
(since h and s are integers), so that h ∈ {1, 2, . . . , s − 1} (since h ∈ {1, 2, . . . , n} ⊆
{1, 2, 3, . . .}). Thus, Ih is one of the intervals I1 , I2 , . . . , Is−1 .
Recall that each of the intervals I1 , I2 , . . . , Is−1 contains at least one of a1 , a2 , . . . , a`−1 .
Hence, Ih contains at least one of a1 , a2 , . . . , a`−1 (since Ih is one of the intervals
I1 , I2 , . . . , Is−1 ). Therefore, Ih contains at least one of a1 , a2 , . . . , a` . Thus, (694) is
proved in Case 1.

December 25, 2021


Math 235 notes page 696

Let us now consider Case 2. In this case, we have h ≥ s. Thus, h ∈ {s, s + 1, . . . , n}


(since h ∈ {1, 2, . . . , n} entails h ≤ n). Therefore, Ih is one of the intervals Is , Is+1 , . . . , In .
Recall that each of the intervals Is , Is+1 , . . . , In contains b. Hence, Ih contains b
(since Ih is one of the intervals Is , Is+1 , . . . , In ). In other words, Ih contains a` (since
a` = b). Hence, Ih contains at least one of a1 , a2 , . . . , a` . Thus, (694) is proved in
Case 2.
We have now proved (694) in each of the two Cases 1 and 2. Thus, (694) always
holds.]
So we have shown that for each h ∈ {1, 2, . . . , n}, the interval Ih contains at least
one of a1 , a2 , . . . , a` . In other words, each of the intervals I1 , I2 , . . . , In contains at
least one of a1 , a2 , . . . , a` .
Now, we have found ` reals a1 , a2 , . . . , a` with the property that each of the inter-
vals I1 , I2 , . . . , In contains at least one of a1 , a2 , . . . , a` . Hence, such ` reals exist. This
proves Claim 3.]
Now, Claim 3 is proved; in other words, we have proved that Exercise 5.4.8 holds
for k = ` + 1. This completes the induction step. Thus, Exercise 5.4.8 is solved.
We note that, if Exercise 5.4.8 is restated in terms of students and lecturers, then
the ` numbers a1 , a2 , . . . , a` constructed in the above solution (i.e., the ` moments
at which the lecturer needs to make their announcement) will be known to the
lecturer as soon as they arrive, at least if the number n is known to the lecturer. (If
the number n is not known, a little tweak has to be made.)
We note furthermore that Exercise 5.4.8 has a generalization, in which the words
“at least two” are replaced by “at least q” for some fixed integer q ≥ 2. See
[Gunder10, Exercise 437] for this generalization. (Note that it is not hard to re-
cover this generalization from Exercise 5.4.8.)

A.6.9. Discussion of Exercise 5.4.9


Discussion of Exercise 5.4.9. Exercise 5.4.9 can easily be reduced to Exercise 5.2.4:
First solution to Exercise 5.4.9 (sketched). Let C be a positive real number large enough
that all of the n numbers C + x0 , C + x1 , . . . , C + xn−1 are positive.
Consider a circular track with n gas stations on it. The n gas stations are labelled
0, 1, . . . , n − 1 (in the order in which a car would encounter them when driving
around the track). Assume that the gas stations are placed at equal distances (i.e.,
the distance between any two consecutive gas stations is the same), and driving
from any gas station to the next consumes C gallons of gas. Thus, a car needs nC
gallons of gas in total to complete the entire track.
Assume that gas station i has C + xi gallons of gas available. Then, the n gas
stations have just enough gas for a car to complete the entire track (indeed, the

December 25, 2021


Math 235 notes page 697

total amount of gas in the stations is


( C + x 0 ) + ( C + x 1 ) + · · · + ( C + x n −1 )
= nC + ( x0 + x1 + · · · + xn−1 ) = nC + 0 = nC,
| {z }
=0

which is exactly what the car needs to complete the track).


Now, Exercise 5.2.4 yields that at least one of these n gas stations has the property
that if the car starts at this gas station with an initially empty gas tank, then it can
traverse the entire track without ever running out of gas396 . Let k be this gas station.
Then, for each m ∈ {k + 1, k + 2, . . . , k + n}, we have
(C + xk ) + (C + xk+1 ) + · · · + (C + xm−1 ) ≥ (m − k) C,
since the car has made it from gas station k to gas station m (collecting (C + xk ) +
(C + xk+1 ) + · · · + (C + xm−1 ) gallons of gas along the way, and using up (m − k) C
gallons) without running out of gas. This inequality rewrites as
(m − k) C + ( xk + xk+1 + · · · + xm−1 ) ≥ (m − k) C.
Subtracting (m − k ) C from both sides of this inequality, we obtain
xk + xk+1 + · · · + xm−1 ≥ 0.
Thus, we have shown that the inequality xk + xk+1 + · · · + xm−1 ≥ 0 holds for each
m ∈ {k + 1, k + 2, . . . , k + n}. Renaming m as m + 1, we thus conclude that the
inequality xk + xk+1 + · · · + xm ≥ 0 holds for each m ∈ {k, k + 1, . . . , k + n − 1}.
However, recall that the sequence ( x0 , x1 , x2 , . . .) is n-periodic and satisfies x0 +
x1 + · · · + xn−1 = 0. Thus, it is easily seen that the sum of any n consecutive entries
of the sequence ( x0 , x1 , x2 , . . .) is 0. Thus,
x m +1 + x m +2 + · · · + x m + n = 0 (695)
for each m ∈ N. From this, we can easily conclude that the sequence
( x k , x k + x k +1 , x k + x k +1 + x k +2 , x k + x k +1 + x k +2 + x k +3 , . . . )
(that is, the sequence of all sums of the form xk + xk+1 + · · · + xm with m ≥ k) is
n-periodic as well (because any m ≥ k satisfies
x k + x k +1 + · · · + x m + n = ( x k + x k +1 + · · · + x m ) + ( x m +1 + x m +2 + · · · + x m + n )
| {z }
=0
(by (695))
= x k + x k +1 + · · · + x m
). But the first n entries of this sequence are nonnegative (since xk + xk+1 + · · · +
xm ≥ 0 holds for each m ∈ {k, k + 1, . . . , k + n − 1}). Hence, all its entries are
nonnegative (because it is n-periodic). In other words, the inequality xk + xk+1 +
· · · + xm ≥ 0 holds for each m ≥ k. This solves Exercise 5.4.9.
396 provided that it refuels at every gas station it comes across (including the one at which it starts)

December 25, 2021


Math 235 notes page 698

The following second solution may appear very different from the first, but in
truth is closely related: It simply formalizes and applies the idea of our solution to
Exercise 5.2.4 straight to our sequence ( x0 , x1 , x2 , . . .), without the detour of restat-
ing it in terms of cars and gas stations. The resulting argument is more rigorous
and perhaps also more readable, although less vivid and intuitive.
Second solution to Exercise 5.4.9. For each m ∈ N, we define a real number

s m = x 0 + x 1 + · · · + x m −1 . (696)

The sequence ( x0 , x1 , x2 , . . .) is n-periodic. In other words, n is a period of this


sequence ( x0 , x1 , x2 , . . .) (by the definition of “n-periodic”). In other words, every
i ∈ N satisfies
xi = xi +n (697)
(by the definition of a “period”).
Next, we claim that every i ∈ N satisfies

si = si +n . (698)

[Proof of (698): We shall prove (698) by induction on i:


Induction base: The definition of s0 yields s0 = x0 + x1 + · · · + x0−1 = (empty sum) =
0. The definition of sn yields sn = x0 + x1 + · · · + xn−1 = 0. Comparing these two
equalities, we obtain s0 = sn = s0+n (since n = 0 + n). In other words, (698) holds
for i = 0.
Induction step: Let j ∈ N. Assume (as the induction hypothesis) that (698) holds
for i = j. We must prove that (698) holds for i = j + 1. In other words, we must
prove that s j+1 = s( j+1)+n .
We have assumed that (698) holds for i = j. In other words, we have s j = s j+n .
The definition of s j yields s j = x0 + x1 + · · · + x j−1 . The definition of s j+1 yields

s j+1 = x0 + x1 + · · · + x( j+1)−1
= x0 + x1 + · · · + x j (since ( j + 1) − 1 = j)

= x 0 + x 1 + · · · + x j −1 + xj = s j+n + x j+n . (699)
| {z } |{z}
=s j =s j+n = x j+n
(by (697),
applied to i = j)

The definition of s j+n yields s j+n = x0 + x1 + · · · + x j+n−1 . The definition of


s j+n+1 yields

s j+n+1 = x0 + x1 + · · · + x( j+n+1)−1
= x0 + x1 + · · · + x j + n (since ( j + n + 1) − 1 = j + n)

= x 0 + x 1 + · · · + x j + n −1 + x j + n = s j + n + x j + n .
| {z }
=s j+n

December 25, 2021


Math 235 notes page 699

Comparing this with (699), we obtain s j+1 = s j+n+1 = s( j+1)+n (since j + n + 1 =


( j + 1) + n). This completes the induction step. Thus, (698) is proven.]
Thus, we have shown that every i ∈ N satisfies si = si+n . In other words, n is
a period of the sequence (s0 , s1 , s2 , . . .) (by the definition of a “period”). In other
words, the sequence (s0 , s1 , s2 , . . .) is n-periodic (by the definition of “n-periodic”).
Pick an element u ∈ {0, 1, . . . , n − 1} for which the number su is minimum397 .
Thus,
su ≤ sv for each v ∈ {0, 1, . . . , n − 1} . (700)
Hence, we can easily see that

su ≤ sm for each m ∈ N. (701)

[Proof of (701): Let m ∈ N. Proposition 3.3.2 (a) (applied to m instead of u) yields


m%n ∈ {0, 1, . . . , n − 1} and m%n ≡ m mod n. Hence, (700) (applied to v = m%n)
yields su ≤ sm%n . However, n is a period of the sequence (s0 , s1 , s2 , . . .), whereas
m%n and m are two nonnegative integers satisfying m%n ≡ m mod n. Therefore,
Theorem 4.7.8 (e) (applied to (s0 , s1 , s2 , . . .), si , n, m%n and m instead of u, ui , a, p
and q) yields that sm%n = sm . Hence, su ≤ sm%n = sm . This proves (701).]
The definition of su yields su = x0 + x1 + · · · + xu−1 .
Now, let m ≥ u be an integer. Thus, m ≥ u ≥ 0, so that m ∈ N. Hence,
m + 1 ∈ N. Thus, (701) (applied to m + 1 instead of m) shows that

su ≤ sm+1 = x0 + x1 + · · · + x(m+1)−1 (by the definition of sm+1 )


= x0 + x1 + · · · + x m (since (m + 1) − 1 = m)
= ( x 0 + x 1 + · · · + x u −1 ) + ( x u + x u +1 + · · · + x m )
| {z }
=su
 
here, we have split the sum after its u-th addend,
since 0 ≤ u ≤ m + 1
= s u + ( x u + x u +1 + · · · + x m ) .

Subtracting su from both sides of this inequality, we obtain 0 ≤ xu + xu+1 + · · · +


xm . In other words, xu + xu+1 + · · · + xm ≥ 0.
Forget that we fixed m. We thus have shown that every m ≥ u satisfies xu +
xu+1 + · · · + xm ≥ 0. Hence, there exists some k ∈ {0, 1, . . . , n − 1} such that every
m ≥ k satisfies xk + xk+1 + · · · + xm ≥ 0 (namely, k = u). This solves Exercise
5.4.9.

397 Thisis, again, an application of Theorem 5.1.1: Indeed, the set {su | u ∈ {0, 1, . . . , n − 1}} is
nonempty (since n is positive) and finite; thus, it has a minimum (by Theorem 5.1.1). If we
denote this minimum by g, then g ∈ {su | u ∈ {0, 1, . . . , n − 1}} (since the minimum of a set
always belongs to this set), and thus there exists some u ∈ {0, 1, . . . , n − 1} such that g = su . We
pick such a u.

December 25, 2021


Math 235 notes page 700

A.6.10. Discussion of Exercise 5.4.10


Discussion of Exercise 5.4.10. Here is one possible solution:
Solution to Exercise 5.4.10. (a) Let ( x, y) be a golden pair such that ( x, y) 6= (0, 1).
We must prove that x − y ≥ 0.
Indeed, ( x, y) is a golden pair. In other words, ( x, y) is a pair of nonnegative
integers such that x2 − xy − y2 = 1 (by the definition of a “golden pair”).
Each z ∈ R satisfies z ≥ − |z|. Applying this to z = x2 − xy − y2 , we obtain
x2 − xy − y2 ≥ − x2 − xy − y2 = −1.
| {z }
=1
Now, our goal is to show that x − y ≥ 0.
Assume the contrary. Thus, x − y < 0, so that x < y. Hence, x2 < y2 (since
x and y are nonnegative) and therefore x2 ≤ y2 − 1 (since x and y are integers).
Moreover, from x < y, we obtain y > x ≥ 0 (since x is nonnegative). If we had
x > 0, we would thus obtain xy > 0 (since x > 0 and y > 0) and therefore
x2 − xy −y2 < y2 − 1 − y2 = −1, which would contradict x2 − xy − y2 ≥ −1.
|{z} |{z}
≤ y2 −1 >0
Hence, we cannot have x > 0. Thus, x ≤ 0. Combining this with x ≥ 0, we find
x = 0. Hence, x2 − xy − y2 = 02 − 0 · y − y2 = −y2 , so that x2 − xy − y2 = −y2 =
y2 = y2 (since y2 ≥ 0). Therefore, y2 = x2 − xy − y2 = 1, so that y = 1 (since
y is nonnegative). Combining x = 0 with y = 1, we find ( x, y) = (0, 1); but this
contradicts ( x, y) 6= (0, 1). This contradiction shows that our assumption was false.
Hence, we conclude that x − y ≥ 0. This solves Exercise 5.4.10 (a).
(b) Let ( x, y) be a golden pair such that ( x, y) 6= (0, 1). We must prove that
( x − y) is a golden pair.
y,
Indeed, ( x, y) is a golden pair. In other words, ( x, y) is a pair of nonnegative
integers such that x2 − xy − y2 = 1 (by the definition of a “golden pair”). More-
over, x − y ≥ 0 (by Exercise 5.4.10 (a)), so that x − y is a nonnegative integer. Thus,
(y, x − y) is a pair of nonnegative integers. A straightforward computation shows
that  
y2 − y ( x − y) − ( x − y)2 = − x2 − xy − y2 ,
so that
 
y2 − y ( x − y) − ( x − y)2 = − x2 − xy − y2 = x2 − xy − y2
(since |−z| = |z| for each z ∈ R)
= 1.

Hence, (y, x − y) is a pair of nonnegative integers satisfying y2 − y ( x − y) − ( x − y)2 =


1. In other words, (y, x − y) is a golden pair (by the definition of a “golden pair”).
This solves Exercise 5.4.10 (b).
(c) Let ( x, y) be a golden pair such that ( x, y) 6= (1, 0). We must prove that y > 0.
Indeed, assume the contrary. Thus, y ≤ 0.

December 25, 2021


Math 235 notes page 701

However, ( x, y) is a golden pair. In other words, ( x, y) is a pair of nonnegative


integers such that x2 − xy − y2 = 1 (by the definition of a “golden pair”). Now,
y ≥ 0 (since y is nonnegative). Combining this with y ≤ 0, we find y = 0.
Hence, x2 − xy − y2 = x2 − x · 0 − 02 = x2 , so that x2 − xy − y2 = x2 = x2
(since x2 ≥ 0). Therefore, x2 = x2 − xy − y2 = 1, so that x = 1 (since x is
nonnegative). Combining x = 1 with y = 0, we find ( x, y) = (1, 0); but this
contradicts ( x, y) 6= (1, 0). This contradiction shows that our assumption was false.
Hence, we conclude that y > 0. This solves Exercise 5.4.10 (c).
(d) Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence (defined as in Definition 2.2.1).
We claim the following:

Claim 1: The golden pairs different from (0, 1) are the pairs ( f n+1 , f n )
for n ∈ N (that is, the pairs ( f 1 , f 0 ), ( f 2 , f 1 ), ( f 3 , f 2 ), . . .).

We shall prove Claim 1 after some preparatory work. First, we prove the easy
direction:

Observation 2: Let n ∈ N. Then, the pair ( f n+1 , f n ) is a golden pair


different from (0, 1).

[Proof of Observation 2: Clearly, n + 1 is a positive integer (since n ∈ N). Hence, we


can apply the Cassini identity (i.e., Exercise 2.2.2) to n + 1 instead of n. We thus find
f (n+1)+1 f (n+1)−1 − f n2+1 = (−1)n+1 . In view of (n + 1) + 1 = n + 2 and (n + 1) −
1 = n, this rewrites as f n+2 f n − f n2+1 = (−1)n+1 . But the recursive definition of the
Fibonacci sequence yields f m = f m−1 + f m−2 for each integer m ≥ 2. Applying this
to m = n + 2, we obtain f n+2 = f (n+2)−1 + f (n+2)−2 = f n+1 + f n . Hence,
| {z } | {z }
= f n +1 = fn
 
f n +2 f n − f n2+1 = ( f n+1 + f n ) f n − f n2+1 = − f n2+1 − f n+1 f n − f n2 .
|{z}
= f n +1 + f n

Therefore,
 
f n +2 f n − f n2+1 = − f n2+1 − f n +1 f n − f n2 = f n2+1 − f n+1 f n − f n2

(since |−z| = |z| for each z ∈ R). Comparing this with

 
f n+2 f n − f n2+1 = (−1)n+1 = 1 since (−1)n+1 is either 1 or − 1 ,
| {z }
=(−1)n+1

we obtain f n2+1 − f n+1 f n − f n2 = 1.


It is easy to see that the Fibonacci numbers f 1 , f 2 , f 3 , . . . are positive integers. In
other words, f m is a positive integer whenever m is a positive integer. Applying this

December 25, 2021


Math 235 notes page 702

to m = n + 1, we conclude that f n+1 is a positive integer (since n + 1 is a positive


integer). Hence, f n+1 6= 0. Thus, ( f n+1 , f n ) 6= (0, 1). Also, f n and f n+1 are nonneg-
ative integers (since all Fibonacci numbers f 0 , f 1 , f 2 , . . . are nonnegative integers).
Thus, ( f n+1 , f n ) is a pair of nonnegative integers such that f n2+1 − f n+1 f n − f n2 = 1.
In other words, ( f n+1 , f n ) is a golden pair (by the definition of a “golden pair”).
Since we know that ( f n+1 , f n ) 6= (0, 1), we thus conclude that ( f n+1 , f n ) is a golden
pair different from (0, 1). This proves Observation 2.]
Now, let us say that a pair ( x, y) of two nonnegative integers is fibonacci (this
word should be understood as an adjective) if it has the form ( f n+1 , f n ) for some
n ∈ N. Thus, Observation 2 can be restated as follows:

Observation 3: Every fibonacci pair is a golden pair different from (0, 1).

We shall now prove the converse statement:

Observation 4: If ( x, y) is a golden pair different from (0, 1), then ( x, y)


is fibonacci.

[Proof of Observation 4: If ( x, y) is a golden pair, then x + y ∈ N (since x and y are


nonnegative integers). Thus, we can prove Observation 4 by strong induction on
x + y:
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that Observa-
tion 4 holds for x + y < m. We must prove that Observation 4 holds for x + y = m.
We have assumed that Observation 4 holds for x + y < m. In other words, if
( x, y) is a golden pair different from (0, 1) and satisfying x + y < m, then

( x, y) is fibonacci. (702)

Now, let ( x, y) be a golden pair different from (0, 1) and satisfying x + y = m.


We shall prove that ( x, y) is fibonacci.
Indeed, if ( x, y) = (1, 0), this is clear (because the pair (1, 0) is fibonacci398 ). Thus,
for the rest of this proof, we WLOG assume that ( x, y) 6= (1, 0). Hence, Exercise
5.4.10 (c) yields y > 0. Thus, x + y > x, so that x < x + y = m. Furthermore,
we have ( x, y) 6= (0, 1) (since ( x, y) is different from (0, 1)). Hence, Exercise 5.4.10
(b) yields that (y, x − y) is a golden pair. We have (y, x − y) 6= (0, 1) 399 and

y + ( x − y) = x < m.
Now, we know that (y, x − y) is a golden pair different from (0, 1) (since (y, x − y) 6=
(0, 1)) and satisfying y + ( x − y) < m. Hence, we can apply (702) to (y, x − y) in-
stead of ( x, y). As a consequence, we conclude that the pair (y, x − y) is fibonacci.

398 since
(1, 0) = ( f n+1 , f n ) for n = 0
399 Proof.
Assume the contrary. Thus, (y, x − y) = (0, 1). In other words, y = 0 and x − y = 1.
Hence, x = y + x − y = 0 + 1 = 1. Combined with y = 0, this yields ( x, y) = (1, 0); but this
|{z} | {z }
=0 =1
contradicts ( x, y) 6= (1, 0). This contradiction shows that our assumption was false. Qed.

December 25, 2021


Math 235 notes page 703

In other words, (y, x − y) has the form ( f n+1 , f n ) for some n ∈ N (by the defi-
nition of “fibonacci”). Consider this n, and denote it by u. Thus, u ∈ N and
(y, x − y) = ( f u+1 , f u ).
From (y, x − y) = ( f u+1 , f u ), we obtain y = f u+1 and x − y = f u . Now, x =
y + x − y = f u +1 + f u .
|{z} | {z }
= f u +1 = fu
But the recursive definition of the Fibonacci sequence yields f p = f p−1 + f p−2 for
each integer p ≥ 2. Applying this to p = u + 2, we obtain f u+2 = f (u+2)−1 + f (u+2)−2 =
| {z } | {z }
= f u +1 = fu
f u+1 + f u . Hence, x = f u+1 + f u = f u+2 = f (u+1)+1 . Combining this with y = f u+1 ,
 
we obtain ( x, y) = f (u+1)+1 , f u+1 . Hence, the pair ( x, y) has the form ( f n+1 , f n )
for some n ∈ N (namely, for n = u + 1). In other words, the pair ( x, y) is fibonacci
(by the definition of “fibonacci”).
Forget that we fixed ( x, y). We thus have shown that if ( x, y) is a golden pair
different from (0, 1) and satisfying x + y = m, then ( x, y) is fibonacci. In other
words, Observation 4 holds for x + y = m. This completes the induction step.
Thus, Observation 4 is proved.]
Observation 4 can be restated as follows:

Observation 5: Every golden pair different from (0, 1) is a fibonacci pair.

Combining this with Observation 3, we conclude that the golden pairs differ-
ent from (0, 1) are precisely the fibonacci pairs. In other words, the golden pairs
different from (0, 1) are precisely the pairs of the form ( f n+1 , f n ) for some n ∈ N
(because this is how the fibonacci pairs are defined). This proves Claim 1. Thus,
Exercise 5.4.10 (d) is solved.
[Remark: Exercise 5.4.10 (d) is a result of Lucas (1876). A proof similar to ours is
given in [Jones75, Lemmas 1, 2, 3].
Note that our proof is an example of an argument by infinite descent, even
though we have formulated it as a strong induction argument. To see this, it
suffices to rewrite Observation 4 above as “there exists no non-fibonacci golden
pair different from (0, 1)”, and reframe our proof of Observation 4 as transforming
an (ostensible) non-fibonacci golden pair ( x, y) different from (0, 1) into a smaller
non-fibonacci golden pair (y, x − y) which is also different from (0, 1). (“Smaller”
here means “smaller sum of entries”.) We chose to instead organize our proof as a
strong induction argument, in order to avoid the detour through the contrapositive;
but it is probably easiest to find this proof by attempting an infinite descent.
We have thus solved the equation x2 − xy − y2 = 1 in nonnegative integers x
and y. This is an example of a quadratic Diophantine equation, closely connected to
the Pell equation x2 − 5y2 = 1 (see [AndAnd14] for the connection). Similar argu-
ments can be used for solving other equations like this; it is not a coincidence that
the solutions in our case were given by the Fibonacci numbers. Usually, solutions
(when they exist) are given by (u, v)-recurrent sequences for some values of u and

December 25, 2021


Math 235 notes page 704

v. For example, the solutions ( x, y) of the equation x2 − 2y2 = 1 in nonnega-


tive integers x and y are precisely the pairs of the form ( an , bn ) for n ∈ N, where
( a0 , a1 , a2 , . . .) and (b0 , b1 , b2 , . . .) are the two (2, 1)-recurrent sequences with start-
ing values a0 = 1, a1 = 1, b0 = 0 and b1 = 1. (These two sequences are A001333
and A000129 in the OEIS.) See [Emerso69] for the proof.
Finally, note that the golden pair (0, 1) is not really an exception from the fi-
bonacci formula ( f n+1 , f n ), even though we have treated it as such in our above
solution. Indeed, if we define f −1 as in Exercise 4.4.4, then (0, 1) = ( f n+1 , f n ) for
n = −1, and thus the pair (0, 1) becomes fibonacci if we extend the definition of
fibonacci pairs to allow for n = −1.]

A.7. Homework set #6 discussion


The following are discussions of the problems on homework set #6 (Section 6.3).

A.7.1. Discussion of Exercise 6.3.1


Discussion of Exercise 6.3.1. Exercise 6.3.1 is [Engel98, Exercise 3.13] (and also eas-
ily seen to be equivalent to [Engel98, Chapter 3, Example E11]). Its solution is a
copybook example of a use of the Extremal Principle:
Solution to Exercise 6.3.1. First, we WLOG assume that no player plays a match
against himself. (Indeed, this is arguably clear from common sense or perhaps
implicit in the statement of the problem. But even if we don’t consider this to
be clear, we can make this true by forgetting about all self-matches400 . That is,
throughout the argument below, we pretend that self-matches do not happen (and,
in particular, we ignore their results). It is clear that if the problem has been solved
without taking the self-matches into account, then it has also been solved with the
self-matches, because a player who has (directly or indirectly) owned all other play-
ers will not lose this property if we add some self-matches. Thus, we can WLOG
assume that self-matches don’t exist – i.e., that no player plays a match against
himself.)
Define the score of a player d to be the number of all players that d has directly
owned. Consider a player a with maximum score. (Such a player clearly exists,
since the set {scores of players} is a finite nonempty set of integers and thus has
a maximum.) We shall show that a has (directly or indirectly) owned all other
players.
Indeed, let b be a player different from a. We shall show that a has (directly or
indirectly) owned b.
Indeed, assume the contrary. Thus, a has neither directly owned b nor indirectly
owned b.
Hence, in particular, a has not directly owned b. In other words, a has not won
a match against b (since “directly owning” b means winning a match against b).
400 i.e., matches that a player plays against himself

December 25, 2021


Math 235 notes page 705

However, the players a and b are distinct (since b is different from a), and thus
there must be a match between a and b (since each pair of distinct players play
exactly one match against one another). This match cannot have been won by a
(since a has not won a match against b), and thus must have been won by b (since
no match ends with a draw). Hence, b has won a match against a. In other words,
b has directly owned a (since “directly owning” a means winning a match against
a).
Let Y be the set of all players that b has directly owned. Thus,

|Y | = (the number of all players that b has directly owned)


= (the score of b) (703)

(since the score of b is defined as the number of all players that b has directly
owned). Moreover, we recall that b has directly owned a; in other words, a ∈ Y
(since Y is the set of all players that b has directly owned). Hence, |Y \ { a}| =
|Y | − 1.
Let X be the set of all players that a has directly owned. Thus,

| X | = (the number of all players that a has directly owned)


= (the score of a)
(since the score of a is defined as the number of all players that a has directly
owned). Thus,

| X | = (the score of a) ≥ (the score of b) (since a has maximum score)


= |Y | (by (703))
> |Y | − 1 = |Y \ { a}| (since |Y \ { a}| = |Y | − 1) .
Thus, we have proved the inequality | X | > |Y \ { a}|. Next, we will show that
X ⊆ Y \ { a}, which will clearly contradict this inequality (and thus give us the
contradiction that we want).
Indeed, let x ∈ X. We shall show that x ∈ Y \ { a}.
We have x ∈ X. In other words, x is a player that a has directly owned (since
X is the set of all players that a has directly owned). In other words, x is a player
that a has won a match against (since “directly owning” a player means winning
a match against this player). Thus, a has won a match against x. Therefore, x 6= a
(since no player plays a match against himself).
Now, we shall show that x ∈ Y. Indeed, assume the contrary.401 Thus, x ∈ / Y. In
other words, b has not directly owned x (since Y is the set of all players that b has
directly owned). In other words, b has not won a match against x (since “directly
owning” x means winning a match against x).
Recall that a has not directly owned b. In other words, b ∈ / X (since X is the
set of all players that a has directly owned). If we had x = b, then we would thus
401 You are reading right: We are doing a proof by contradiction inside a proof by contradiction. This
is perhaps not particularly elegant, but perfectly valid.

December 25, 2021


Math 235 notes page 706

obtain x = b ∈ / X, which would contradict x ∈ X. Hence, we cannot have x = b.


Thus, we have x 6= b. Therefore, the players x and b are distinct, so that there must
be a match between x and b (since each pair of distinct players play exactly one
match against one another). This match cannot have been won by b (since b has not
won a match against x), and thus must have been won by x (since no match ends
with a draw). Hence, x has won a match against b. Recall also that a has won a
match against x. Hence, there exists a player c such that a has won a match against
c and c has won a match against b (namely, c = x). In other words, a has indirectly
owned b (by the definition of “indirectly owned”). This contradicts the fact that a
has neither directly owned b nor indirectly owned b. This contradiction shows that
our latest assumption was false. Thus, x ∈ Y is proved.
Combining x ∈ Y with x 6= a, we find x ∈ Y \ { a}.
Forget that we fixed x. We thus have shown that x ∈ Y \ { a} for each x ∈ X.
In other words, X ⊆ Y \ { a}. Hence, | X | ≤ |Y \ { a}|. But this contradicts | X | >
|Y \ { a}|. This contradiction shows that our assumption was false. Hence, we have
shown that a has (directly or indirectly) owned b.
Forget that we fixed b. We thus have shown that if b is any player different from
a, then a has (directly or indirectly) owned b. In other words, a has (directly or
indirectly) owned all other players. Thus, there exists a player who has (directly or
indirectly) owned all other players (namely, a). This solves Exercise 6.3.1.

A.7.2. Discussion of Exercise 6.3.2


Discussion of Exercise 6.3.2. Exercise 6.3.2 is a generalization of Exercise 5.3.2 (in that
its assumptions are weaker, but its conclusion is the same). We shall solve it by
modifying our solution to Exercise 5.3.2 as follows:
Solution to Exercise 6.3.2 (sketched). Some notations first.
A solution will mean an (2n + 1)-tuple ( a1 , a2 , . . . , a2n+1 ) of integers that has the
weaker splitting property.
A solution ( a1 , a2 , . . . , a2n+1 ) will be called flat if all 2n + 1 numbers a1 , a2 , . . . , a2n+1
are equal. Thus, our goal is to show that every solution is flat. In other words, our
goal is to show that there is no non-flat solution.
A solution ( a1 , a2 , . . . , a2n+1 ) will be called nonnegative if all 2n + 1 numbers
a1 , a2 , . . . , a2n+1 are nonnegative.
First, we observe the following:

Observation 1’: If there exists a non-flat solution, then there exists a non-
negative non-flat solution.

[Proof of Observation 1’: This can be proved in the same way as Observation 1 was
proved in our solution to Exercise 5.3.2.]
Thanks to Observation 1’, we don’t need to bother with negative integers if we
don’t want to. This will come useful later.

December 25, 2021


Math 235 notes page 707

Next, let us study the parity of the integers in a solution:


Observation 2’: If ( a1 , a2 , . . . , a2n+1 ) is a solution, then the 2n + 1 integers
a1 , a2 , . . . , a2n+1 all have the same parity (i.e., are either all even or all
odd).
[Proof of Observation 2’: This is similar to the proof of Observation 2 in our solu-
tion to Exercise 5.3.2, but somewhat more complicated because the weaker splitting
property is (as its name suggests) weaker than the original splitting property. Here
are the details:
Let ( a1 , a2 , . . . , a2n+1 ) be a solution. Let t = a1 + a2 + · · · + a2n+1 be the sum of
all its entries. We WLOG assume that 2n + 1 > 1 (since otherwise, the claim of
Observation 2’ is obvious). Hence, 2n > 0, so that n > 0 and thus n ≥ 1 (since
n ∈ N). Therefore, 1 ∈ {1, 2, . . . , 2n}.
Thus, the weaker splitting property shows that if the integer a1 is removed (from
our 2n + 1 numbers a1 , a2 , . . . , a2n+1 ), then the remaining 2n numbers can be split
into two equinumerous heaps with equal sum. In other words, the 2n numbers
a2 , a3 , . . . , a2n+1 can be split into two equinumerous heaps with equal sum. Let s
be the sum of either heap. Then, s is an integer (since a2 , a3 , . . . , a2n+1 are integers).
But the sum a2 + a3 + · · · + a2n+1 of all the 2n numbers a2 , a3 , . . . , a2n+1 must be
s + s (since these 2n numbers can be split into two heaps, each of which has sum
s). Thus,
a2 + a3 + · · · + a2n+1 = s + s = 2s ≡ 0 mod 2 (since s is an integer) .
Hence,
t = a1 + a2 + · · · + a2n+1 = a1 + ( a2 + a3 + · · · + a2n+1 ) ≡ a1 mod 2,
| {z }
≡0 mod 2

so that a1 ≡ t mod 2.
Thus, by removing a1 and applying the weaker splitting property, we have ob-
tained a1 ≡ t mod 2. But we can apply the same argument to any of the 2n integers
a1 , a2 , . . . , a2n in place of a1 . Thus, we find that
ai ≡ t mod 2 (704)
for each i ∈ {1, 2, . . . , 2n}. Using (40), we now have
2n 2n
∑ ai
|{z}
≡ ∑ t = 2nt ≡ 0 mod 2
i =1 i =1
≡t mod 2
(by (704))

(since 2 | 2nt). Now,


t = a1 + a2 + · · · + a2n+1 = ( a1 + a2 + · · · + a2n ) + a2n+1 ≡ a2n+1 mod 2.
| {z }
2n
= ∑ ai ≡0 mod 2
i =1

December 25, 2021


Math 235 notes page 708

Hence, a2n+1 ≡ t mod 2. Thus, the congruence (704) holds not only for each i ∈
{1, 2, . . . , 2n}, but also for i = 2n + 1. Hence, this congruence (704) holds for each
i ∈ {1, 2, . . . , 2n + 1}. As a consequence,

• if t is even, then all of a1 , a2 , . . . , a2n+1 are even;

• if t is odd, then all of a1 , a2 , . . . , a2n+1 are odd.

Thus, a1 , a2 , . . . , a2n+1 all have the same parity. This proves Observation 2’.]
Now, Observation 2’ helps us transform non-flat solutions into smaller non-flat
solutions with an appropriate meaning of “smaller”. To be more precise, we con-
sider nonnegative solutions. If ( a1 , a2 , . . . , a2n+1 ) is a nonnegative solution, then the
weight of this solution is defined to be the nonnegative integer a1 + a2 + · · · + a2n+1 .
Now we claim:

Observation 3’: If ( a1 , a2 , . . . , a2n+1 ) is a nonnegative non-flat solution,


then there exists a nonnegative non-flat solution with smaller weight
than ( a1 , a2 , . . . , a2n+1 ).

[Proof of Observation 3’: This can be proved in the same way as Observation 3
was proved in our solution to Exercise 5.3.2. (Of course, we now need to use
Observation 2’ instead of Observation 2.)]
Now, all we need is to reap our rewards. By the Principle of Infinite Descent,
Observation 3’ entails that there exists no nonnegative non-flat solution. Hence, by
Observation 1’, we conclude that there exists no non-flat solution either. In other
words, any solution is flat. Exercise 6.3.2 is solved.

A.7.3. Discussion of Exercise 6.3.3


Discussion of Exercise 6.3.3. Exercise 6.3.3 is an easy consequence of Theorem 6.2.5:
Solution to Exercise 6.3.3. Theorem 6.2.5 (a) yields that there exist two integers i and
j with 0 ≤ i < j ≤ n and f i ( x ) = f j ( x ). Consider these i and j. Set a = j − i. We
have a = j − i > 0 (since i < j); thus, a is a positive integer.
Theorem 6.2.5 (b) yields that the sequence f i ( x ) , f i+1 ( x ) , f i+2 ( x ) , . . . is ( j − i )-


periodic. In other words, the sequence f i ( x ) , f i+1 ( x ) , f i+2 ( x ) , . . . is a-periodic




(since a = j − i). In other words, a is a period of the sequence f i ( x ) , f i+1 ( x ) , f i+2 ( x ) , . . .




(by the definition of “a-periodic”). Thus, if u and v are two nonnegative integers
satisfying u ≡ v mod a, then

f i +u ( x ) = f i +v ( x ) (705)

(by Theorem 4.7.8 (e), applied to f i ( x ) , f i+1 ( x ) , f i+2 ( x ) , . . . , f i+m ( x ), u and v




instead of u, um , p and q).

December 25, 2021


Math 235 notes page 709

Define an integer s by

s = 1 + ( p − q − i − 1) %a.

Proposition 3.3.2 (a) (applied to a and p − q − i − 1 instead of n and u) yields that


( p − q − i − 1) %a ∈ {0, 1, . . . , a − 1} and ( p − q − i − 1) %a ≡ p − q − i − 1 mod a.
Now,
s = 1 + ( p − q − i − 1) %a ∈ {1, 2, . . . , a}
(since ( p − q − i − 1) %a ∈ {0, 1, . . . , a − 1}), so that s ≥ 1 and s ≤ a. Hence,
i + |{z}
s ≤ i + ( j − i ) = j ≤ n. Also, |{z} i +s ≥ s ≥ 1. Combining i + s ≥ 1 with
≤ a = j −i ≥0
i + s ≤ n, we find i + s ∈ {1, 2, . . . , n} (since i + s is an integer). Moreover,

s = 1 + ( p − q − i − 1) %a ≡ 1 + ( p − q − i − 1) = p − q − i mod a.
| {z }
≡ p−q−i −1 mod a

Hence,

(i + 2s + q) − (s + p) = s
|{z} +i + q − p ≡ p − q − i + i + q − p ≡ 0 mod a.
≡ p−q−i mod a

In other words, a | (i + 2s + q) − (s + p). In other words,

i + 2s + q ≡ s + p mod a.

Thus, (705) (applied to u = i + 2s + q and v = s + p) yields f i+(i+2s+q) ( x ) =


f i+(s+ p) ( x ). In view of i + (i + 2s + q) = 2 (i + s) + q and i + (s + p) = (i + s) +
p, this rewrites as f 2(i+s)+q ( x ) = f (i+s)+ p ( x ). In other words, f (i+s)+ p ( x ) =
f 2(i+s)+q ( x ). Since we know that i + s ∈ {1, 2, . . . , n}, we thus conclude that there
exists some k ∈ {1, 2, . . . , n} such that f k+ p ( x ) = f 2k+q ( x ) (namely, k = i + s). This
solves Exercise 6.3.3.
The above solution may appear unmotivated in places (in particular, how did
we think of defining s as 1 + ( p − q − i − 1) %a ?); however, it can be found by
fairly straightforward reasoning. Indeed, once i, j and a have been defined, it is
clear that the best bet for a k ∈ {1, 2, . . . , n} satisfying f k+ p ( x ) = f 2k+q ( x ) is to
have k ≥ 1 and k ≥ i and k + p ≡ 2k + q mod a (since Theorem 6.2.5 (b) will then
yield f k+ p ( x ) = f 2k+q ( x )). The easiest way to satisfy k ≥ 1 and k ≥ i is by taking
k = i + s for some positive integer s. Rewriting the congruence k + p ≡ 2k + q mod a
in terms of this latter s, we obtain i + s + p ≡ 2 (i + s) + q mod a, which is equivalent
to s ≡ p − q − i mod a. This suggests setting s = ( p − q − i ) %a, but this would
sometimes result in s = 0, which we don’t want (as we want s to be positive).
Thus, we instead set s = 1 + ( p − q − i − 1) %a, in order for s to be positive. It
remains to verify that the resulting k = i + s does indeed belong to {1, 2, . . . , n}.
Thus, the above solution is found.
Let us notice that Theorem 6.2.10 is a particular case of Exercise 6.3.3:

December 25, 2021


Math 235 notes page 710

Proof of Theorem 6.2.10. Exercise 6.3.3 (applied to p = 0 and q = 0) yields that there
exists some k ∈ {1, 2, . . . , n} such that f k+0 ( x ) = f 2k+0 ( x ). In other words, there
exists some k ∈ {1, 2, . . . , n} such that f k ( x ) = f 2k ( x ) (since k + 0 = k and 2k + 0 =
2k). This proves Theorem 6.2.10.

A.7.4. Discussion of Exercise 6.3.4


Discussion of Exercise 6.3.4. The solution to Exercise 6.3.4 is similar to our proof of
Proposition 6.2.12 (c), except that we need to use | f n ( X )| ≥ 1 instead of f n+1 ( X ) ≥
0. Here are the details:
Solution to Exercise 6.3.4. Note that f 0 = idX , so that f 0 ( X ) = idX ( X ) = X. Hence,
f 0 ( X ) = | X | = n.
Also, the set f n ( X ) is nonempty402 . Hence, | f n ( X )| ≥ 1.
We shall first show that there exists some i ∈ {0, 1, . . . , n − 1} such that f i ( X ) =
i +
f 1 ( X ).
Indeed, assume the contrary. Thus, each i ∈ {0, 1, . . . , n − 1} satisfies

f i ( X ) 6 = f i +1 ( X ) . (706)

Now, let i ∈ {0, 1, . . . , n − 1}. Then, Proposition 6.2.12 (a) yields f 0 ( X ) ⊇


f 1 ( X ) ⊇ f 2 ( X ) ⊇ · · · . Thus, f i ( X ) ⊇ f i+1 ( X ). In other words, f i+1 ( X ) is
a subset of f i ( X ). Moreover, this subset is proper, because (706) shows that
f i ( X ) 6 = f i +1 ( X ).
It is a well-known fact that if U is a proper subset of a finite set V, then |U | < |V |.
Applying this to U = f i+1 ( X ) and V = f i ( X ), we obtain f i+1 ( X ) < f i ( X )
(since f i+1 ( X ) is a proper subset of the finite set f i ( X )). This entails f i+1 ( X ) ≤
f i ( X ) − 1 (since f i+1 ( X ) and f i ( X ) are integers). In other words, f i+1 ( X ) −
f i ( X ) ≤ −1.
Now, forget that we fixed i. We thus have proved the inequality f i+1 ( X ) −
f i ( X ) ≤ −1 for each i ∈ {0, 1, . . . , n − 1}. Summing these inequalities over all
i ∈ {0, 1, . . . , n − 1}, we obtain
n   n −1
∑ f i +1 ( X ) − f i ( X ) ≤ ∑ (−1) = n · (−1) = −n.
i =0 i =0

402 Proof. The set X is nonempty. Hence, there exists some x ∈ X. Consider this x. Thus, f n ( x ) ∈
f n ( X ) (since x ∈ X). Therefore, the set f n ( X ) has an element (namely, f n ( x )), and thus is
nonempty. Qed.

December 25, 2021


Math 235 notes page 711

But this contradicts

n −1  
∑ f i +1 ( X ) − f i ( X ) = f (n−1)+1 ( X ) − f 0 ( X )
i =0
| {z }
n
| {z }
=f =n
!
by Corollary 4.1.17,
applied to u = 0 and v = n − 1 and ai = f i ( X )
= | f n ( X )| −n ≥ 1 − n > −n.
| {z }
≥1

This contradiction shows that our assumption was false.


Hence, we have shown that there exists some i ∈ {0, 1, . . . , n − 1} such that
f ( X ) = f i+1 ( X ). Consider this i.
i

Now, i ≤ n − 1 (since i ∈ {0, 1, . . . , n − 1}), so that n − 1 ≥ i. Thus, Proposition


6.2.12 (b) (applied to k = n − 1) yields f i ( X ) = f n−1 ( X ). However, we also have
n ≥ n − 1 ≥ i. Thus, Proposition 6.2.12 (b) (applied to k = n) yields f i ( X ) =
f n ( X ). Hence, f n ( X ) = f i ( X ) = f n−1 ( X ). This solves Exercise 6.3.4.

A.7.5. Discussion of Exercise 6.3.5


Discussion of Exercise 6.3.5. Here is the simplest way to solve Exercise 6.3.5:
Solution to Exercise 6.3.5. (a) Let x ∈ X and k ∈ N be such that f k ( x ) = f 2k ( x ). We
must prove that
f ik ( x ) = f k ( x ) (707)
for every positive integer i.
[Proof of (707): We shall prove (707) by induction on i:
Induction base: We have f 1k ( x ) = f k ( x ) (since 1k = k). In other words, (707)
holds for i = 1.
Induction step: Let j be a positive integer. Assume (as the induction hypothesis)
that (707) holds for i = j. We must prove that (707) holds for i = j + 1. In other
words, we must prove that f ( j+1)k ( x ) = f k ( x ).
We have assumed that (707) holds for i = j. In other words, we have f jk ( x ) =
k
f ( x ). Now, ( j + 1) k = k + jk, so that

f ( j+1)k = f k+ jk = f k ◦ f jk

(since f p+q = f p ◦ f q for any p, q ∈ N). Therefore,


 
   
f ( j+1)k ( x ) = f k ◦ f jk ( x ) = f k  f jk ( x ) = f k f k ( x ) . (708)
 
| {z }
= f k (x)

December 25, 2021


Math 235 notes page 712

On the other hand, 2k = k + k, so that f 2k = f k+k = f k ◦ f k (since f p+q = f p ◦ f q


for any p, q ∈ N). Hence,
   
f 2k ( x ) = f k ◦ f k ( x ) = f k f k ( x ) .

Comparing this with (708), we obtain f ( j+1)k ( x ) = f 2k ( x ) = f k ( x ) (since f k ( x ) =


f 2k ( x )). This completes the induction step. Thus, (707) is proved.]
Exercise 6.3.5 (a) is thus solved.
(b) Let x ∈ X. We shall show that f n! ( x ) = f 2n! ( x ).
Indeed, Theorem 6.2.10 yields that there exists some k ∈ {1, 2, . . . , n} such that
k
f ( x ) = f 2k ( x ). Consider this k.
We have
n! = 1 · 2 · · · · · n = ∏ i = k· ∏ i (709)
i ∈{1,2,...,n} i ∈{1,2,...,n};
i 6=k

(here, we have split off the factor k from the product, because k ∈ {1, 2, . . . , n}).
Set s = ∏ i. Then, s is a positive integer (since s is defined as a product of
i ∈{1,2,...,n};
i 6=k
positive integers). Hence, 2s is a positive integer as well.
The equality (709) rewrites as n! = k · s (since s = ∏ i). Thus, n! = k · s =
i ∈{1,2,...,n};
i 6=k
sk, so that
f n! ( x ) = f sk ( x ) = f k ( x ) (710)
n! = 2sk, so that
(by Exercise 6.3.5 (a), applied to i = s). Also, 2 |{z}
=sk

f 2n! ( x ) = f 2sk ( x ) = f k ( x )

(by Exercise 6.3.5 (a), applied to i = 2s). Comparing this with (710), we obtain
f n! ( x ) = f 2n! ( x ).
Now, forget that we fixed x. We thus have proved that f n! ( x ) = f 2n! ( x ) for each
x ∈ X. In other words, f n! = f 2n! . This solves Exercise 6.3.5 (b).
(c) Assume that f is a permutation of X.
The map f is a permutation, thus bijective (by the definition of a permutation).
Hence, its power f n! = f ◦ f ◦ · · · ◦ f is bijective as well (since a composition of
| {z }
n! times
bijective maps is always bijective). Thus, in particular, this map f n! is injective.
Now, let x ∈ X. Exercise 6.3.5 (b) yields f n! = f 2n! . But 2n! = n! + n! and
thus f 2n! = f n!+n! = f n! ◦f n! . Hence, f n! = f 2n! = f n! ◦ f n! , so that f n! ( x ) =
f n! ◦ f n! ( x ) = f n! f n! ( x ) . Therefore, x = f n! ( x ) (since the map f n! is injective).
Consequently, f n! ( x ) = x = idX ( x ).
Forget that we fixed x. We thus have shown that f n! ( x ) = idX ( x ) for each x ∈ X.
In other words, f n! = idX . This solves Exercise 6.3.5 (c).

December 25, 2021


Math 235 notes page 713

[Remark: Our above solution to Exercise 6.3.5 (c) is not how this exercise is usually
solved. A more common approach to Exercise 6.3.5 (c) uses the notion of a group
(in the sense of group theory), and the following facts:

• The group of all permutations of a given n-element set X has size n!.

• If G is a finite group with identity element e, then g|G| = e for each g ∈ G.

The first of these two facts is a basic fact in enumerative combinatorics (see, e.g.,
our Theorem 7.4.1, or [Loehr11, Theorem 1.28] or [Grinbe15, Corollary 7.82]); the
second is a known result in elementary group theory (see, e.g., [Loehr11, Theorem
9.119] or [Elman20, Corollary 10.12] or [Goodma15, Corollary 2.5.9] or [Steinb06,
Corollary 3.2.10]). Combining these two facts, we conclude that f n! = idX for each
permutation f of X (since the permutations of X form a finite group with size n!
and identity element idX ). This solves Exercise 6.3.5 (c) again.]

A.7.6. Discussion of Exercise 6.3.6


Discussion of Exercise 6.3.6. This would become really straightforward if we had
used residue classes instead of remainders (i.e., the ring Z/m instead of the set
{0, 1, . . . , m − 1}).
Solution to Exercise 6.3.6. We shall use all the notations that we have introduced in
our above solution to Exercise 6.2.3. We must prove Claims 1, 2 and 3 from this
solution. Let us do this now:
[Proof of Claim 1: We have b ⊥ m (by assumption). In other words, gcd (b, m) = 1
(by the definition of “coprime”). But Theorem 3.4.5 (applied to b and m instead of
a and b) yields that there exist integers x ∈ Z and y ∈ Z such that

gcd (b, m) = xb + ym.

Consider these x and y. Comparing the equalities gcd (b, m) = xb + ym and


gcd (b, m) = 1, we obtain

1 = xb + y |{z}
m ≡ xb + y · 0 = xb = bx mod m.
≡0 mod m

In other words,
bx ≡ 1 mod m. (711)
Now, we define a map g : M × M → M × M by
−−−−−−→ 
g (( p, q)) = x (q − ap), p for each ( p, q) ∈ M × M.
−−−−−−→ 
This is well-defined, since each ( p, q) ∈ M × M satisfies x (q − ap), p ∈ M × M
−−−−−−→
(because x (q − ap) = ( x (q − ap)) %m ∈ {0, 1, . . . , m − 1} = M and p ∈ M).

December 25, 2021


Math 235 notes page 714

We shall now show that f ◦ g = id M× M .


Indeed, let α ∈ M × M be arbitrary. Thus, α = ( p, q) for some p ∈ M and
q ∈ M. Consider these p and q. From α = ( p, q), we obtain g (α) = g (( p, q)) =
−−−−−−→  −−−−−−→
x (q − ap), p (by the definition of g). Set w = x (q − ap). Thus,

−−−−−−→
w = x (q − ap) ≡ x (q − ap) mod m (712)

(by (270), applied to z = x (q − ap)). Also,


−−−−−−→ 
g (α) = x (q − ap), p = (w, p)

−−−−−−→
(since x (q − ap) = w). Now,
 
 −−−−→
( f ◦ g) (α) = f  g (α)  = f ((w, p)) = p, ap + bw (713)
 
| {z }
=(w,p)

−−−−→
(by the definition of f ). We will now show that ap + bw = q.
Indeed, (270) (applied to z = ap + bw) yields
−−−−→
ap + bw ≡ ap + b w
|{z} ≡ ap + |{z}
bx (q − ap)
≡ x (q− ap) mod m ≡1 mod m
(by (712)) (by (711))

≡ ap + (q − ap) = q mod m.
−−−−→
Moreover, ap + bw ∈ {0, 1, . . . , m − 1} (since every integer z satisfies − →
z = z%m ∈
−−−−→
{0, 1, . . . , m − 1}). Hence, Proposition 3.3.2 (c) (applied to m, q and ap + bw instead
−−−−→ −−−−→
of n, u and c) yields ap + bw = q%m (since ap + bw ≡ q mod m).
But from ( p, q) ∈ M × M, we obtain q ∈ M = {0, 1, . . . , m − 1}. Hence, Propo-
sition 3.3.2 (c) (applied to m, q and q instead of n, u and c) yields q = q%m (since
−−−−→ −−−−→
q ≡ q mod m). Comparing this with ap + bw = q%m, we obtain ap + bw = q. Thus,
(713) becomes
 
 −−−−→
( f ◦ g) (α) =  p, ap + bw = ( p, q) = α = id M× M (α) .
| {z }
=q

Forget that we fixed α. Thus we have shown that ( f ◦ g) (α) = id M× M (α) for
each α ∈ M × M. In other words, f ◦ g = id M× M .
We could now prove g ◦ f = id M× M by a similar argument, and then conclude
that the maps f and g are mutually inverse, whence f is bijective. However, let
us instead take a shortcut: The set M × M is finite (since M is finite) and clearly

December 25, 2021


Math 235 notes page 715

satisfies | M × M | = | M × M|. Hence, Corollary 6.2.1 (applied to U = M × M and


V = M × M) yields that the maps f and g are mutually inverse (since f ◦ g =
id M× M ). Thus, the map f is invertible, i.e., bijective. That is, f is a permutation of
the set M × M. This proves Claim 1.]
[Proof of Claim 2: Let i ∈ N. Applying (270) to z = xi+1 , we obtain − x−→
i +1 ≡
xi+1 mod m. Hence, xi+1 ≡ − x−→
i +1 mod m. The same argument (applied to xi instead


of xi+1 ) shows that xi ≡ xi mod m.
Recall that the sequence ( x0 , x1 , x2 , . . .) is ( a, b)-recurrent. In other words, every
n ≥ 2 satisfies xn = axn−1 + bxn−2 (by the definition of “( a, b)-recurrent”). Apply-
ing this to n = i + 2, we obtain xi+2 = a x(i+2)−1 +b x(i+2)−2 = axi+1 + bxi . Now,
| {z } | {z }
= x i +1 = xi
(270) (applied to z = xi+2 ) yields

x i +2 = a x i +1 +b xi ≡ a−
x−→ −

i +1 + b xi mod m.
|{z} |{z}
≡−
x− →
i +1 mod m ≡−

xi mod m

Now, Proposition 3.3.4 (applied to m, xi+2 and a− x−→ −



i +1 + b xi instead of n, u and
 v)
−−→ −
→ −−→ −

yields that xi+2 ≡ a xi+1 + b xi mod m if and only if xi+2 %m = a xi+1 + b xi %m.
Hence, we have xi+2 %m = a− x− → −
→ −−→ −

i +1 + b xi %m (since we have xi +2 ≡ a xi +1 + b xi mod m).
The definition of −
x−→
i +2 now yields

− −−−−−−−− →
x−→ −−→ −
→ −→ −

i +2 = xi +2 %m = a xi +1 + b xi %m = a xi +1 + b xi (714)
−−−−−−− → −−−−−−−− →
(since the definition of a−
x−→ −
→ −→ −
→ −−→ −
→
i +1 + b xi yields a xi +1 + b xi = a xi +1 + b xi %m).
Now, the definition of f yields
 

 −−→ −− −−−−−− →
 
f −
→ −− →
x i , x i +1 =  x , a x− → + b −

x = −
x−→, − x−→ .
 i + 1 i + 1 i i + 1 i +2
| {z }
 −−→
= x i +2

(by (714))

This proves Claim 2.]


[Proof of Claim 3: We shall prove Claim 3 by induction on i:
Induction base: We have f 0 = id M× M and thus f 0 (ω ) = idM× M (ω ) = ω =


x0 , x1 (by thedefinition of ω). Now, −

→  →
x0 , −
x−→ −→
x0 , −

x1 = f 0 (ω ) (since
0+1 =
f 0 (ω ) = − →
x0 , −

x1 ). In other words, Claim 3 holds for i = 0.
Induction step: Let j ∈ N. Assume (as the induction hypothesis) that Claim 3
holds for i = j. We  must showthat Claim 3 holds for i = j + 1. In other words, we
must show that − x−→, −
j +1x −−−→ = f j+1 (ω ).
( j+1)+1
We have assumed that Claim 3 holds for i = j. In other words, we have

December 25, 2021


Math 235 notes page 716



xj , −
x−→ j j+1 = f ◦ f j , so that
j+1 = f ( ω ). But f
 

= f −
→ −−→
 
f j +1 ( ω ) = f ◦ f j ( ω ) = f 
 j 
f (
 | {z }  ω ) x j , x j +1

=(− →
x j ,−
x− →
j +1 )

= −
x− → −−→ 
j +1 , x j +2 (by Claim 2, applied to i = j)
= −x−→, − x −−−→
 
j +1 ( j+1)+1 (since j + 2 = ( j + 1) + 1) .

−−→ −−−− →
 
In other words, x j+1 , x( j+1)+1 = f j+1 (ω ). This completes the induction step.
Thus, Claim 3 is proven.]
We have now proved Claims 1, 2 and 3; thus, Exercise 6.3.6 is solved.

A.7.7. Discussion of Exercise 6.3.7


Discussion of Exercise 6.3.7. The slickest way to solve Exercise 6.3.7 is probably by
using the following variant of Theorem 6.2.8 (a):
Theorem A.7.1. Let X be a finite set. Let n = | X |. Assume that n > 1. Let p ∈ X.
Let f : X → X be a permutation of X satisfying f ( p) = p. Let x ∈ X. Then,
there exists a k ∈ {1, 2, . . . , n − 1} such that f k ( x ) = x.

Proof of Theorem A.7.1. Informally, the idea is the following: If x = p, then this is
clear (just set k = 1). But if x 6= p, then we can “throw away” the element p from
the set X (indeed, f ( p) = p shows that p does not “interfere” with the remaining
elements of X), and obtain an (n − 1)-element set X \ { p}, to which we can apply
Theorem 6.2.8 (a).
Here are the details of this argument: It is easy to see that Theorem A.7.1 holds
if x = p 403 . Hence, for the rest of this proof, we WLOG assume that x 6= p.
The map f is a permutation of X; thus, f is a bijection. Hence, f is bijective, thus
injective.
Set Y = X \ { p}. Thus, |Y | = | X \ { p}| = | X | − 1 (since p ∈ X), so that |Y | =
| X | −1 = n − 1. In particular, the set Y is finite.
|{z}
=n
Combining x ∈ X with x 6= p, we obtain x ∈ X \ { p} = Y (since Y = X \ { p}).

403 Proof.
Assume that x = p. Note that n − 1 > 0 (since n > 1), so that n − 1 is a positive integer.
Hence, 1 ∈ {1, 2, . . . , n − 1}. Furthermore, f 1 ( p) = f ( p) = p. In other words, f 1 ( x ) = x
|{z}
=f
(since x = p). So the element 1 ∈ {1, 2, . . . , n − 1} satisfies f 1 ( x ) = x. Hence, there exists a
k ∈ {1, 2, . . . , n − 1} such that f k ( x ) = x (namely, k = 1). In other words, the claim of Theorem
A.7.1 holds. Thus, Theorem A.7.1 is proved under the assumption that x = p.

December 25, 2021


Math 235 notes page 717

For each y ∈ Y, we have f (y) ∈ Y 404 . Thus, we can define the map

g : Y → Y,
y 7→ f (y) .

This map g is “essentially just” the map f , except with the element p removed from
its domain and target.
It is easy to see (by a straightforward induction) that

gk ( x ) = f k ( x ) for each k ∈ N. (715)


405

The map g is injective406 . Thus, g : Y → Y is an injective map. Hence, Corollary


6.2.9 (a) (applied to Y and g instead of X and f ) yields that g is a permutation of Y.
Hence, Theorem 6.2.8 (a) (applied to Y, n − 1 and g instead of X, n and f ) yields
that there exists a k ∈ {1, 2, . . . , n − 1} such that gk ( x ) = x (since n − 1 = |Y | and
x ∈ Y). In view of (715), this rewrites as follows: There exists a k ∈ {1, 2, . . . , n − 1}
such that f k ( x ) = x. This proves Theorem A.7.1.
Now, we can solve Exercise 6.3.7:
Solution to Exercise 6.3.7. We shall use all notations introduced in our above solu-
tion to Exercise 6.2.3.
404 Proof. Let y ∈ Y. Then, y ∈ Y = X \ { p}; in other words, y ∈ X and y 6= p.
But the map f is injective. Therefore, if we had f (y) = f ( p), then we would have y = p, which
would contradict y 6= p. Hence, we cannot have f (y) = f ( p). Therefore, f (y) 6= f ( p) = p.
Combining f (y) ∈ X with f (y) 6= p, we obtain f (y) ∈ X \ { p} = Y. Qed.
405 Proof of (715): We shall prove (715) by induction on k:

Induction base: We have g0 = idY and thus g0 ( x ) = idY ( x ) = x. Also, f 0 = idX and thus
f ( x ) = idX ( x ) = x. Hence, g0 ( x ) = x = f 0 ( x ). In other words, (715) holds for k = 0.
0

Induction step: Let ` ∈ N. Assume (as the induction hypothesis) that (715) holds for k = `. We
must prove that (715) holds for k = ` + 1. In other words, we must prove that g`+1 ( x ) = f `+1 ( x ).
We have assumed that (715) holds for k = `. In other words, g` ( x ) = f ` ( x ). Now,
 
   
g`+1 ( x ) = g ◦ g` ( x ) = g 
 `
 = g f ` (x)

g ( x
| {z } )
|{z}
= g◦ g` = f ` (x)
 
= f f ` (x) (by the definition of g)
 
= f ◦ f ` ( x ) = f `+1 ( x ) .
| {z }
= f `+1

This completes the induction step. Thus, (715) is proved.


406 Proof. This is a straightforward consequence of the fact that f is injective. In more detail: Let
a, b ∈ Y satisfy g ( a) = g (b). The definition of g yields g ( a) = f ( a) and g (b) = f (b). Hence,
f ( a) = g ( a) = g (b) = f (b). Since f is injective, this entails a = b. Now, forget that we fixed
a, b. We thus have shown that if a, b ∈ Y satisfy g ( a) = g (b), then a = b. In other words, the
map g is injective.

December 25, 2021


Math 235 notes page 718


→ −

The definition of 0 yields 0 = 0%m = 0. Now, the definition of f yields
 −−−−−−→  − →
f ((0, 0)) = 0, a · 0 + b · 0 = 0, 0 (since a · 0 + b · 0 = 0)
 −
→ 
= (0, 0) since 0 = 0 .

We also know (from Claim 1 in our solution to Exercise 6.2.3) that the map f is
bijective. Hence, f is a permutation of the set M × M. Moreover, from m > 1,
we obtain m2 > 1. Hence, we can apply Theorem A.7.1 to X = M × M, n = m2 ,
p = (0, 0) and x = ω (since | M × M | = m2 ). This yields that there exists a k ∈
1, 2, . . . , m2 − 1 such that f k (ω ) = ω. Consider this k.


Now, it is easy to see that the sequence ( x0 %m, x1 %m, x2 %m, . . .) is k-periodic (in-
deed, this canbe shown exactly as in the solution to Exercise 6.2.3). Thus, we have
found a k ∈ 1, 2, . . . , m2 − 1 such that the sequence ( x0 %m, x1 %m, x2 %m, . . .) is
k-periodic. This solves Exercise 6.3.7.

A.7.8. Discussion of Exercise 6.3.8


Discussion of Exercise 6.3.8. Exercise 6.3.8 was problem 9 on the Baltic Way math-
ematical contest 2004; it has been discussed in [Grinbe08, Aufgabe 2.20] and in
https://artofproblemsolving.com/community/c6h20213 . We can regard it as a
more complicated variant of Exercise 1.1.9 (the solution uses the same idea, but
more work is needed to apply it). The following is probably the simplest solution:
Solution to Exercise 6.3.8. Define n + 1 integers b0 , b1 , . . . , bn as follows:

• For each i ∈ {0, 1, . . . , n − 1}, set

bi = a 1 + a 2 + · · · + a i . (716)

(Thus, b1 = a1 and b0 = (empty sum) = 0.)

• Set
bn = a 2 . (717)

Recall that the remainder of an integer u upon division by n is denoted by u%n.


Now, the n + 1 remainders

b0 %n, b1 %n, b2 %n, . . . , bn %n

are n + 1 elements of the n-element set {0, 1, . . . , n − 1} (since they are remainders
upon division by n), and thus at least two of them must be equal (by the Pigeonhole
Principle407 ). In other words, there exist two integers u and v with 0 ≤ u < v ≤ n
407 To
be more specific: by Corollary 6.1.4 (applied to n + 1, {0, 1, . . . , n − 1} and bi−1 %n instead of
m, V and ai ).

December 25, 2021


Math 235 notes page 719

and bu %n = bv %n. Consider these u and v. From u < v, we obtain u + 1 ≤ v. Also,


0 ≤ u, thus 1 ≤ u + 1 ≤ v ≤ n. Hence, both u + 1 and v belong to {1, 2, . . . , n}.
Moreover, from u + 1 ≤ v, we see that the set {u + 1, u + 2, . . . , v} is nonempty.
We have u < v ≤ n and thus u ∈ {0, 1, . . . , n − 1} (since u is a nonnegative inte-
ger). Therefore, (716) (applied to i = u) yields bu = a1 + a2 + · · · + au . Furthermore,
{1, 2, . . . , u} ⊆ {1, 2, . . . , n − 1} (since u ∈ {0, 1, . . . , n − 1}).
The integers bv and bu leave the same remainder when divided by n (since
bv %n = bu %n); thus, bv ≡ bu mod n (by Proposition 3.3.4, applied to bv and bu
instead of u and v). In other words, n | bv − bu .
Now, we are in one of the following two cases:
Case 1: We have v 6= n.
Case 2: We have v = n.
Let us consider Case 1 first. In this case, we have v 6= n. Hence, v < n (since
v ≤ n), so that v ≤ n − 1 (since v and n are integers). Thus, v ∈ {0, 1, . . . , n − 1}
(since 0 ≤ v). Therefore, (716) (applied to i = v) yields bv = a1 + a2 + · · · + av .
Also, the set {u + 1, u + 2, . . . , v} is nonempty (as we have seen) and is a subset of
{1, 2, . . . , n − 1} (since 1 ≤ u + 1 and v ≤ n − 1).
Now, recall that n | bv − bu . In view of

bv − bu = ( a1 + a2 + · · · + a v ) − ( a1 + a2 + · · · + a u )
|{z} |{z}
= a1 + a2 +···+ av = a1 + a2 +···+ au
= a u +1 + a u +2 + · · · + a v (since u < v)
= ∑ ai ,
i ∈{u+1,u+2,...,v}

this rewrites as n | ∑ ai . Since we know that {u + 1, u + 2, . . . , v} is


i ∈{u+1,u+2,...,v}
a nonempty subset of {1, 2, . . . , n − 1}, we can thus conclude that there exists a
nonempty subset I of {1, 2, . . . , n − 1} such that n | ∑ ai (namely, I = {u + 1, u + 2, . . . , v}).
i∈ I
Hence, Exercise 6.3.8 is solved in Case 1.
Let us now consider Case 2. In this case, we have v = n. Thus, bv = bn = a2 (by
(717)). Recall that

n | bv − bu = a 2 − bu | − ( a 2 − bu ) = bu − a 2 .
|{z}
= a2

Note that n ≥ 3, so that n − 1 ≥ 2 ≥ 1 and thus 1 ∈ {0, 1, . . . , n − 1}. Hence, (716)


(applied to i = 1) yields b1 = a1 . If we had u = 1, then we would have bu = b1 = a1
and therefore
n | bu − a 2 = a 1 − a 2 ,
|{z}
= a1

which would contradict the assumption n - a1 − a2 . Hence, we cannot have u = 1.


Thus, we have u 6= 1.
We are now in one of the following two subcases:

December 25, 2021


Math 235 notes page 720

Subcase 2.1: We have u = 0.


Subcase 2.2: We have u 6= 0.
Let us consider Subcase 2.1 first. In this subcase, we have u = 0. But 0 ∈
{0, 1, . . . , n − 1} (since n − 1 ≥ 1 ≥ 0); therefore, (716) (applied to i = 0) yields b0 =
a1 + a2 + · · · + a0 = (empty sum) = 0. Now, from u = 0, we obtain bu = b0 = 0.
But
n | bv − bu = a 2 = ∑ a i .
|{z} |{z}
= a2 =0 i ∈{2}

Note that 2 ∈ {1, 2, . . . , n − 1} (because n − 1 ≥ 2), and therefore {2} is a nonempty


subset of {1, 2, . . . , n − 1}. Thus, we conclude that there exists a nonempty subset I
of {1, 2, . . . , n − 1} such that n | ∑ ai (namely, I = {2}), because we have n | ∑ ai .
i∈ I i ∈{2}
Hence, Exercise 6.3.8 is solved in Subcase 2.1.
Let us finally consider Subcase 2.2. In this subcase, we have u 6= 0. But u
is a nonnegative integer (since 0 ≤ u) and satisfies u 6= 0 and u 6= 1. Hence,
u ≥ 2. Thus, 2 ∈ {1, 2, . . . , u}. Moreover, the set {1, 2, . . . , u} \ {2} contains (at
least) the element 1, and thus is nonempty. This nonempty set {1, 2, . . . , u} \ {2} is
furthermore a subset of {1, 2, . . . , n − 1} (since {1, 2, . . . , u} \ {2} ⊆ {1, 2, . . . , u} ⊆
{1, 2, . . . , n − 1}).
Recall that
bu = a 1 + a 2 + · · · + a u = ∑ a i = a2 + ∑ ai
i ∈{1,2,...,u} i ∈{1,2,...,u}\{2}

(here, we have split off the addend for i = 2 from the sum, since 2 ∈ {1, 2, . . . , u}).
Therefore,
bu − a 2 = ∑ ai . (718)
i ∈{1,2,...,u}\{2}
Now, recall that n | bu − a2 . In view of (718), this rewrites as n | ∑ ai .
i ∈{1,2,...,u}\{2}
Since we know that {1, 2, . . . , u} \ {2} is a nonempty subset of {1, 2, . . . , n − 1}, we
can thus conclude that there exists a nonempty subset I of {1, 2, . . . , n − 1} such
that n | ∑ ai (namely, I = {1, 2, . . . , u} \ {2}). Hence, Exercise 6.3.8 is solved in
i∈ I
Subcase 2.2.
We have now solved Exercise 6.3.8 in both Subcases 2.1 and 2.2. Hence, Exercise
6.3.8 holds in Case 2.
We have now solved Exercise 6.3.8 in both Cases 1 and 2. Thus, the solution to
Exercise 6.3.8 is complete.

A.7.9. Discussion of Exercise 6.3.9


Discussion of Exercise 6.3.9. Exercise 6.3.9 (c) is one of the simplest parts of the
equidistribution theorem (and Exercise 6.3.9 (a) and Exercise 6.3.9 (b) are weaker ver-
sions of it, which are useful as stepping stones in the solution of Exercise 6.3.9 (c)).

December 25, 2021


Math 235 notes page 721

A deeper part of the equidistribution theorem claims that if x ∈ R is irrational,


then the sequence (frac (0x ) , frac (1x ) , frac (2x ) , . . .) is uniformly distributed on
the half-open interval [0, 1) (that is, roughly speaking, its entries are equally likely
to end up near any point of this interval408 ). However, Exercise 6.3.9 (c) is already
useful enough for some applications. Exercise 6.3.9 (d) is a sample application of
Exercise 6.3.9 (c).
Our solution to Exercise 6.3.9 (a) will rely on the following two simple properties
of floors and fractional parts:
Lemma A.7.2. Let x ∈ R and r ∈ Z satisfy r ≤ x < r + 1. Then, b x c = r and
frac x = x − r.
Proof of Lemma A.7.2. We know that r is an integer (since r ∈ Z). This integer r is
≤ x (since r ≤ x), whereas the next integer r + 1 is no longer ≤ x (since x < r + 1).
Hence, r is the largest integer that is ≤ x. In other words, r is b x c (since b x c was
defined to be the largest integer that is ≤ x). In other words, b x c = r. Furthermore,
the definition of frac x yields frac x = x − b x c = x − r. Thus, Lemma A.7.2 is
|{z}
=r
proved.

Lemma A.7.3. Let a, b ∈ R. Then:


(a) If frac a ≥ frac b, then frac ( a − b) = frac a − frac b.
(b) If frac a < frac b, then frac ( a − b) = frac a − frac b + 1.

Proof of Lemma A.7.3. Let p = b ac and q = bbc. Thus, p and q are integers (since the
floor of any real number is an integer). In other words, p ∈ Z and q ∈ Z. Hence,
p − q ∈ Z and p − q − 1 ∈ Z.
The definition of frac a yields frac a = a − b ac = a − p. The definition of frac b
|{z}
=p
yields frac b = b − bbc = b − q.
|{z}
=q
The chain of inequalities (1) (applied to x = a) says that b ac ≤ a < b ac + 1. In
view of p = b ac, this rewrites as p ≤ a < p + 1. The same argument (applied to b
and q instead of a and p) yields q ≤ b < q + 1.
(a) Assume that frac a ≥ frac b. This rewrites as a − p ≥ b − q (since frac a = a − p
and frac b = b − q). In other words, a + q ≥ b + p. In other words, a − b ≥ p − q.
That is, p − q ≤ a − b. Moreover, |{z}
a − |{z} b < p + 1 − q = p − q + 1. Hence,
< p +1 ≥q
(since q≤b)
p − q ≤ a − b < p − q + 1. Therefore, Lemma A.7.2 (applied to x = a − b and
r = p − q) yields that b a − bc = p − q and frac ( a − b) = ( a − b) − ( p − q). Hence,
frac ( a − b) = ( a − b) − ( p − q) = ( a − p) − (b − q) = frac a − frac b.
| {z } | {z }
=frac a =frac b
(since frac a= a− p) (since frac b=b−q)
408 Don’t mistake this for a rigorous statement.

December 25, 2021


Math 235 notes page 722

This proves Lemma A.7.3 (a).


(b) Assume that frac a < frac b. This rewrites as a − p < b − q (since frac a = a − p
and frac b = b − q). In other words, a + q < b + p. In other words, a − b < p − q.
Hence, a − b < p − q = ( p − q − 1) + 1. Moreover, |{z} a − |{z}
b > p − ( q + 1) =
≥p < q +1
(since p≤ a)
p − q − 1. Hence, p − q − 1 ≤ a − b < ( p − q − 1) + 1. Therefore, Lemma A.7.2
(applied to x = a − b and r = p − q − 1) yields that b a − bc = p − q − 1 and
frac ( a − b) = ( a − b) − ( p − q − 1). Hence,

frac ( a − b) = ( a − b) − ( p − q − 1) = ( a − p) − (b − q) +1
| {z } | {z }
=frac a =frac b
(since frac a= a− p) (since frac b=b−q)
= frac a − frac b + 1.

This proves Lemma A.7.3 (b).


Solution to Exercise 6.3.9. (a) Let x ∈ R. Let n be a positive integer.
1 2 n−1
The numbers , , . . . , subdivide the half-open interval [0, 1) into n equally
n n n
sized segments. Denote these segments (themselves half-open intervals) by I1 , I2 , . . . , In .
More precisely: Define n half-open intervals I1 , I2 , . . . , In by

n−1 n
     
0 1 1 2
I1 = , , I2 = , , ..., In = ,
n n n n n n

k−1 k
 
(that is, Ik = , for each k ∈ {1, 2, . . . , n}). The union of these n intervals
n n
is I1 ∪ I2 ∪ · · · ∪ In = [0, 1); furthermore, these n intervals I1 , I2 , . . . , In are disjoint.
Hence, each number y ∈ [0, 1) lies in exactly one of these n intervals I1 , I2 , . . . , In .
Now, consider the n + 1 numbers frac (0x ) , frac (1x ) , . . . , frac (nx ). Each of these
n + 1 numbers belongs to [0, 1) (since frac z ∈ [0, 1) for each z ∈ R), and thus must
lie in one of the n intervals I1 , I2 , . . . , In (since we know that each number y ∈ [0, 1)
lies in exactly one of these n intervals I1 , I2 , . . . , In ). Hence, by the Pigeonhole Princi-
ple, we see that at least two of these n + 1 numbers frac (0x ) , frac (1x ) , . . . , frac (nx )
must belong to one and the same of the n intervals I1 , I2 , . . . , In 409 . In other words,
409 Hereis this argument in more detail:
Let i ∈ {0, 1, . . . , n}. Then,

frac (ix ) ∈ [0, 1) (since frac z ∈ [0, 1) for each z ∈ R)


= I1 ∪ I2 ∪ · · · ∪ In (since I1 ∪ I2 ∪ · · · ∪ In = [0, 1)) .

Hence, there exists some k ∈ {1, 2, . . . , n} such that frac (ix ) ∈ Ik . Fix such a k, and denote it by
bi . (Note that this k is unique, since the n intervals I1 , I2 , . . . , In are disjoint; but we will not need
this in our argument.)
Forget that we fixed i. We thus have defined an element bi ∈ {1, 2, . . . , n} for each
i ∈ {0, 1, . . . , n}. In other words, we have defined n + 1 elements b0 , b1 , . . . , bn ∈ {1, 2, . . . , n}.

December 25, 2021


Math 235 notes page 723

there exist two elements i and j of {0, 1, . . . , n} such that i < j and such that the
two numbers frac (ix ) and frac ( jx ) belong to one and the same of the n intervals
I1 , I2 , . . . , In . Consider these i and j.
The two numbers frac (ix ) and frac ( jx ) belong to one and the same of the n
intervals I1 , I2 , . . . , In . In other words, there exists some k ∈ {1, 2, . . . , n} such that
frac (ix ) and frac ( jx ) belong to Ik . Consider this k.
k−1 k
 
We know that frac (ix ) belongs to Ik . Hence, frac (ix ) ∈ Ik = , (by the
n n
k−1 k
definition of Ik ). In other words, frac (ix ) ≥ and frac (ix ) < . The same
n n
k−1 k
argument (applied to j instead of i) shows that frac ( jx ) ≥ and frac ( jx ) < .
n n
Now, j − i is a positive integer (since i and j are integers satisfying i < j). We
now claim that
1 n−1
frac (( j − i ) x ) is either < or > . (719)
n n
[Proof of (719): We are in one of the following two cases:
Case 1: We have frac ( jx ) ≥ frac (ix ).
Case 2: We have frac ( jx ) < frac (ix ).
Let us first consider Case 1. In this case, we have frac ( jx ) ≥ frac (ix ). Hence,
Lemma A.7.3 (a) (applied to a = jx and b = ix) yields

k k−1 1
frac ( jx − ix ) = frac ( jx ) − frac (ix ) < − = .
| {z } | {z } n n n
k k−1
< ≥
n n
1
In view of jx − ix = ( j − i ) x, this rewrites as frac (( j − i ) x ) < . Hence, frac (( j − i ) x )
n
1 n−1
is either < or > . Thus, (719) is proved in Case 1.
n n
Let us now consider Case 2. In this case, we have frac ( jx ) < frac (ix ). Hence,

Hence, Corollary 6.1.4 (applied to {1, 2, . . . , n}, n + 1 and bi−1 instead of V, m and ai ) yields
that at least two of these n + 1 elements b0 , b1 , . . . , bn are equal. In other words, there exist two
numbers i, j ∈ {0, 1, . . . , n} such that i < j and bi = b j . Consider these i, j.
Our definition of bi shows that bi is a k ∈ {1, 2, . . . , n} satisfying frac (ix ) ∈ Ik . Hence,
frac (ix ) ∈ Ibi . The same argument (applied to j instead of i) yields frac ( jx ) ∈ Ibj . In view
of bi = b j , this rewrites as frac ( jx ) ∈ Ibi .
Now, both frac (ix ) and frac ( jx ) belong to Ibi . Hence, frac (ix ) and frac ( jx ) belong to one and
the same of the n intervals I1 , I2 , . . . , In (namely, to Ibi ). Since i < j, this shows that at least two
of these n + 1 numbers frac (0x ) , frac (1x ) , . . . , frac (nx ) must belong to one and the same of the
n intervals I1 , I2 , . . . , In .
Note that we have not used the fact that the intervals I1 , I2 , . . . , In are disjoint.

December 25, 2021


Math 235 notes page 724

Lemma A.7.3 (b) (applied to a = jx and b = ix) yields


k−1 k n−1
frac ( jx − ix ) = frac ( jx ) − frac (ix ) +1 > − +1 = .
| {z } | {z } n n n
k−1 k
≥ <
n n
n−1
In view of jx − ix = ( j − i ) x, this rewrites as frac (( j − i ) x ) > . Hence,
n
1 n−1
frac (( j − i ) x ) is either < or > . Thus, (719) is proved in Case 2.
n n
We have now proved (719) in both Cases 1 and 2. Hence, (719) always holds.]
Now, recall that j − i is a positive integer. Furthermore, (719) shows that frac (( j − i ) x )
1 n−1
is either < or > . Hence, there exists a positive integer m such that frac (mx )
n n
1 n−1
is either < or > (namely, m = j − i). This solves Exercise 6.3.9 (a).
n n
(b) Let x ∈ R. Let n be a positive integer. Exercise 6.3.9 (a) yields that there exists
1 n−1
a positive integer m such that frac (mx ) is either < or > . Consider this m,
n n
1
and denote it by p. Thus, p is a positive integer such that frac ( px ) is either < or
n
n−1
> .
n
1
We must prove that there exists a positive integer m such that frac (mx ) < . If
n
1
frac ( px ) < , then this is immediately clear (since we can just take m = p). Thus,
n
1
for the rest of this proof, we WLOG assume that we don’t have frac ( px ) < . In
n
1 n−1
other words, frac ( px ) is not < . Hence, frac ( px ) is > (since we know that
n n
1 n−1 n−1
frac ( px ) is either < or > ). In other words, frac ( px ) > .
n n n
But every z ∈ R satisfies frac z < 1. Hence, frac ( px ) < 1, so that 1 − frac ( px ) >
1
0. Thus, is a well-defined positive real. Hence, there exists an integer
1 − frac ( px )  
1 1
u such that u > (for example, we can take u = + 1).
1 − frac ( px ) 1 − frac ( px )
1
Consider this u. Clearly, u > > 0 (since 1 − frac ( px ) is positive), so
1 − frac ( px )
1 1
that u is positive. Also, from u > , we obtain < 1 − frac ( px ) (since
1 − frac ( px ) u
u and 1 − frac ( px ) are positive) and thus
1 n−1 1
< 1 − frac ( px ) < 1 − = .
u | {z } n n
n−1
>
n

December 25, 2021


Math 235 notes page 725

Now, let us apply Exercise 6.3.9 (a) to px and u instead of x and n. We thus
1
conclude that there exists a positive integer m such that frac (mpx ) is either < or
u
u−1
> . Consider this m, and denote it by r. Thus, r is a positive integer such that
u
1 u−1
frac (rpx ) is either < or > .
u u
The product rp is a positive integer (since r and p are positive integers). We must
1
prove that there exists a positive integer m such that frac (mx ) < . If frac (rpx ) <
n
1
, then this is immediately clear (since we can just take m = rp). Thus, for the
n
1
rest of this proof, we WLOG assume that we don’t have frac (rpx ) < . Hence, we
n
1 1 1 1 1
have frac (rpx ) ≥ > (since < ). Therefore, frac (rpx ) is not < . Hence,
n u u n u
u−1 1 u−1
frac (rpx ) is > (since we know that frac (rpx ) is either < or > ). In
u u u
u−1
other words, frac (rpx ) > .
u
Now,
u−1
 
1 1
frac (rpx ) > = 1 − > 1 − (1 − frac ( px )) since < 1 − frac ( px )
u u u
= frac ( px ) . (720)
 

r px  = frac ( px ), which would


If we had r = 1, then we would have frac |{z}
=1
contradict (720). Hence, we cannot have r = 1. Thus, r > 1 (since r is a positive
integer), so that r − 1 is a positive integer. Thus, (r − 1) p is a positive integer
(since p is a positive integer). Moreover, (720) entails frac (rpx ) ≥ frac ( px ). Hence,
Lemma A.7.3 (a) (applied to a = rpx and b = px) yields
n−1 1
frac (rpx − px ) = frac (rpx ) − frac ( px ) < 1 − = .
| {z } | {z } n n
<1
(since frac z<1
n−1
>
for each z∈R) n
1
In view of rpx − px = (r − 1) px, this rewrites as frac ((r − 1) px ) < .
n
1
Thus, (r − 1) p is a positive integer and satisfies frac ((r − 1) px ) < . Hence,
n
1
there exists a positive integer m such that frac (mx ) < (namely, m = (r − 1) p).
n
This solves Exercise 6.3.9 (b).
1
(c) Let x ∈ R. Let ε be a positive real. Thus, is a well-defined positive real.
ε
1
Hence, there exists some integer n such that n > (for example, we can take
ε

December 25, 2021


Math 235 notes page 726

 
1 1
n= + 1). Consider this n. Note that n > > 0 (since ε is positive); thus, n is
ε ε
1 1
positive. Furthermore, from n > , we obtain < ε (since n and ε are positive).
ε n
Exercise 6.3.9 (b) shows that there exists a positive integer m such that frac (mx ) <
1
. This positive integer m must then also satisfy frac (mx ) < ε (since it satisfies
n
1
frac (mx ) < < ε). Hence, there exists a positive integer m such that frac (mx ) < ε.
n
This solves Exercise 6.3.9 (c).
(d) Here is where we will need a bit of analysis. We will use the following two
well-known facts about the sine function:
Fact 1: If x is a nonnegative real, then sin x ≤ x.
Fact 2: If x ∈ R and j ∈ Z, then sin ( x + 2πj) = sin x.
Note that Fact 2 is a consequence of the fact that the function sin has period 2π.
We can easily use these two facts to derive the following:
  z 
Fact 3: If z ∈ R, then sin z = sin 2π frac .

j z k
[Proof of Fact 3: Let z ∈ R. Then, is an integer410 . Now, the definition
 z   z  2π
z j z k z  z  j z k
of frac yields frac = − . Hence, = frac + .
2π 2π 2π 2π 2π 2π 2π
Multiplying both sides of this equality by 2π, we find
  z  j z k  z  j z k
z = 2π frac + = 2π frac + 2π .
2π 2π 2π 2π
Hence,
  z  j z k   z 
sin z = sin 2π frac + 2π = sin 2π frac
2π 2π 2π
 z  j z k j z k
(by Fact 2, applied to x = 2π frac and j = ), since is an integer.
2π 2π 2π
This proves Fact 3.]
Let ε be a positive real. Let z be a real. We must show that there exists a positive
integer m such that 0 ≤ sin (mz) < ε.
Indeed, we WLOG assume that ε ≤ π (since otherwise, we can simply replace ε
by the positive real min {ε, π }, which is no larger than ε).
ε
The real is positive (since ε and 2π are positive). Hence, Exercise 6.3.9 (c)

z ε
(applied to and instead of x and ε) yields that there exists a positive integer
2π  2π 
z ε
m such that frac m · < . Consider this m. We have
2π 2π
 mz   z  ε
frac = frac m · < .
2π 2π 2π
410 since a floor of a real number is always an integer

December 25, 2021


Math 235 notes page 727

Multiplying both sides of this inequality by 2π, we obtain


 mz 
2π frac < ε ≤ π. (721)

 mz   mz 
But frac ≥ 0 (since frac y ≥ 0 for each y ∈ R) and thus 2π frac ≥ 0.
2π  mz  2π
Combining this with (721), we obtain 2π frac ∈ [0, π ), so that

  mz 
sin 2π frac ≥ 0. (722)

Now, Fact 3 (applied to mz instead of z) yields
  mz 
sin (mz) = sin 2π frac (723)

≥0 (by (722)) .
 mz   mz 
Also, recall that 2π frac ≥ 0; thus, Fact 1 (applied to x = 2π frac )
2π 2π
yields   mz   mz 
sin 2π frac ≤ 2π frac < ε.
2π 2π
Thus, (723) becomes
  mz 
sin (mz) = sin 2π frac < ε.

Combining this with sin (mz) ≥ 0, we obtain 0 ≤ sin (mz) < ε.
Thus, we have found a positive integer m such that 0 ≤ sin (mz) < ε. Hence,
such an m exists. This solves Exercise 6.3.9 (d).
See https://artofproblemsolving.com/community/c4h15415p109278 for slightly
different solution to Exercise 6.3.9 (d) (using the continuity of sin instead of Fact
1).

A.7.10. Discussion of Exercise 6.3.10


Discussion of Exercise 6.3.10. I have taken Exercise 6.3.10 from https://artofproblemsolving.
com/community/c6h15141 . Here is my solution:
Solution to Exercise 6.3.10 (sketched). We claim that the smallest positive real ε such
1
that the entire set R can be covered with 5 closed intervals of length ε each is .
10
In order to prove this, we need to prove the following two claims:

Claim 1: The entire set R can be covered with 5 closed intervals of length
1
each.
10

December 25, 2021


Math 235 notes page 728

Claim 2: Let ε be a positive real such that the entire set R can be covered
1
with 5 closed intervals of length ε each. Then, ε ≥ .
10
[Proof of Claim 1: Define five closed intervals A, B, C, D, E by
         
1 1 1 1 7 1 3 9
A = 0, , B= , , C= , , D= , , E= ,1 .
10 10 5 4 20 2 5 10

1
These five intervals A, B, C, D, E have length each, and together cover the entire
10
1
set R (indeed, the interval A contains all numbers with s ≥ 10; the interval B
s
1 1 1 1 1 1 1
contains the numbers , , , , ; the interval C contains the numbers , ; the
9 8 7 6 5 4 3
1
interval D contains the number ; the interval E contains the number 1). Thus, the
2
1
entire set R can be covered with 5 closed intervals of length each (namely, with
10
the 5 intervals A, B, C, D, E). This proves Claim 1.]
1 1
[Proof of Claim 2: Assume the contrary. Thus, ε < . In other words, − ε > 0.
10 10
1
Hence, is a well-defined positive real. Hence, there exists an integer N such
1
−ε
10  
 
1  1 
 
that N > (for example, N =   + 1). Consider this N. We have
1 1
−ε −ε
10 10
1 1 1 1 1
N> > 0 (since − ε > 0). Also, from N > , we obtain < −ε
1 10 1 N 10
−ε −ε
10 10
1 1 1 1 1
(since N and − ε are positive). Hence, ε < − , so that − > ε.
10 10 N 10 N
We have assumed that the entire set R can be covered with 5 closed intervals of
length ε each. In other words, there exist 5 closed intervals A, B, C, D, E of length
ε each such that these 5 intervals cover the entire set R. Consider these 5 intervals
A, B, C, D, E.
Now, consider the 6 numbers
1 1 1 1 1 1
, , , , , .
1 2 3 5 10 N
These 6 numbers all belong to R, and therefore each of them belongs to (at least) one
of the 5 intervals A, B, C, D, E (since these 5 intervals cover the entire set R). Hence,
by the Pigeonhole Principle, we conclude that at least two of these 6 numbers
belong to one and the same of the 5 intervals A, B, C, D, E. These two numbers
therefore belong to a common interval of length ε (since each of the 5 intervals

December 25, 2021


Math 235 notes page 729

A, B, C, D, E has length ε), and thus their difference (if we subtract the smaller one
from the larger) must be ≤ ε. But this contradicts the fact that no two of the 6
numbers
1 1 1 1 1 1
, , , , ,
1 2 3 5 10 N
have a difference that is ≤ ε (indeed, the differences between consecutive numbers
in this list are
1 1 1 1
− = > > ε,
1 2 2 10
1 1 1 1
− = > > ε,
2 3 6 10
1 1 2 1
− = > > ε,
3 5 15 10
1 1 1
− = > ε,
5 10 10
1 1
− > ε,
10 N
and therefore the differences between non-consecutive numbers in this list are even
larger, since the list is in decreasing order). This contradiction shows that our
assumption was false. Thus, Claim 2 is proved.]
With Claim 1 and Claim 2 both proved, we thus have solved Exercise 6.3.10.

A.8. Homework set #7 discussion


The following are discussions of the problems on homework set #7 (Section 7.7).

A.8.1. Discussion of Exercise 7.7.1


Discussion of Exercise 7.7.1. Exercise 7.7.1 is a minor generalization of [17f-hw6s, Ex-
ercise 2 (a)]. The solution (essentially copied from [17f-hw6s, Exercise 2 (a)]) is a
textbook application of the bijection principle:
Solution to Exercise 7.7.1 (sketched). We have g ( x ) ∈ Fix ( g ◦ f ) for each x ∈ Fix ( f ◦ g)
411 . The same argument (applied to V, U, g and f instead of U, V, f and g) shows

that f ( x ) ∈ Fix ( f ◦ g) for each x ∈ Fix ( g ◦ f ).


411 Proof. Let x ∈ Fix ( f ◦ g). We must show that g ( x ) ∈ Fix ( g ◦ f ).
We know that x ∈ Fix ( f ◦ g). In other words, x is a fixed point of f ◦ g (since Fix ( f ◦ g) is
defined as the set of all fixed points of f ◦ g). In other words, x ∈ V and ( f ◦ g) ( x ) = x. Thus,
f ( g ( x )) = ( f ◦ g) ( x ) = x. Hence,
 

( g ◦ f ) ( g ( x )) = g  f ( g ( x )) = g ( x ) .
| {z }
=x

December 25, 2021


Math 235 notes page 730

Let γ be the map


Fix ( f ◦ g) → Fix ( g ◦ f ) , x 7→ g ( x ) .
(This is well-defined, because g ( x ) ∈ Fix ( g ◦ f ) for each x ∈ Fix ( f ◦ g).)
Let ϕ be the map
Fix ( g ◦ f ) → Fix ( f ◦ g) , x 7→ f ( x ) .
(This is well-defined, because f ( x ) ∈ Fix ( f ◦ g) for each x ∈ Fix ( g ◦ f ).)
We have ϕ ◦ γ = id 412 . The same argument (applied to V, U, g, f , γ and ϕ
instead of U, V, f , g, ϕ and γ) shows that γ ◦ ϕ = id.
The maps ϕ and γ are mutually inverse (since ϕ ◦ γ = id and γ ◦ ϕ = id),
and thus are bijections. Hence, we have found a bijection Fix ( f ◦ g) → Fix ( g ◦ f )
(namely, γ). Hence, |Fix ( f ◦ g)| = |Fix ( g ◦ f )|. This solves Exercise 7.7.1.
A few remarks are in order:
• The assumption that U and V are finite in Exercise 7.7.1 is unnecessary (we
have never used it in the above solution).
• It is not true that every three maps f , g, h from a finite set S to S satisfy
|Fix ( f ◦ g ◦ h)| = |Fix ( g ◦ f ◦ h)|. See [17f-hw6s, Exercise 2 (b)] for a coun-
terexample.
• Exercise 7.7.1 is a combinatorial analogue of the following fact from linear al-
gebra: If A is an n × m-matrix and B is an m × n-matrix (so that both products
AB and BA are well-defined), then
Tr ( AB) = Tr ( BA) (724)
(where Tr M denotes the trace of a square matrix M, that is, the sum of all
diagonal entries of M). This is not just an analogy; it is in fact possible
to derive Exercise 7.7.1 by applying (724) to two appropriate matrices! See
[17f-hw6s, Remark 0.11] for this derivation. This yields another solution to
Exercise 7.7.1.

In other words, g ( x ) is a fixed point of g ◦ f . In other words, g ( x ) ∈ Fix ( g ◦ f ) (since Fix ( g ◦ f )


is defined as the set of all fixed points of g ◦ f ). This completes our proof.
412 Proof. Let x ∈ Fix ( f ◦ g ). Thus, γ ( x ) = g ( x ) (by the definition of γ). But γ ( x ) ∈ Fix ( g ◦ f ), so

that ϕ (γ ( x )) = f (γ ( x )) (by the definition of ϕ).


We have x ∈ Fix ( f ◦ g). In other words, x is a fixed point of f ◦ g (since Fix ( f ◦ g) is defined
as the set of all fixed points of f ◦ g). In other words, x ∈ V and ( f ◦ g) ( x ) = x. Now,
 

( ϕ ◦ γ) ( x ) = ϕ (γ ( x )) = f γ ( x ) = f ( g ( x )) = ( f ◦ g) ( x ) = x = id ( x ) .
 
| {z }
= g( x )

Now, forget that we fixed x. We thus have proven that ( ϕ ◦ γ) ( x ) = id ( x ) for each x ∈
Fix ( f ◦ g). In other words, ϕ ◦ γ = id.

December 25, 2021


Math 235 notes page 731

A.8.2. Discussion of Exercise 7.7.2


Discussion of Exercise 7.7.2. Exercise 7.7.2 is a somewhat more sophisticated variant
of Exercise 3.8.3, and can easily be reduced to the latter:
Solution to Exercise 7.7.2. We are in one of the following two cases:
Case 1: The integer n is even.
Case 2: The integer n is odd.
Let us first consider Case 1. In this case, the integer n is even. Thus, 2 | n, so that
n/2 ∈ Z.
If d is an even positive divisor of n, then d/2 is a positive divisor of n/2 413 .
Hence, the map

Φ : {even positive divisors of n} → {positive divisors of n/2} ,


d 7→ d/2

is well-defined. Consider this map Φ.


If u is a positive divisor of n/2, then 2u is an even positive divisor of n 414 .

Hence, the map

Ψ : {positive divisors of n/2} → {even positive divisors of n} ,


u 7→ 2u

is well-defined. Consider this map Ψ.


The maps Φ and Ψ are mutually inverse. (Indeed, the map Φ divides its argu-
ment by 2, whereas the map Ψ multiplies its argument by 2. Thus, clearly these
two maps undo each other.)
Now, the map Φ is invertible (since the maps Φ and Ψ are mutually inverse), and
thus is a bijection. Hence, we have found a bijection

Φ : {even positive divisors of n} → {positive divisors of n/2} .

The bijection principle thus yields

|{even positive divisors of n}| = |{positive divisors of n/2}| .

Let d be an even positive divisor of n. Then, 2 | d (since d is even), so that d/2 ∈ Z.


413 Proof.

Moreover, there exists an integer c such that n = dc (since d is a divisor of n). Consider this c.
n /2 = dc/2 = (d/2) c. Hence, d/2 | n/2 (since c is an integer). That is, d/2 is a
We have |{z}
=dc
divisor of n/2. Moreover, d/2 is positive (since d is positive). We have thus shown that d/2 is a
positive divisor of n/2. Qed.
414 Proof. Let u be a positive divisor of n/2. Then, u is an integer, so that 2u is an even integer.

Moreover, 2u is positive (since u is positive). Furthermore, there exists some integer c such
that n/2 = uc (since u is a divisor of n/2). Consider this c. From n/2 = uc, we obtain
n = 2uc = (2u) c. Hence, 2u is a divisor of n (since c is an integer). Thus, 2u is an even positive
divisor of n (since 2u is even and positive). Qed.

December 25, 2021


Math 235 notes page 732

In other words, the number of even positive divisors of n equals the number of
positive divisors of n/2.
However, n/2 is positive (since n is positive) and is an integer (since n/2 ∈ Z).
Thus, Exercise 3.8.3 (applied to n/2 instead of n) yields that the number of positive
divisors of n/2 is even if and only if n/2 is not a perfect square. Since the number
of even positive divisors of n equals the number of positive divisors of n/2, we can
rewrite this as follows: The number of even positive divisors of n is even if and
only if n/2 is not a perfect square. Thus, Exercise 7.7.2 is solved in Case 1.
Let us now consider Case 2. In this case, the integer n is odd. Thus, 2 - n, so that
n/2 ∈/ Z. In other words, n/2 is not an integer. Hence, n/2 is not a perfect square
(since each perfect square is an integer).
Moreover, the number n has no even positive divisors415 . Thus, the number of
even positive divisors of n is 0. Hence, the number of even positive divisors of n is
even (since 0 is even).
We thus conclude that the number of even positive divisors of n is even if and
only if n/2 is not a perfect square (because we know that the number of even
positive divisors of n is even, and we also know that n/2 is not a perfect square).
Thus, Exercise 7.7.2 is solved in Case 2.
We have now solved Exercise 7.7.2 in both Cases 1 and 2. This completes the
solution to Exercise 7.7.2.

A.8.3. Discussion of Exercise 7.7.3


Discussion of Exercise 7.7.3. Exercise 7.7.3 is essentially Problem 2 on the Interna-
tional Mathematical Olympiad 1981 (except that the latter problem asked for the
average instead of the sum of the min S; but one question is easily reduced to the
other). We give two solutions:
First solution to Exercise 7.7.3. We have r 6= 0 (since r is positive). If S is a subset of
[n] satisfying |S| = r, then the set S is nonempty (since |S| = r 6= 0) and therefore
its minimum min S exists. This minimum min S is an element of S and therefore an
element of [n] (since S is a subset of [n]). Hence, we can split the sum ∑ min S
S⊆[n];
|S|=r

415 Proof.
Let d be an even positive divisor of n. We shall derive a contradiction.
Indeed, 2 | d (since d is even) and d | n (since d is a divisor of n). Hence, 2 | d | n. But this
contradicts 2 - n.
Forget that we fixed d. We thus have found a contradiction for each even positive divisor d of
n. Hence, there exist no even positive divisors of n. In other words, the number n has no even
positive divisors.

December 25, 2021


Math 235 notes page 733

according to the value of min S as follows:

∑ min S = ∑ ∑ | {z S} =
min ∑ ∑ k
S⊆[n]; k∈[n] S⊆[n]; =k k∈[n] S⊆[n];
|S|=r |S|=r; |S|=r;
min S=k min S=k
| {z }
=(# of subsets S of [n] satisfying |S|=r and min S=k)·k
= ∑ (# of subsets S of [n] satisfying |S| = r and min S = k) · k.
k∈[n]

Now, let us fix k ∈ [n]. We shall now compute the # of subsets S of [n] satisfying
|S| = r and min S = k.
For the sake of brevity, let us introduce some terminology:
• A red set will mean a subset S of [n] satisfying |S| = r and min S = k.
• A blue set will mean an (r − 1)-element subset of {k + 1, k + 2, . . . , n}.
The blue sets are easy to count (see the next paragraph), whereas the red sets
are what we want to count. We shall soon find a bijection between {red sets} and
{blue sets}, and therefore we will know how many red sets there are.
First, let us count the blue sets. Note that k ∈ [n] entails 1 ≤ k ≤ n; hence, we
have n − k ∈ N, and the set {k + 1, k + 2, . . . , n} is an (n − k)-element set. Theorem
4.3.12 (applied to n − k, {k + 1, k + 2, . . . , n} and r − 1 instead of n, S and k) thus
yields
n−k
 
= (the number of (r − 1) -element subsets of {k + 1, k + 2, . . . , n})
r−1
= (# of (r − 1) -element subsets of {k + 1, k + 2, . . . , n}) .
However, from the definition of a “blue set”, we see that
(# of blue sets) = (# of (r − 1) -element subsets of {k + 1, k + 2, . . . , n}) .
Comparing these two equalities, we thus find
n−k
 
(# of blue sets) = . (725)
r−1
Now, let us construct a bijection between {red sets} and {blue sets}. We shall
present the proof in maximum possible detail, in order to show at least once what
one needs to check when claiming the existence of a bijection; in practice, the actual
checking can often be done easily in one’s head (certainly this is true in the case at
hand), and thus the definition of the bijection may well be sufficient.
If U is a red set, then U \ {k} is a blue set416 . Hence, we can define a map
Φ : {red sets} → {blue sets} ,
U 7→ U \ {k} .
416 Proof. Let U be a red set. We must show that U \ {k} is a blue set.

December 25, 2021


Math 235 notes page 734

Consider this map Φ.


If V is a blue set, then V ∪ {k } is a red set417 . Hence, we can define a map

Ψ : {blue sets} → {red sets} ,


V 7→ V ∪ {k} .

Consider this map Ψ.

We know that U is a red set. In other words, U is a subset S of [n] satisfying |S| = r and
min S = k (by the definition of a “red set”). In other words, U is a subset of [n] and satisfies
|U | = r and min U = k. Hence, k = min U ∈ U (since the minimum of a set always belongs to
this set) and therefore |U \ {k}| = |U | −1 = r − 1. In other words, U \ {k} is an (r − 1)-element
|{z}
=r
set.
Next, let u ∈ U \ {k}. Thus, u ∈ U and u 6= k. We have u ∈ U ⊆ [n] (since U is a subset of [n]);
that is, u is an integer satisfying 1 ≤ u ≤ n. But k is the minimum of the set U (since k = min U),
and therefore is ≤ to any element of U. In other words, k ≤ v for each v ∈ U. Applying this to
v = u, we obtain k ≤ u. Thus, u ≥ k, so that u > k (since u 6= k) and therefore u ≥ k + 1 (since u
and k are integers). Combining this with u ≤ n, we obtain u ∈ {k + 1, k + 2, . . . , n} (since u is an
integer).
Forget that we fixed u. We thus have shown that u ∈ {k + 1, k + 2, . . . , n} for each u ∈ U \ {k }.
In other words, U \ {k} is a subset of {k + 1, k + 2, . . . , n}. Hence, we have shown that U \ {k}
is an (r − 1)-element subset of {k + 1, k + 2, . . . , n}. In other words, U \ {k} is a blue set (by the
definition of a “blue set”). Qed.
417 Proof. Let V be a blue set. We must show that V ∪ { k } is a red set.

We know that V is a blue set. In other words, V is an (r − 1)-element subset of


{k + 1, k + 2, . . . , n} (by the definition of a “blue set”). In other words, V ⊆ {k + 1, k + 2, . . . , n}
and |V | = r − 1.
If we had k ∈ V, then we would have k ∈ V ⊆ {k + 1, k + 2, . . . , n} and thus k ≥ k + 1 > k,
which is absurd. Thus, we cannot have k ∈ V. Hence, k ∈ / V, so that |V ∪ {k}| = |V | + 1 = r
(since |V | = r − 1). Moreover, the two sets V and {k} are subsets of {k, k + 1, . . . , n} (since V ⊆
{k + 1, k + 2, . . . , n} ⊆ {k, k + 1, . . . , n} and {k} ⊆ {k, k + 1, . . . , n} (because k ≤ n)); therefore,
their union V ∪ {k} is a subset of {k, k + 1, . . . , n} as well. Hence, each element of V ∪ {k}
belongs to the set {k, k + 1, . . . , n} and therefore is ≥ k. Moreover, k is an element of V ∪ {k}
(since k ∈ {k } ⊆ V ∪ {k}). Thus, we have shown that k is an element of V ∪ {k} and has the
property that each element of V ∪ {k} is ≥ k. In other words, k is the smallest element of
V ∪ {k }. In other words, k = min (V ∪ {k }). Hence, min (V ∪ {k }) = k.
Furthermore, the two sets V and {k} are subsets of [n] (since V ⊆ {k + 1, k + 2, . . . , n} ⊆
{ k + 1, . . . , n} ⊆ {1, 2, . . . , n} = [n] and {k} ⊆ [n] (since k ∈ [n])); therefore, their union
k,
V ∪ {k} is a subset of [n] as well.
Now, we have shown that V ∪ {k} is a subset of [n] and satisfies |V ∪ {k}| = r and
min (V ∪ {k }) = k. In other words, V ∪ {k} is a subset S of [n] satisfying |S| = r and min S = k.
In other words, V ∪ {k } is a red set (by the definition of a “red set”). Qed.

December 25, 2021


Math 235 notes page 735

We have Φ ◦ Ψ = id 418 and Ψ ◦ Φ = id 419 . Thus, the two maps Φ and

Ψ are mutually inverse. Hence, the map Φ is invertible, i.e., is a bijection. Now,
the bijection principle yields |{red sets}| = |{blue sets}| (since Φ : {red sets} →
{blue sets} is a bijection). Hence,

n−k
 
(# of red sets) = |{red sets}| = |{blue sets}| = (# of blue sets) =
r−1

(by (725)). Comparing this with

(# of red sets) = (# of subsets S of [n] satisfying |S| = r and min S = k)


(by the definition of a “red set”) ,

we obtain

(# of subsets S of [n] satisfying |S| = r and min S = k)


n−k
 
= . (726)
r−1

Now, forget that we fixed k. We thus have proved (726) for each k ∈ [n]. Now,

418 Proof.
Let V ∈ {blue sets}. Thus, V is a blue set. In other words, V is an (r − 1)-element subset of
{k + 1, k + 2, . . . , n} (by the definition of a “blue set”). In other words, V ⊆ {k + 1, k + 2, . . . , n}
and |V | = r − 1.
If we had k ∈ V, then we would have k ∈ V ⊆ {k + 1, k + 2, . . . , n} and thus k ≥ k + 1 > k,
which is absurd. Thus, we cannot have k ∈ V. Hence, k ∈ / V, so that (V ∪ {k}) \ {k } = V. Now,
we have Ψ (V ) = V ∪ {k} (by the definition of Ψ), and furthermore

(Φ ◦ Ψ) (V ) = Φ (Ψ (V )) = (Ψ (V )) \ {k} (by the definition of Φ)


| {z }
=V ∪{k}
= (V ∪ {k}) \ {k} = V = id (V ) .

Forget that we fixed V. We thus have shown that (Φ ◦ Ψ) (V ) = id (V ) for each V ∈


{blue sets}. In other words, Φ ◦ Ψ = id.
419 Proof. Let U ∈ {red sets}. Thus, U is a red set. In other words, U is a subset S of [ n ] satisfying

|S| = r and min S = k (by the definition of a “red set”). In other words, U is a subset of [n] and
satisfies |U | = r and min U = k. Hence, k = min U ∈ U (since the minimum of a set always
belongs to this set). Therefore, (U \ {k }) ∪ {k } = U. Now, we have Φ (U ) = U \ {k} (by the
definition of Φ), and furthermore

(Ψ ◦ Φ) (U ) = Ψ (Φ (U )) = (Φ (U )) ∪ {k} (by the definition of Ψ)


| {z }
=U \{k}
= (U \ {k}) ∪ {k} = U = id (U ) .

Forget that we fixed U. We thus have shown that (Ψ ◦ Φ) (U ) = id (U ) for each U ∈


{ red sets}. In other words, Ψ ◦ Φ = id.

December 25, 2021


Math 235 notes page 736

recall that

∑ min S = ∑ (# of subsets S of [n] satisfying |S| = r and min S = k) ·k


S⊆[n]; k∈[n]
|  {z  }
|S|=r n−k
=
r−1
(by (726))
n−k
 
= ∑ r−1
· k. (727)
k∈[n]

Now, let us compute the sum on the right hand side of this equality.
We have r − 1 ∈ N (since r is a positive integer). Hence, Exercise 7.6.1 (applied
to x = 1 and y = r − 1) yields
n n 
n−k n−k
      
n+1 k
= ∑ = ∑k
1 + (r − 1) + 1 k =0
1 r−1 k =0
r−1
|{z}
=k
(by (120),
applied to k
instead of n)
n  n
n−0 n−k n−k
    
=0 +∑k = ∑ k
r−1 k = 1
r−1 k =1
r−1
| {z } |{z} | {z }
=0 = ∑ n−k
k ∈[n] = ·k
(since {1,2,...,n}=[n]) r−1
n−k
 
= ∑ r−1
· k.
k∈[n]

Comparing this with (727), we obtain


   
n+1 n+1
∑ min S = 1 + (r − 1) + 1 = r + 1
S⊆[n];
|S|=r

(since 1 + (r − 1) = r). This solves Exercise 7.7.3.


Second solution to Exercise 7.7.3 (sketched). We proceed by double counting. The things
we shall count are the (r + 1)-element subsets of the set {0, 1, . . . , n}. How many
such subsets are there? Here are two ways to answer this question:
First way: The set {0, 1, . . . , n} is an (n + 1)-element set; thus, an easy application
of Theorem 4.3.12 yields

(# of (r + 1) -element subsets of {0, 1, . . . , n})


 
n+1
= . (728)
r+1

December 25, 2021


Math 235 notes page 737

Second way: If U is an (r + 1)-element subset of {0, 1, . . . , n}, then we define the


tail of U to be the set U \ {min U }. That is, the tail of U is defined to be U with the
smallest element removed.420 It is easy to see that if U is an (r + 1)-element subset
of {0, 1, . . . , n}, then the tail of U is an r-element subset of [n] (indeed, removing
the smallest element from U clearly reduces the size of U by 1, and furthermore
all the remaining elements are positive421 and therefore belong to [n]). Hence, the
sum rule yields
(# of (r + 1) -element subsets of {0, 1, . . . , n})
= ∑ (# of (r + 1) -element subsets of {0, 1, . . . , n} with tail S) .
S⊆[n];
|S|=r

Now, let S be an r-element subset of [n]. What is the # of (r + 1)-element sub-


sets of {0, 1, . . . , n} with tail S ? Clearly, any such subset must contain all r ele-
ments of S as well as one extra element; this extra element must furthermore be
smaller than min S (in order for S to be the tail of the subset). Thus, any (r + 1)-
element subset of {0, 1, . . . , n} with tail S must have the form S ∪ {i } for some
i ∈ {0, 1, . . . , min S − 1}. Conversely, any set of the latter form is an (r + 1)-element
subset of {0, 1, . . . , n} with tail S (check this!). Thus, the (r + 1)-element subsets of
{0, 1, . . . , n} with tail S are the min S sets
S ∪ {0} , S ∪ {1} , S ∪ {2} , ..., S ∪ {min S − 1} .
Hence,
(# of (r + 1) -element subsets of {0, 1, . . . , n} with tail S)
= min S. (729)
Now, forget that we fixed S. We thus have proved (729) for each r-element subset
S of [n]. Now, recall that
(# of (r + 1) -element subsets of {0, 1, . . . , n})
= ∑ (# of (r + 1) -element subsets of {0, 1, . . . , n} with tail S)
S⊆[n];
| {z }
=min S
|S|=r (by (729))

= ∑ min S.
S⊆[n];
|S|=r

Comparing this with (728), we obtain


 
n+1
∑ min S =
r+1
.
S⊆[n];
|S|=r
420 Forexample, if U = {2, 4, 6, 7}, then the tail of U is {4, 6, 7}.
421 becauseif one of them was 0, then it would be the smallest element of U and thus would have
been removed

December 25, 2021


Math 235 notes page 738

This solves Exercise 7.7.3 again.

A.8.4. Discussion of Exercise 7.7.4


Discussion of Exercise 7.7.4. We shall call a tuple onefree if it does not contain 1 as an
entry. Thus, Exercise 7.7.4 asks for the # of onefree compositions of n. Here is the
answer:
Proposition A.8.1. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence (defined as in
Definition 2.2.1). Then,

(# of onefree compositions of n) = f n−1 (730)

for each positive integer n.


We shall outline three proofs of Proposition A.8.1:
First proof of Proposition A.8.1 (sketched). We proceed by strong induction on n:
Induction step: Let m be a positive integer. Assume (as the induction hypothesis)
that Proposition A.8.1 holds for n < m. We must prove that Proposition A.8.1 holds
for n = m. In other words, we must prove that (# of onefree compositions of m) =
f m −1 .
If m = 1 or m = 2, then this is easy to check422 . Thus, for the rest of this proof,
we WLOG assume that we have neither m = 1 nor m = 2. Hence, m ≥ 3 (since m
is a positive integer). Therefore, m − 1 and m − 2 are positive integers. Moreover,
from m ≥ 3, we obtain m − 1 ≥ 2.
Definition 2.2.1 yields that f n = f n−1 + f n−2 for all n ≥ 2. We can apply this to
n = m − 1 (since m − 1 ≥ 2), and thus obtain

f m−1 = f (m−1)−1 + f (m−1)−2 = f m−2 + f m−3 . (731)


| {z } | {z }
= f m −2 = f m −3

We know that m − 1 is a positive integer satisfying m − 1 < m. Hence, Proposition


A.8.1 holds for n = m − 1 (since our induction hypothesis says that Proposition

422 Proof. There are no onefree compositions of 1 (since the only composition of 1 is (1), which
is clearly not onefree). That is, we have (# of onefree compositions of 1) = 0. Compar-
ing this with f 1−1 = f 0 = 0, we obtain (# of onefree compositions of 1) = f 1−1 . Hence,
(# of onefree compositions of m) = f m−1 holds for m = 1.
The only onefree composition of 2 is (2) (since the only compositions of 2 are (1, 1) and
(2), but (1, 1) is not onefree). Thus, we have (# of onefree compositions of 2) = 1. Com-
paring this with f 2−1 = f 1 = 1, we obtain (# of onefree compositions of 2) = f 2−1 . Hence,
(# of onefree compositions of m) = f m−1 holds for m = 2.
We have thus proved that (# of onefree compositions of m) = f m−1 holds for m = 1 and for
m = 2.

December 25, 2021


Math 235 notes page 739

A.8.1 holds for n < m). In other words, we have


(# of onefree compositions of m − 1) = f (m−1)−1 . (732)
The same argument (applied to m − 2 instead of m − 1) yields
(# of onefree compositions of m − 2) = f (m−2)−1 . (733)
Now, if ( a1 , a2 , . . . , ak ) is a onefree composition of m, then we necessarily have
k ≥ 1 423 , and therefore its first entry a1 is well-defined. We say that a onefree
composition ( a1 , a2 , . . . , ak ) of m is
• green if a1 = 2;
• red if a1 6= 2.
Each onefree composition ( a1 , a2 , . . . , ak ) of m is either green or red (since it sat-
isfies either a1 = 2 or a1 6= 2), but cannot be both at the same time. Hence, the sum
rule yields
(# of onefree compositions of m)
= (# of green onefree compositions of m)
+ (# of red onefree compositions of m) . (734)
We shall now compute the two addends on the right hand side.
If ( a1 , a2 , . . . , ak ) is a green onefree composition of m, then ( a2 , a3 , . . . , ak ) is a
onefree composition of m − 2 424 . Hence, we can define a map
Φ : {green onefree compositions of m} → {onefree compositions of m − 2} ,
( a1 , a2 , . . . , a k ) 7 → ( a2 , a3 , . . . , a k ) .
423 Proof. Let ( a1 , a2 , . . . , ak ) be a onefree composition of m. Then, ( a1 , a2 , . . . , ak ) is a composition of
m, that is, a tuple of positive integers whose sum is m (by the definition of a “composition”). In
other words, a1 , a2 , . . . , ak are positive integers satisfying a1 + a2 + · · · + ak = m.
If we had k = 0, then we would have a1 + a2 + · · · + ak = a1 + a2 + · · · + a0 = (empty sum) =
0, which would contradict a1 + a2 + · · · + ak = m > 0. Hence, we cannot have k = 0. Thus,
k 6= 0, so that k ≥ 1 (since k ∈ N). Qed.
424 Proof. Let ( a , a , . . . , a ) be a green onefree composition of m. Then, a = 2 (since ( a , a , . . . , a )
1 2 k 1 1 2 k
is green). Moreover, ( a1 , a2 , . . . , ak ) is a composition of m, that is, a tuple of positive integers
whose sum is m (by the definition of a “composition”). In other words, a1 , a2 , . . . , ak are positive
integers satisfying a1 + a2 + · · · + ak = m. Hence,
m = a1 + a2 + · · · + a k = a1 + ( a2 + a3 + · · · + a k ) = 2 + ( a2 + a3 + · · · + a k ) ,
|{z}
=2

so that a2 + a3 + · · · + ak = m − 2.
The positive integers a1 , a2 , . . . , ak are distinct from 1 (since the composition ( a1 , a2 , . . . , ak ) is
onefree, i.e., does not contain 1 as an entry). Thus, in particular, the positive integers a2 , a3 , . . . , ak
are distinct from 1. Now, ( a2 , a3 , . . . , ak ) is a tuple of positive integers whose sum is m − 2 (since
a2 + a3 + · · · + ak = m − 2); in other words, ( a2 , a3 , . . . , ak ) is a composition of m − 2 (by the
definition of a “composition”). This composition ( a2 , a3 , . . . , ak ) doesn’t contain 1 as an entry
(since the positive integers a2 , a3 , . . . , ak are distinct from 1); in other words, it is onefree. Hence,
( a2 , a3 , . . . , ak ) is a onefree composition of m − 2, qed.

December 25, 2021


Math 235 notes page 740

It is easy to see that this map Φ is a bijection425 . Hence, the bijection principle
yields

|{green onefree compositions of m}| = |{onefree compositions of m − 2}| .

Thus,

(# of green onefree compositions of m)


= |{green onefree compositions of m}|
= |{onefree compositions of m − 2}|
= (# of onefree compositions of m − 2)
= f (m−2)−1 (by (733))
= f m −3 . (735)

Next, let us count the red onefree compositions of m.


If ( a1 , a2 , . . . , ak ) is a red onefree composition of m, then ( a1 − 1, a2 , a3 , . . . , ak ) is

425 Indeed,we can easily construct a map inverse to Φ: Namely, if (b1 , b2 , . . . , b` ) is a onefree com-
position of m − 2, then (2, b1 , b2 , . . . , b` ) is a green onefree composition of m (check this!). Thus,
the map

Ψ : {onefree compositions of m − 2} → {green onefree compositions of m} ,


(b1 , b2 , . . . , b` ) 7→ (2, b1 , b2 , . . . , b` )

is well-defined. It is straightforward to see that the maps Φ and Ψ are mutually inverse. Thus,
the map Φ is invertible, i.e., is a bijection.

December 25, 2021


Math 235 notes page 741

a onefree composition of m − 1 426 . Hence, we can define a map


Φ0 : {red onefree compositions of m} → {onefree compositions of m − 1} ,
( a1 , a2 , . . . , ak ) 7→ ( a1 − 1, a2 , a3 , . . . , ak ) .
It is easy to see that this map Φ0 is a bijection427 . Hence, the bijection principle
yields
|{red onefree compositions of m}| = |{onefree compositions of m − 1}| .
Thus,
(# of red onefree compositions of m)
= |{red onefree compositions of m}|
= |{onefree compositions of m − 1}|
= (# of onefree compositions of m − 1)
= f (m−1)−1 (by (732))
= f m −2 . (736)
426 Proof.Let ( a1 , a2 , . . . , ak ) be a red onefree composition of m. Then, a1 6= 2 (since ( a1 , a2 , . . . , ak ) is
red). Moreover, ( a1 , a2 , . . . , ak ) is a composition of m, that is, a tuple of positive integers whose
sum is m (by the definition of a “composition”). In other words, a1 , a2 , . . . , ak are positive integers
satisfying a1 + a2 + · · · + ak = m. Comparing a1 + a2 + · · · + ak = m with
a1 + a2 + · · · + a k = a1 + ( a2 + a3 + · · · + a k ) = 1 + ( a1 − 1) + ( a2 + a3 + · · · + a k ) ,
|{z}
=1+( a1 −1)

we obtain 1 + ( a1 − 1) + ( a2 + a3 + · · · + ak ) = m. Hence, ( a1 − 1) + ( a2 + a3 + · · · + ak ) = m − 1.
The positive integers a1 , a2 , . . . , ak are distinct from 1 (since the composition ( a1 , a2 , . . . , ak ) is
onefree, i.e., does not contain 1 as an entry). Thus, in particular, the positive integer a1 is distinct
from 1, and the positive integers a2 , a3 , . . . , ak are distinct from 1.
The positive integer a1 is distinct from 1, and thus must be ≥ 2. Hence, a1 − 1 ≥ 1. This shows
that a1 − 1 is a positive integer. Moreover, a1 − 1 6= 1 (since a1 6= 2); thus, the number a1 − 1 is
distinct from 1. Since we also know that the numbers a2 , a3 , . . . , ak are distinct from 1, we thus
conclude that the numbers a1 − 1, a2 , a3 , . . . , ak are distinct from 1.
We now know that a1 − 1 is a positive integer, and that a2 , a3 , . . . , ak are positive integers as
well. Hence, ( a1 − 1, a2 , a3 , . . . , ak ) is a tuple of positive integers. Moreover, ( a1 − 1, a2 , a3 , . . . , ak )
is a tuple of positive integers whose sum is m − 1 (since ( a1 − 1) + ( a2 + a3 + · · · + ak ) = m − 1);
in other words, ( a1 − 1, a2 , a3 , . . . , ak ) is a composition of m − 1 (by the definition of a “composi-
tion”). This composition ( a1 − 1, a2 , a3 , . . . , ak ) doesn’t contain 1 as an entry (since the numbers
a1 − 1, a2 , a3 , . . . , ak are distinct from 1); in other words, it is onefree. Hence, ( a1 − 1, a2 , a3 , . . . , ak )
is a onefree composition of m − 1, qed.
427 Indeed, we can easily construct a map inverse to Φ0 : Namely, if ( b , b , . . . , b ) is a onefree com-
1 2 `
position of m − 1, then the tuple (b1 + 1, b2 , b3 , . . . , b` ) is well-defined (this requires proving that
` ≥ 1; check this!) and is a red onefree composition of m (check this!). Thus, the map
Ψ0 : {onefree compositions of m − 1} → {red onefree compositions of m} ,
(b1 , b2 , . . . , b` ) 7→ (b1 + 1, b2 , b3 , . . . , b` )
is well-defined. It is straightforward to see that the maps Φ0 and Ψ0 are mutually inverse. Thus,
the map Φ0 is invertible, i.e., is a bijection.

December 25, 2021


Math 235 notes page 742

Now, (734) becomes

(# of onefree compositions of m)
= (# of green onefree compositions of m) + (# of red onefree compositions of m)
| {z } | {z }
= f m −3 = f m −2
(by (735)) (by (736))
= f m −3 + f m −2 = f m −2 + f m −3 = f m −1 (by (731)) .

In other words, Proposition A.8.1 holds for n = m. This completes the induction
step; thus, Proposition A.8.1 is proved.
Second proof of Proposition A.8.1 (sketched). We proceed by strong induction on n:
Induction step: Let m be a positive integer. Assume (as the induction hypothesis)
that Proposition A.8.1 holds for n < m. We must prove that Proposition A.8.1 holds
for n = m. In other words, we must prove that (# of onefree compositions of m) =
f m −1 .
If m = 1 or m = 2, then this is easy to check. Thus, for the rest of this proof, we
WLOG assume that we have neither m = 1 nor m = 2. Hence, m ≥ 3 (since m is a
positive integer), so that m − 3 ≥ 0.
If ( a1 , a2 , . . . , ak ) is a onefree composition of m, then we necessarily have k ≥ 1
428 , and therefore its first entry a is well-defined. This first entry a must be a
1 1
positive integer (since a1 , a2 , . . . , ak are positive integers) and satisfies a1 6= 1 (since
the composition ( a1 , a2 , . . . , ak ) is onefree). Hence, it satisfies a1 ≥ 2 (since any
positive integer that is 6= 1 must be ≥ 2). It furthermore satisfies a1 ≤ m 429 , and
thus a1 ∈ {2, 3, . . . , m} (since a1 ≥ 2 and a1 ≤ m). Hence, the sum rule yields

(# of onefree compositions of m)
= ∑ (# of onefree compositions ( a1 , a2 , . . . , ak ) of m such that a1 = r ) .
r ∈{2,3,...,m}

Now, let us fix some r ∈ {2, 3, . . . , m}. We shall compute

(# of onefree compositions ( a1 , a2 , . . . , ak ) of m such that a1 = r ) .

Indeed, it is not hard to see that the map

{onefree compositions ( a1 , a2 , . . . , ak ) of m such that a1 = r }


→ {onefree compositions of m − r }

428 This follows from the positivity of m. See the first proof of Proposition A.8.1 above for the details
of the argument.
429 Proof. The numbers a , a , . . . , a are positive integers; hence, none of them cannot exceed their
1 2 k
sum. In particular, this shows that a1 ≤ a1 + a2 + · · · + ak = m (since ( a1 , a2 , . . . , ak ) is a compo-
sition of m, that is, a tuple of positive integers whose sum is m).

December 25, 2021


Math 235 notes page 743

that sends each ( a1 , a2 , . . . , ak ) to ( a2 , a3 , . . . , ak ) is a bijection430 . Thus, the bijection


principle yields

|{onefree compositions ( a1 , a2 , . . . , ak ) of m such that a1 = r }|


= |{onefree compositions of m − r }| .

In other words,

(# of onefree compositions ( a1 , a2 , . . . , ak ) of m such that a1 = r )


= (# of onefree compositions of m − r ) . (737)

Forget that we fixed r. We thus have proved (737) for each r ∈ {2, 3, . . . , m}. Now,

(# of onefree compositions of m)
= ∑ (# of onefree compositions ( a1 , a2 , . . . , ak ) of m such that a1 = r )
r ∈{2,3,...,m}
| {z }
| {z } =(# of onefree compositions of m−r )
m (by (737))
=∑
r =2
m
= ∑ (# of onefree compositions of m − r)
r =2
m −1
= ∑ (# of onefree compositions of m − r )
|r=2 {z }
m −2
= ∑ (# of onefree compositions of n)
n =1
(here, we have substituted n for m−r in the sum)
+ (# of onefree compositions of m − m)
| {z }
=1
(since m−m=0, and thus the only onefree composition of m−m is the empty tuple ())
 
here, we have split off the addend for r = m from the sum
(this addend was indeed in the sum, because m ≥ 3 ≥ 2)
m −2
= ∑ (# of onefree compositions of n) +1
n =1
| {z }
= f n −1
(by our induction hypothesis, since n≤m−2<m)
m −2
= ∑ f n −1 + 1 = f m −1 − 1 + 1 = f m −1 .
n =1
| {z }
= f 0 + f 1 +···+ f m−3
= f m −1 −1
(by Exercise 2.2.1 (applied to n=m−3),
since m−3≥0)

430 Itsinverse map, of course, sends each onefree composition (b1 , b2 , . . . , b` ) of m − r to the onefree
composition (r, b1 , b2 , . . . , b` ) of m.

December 25, 2021


Math 235 notes page 744

This is precisely what we needed to show. Thus, the induction step is complete, so
that Proposition A.8.1 is proved.
Our third proof of Proposition A.8.1 will be bijective (i.e., it will rely on a bi-
jection). Crucial to this proof will be the following combinatorial interpretation of
Fibonacci numbers:
Proposition A.8.2. Let ( f 0 , f 1 , f 2 , . . .) be the Fibonacci sequence. Let n ∈ N and
a ∈ Z. Then,

(# of lacunar subsets of [ a + 1, a + n]) = f n+2 ,

where [ a + 1, a + n] denotes the n-element set { a + 1, a + 2, . . . , a + n}.

Hints to the proof of Proposition A.8.2. (See [19fco, proof of Proposition 1.4.18] for de-
tails.) Proposition A.8.2 can easily be derived from Theorem 2.3.4. Indeed, the set
[ a + 1, a + n] (where we are using the notations of Proposition A.8.2) is just the set
[n] shifted to the right by a units (if we visualize these sets on the real axis); in
more formal language, there is a bijection from [n] to [ a + 1, a + n] that sends each
i ∈ [n] to a + i. This bijection gives rise to a bijection from {lacunar subsets of [n]}
to {lacunar subsets of [ a + 1, a + n]} (namely, we apply the same shift to each ele-
ment of our lacunar subset). Thus, the bijection principle yields

(# of lacunar subsets of [ a + 1, a + n])


= (# of lacunar subsets of [n]) = f n+2 (by Theorem 2.3.4) .

This proves Proposition A.8.2.


Third proof of Proposition A.8.1 (sketched). Let n be a positive integer. We WLOG as-
sume that n ≥ 3 (since the other cases can easily be checked by hand). Thus,
n − 3 ∈ N.
Consider the map

C : {compositions of n} → {subsets of [n − 1]}

defined in the proof of Theorem 7.3.4. We recall (from said proof) that this map C
is a bijection; thus, it has an inverse map C −1 .
Now, the following two claims are crucial:431

Claim 1: Let a be a onefree composition of n. Then, C ( a) is a lacunar


subset of [2, n − 2].

Claim 2: Let U be a lacunar subset of [2, n − 2]. Then, C −1 (U ) is a


onefree composition of n.
431 In
the following, the notation [ p, q] for two integers p and q shall denote the set { p, p + 1, . . . , q} ⊆
Z.

December 25, 2021


Math 235 notes page 745

[Proof of Claim 1: The composition a is onefree; in other words, it does not contain
1 as an entry (by the definition of “onefree”).
Write the composition a in the form a = ( a1 , a2 , . . . , ak ). Then, ( a1 , a2 , . . . , ak ) is
a composition of n. In other words, ( a1 , a2 , . . . , ak ) is a tuple of positive integers
whose sum is n. Hence, the numbers a1 , a2 , . . . , ak are positive integers and satisfy
a1 + a2 + · · · + ak = n.
The numbers a1 , a2 , . . . , ak are the entries of the composition a (since a = ( a1 , a2 , . . . , ak )),
and therefore are distinct from 1 (since this composition a does not contain 1 as an
entry). Hence, these numbers a1 , a2 , . . . , ak are ≥ 2 (since they are positive integers).
Now, the definition of C ( a) yields

C ( a) = { a1 + a2 + · · · + ai | i ∈ {1, 2, . . . , k − 1}} .

Hence, it is easy to see that C ( a) is a subset of [2, n − 2] 432 . Furthermore, the set
C ( a) is lacunar433 . This completes the proof of Claim 1.]

432 Proof. Let p ∈ C ( a). We shall show that p ∈ [2, n − 2].


We have p ∈ C ( a) = { a1 + a2 + · · · + ai | i ∈ {1, 2, . . . , k − 1}}. In other words, p = a1 + a2 +
· · · + ai for some i ∈ {1, 2, . . . , k − 1}. Consider this i.
We have i ≥ 1 (since i ∈ {1, 2, . . . , k − 1}). Thus, a1 is an addend of the sum a1 + a2 + · · · + ai .
But a1 + a2 + · · · + ai is a sum of positive integers (since a1 , a2 , . . . , ak are positive integers), and
thus is ≥ to any of its addends. Hence, a1 + a2 + · · · + ai ≥ a1 (since a1 is an addend of this
sum). Now, p = a1 + a2 + · · · + ai ≥ a1 ≥ 2 (since the numbers a1 , a2 , . . . , ak are ≥ 2).
We have i ≤ k − 1 (since i ∈ {1, 2, . . . , k − 1}). Thus, the sum a1 + a2 + · · · + ak−1 contains all i
addends of the sum a1 + a2 + · · · + ai and possibly a few more. Since all these extra addends are
positive (because a1 , a2 , . . . , ak are positive integers), we thus conclude that a1 + a2 + · · · + ak−1 ≥
a1 + a2 + · · · + ai (because a sum can only get larger if we add some extra positive addends).
Hence,

a 1 + a 2 + · · · + a i ≤ a 1 + a 2 + · · · + a k −1
= ( a1 + a2 + · · · + a k ) − ak
| {z } |{z}
=n ≥2
(since the numbers a1 ,a2 ,...,ak are ≥2)

≤ n − 2.

Hence, p = a1 + a2 + · · · + ai ≤ n − 2.
Combining p ≥ 2 with p ≤ n − 2, we obtain p ∈ [2, n − 2].
Forget that we fixed p. We thus have shown that p ∈ [2, n − 2] for each p ∈ C ( a). Hence, C ( a)
is a subset of [2, n − 2].
433 Proof. Assume the contrary. Thus, the set C ( a ) is not lacunar; in other words, the set C ( a )

contains two consecutive integers (by the definition of “lacunar”). Let p and q be these two
consecutive integers (in some order). Thus, p ∈ C ( a) and q ∈ C ( a).
We have p ∈ C ( a) = { a1 + a2 + · · · + ai | i ∈ {1, 2, . . . , k − 1}}. In other words, there exists
some u ∈ {1, 2, . . . , k − 1} such that p = a1 + a2 + · · · + au . Consider this u.
We have q ∈ C ( a) = { a1 + a2 + · · · + ai | i ∈ {1, 2, . . . , k − 1}}. In other words, there exists
some v ∈ {1, 2, . . . , k − 1} such that q = a1 + a2 + · · · + av . Consider this v.
We WLOG assume that u ≤ v (since otherwise, we can just swap u with v, while simultane-
ously swapping p with q). Note that p 6= q (since p and q are consecutive integers), so that u 6= v
(because if we had u = v, then we would have a1 + a2 + · · · + au = a1 + a2 + · · · + av , which
would contradict a1 + a2 + · · · + au = p 6= q = a1 + a2 + · · · + av ). Combining this with u ≤ v,

December 25, 2021


Math 235 notes page 746

[Proof of Claim 2: I shall be somewhat brief and handwavy, but I trust the reader
to be able to formalize this argument by now.
The set U is a subset of [2, n − 2] and thus a subset of [n − 1] (since [2, n − 2] ⊆
[n − 1]). Hence, C −1 (U ) is a well-defined composition of n.
Recall how the inverse map C −1 of C was described in the proof of Theorem
7.3.4: If I is any subset of [n − 1], then the elements of I subdivide the interval
[0, n] into several blocks; the composition C −1 ( I ) is formed by the lengths of these
blocks (from left to right).
Applying this to I = U, we see that the composition C −1 (U ) is formed by the
lengths of the blocks into which the elements of U subdivide the interval [0, n]. 434
We shall show that each of these blocks has length ≥ 2.
Indeed, this is obvious if U = ∅ (because in this case, there is only one block
(namely, [0, n]), and it has length n ≥ 3 ≥ 2). Hence, for the rest of this proof, we
WLOG assume that U 6= ∅; thus, the set U has a smallest element min U and a
largest element max U. Note that min U ∈ U ⊆ [2, n − 2], so that min U ≥ 2. Also,
max U ∈ U ⊆ [2, n − 2] and thus max U ≤ n − 2. Note that the set U is lacunar;
thus, any two distinct elements of U are at least a distance of 2 apart (on the real
axis).
Now, consider the blocks into which the elements of U subdivide the interval
[0, n]. The first of these blocks is [0, min U ], and thus has length min U − 0 =

we obtain u < v. Now,

q = a 1 + a 2 + · · · + a v = ( a 1 + a 2 + · · · + a u ) + ( a u +1 + a u +2 + · · · + a v ) (since u ≤ v)
| {z }
=p
= p + ( a u +1 + a u +2 + · · · + a v ) .

But av is an addend of the sum au+1 + au+2 + · · · + av (since u < v). However, au+1 + au+2 +
· · · + av is a sum of positive integers (since a1 , a2 , . . . , ak are positive integers), and thus is ≥ to
any of its addends. Hence, au+1 + au+2 + · · · + av ≥ av (since av is an addend of this sum). Also,
av ≥ 2 (since the numbers a1 , a2 , . . . , ak are ≥ 2). Now,

q = p + ( au+1 + au+2 + · · · + av ) ≥ p + 2.
| {z }
≥ a v ≥2

That is, the integer q is at least by 2 larger than p. Hence, p and q cannot be consecutive integers.
This contradicts the fact that p and q are consecutive integers. This contradiction shows that our
assumption was false. Qed.
434 Let us again illustrate this on an example, this time making sure to pick a lacunar subset of

[2, n − 2]. Namely, set n = 14 and U = {2, 4, 7, 11}. Then, the elements of U subdivide the
interval [0, n] = [0, 14] into 5 blocks as follows:

2 2 3 4 3

0 2 4 7 11 14 .

The lengths of these blocks are 2, 2, 3, 4, 3 (from left to right). Thus, the composition C −1 (U ) is
(2, 2, 3, 4, 3).

December 25, 2021


Math 235 notes page 747

min U ≥ 2. The last of these blocks is [max U, n], and thus has length n − max
| {z U} ≥
≤ n −2
n − (n − 2) = 2. Each of the remaining blocks begins and ends at two (distinct)
elements of U, and thus has length ≥ 2 (since any two distinct elements of U are at
least a distance of 2 apart (on the real axis)). Combining these results, we conclude
that each of our blocks has length ≥ 2. Hence, none of our blocks has length 1.
Now, recall that the composition C −1 (U ) is formed by the lengths of these
blocks. Since none of our blocks has length 1, we thus conclude that the com-
position C −1 (U ) does not contain 1 as an entry. In other words, the composition
C −1 (U ) is onefree. This proves Claim 2.]
Now, Claim 1 shows that we can define a map

C : {onefree compositions of n} → {lacunar subsets of [2, n − 2]} ,


a 7→ C ( a) .

Claim 2 shows that we can define a map

D : {lacunar subsets of [2, n − 2]} → {onefree compositions of n} ,


U 7 → C −1 (U ) .

These two maps C and D are restrictions of the maps C and C −1 (respectively), and
thus are mutually inverse (since the maps C and C −1 are mutually inverse). Hence,
the map C is invertible, i.e., is a bijection. The bijection principle thus yields

|{onefree compositions of n}|


= |{lacunar subsets of [2, n − 2]}|
  

= # of lacunar subsets of  |{z} − 2} 


2 , |n {z
  
=1+1 =1+(n−3)

= (# of lacunar subsets of [1 + 1, 1 + (n − 3)])


= f (n−3)+2 (by Proposition A.8.2 (applied to 1 and n − 3 instead of a and n))
= f n −1 .

In other words, (# of onefree compositions of n) = f n−1 . This proves Proposition


A.8.1 again.

A.8.5. Discussion of Exercise 7.7.5


Discussion of Exercise 7.7.5. Exercise 7.7.5 is a well-known problem, appearing in
some form in almost any text on combinatorics. See, for instance, [YagYag64, Prob-
lem 31], [Stanle11, §1.2] or [AndFen04, Theorem 4.2]. We note that Exercise 7.7.5 (b)
is commonly used in commutative algebra, since the weak compositions of n into

December 25, 2021


Math 235 notes page 748

k parts are in bijection with the degree-n monomials in k variables x1 , x2 , . . . , xk


(namely, a weak composition ( a1 , a2 , . . . , ak ) of n into k parts corresponds to the
a
monomial x1a1 x2a2 · · · xk k ).
(a) We claim that
n−1 n−1
   
(# of compositions of n into k parts) = = .
n−k k−1
Even more generally, we can allow n to be 0 and get the following:
Theorem A.8.3. Let n ∈ N and k ∈ N. Then,

(# of compositions of n into k parts)


n−1
 
= (738)
n−k

 n − 1 , if n > 0;


= k−1 (739)

 [ k = 0] , if n = 0.

We refer to [19fco, §2.10.1] for two proofs of Theorem A.8.3. Here, we shall just
briefly outline one of the proofs:
Hints to the proof of Theorem A.8.3. The case when n = 0 is straightforward busy-
work (and is not part of Exercise 7.7.5 anyway), so we WLOG assume that n 6= 0.
Thus, n is a positive integer.
Likewise, we leave the case k = 0 to the reader (again, noting that this case is
straightforward), so we WLOG assume that k 6= 0. Hence, k is a positive integer.
Consider the map

C : {compositions of n} → {subsets of [n − 1]}

defined in the proof of Theorem 7.3.4. We recall (from said proof) that this map C
is a bijection; thus, it has an inverse map C −1 .
Now, the following two claims are crucial:

Claim 1: Let a be a composition of n into k parts. Then, C ( a) is a (k − 1)-


element subset of [n − 1].

Claim 2: Let U be a (k − 1)-element subset of [n − 1]. Then, C −1 (U ) is a


composition of n into k parts.

The reader will have no trouble proving these two claims. Now, Claim 1 shows
that we can define a map

C : {compositions of n into k parts} → {(k − 1) -element subsets of [n − 1]} ,


a 7→ C ( a) .

December 25, 2021


Math 235 notes page 749

Claim 2 shows that we can define a map

D : {(k − 1) -element subsets of [n − 1]} → {compositions of n into k parts} ,


U 7 → C −1 (U ) .

These two maps C and D are restrictions of the maps C and C −1 (respectively), and
thus are mutually inverse. Hence, the map C is invertible, i.e., is a bijection. The
bijection principle thus yields

|{compositions of n into k parts}|


= |{(k − 1) -element subsets of [n − 1]}|
= (# of (k − 1) -element subsets of [n − 1])
n−1
 
= (by an application of Theorem 4.3.12)
k−1
n−1
 
= (by an application of Theorem 4.3.10)
( n − 1) − ( k − 1)
n−1
 
= .
n−k

Theorem A.8.3 follows.


(b) We claim that

(# of weak compositions of n into k parts)



n+k−1

 
n+k−1
  , if k > 0;
= = k−1
n 
0, if k = 0.

Even more generally, we can allow n to be 0 and get the following:


Theorem A.8.4. Let n ∈ N and k ∈ N. Then,

(# of weak compositions of n into k parts)


n+k−1
 
= (740)
n

 n + k − 1 , if k > 0;


= k−1 (741)

 [ n = 0] , if k = 0.

We refer to [19fco, §2.10.3] for a detailed proof of Theorem A.8.4. Here, let us
just briefly outline it:

December 25, 2021


Math 235 notes page 750

Hints to the proof of Theorem A.8.4. If ( a1 , a2 , . . . , ak ) is a weak composition of n into


k parts, then ( a1 + 1, a2 + 1, . . . , ak + 1) is a composition of n + k into k parts435 .
Thus, there is a map

{weak compositions of n into k parts} → {compositions of n + k into k parts} ,


( a1 , a2 , . . . , ak ) 7→ ( a1 + 1, a2 + 1, . . . , ak + 1) .

It is easy to see that this map is a bijection. The bijection principle therefore shows
that

(# of weak compositions of n into k parts)


= (# of compositions of n + k into k parts)
n+k−1
 
= (by (738) (applied to n + k instead of n))
n+k−k

n+k−1

 
n+k−1
  , if k > 0;
= = k−1
n 
 [ n = 0] , if k = 0

(where the last equality sign follows from an application of Theorem 4.3.10 in the
case when k > 0, and can be checked by hand in the case when k = 0). Theorem
A.8.4 thus follows.
The equality (740) can also be proved by induction (see [Jarvin20, §19.3] or
[Grinbe15, Exercise 3.15] for such proofs) or by a direct counting argument (see
[AndFen04, proof of Theorem 4.2 (b)] or [Jarvin20, §19.3] for this).

A.8.6. Discussion of Exercise 7.7.6


Discussion of Exercise 7.7.6. Exercise 7.7.6 is [GrKnPa94, Exercise 5.65] or [Tomesc85,
Problem 1.14]; I have also seen it called Riordan’s identity. We first give an algebraic
solution (using the telescope principle), then a combinatorial solution (via double
counting).
First solution to Exercise 7.7.6. For each k ∈ {0, 1, . . . , n}, we define a number

n − 1 k!
 
bk = n . (742)
k nk

435 because adding 1 to a nonnegative integer yields a positive integer, and because

( a1 + 1) + ( a2 + 1) + · · · + ( a k + 1) = ( a1 + a2 + · · · + a k ) + (1 + 1 + · · · + 1) = n + k
| {z } | {z }
=n k times
| {z }
=k

December 25, 2021


Math 235 notes page 751

Now, we claim that


n − 1 ( k + 1) !
 
= bk − bk + 1 (743)
k nk
for each k ∈ {0, 1, . . . , n − 1}.
[Proof of (743): Let k ∈ {0, 1, . . . , n − 1}. The definition of bk+1 yields

n − 1 ( k + 1) ! n − 1 (k + 1) · k!
   
bk +1 = n =n
k+1 n k +1 k+1 nk · n
 
since (k + 1)! = (k + 1) · k! and nk+1 = nk · n
n−1 n − 1 k!
   
k!
= ( k + 1) = ((n − 1) − k) .
k+1 nk k nk
| {z }
n−1
=((n−1)−k)
k
(by Lemma A.4.9 (b)
(applied to n−1 instead of n))

Subtracting this equality from (742), we find

n − 1 k! n − 1 k!
   
bk − bk + 1 = n − ((n − 1) − k)
k nk k nk
n − 1 k! n − 1 k!
   
= (n − ((n − 1) − k)) = ( k + 1)
| {z } k nk k nk
= k +1
n − 1 (k + 1) · k! n − 1 ( k + 1) !
   
= =
k nk k nk

(since (k + 1) · k! = (k + 1)!). This proves (743).]


Now,
n −1 
n − 1 ( k + 1) !

∑ k nk
k =0 | {z }
= bk − bk + 1
(by (743))
n −1 n −1 n −1
= ∑ (b − b ) =
| k {z k+1} ∑ ((−bk+1 ) − (−bk )) = ∑ ((−bi+1 ) − (−bi ))
k =0 k =0 i =0
=(−bk+1 )−(−bk )
(here, we have renamed the summation index k as i )
 
= −b(n−1)+1 − (−b0 )
(by Corollary 4.1.17 (applied to u = 0, v = n − 1 and ai = −bi ))
= b0 − b(n−1)+1
= b0 − bn (since (n − 1) + 1 = n) . (744)

December 25, 2021


Math 235 notes page 752

However, the definition of b0 yields

n−1
 
0! 0!
b0 = n 0
= n · 0
= n · |{z} n0 = n.
0! / |{z}
0 n n
| {z } =1 =1
=1
(by (119)
(applied to n−1 instead of n))

Furthermore, it is easy to see that bn = 0 436 . Hence, (744) becomes


n −1 
n − 1 ( k + 1) !

∑ k nk
= b0 − bn = n.
|{z} |{z}
k =0 =n =0

This solves Exercise 7.7.6.


Second solution to Exercise 7.7.6 (sketched). It is easy to solve Exercise 7.7.6 in the case
when n = 0 (indeed, it boils down to 0 = 0 in this case). Thus, for the rest of this
solution, we WLOG assume that n 6= 0. Hence, n ≥ 1.
If a = ( a1 , a2 , . . . , an ) ∈ [n]n is an n-tuple, then there exists an i ∈ [n] such that
the i entries a1 , a2 , . . . , ai are distinct (indeed, i = 1 always fits the bill, since the
single entry a1 is distinct). We define the wit of an n-tuple a = ( a1 , a2 , . . . , an ) ∈ [n]n
to be the largest i ∈ [n] such that the i entries a1 , a2 , . . . , ai are distinct. Thus,
roughly speaking, the wit of an n-tuple measures “how long the n-tuple can avoid
repeating its own entries”. For example, the 9-tuple (3, 1, 6, 2, 4, 1, 5, 2) has wit 5
(since its first 5 entries 3, 1, 6, 2, 4 are distinct, while its first 6 entries 3, 1, 6, 2, 4, 1 are
not). Likewise, the 7-tuple (3, 1, 3, 2, 4, 5, 3) has wit 2.
For any k ∈ [n], we have

# of n-tuples a ∈ [n]n with wit k




n−1
 
= k! · nn−k . (745)
k−1

[Proof of (745): Let k ∈ [n]. We need to prove the equality (745).


We have k ≤ n (since k ∈ [n]). Thus, we are in one of the two cases k < n and
k = n. We shall only handle the case k < n in the following; the case k = n is
similar (but easier) and we leave it to the reader.
436 Proof.If n = 0, then bn = b0 = n = 0. Thus, for the rest of this proof of bn = 0, we WLOG assume
that n 6= 0. Hence, n is a positive integer (since n ∈ N), so n − 1 ∈ N. Therefore, Proposition
 that 
n−1
4.3.4 (applied to n − 1 and n instead of n and k) yields = 0 (since n > n − 1). Now, the
n
definition of bn yields
n − 1 n!
 
bn = n = 0.
n nn
| {z }
=0
Qed.

December 25, 2021


Math 235 notes page 753

So let us assume that k < n. An n-tuple a = ( a1 , a2 , . . . , an ) ∈ [n]n has wit k if


and only if its first k entries a1 , a2 , . . . , ak are distinct while its (k + 1)-st entry ak+1
equals one of these first k entries437 . Thus, the following decision procedure can be
used to construct an n-tuple a = ( a1 , a2 , . . . , an ) ∈ [n]n with wit k:

• First, we choose the first k entries a1 , a2 , . . . , ak of a, one after the other (keep-
ing in mind that they have to be distinct). This procedure involves k decisions,
and it is easy to count how many options there are in each decision: There are
n options for choosing a1 (since a1 has to be an element of [n]); there are n − 1
options for choosing a2 (since a2 has to be an element of [n] distinct from a1 );
there are n − 2 options for choosing a3 (since a3 has to be an element of [n]
distinct from both the two distinct elements a1 and a2 ); and so on.
After these k decisions, the first k entries a1 , a2 , . . . , ak of our n-tuple a have
been chosen.

• Next, we choose the (k + 1)-st entry ak+1 of a. This entry has to equal one
of the first k entries a1 , a2 , . . . , ak . Since these first k entries a1 , a2 , . . . , ak are
distinct, we thus have k options for choosing ak+1 .

• Finally, we choose the remaining n − k − 1 entries ak+2 , ak+3 , . . . , an of a. These


entries can be arbitrary elements of [n] (they need not be distinct from any-
thing or equal to anything); thus, there are n options for choosing each of
them.

The dependent product rule shows that the total # of possibilities for making these
choices is

n (n − 1) (n − 2) · · · (n − k + 1) · k · nn · · · n}
| {z
n−k−1 times
n − k −1
= n ( n − 1) ( n − 2) · · · ( n − k + 1) · k · n .

Hence,

# of n-tuples a ∈ [n]n with wit k




= n ( n − 1 ) ( n − 2 ) · · · ( n − k + 1 ) · k · n n − k −1 . (746)

437 This is where we need k < n: If we had k = n, then there would be no (k + 1)-st entry ak+1 .

December 25, 2021


Math 235 notes page 754

On the other hand, from k ≥ 1, we have k − 1 ∈ N and thus


n−1
 
n−k
k! · n
k−1 |{z} |{z}
| {z } =k·(k−1)! =n·nn−k−1
(n − 1) (n − 2) (n − 3) · · · ((n − 1) − (k − 1) + 1)
=
( k − 1) !
(by (117) (applied to n−1 and k−1 instead of n and k))
(n − 1) (n − 2) (n − 3) · · · ((n − 1) − (k − 1) + 1)
= · k ( k − 1 ) ! · n · n n − k −1
( k − 1) !
= (n − 1) (n − 2) (n − 3) · · · ((n − 1) − (k − 1) + 1) ·kn · nn−k−1
| {z }
= n − k +1
= (n − 1) (n − 2) (n − 3) · · · (n − k + 1) · kn · nn−k−1
= n · ( n − 1 ) ( n − 2 ) ( n − 3 ) · · · ( n − k + 1 ) · k · n n − k −1
| {z }
=n(n−1)(n−2)···(n−k+1)

= n ( n − 1 ) ( n − 2 ) · · · ( n − k + 1 ) · k · n n − k −1 .
Comparing this with (746), we find
n−1
 
n
k! · nn−k .

# of n-tuples a ∈ [n] with wit k =
k−1
This proves (745).]
Now, the wit of an n-tuple a ∈ [n]n is an element of [n]. Hence, the sum rule
yields
# of n-tuples a ∈ [n]n

n
= ∑ # of n-tuples a ∈ [n]n with wit k

k =1 | {z }
n−1

= k!·nn−k
k−1
(by (745))
n n −1 
n−1 n−1
  
= ∑ k−1
k! · n n−k
= ∑
( k + 1 ) − 1
( k + 1) ! · n n−(k+1)
| {z }
k =1 k =0 |
 {z  } n n −1
n−1 = n n −1− k =
= nk
k
(here, we have substituted k + 1 for k in the sum)
n −1 n −1 
n−1 n n −1 n − 1 ( k + 1) !
  
= ∑ ( k + 1) ! · k = n n −1
·∑ .
k =0
k n k =0
k nk
Thus,
n −1 
n − 1 ( k + 1) !

n n −1
· ∑ k n k
= # of n-tuples a ∈ [ n ] n
= [n]n = nn .
k =0

December 25, 2021


Math 235 notes page 755

Dividing both sides of this equality by nn−1 , we obtain


n −1 
n − 1 ( k + 1) !

∑ k nk
= n.
k =0
Thus, Exercise 7.7.6 is solved again.

A.8.7. Discussion of Exercise 7.7.7


Discussion of Exercise 7.7.7. Exercise 7.7.7 is part of [Riorda68, Problem 1.10];it also

1 2n
appears implicitly in [Shapir76, Proposition 3.1] (since it is easily seen that =
2 n
2n − 1
 
when n is a positive integer). We shall give a purely algebraic solution:
n
Solution to Exercise 7.7.7. For each k ∈ {0, 1, . . . , n}, we have
 
2n
k
|{z} n−k
=n−(n−k)
 
2n
= (n − (n − k))
n−k
   
2n 2n
=n − (n − k)
n−k n−k
| {z } | {z }
2n − 1 2n − 1 2n − 1
    
= + =2n
n−k−1 n−k n−k−1
(by Theorem 4.3.7 (since Lemma A.4.9 (a)
(applied to 2n and n−k instead of n and k)) (appliedto 2n and n−
k instead of
 n and k)
2n − 1 2n
yields 2n =(n−k) )
n−k−1 n−k
2n − 1 2n − 1 2n − 1
     
=n + − 2n
n−k−1 n−k n−k−1
2n − 1 2n − 1 2n − 1 2n − 1
       
=n − =n −
n−k n−k−1 n−k n − ( k + 1)
(since n − k − 1 = n − (k + 1)). Summing this equality over all k ∈ {0, 1, . . . , n}, we
obtain
n  
2n
∑ k n−k
k =0
n
2n − 1 2n − 1
   
= ∑n −
k =0
n−k n − ( k + 1)
n
2n − 1 2n − 1
   
=n∑ − . (747)
k =0
n−k n − ( k + 1)

December 25, 2021


Math 235 notes page 756

Now,
n
2n − 1 2n − 1
   
∑ n − k

n − ( k + 1)
k =0 | {z } 
    
2n − 1 2n − 1

=− −− 
n − ( k + 1) n−k
n  
2n − 1 2n − 1
   
= ∑ − − −
k =0
n − ( k + 1 ) n−k
n
2n − 1 2n − 1
     
=∑ − − −
i =0
n − ( i + 1) n−i
(here, we have renamed the summation index k as i )
2n − 1 2n − 1
     
= − − −
n − ( n + 1) n−0
by Corollary 4.1.17
 
2n − 1
 
 
(applied to u = 0 and v = n and ai = − )
n−i
2n − 1 2n − 1 2n − 1 2n − 1
       
= − = −
n−0 n − ( n + 1) n −1
| {z }
=0
(by (118)
(since −1/∈N))
(since n − 0 = n and n − (n + 1) = −1)
2n − 1
 
= .
n
Hence, (747) rewrites as
n
2n − 1
   
2n
∑ k n−k =n
n
.
k =0

This solves Exercise 7.7.7.

A.8.8. Discussion of Exercise 7.7.8


Discussion of Exercise 7.7.8. Exercise 7.7.8 is one of the facts known as the binomial
inversion formula. An equivalent fact appears in [Grinbe15, Exercise 3.18 (a)] and in
[17f-hw4s, Exercise 6]438 . For convenience, let me show an adaptation of the proof
of [17f-hw4s, Exercise 6].
First, I will need the following lemma:
438 The differences between [Grinbe15, Exercise 3.18 (a)], [17f-hw4s, Exercise 6] and our Exercise
7.7.8 are insubstantial: Our Exercise 7.7.8 is stated for two infinite sequences ( f 0 , f 1 , f 2 , . . .) and

December 25, 2021


Math 235 notes page 757

Lemma A.8.5. Let n ∈ N. Let i ∈ {0, 1, . . . , n}. Then,


n   
j +i n j
∑ (−1) j i
= [i = n ] .
j =i

Proof of Lemma A.8.5. We have i ∈ {0, 1, . . . , n}, so that i ≤ n and i ∈ N. From


i ≤ n, we obtain n − i ≥ 0. Thus, n − i ∈ N.
Let j ∈ {i, i + 1, . . . , n}. Then, j ≥ i ≥ 0. Therefore, Theorem 7.5.2 (applied to
a = j and b = i) yields
n−i
     
n j n
= . (748)
j i i j−i
Also, j + i ≡ j − i mod 2 (since ( j + i ) − ( j − i ) = 2i is even). Thus, (−1) j+i =
(−1) j−i . Multiplying this equality by (748), we obtain
n−i
     
j +i n j j −i n
(−1) = (−1) . (749)
j i i j−i
Now, forget that we fixed j. We thus have proven the equality (749) for each
j ∈ {i, i + 1, . . . , n}. Summing this equality over all j ∈ {i, i + 1, . . . , n}, we obtain
n n  n −i
n−i n−i
       
j +i n j j −i n k n
∑ (−1) j i
= ∑ (−1)
i j−i
= ∑ (−1)
i k
j =i j =i k =0
(here, we have substituted k for j − i in the sum)
n −i
k n−i
   
n
=
i ∑ (−1) k
k =0
| {z }
=[n−i =0]
(by Proposition 4.3.18 (applied to n−i instead of n))
 
n
= [ n − i = 0] . (750)
i
But it is easy to see that  
n
[ n − i = 0] = [ i = n ] (751)
i
439 . Thus, (750) becomes
n     
n j n
∑ (−1) j +i
j i
=
i
[ n − i = 0] = [ i = n ] .
j =i

( g0 , g1 , g2 , . . .), whereas [Grinbe15, Exercise 3.18 (a)] and [17f-hw4s, Exercise 6] are stated for two
finite sequences (i.e., tuples) ( f 0 , f 1 , . . . , f N ) and ( g0 , g1 , . . . , g N ) (which are called ( a0 , a1 , . . . , a N )
and (b0 , b1 , . . . , b N ) in [17f-hw4s, Exercise 6]). The proofs given in [Grinbe15] and [17f-hw4s]
for [Grinbe15, Exercise 3.18 (a)] and [17f-hw4s, Exercise 6] apply to Exercise 7.7.8 (once some
obvious changes are made).
439 Proof of (751): We are in one of the following two cases:

Case 1: We have i 6= n.

December 25, 2021


Math 235 notes page 758

This proves Lemma A.8.5.


We are now ready for the solution to Exercise 7.7.8:
Solution to Exercise 7.7.8. We have assumed that
n  
i n
gn = ∑ (−1) f (752)
i =0
i i

for each n ∈ N.

Case 2: We have i = n.
  we have i 6= n. In other words, n 6= i. Hence,
Let us consider Case 1 first. In this case,
n
n − i 6= 0. Thus, [n − i = 0] = 0, so that [n − i = 0] = 0. Comparing this with [i = n] = 0
i | {z }
  =0
n
(since i 6= n), we obtain [n − i = 0] = [i = n]. Hence, (751) is proven in Case 1.
i
Now, let us consider Case 2. In this case, we have i = n. In other   words, n = i. Thus,
n n
n − i = 0. Thus, [n − i = 0] = 1. Also, from i = n, we obtain = = 1 (by (124)). Hence,
  i n  
n n
[n − i = 0] = 1. Comparing this with [i = n] = 1 (since i = n), we obtain [ n − i = 0] =
i | {z } i
| {z } =1
=1
[i = n]. Hence, (751) is proven in Case 2.
We thus have proven (751) in each of the two Cases 1 and 2. Thus, (751) always holds.

December 25, 2021


Math 235 notes page 759

Now, let n ∈ N. Then,


n   n  
i n j n
∑ (−1) i gi = ∑ (−1) j gj
i =0 j =0 |{z} 
j j
= ∑ (−1)i fi
i =0 i
(by (752), applied to j
instead of n)
(here, we have renamed the summation index i as j)
n   j 
j n i j
= ∑ (−1) ∑ (−1) i fi
j =0
j i =0
n j   
j n i j
= ∑ ∑ (−1) (−1) f
j =0 i =0
j i i
| {z } | {z }
n n n
=∑ ∑ =(−1)i
i =0 j = i j
(by (102))
n n    n n   
n j n j
= ∑ ∑ |(−1){z(−1)} j i fi = ∑
j i
∑ (−1) j +i
j i i
f
i =0 j =i i =0 j =i
=(−1) j+i
n   !
n
n j
= ∑ ∑ (−1) j+i fi
i =0 j = i
j i
| {z }
=[i =n]
(by Lemma A.8.5)
n n −1
= ∑ [i = n] fi = [|n {z
= n] f n + ∑ [i = n ] fi
i =0 i =0
} | {z }
=1 =0
(since n=n) (since i 6=n
(because i ≤n−1<n))
 
here, we have split off the addend for i = n
from the sum
n −1
= fn + ∑ 0 fi = fn.
|i={z
0
}
=0
 
n n i
In other words, f n = ∑ (−1) g . This solves Exercise 7.7.8.
i =0 i i

December 25, 2021


Math 235 notes page 760

A.8.9. Discussion of Exercise 7.7.9


Discussion of Exercise 7.7.9. Exercise 7.7.9 is [18f-hw3s, Exercise 3]. Its part (a) also
appears in [Grinbe15, Exercise 3.2 (b)] and in [GrKnPa94, (5.37)], whereas its part
(b) also appears in [Grinbe15, Exercise 3.23 (a)], in [Spivey19, Identity 154] and in
[GrKnPa94, (5.39)]. The solution I shall give below is copied almost verbatim from
[18f-hw3s]. Note that the solution to part (b) is probably one of the nicest illus-
trations of the “substitute non-integer values into the Chu–Vandermonde identity,
and simplify the result” strategy. Combinatorial solutions to Exercise 7.7.9 (b) also
exist, but are much more complicated (some such proofs are sketched in [Sved84]
as well as in the math.stackexchange discussions https://math.stackexchange.
com/questions/72367 and https://math.stackexchange.com/a/360780 ).
Solution to Exercise 7.7.9. (a) From n ∈ N, we obtain 2n ≥ n and 2n ∈ N. Hence,
Theorem 4.3.8 (applied to 2n and n instead of n and k) yields
 
2n (2n)! (2n)! 1
= = = (2n)!
n n! · (2n − n)! n! · n! n!n! | {z }
=1·2·····(2n)
=(1·3·5·····(2n−1))·(2·4·6·····(2n))
(here, we have split the product into
the product of its odd factors and
the product of its even factors)
1
= (1 · 3 · 5 · · · · · (2n − 1)) · (2 · 4 · 6 · · · · · (2n))
n!n! | {z } | {z }
n −1 n n
= ∏ (2i +1) = ∏ (2i )=2n ∏ i
i =0 i =1 i =1
! !
n −1 n n −1
1 1
=
n!n! ∏ (2i + 1) · 2n ∏ i =
n!n! ∏ (2i + 1) · 2n n!
i =0 i =1 i =0
|{z}
=n!
2n n −1
=
n! ∏ (2i + 1) .
i =0
n −1
Solving this equality for ∏ (2i + 1), we obtain
i =0
n −1   n  
2n 2 n! 2n
∏ (2i + 1) = n
/ = n
n! 2 n
. (753)
i =0

For each a ∈ Q, we have


a ( a − 1) ( a − 2) · · · ( a − n + 1)
   
a by (117) (applied to a and n
=
n n! instead of n and k)
n −1
∏ (a − i)
1 n −1
n! ∏
i =0
= = (a − i) .
n! i =0

December 25, 2021


Math 235 notes page 761

Applying this to a = −1/2, we obtain


n −1
∏ (2i + 1)
−1/2 1 n −1 1 n−1 2i + 1
 
1
∏ ∏
i =0
= (− 1/2 − i ) = = ·
n n! i=0 | {z } n! i=0 −2 n! (−2)n
2i + 1
=
−2
n −1    
1 1 1 1 n! 2n 1 2n
= ·
n! (−2)n ∏ (2i + 1) = n! · (−2)n · 2n n = (−2)n · 2n n
|i=0 {z
 }
| {z }
−1 n
!
n! 2n =
=
2n n 4
(by (753))
n 
−1
 
2n
= .
4 n
This solves Exercise 7.7.9 (a).
(b) Theorem 7.5.3 (applied to x = −1/2 and y = −1/2) yields
n 
−1/2 −1/2
   
(−1/2) + (−1/2)
= ∑ .
n k =0
k n − k

Comparing this with


−1
   
(−1/2) + (−1/2)
= = (−1)n (by (122), applied to k = n) ,
n n
we obtain
n
−1/2 −1/2
   
(−1) =n
∑ k n−k
k =0 | {z } | {z }
−1 k 2k −1 n−k 2 ( n − k )
!   !  
= =
4 k 4 n−k
(by Exercise 7.7.9 (a), (by Exercise 7.7.9 (a),
applied to k instead of n) applied to n−k instead of n)
k  n−k  
n
−1 −1 2 (n − k) −1 n n 2k 2 (n − k)
      
2k
= ∑ 4 4 k n−k
=
4 ∑ k n−k
.
k =0 | {z } k = 0
−1 n
!
=
4

Multiplying both sides of this equality by (−4)n , we obtain


n n   n  
n −1 2 (n − k) 2 (n − k)
  
2k 2k
n n
(−4) (−1) = (−4)
4 ∑ k n−k
= ∑
k n−k
.
| {z } k = 0 k = 0
=1

December 25, 2021


Math 235 notes page 762

Hence,
n
2 (n − k)
  
2k
∑ k n − k
= (−4)n (−1)n = 4n .
k =0
This solves Exercise 7.7.9 (b).
We end this discussion by mentioning two binomial identities similar to Exercise
7.7.9 (b):

• For each n ∈ N, we have


  
n  n n
2 (n − k)
  
2k  2 , if n is even;
∑ (−1)k k n−k
= n/2
k =0

0, if n is odd.

This appears in [Grinbe15, Exercise 3.23 (b)].

• For each n ∈ N and u ∈ C, we have


n 
2k − u 2 (n − k) + u
 
∑ k n−k
= 4n . (754)
k =0

This is a result of Duarte and De Oliveira ([DuaOli13, Theorem]). I give a


detailed proof in [19fco-mt2s, Exercise 1] (where I require u ∈ R instead
of u ∈ C, but this makes no difference). Note that Exercise 7.7.9 (b) is the
particular case of this identity (754) for u = 0. However, our above solution to
Exercise 7.7.9 (b) does not appear to adapt to the more general identity (754).

A.8.10. Discussion of Exercise 7.7.10


Discussion of Exercise 7.7.10. Exercise 7.7.10 was on the IMO Longlist 1983 (which
means it was proposed for the IMO in 1983 but did not get into the shortlist). To
us, it is an easy consequence of Exercise 7.5.2. For convenience, we front-load part
of our solution as a self-contained lemma:

Lemma A.8.6. Let x and y be two positive integers such that x2 − x = y2 − y.


Then, x = y.

Proof of Lemma A.8.6. We have x ≥ 1 (since x is a positive integer) and y > 0 (since
x + y > 1 + 0 = 1. Hence, x + y − 1 > 0, so that
y is a positive integer), thus |{z}
|{z}
≥1 >0
x + y − 1 6= 0.

December 25, 2021


Math 235 notes page 763

Now, recall that x2 − x = y2 − y. Hence, x2 − x − y2 − y = 0. Comparing


 

this with
   
x − x − y − y = x 2 − y2 − ( x − y ) = ( x + y ) ( x − y ) − ( x − y )
2 2
| {z }
=( x +y)( x −y)
= ( x + y − 1) ( x − y ) ,
we obtain ( x + y − 1) ( x − y) = 0. We can divide this equality by x + y − 1 (since
x + y − 1 6= 0), and thus obtain x − y = 0. In other words, x = y. This proves
Lemma A.8.6.
(An alternative proof of Lemma A.8.6 could be given using Viete’s theorem, as
the x2 − x = y2 − y condition means that x and y are two roots of the polynomial
X 2 − X − c for c = x2 − x = y2 − y. However, this would be overkill compared to
the completely pedestrian proof given above.)
Solution to Exercise 7.7.10. We need to show the following two claims:

Claim 1: There is at least one sequence (u0 , u1 , u2 , . . .) of positive integers


such that
n  
n+r
un = ∑
2
u n −r for all n ∈ N.
r =0 r

Claim 2: There is at most one sequence (u0 , u1 , u2 , . . .) of positive inte-


gers such that
n  
n+r
un = ∑
2
u n −r for all n ∈ N. (755)
r =0 r

[Proof of Claim 1: We shall show that the sequence 20 , 21 , 22 , . . . fits the bill.


Indeed, this sequence 20 , 21 , 22 , . . . is clearly a sequence of positive integers. For




each n ∈ N, we have
n  n  n  n 
n + r 2n
   
n + r n −r n+r 1 n+k 1
∑ r 2|{z} = ∑ r 2r = 2 · ∑ r 2r = 2 · ∑ k 2k n n
r =0 r =0 r =0 k =0
2n | {z }
= = 2 n
2 r
(by Exercise 7.5.2)

(here, we have renamed the summation index r as k)


= 2n · 2n = (2n )2 .
 
n n + r n −r
2
n
Thus, (2 ) = ∑ 2 for all n ∈ N. Hence, there is at least one sequence
r =0 r
(u0 , u1 , u2 , . . .) of positive integers such that
n  
n+r
un = ∑
2
u n −r for all n ∈ N
r =0 r

December 25, 2021


Math 235 notes page 764

(namely, (u0 , u1 , u2 , . . .) = 20 , 21 , 22 , . . . ). This proves Claim 1.]




[Proof of Claim 2: Let (v0 , v1 , v2 , . . .) and (w0 , w1 , w2 , . . .) be two sequences (u0 , u1 , u2 , . . .)


of positive integers satisfying (755). We shall show that (v0 , v1 , v2 , . . .) = (w0 , w1 , w2 , . . .).
Indeed, we claim that
vj = wj for each j ∈ N. (756)
[Proof of (756): We shall prove (756) by strong induction on j:
Induction step: Let n ∈ N. Assume (as the induction hypothesis) that (756) holds
for j < n. We must prove that (756) holds for j = n. In other words, we must prove
that vn = wn .
We know that (v0 , v1 , v2 , . . .) is a sequence (u0 , u1 , u2 , . . .) satisfying (755). Thus,
(755) holds for ui = vi . Therefore,
n     n   n  
n+r n+0 n+r n+r
vn = ∑
2
v n −r = v n −0 + ∑ v n −r = v n + ∑ v n −r .
r =0 r 0 |{z} r =1
r r =1
r
| {z } =vn
=1
(by (119))

Thus,
n  
n+r
v2n − vn = ∑ r
v n −r . (757)
r =1
The same argument (applied to (w0 , w1 , w2 , . . .) instead of (v0 , v1 , v2 , . . .)) yields
n  
n+r
wn − wn = ∑
2
w n −r . (758)
r =1
r
However, our induction hypothesis says that (756) holds for j < n. In other
words, v j = w j holds for each j < n. In other words, v j = w j holds for each j ∈
{0, 1, . . . , n − 1}. Substituting n − r for j in this result, we conclude the following:
v n −r = w n −r holds for each r ∈ {1, 2, . . . , n} .
Hence, the right hand sides of the equalities (757) and (758) are equal. Thus, their
left hand sides are equal as well. In other words, v2n − vn = w2n − wn . Moreover, vn
is a positive integer (since (v0 , v1 , v2 , . . .) is a sequence of positive integers), and wn
is a positive integer (similarly). Thus, Lemma A.8.6 (applied to x = vn and y = wn )
yields that vn = wn . This is precisely what we needed to prove. Thus, the induction
step is complete. Hence, (756) is proved.]
Now, we have proved (756); in other words, we have shown that (v0 , v1 , v2 , . . .) =
( w0 , w1 , w2 , . . . ) .
Forget that we fixed (v0 , v1 , v2 , . . .) and (w0 , w1 , w2 , . . .). We thus have shown that
if (v0 , v1 , v2 , . . .) and (w0 , w1 , w2 , . . .) are two sequences (u0 , u1 , u2 , . . .) of positive
integers satisfying (755), then (v0 , v1 , v2 , . . .) = (w0 , w1 , w2 , . . .). In other words,
there is at most one such sequence (u0 , u1 , u2 , . . .). Thus, Claim 2 is proved.]
Having proved Claim 1 and Claim 2, we have thus solved Exercise 7.7.10.

December 25, 2021


Math 235 notes page 765

A.9. Homework set #8 discussion


The following are discussions of the problems on homework set #8 (Section 8.3).

A.9.1. Discussion of Exercise 8.3.1


Discussion of Exercise 8.3.1. Exercise 8.3.1 appears in [Engel98, Exercise 8.33] and in
[19s, Exercise 2.10.19]. We shall outline two solutions for it: a relatively elegant one
and a relatively straightforward one.
First solution to Exercise 8.3.1 (sketched). (See [19s, solution to Exercise 2.10.19] for
1
the details of this solution.) We shall show that ∑ = 1.
( x,y)∈ Z xy
Let W be the set of all pairs ( x, y) ∈ [n]2 satisfying x ⊥ y and x + y ≤ n. Any
pair ( x, y) ∈ [n]2 satisfying x ⊥ y must satisfy either x + y ≤ n or x + y > n (but
not both at the same time), and thus must belong to exactly one of the two sets W
1
and Z. Hence, we can split the sum ∑ as follows:
( x,y)∈[n]2 ;
xy
x ⊥y

1 1 1
∑ xy
= ∑ + ∑
xy ( x,y)∈Z xy
. (759)
2 ( x,y)∈W
( x,y)∈[n] ;
x ⊥y

On the other hand, let A be the set of all pairs ( x, y) ∈ [n]2 satisfying x ⊥ y and
x < y. Let B be the set of all pairs ( x, y) ∈ [n]2 satisfying x ⊥ y and x = y. Let C be
the set of all pairs ( x, y) ∈ [n]2 satisfying x ⊥ y and x > y.
Now, any pair ( x, y) ∈ [n]2 satisfying x ⊥ y must satisfy exactly one of the three
relations x < y and x = y and x > y, and thus must belong to exactly one of the
1
three sets A, B and C. Thus, we can split the sum ∑ as follows:
( x,y)∈[n]2 ;
xy
x ⊥y

1 1 1 1
∑ xy
= ∑ + ∑ + ∑
xy ( x,y)∈ B xy ( x,y)∈C xy
. (760)
2 ( x,y)∈ A
( x,y)∈[n] ;
x ⊥y

We shall now study the three sums on the right hand side of this equality. We
begin with the first one: We claim that
1 1
∑ xy
= ∑
x ( x + y )
. (761)
( x,y)∈ A ( x,y)∈W

[Proof of (761): It is fairly straightforward to see that the two maps


f : W → A,
(u, v) 7→ (u, u + v)

December 25, 2021


Math 235 notes page 766

and
g : A → W,
(u, v) 7→ (u, v − u)
are well-defined440 and mutually inverse441 . Hence, these two maps are bijections.
In particular, this means that f is a bijection. Hence, we can substitute (u, u + v)
1
for ( x, y) in the sum ∑ . We thus obtain
( x,y)∈ A xy

1 1 1
∑ xy
= ∑
u (u + v)
= ∑
x ( x + y)
( x,y)∈ A (u,v)∈W ( x,y)∈W

(here, we have renamed the summation index (u, v) as ( x, y)). This proves (761).]
Next, we claim that
1 1
∑ xy
= ∑
y ( x + y)
. (762)
( x,y)∈C ( x,y)∈W

[Proof of (762): This is similar to the proof of (761). It is fairly straightforward to


see that the two maps
f : W → C,
(u, v) 7→ (u + v, v)
and
g : C → W,
(u, v) 7→ (u − v, v)
are well-defined442 and mutually inverse443 . Hence, these two maps are bijections.
In particular, this means that f is a bijection. Hence, we can substitute (u + v, v)
1
for ( x, y) in the sum ∑ . We thus obtain
( x,y)∈C xy

1 1 1 1
∑ xy
= ∑
(u + v) v
= ∑
v (u + v)
= ∑
y ( x + y)
( x,y)∈C (u,v)∈W | {z } (u,v)∈W ( x,y)∈W
1
=
v (u + v)
440 Proving this is fairly easy: The only part that is not completely trivial is showing that u ⊥ v
implies u ⊥ u + v and u ⊥ v − u. But this can easily be derived from Proposition 3.4.4 (indeed,
Proposition 3.4.4 (b) entails gcd (u, u + v) = gcd (u, v) and gcd (u, v − u) = gcd (u, v)).
441 This is completely straightforward to check.
442 Proving this is fairly easy: The only part that is not completely trivial is showing that u ⊥ v

implies u + v ⊥ v and u − v ⊥ v. But this can easily be derived from Proposition 3.4.4 (indeed,
Proposition 3.4.4 (b) entails gcd (v, u + v) = gcd (v, u) and gcd (v, u − v) = gcd (v, u)).
443 This is completely straightforward to check.

December 25, 2021


Math 235 notes page 767

(here, we have renamed the summation index (u, v) as ( x, y)). This proves (762).]
Next, we claim that
1
∑ xy = 1. (763)
( x,y)∈ B

[Proof of (763): The set B consists of all pairs ( x, y) ∈ [n]2 satisfying x ⊥ y and
x = y. In other words, B consists of all pairs ( x, x ) ∈ [n]2 satisfying x ⊥ x (since
the condition x = y allows us to rewrite the pair ( x, y) as ( x, x )). However, the only
such pair is (1, 1) (indeed, a positive integer x always satisfies gcd ( x, x ) = x, and
therefore will satisfy x ⊥ x if and only if x = 1). Hence, B = {(1, 1)}. Consequently,

1 1 1
∑ xy
= ∑ xy
=
1·1
= 1.
( x,y)∈ B ( x,y)∈{(1,1)}

This proves (763).]


Now, (760) becomes

1 1 1 1
∑ xy
= ∑ xy
+ ∑
xy
+ ∑ xy
( x,y)∈[n]2 ; ( x,y)∈ A ( x,y)∈ B ( x,y)∈C
x ⊥y | {z } | {z } | {z }
1 =1 1
= ∑ (by (763)) = ∑
( x,y)∈W x ( x + y ) ( x,y)∈W y ( x + y )
(by (761)) (by (762))
1 1
= ∑ x ( x + y)
+1+ ∑
y ( x + y)
( x,y)∈W ( x,y)∈W
1 1
= ∑ + ∑
x ( x + y) ( x,y)∈W y ( x + y)
+1
( x,y)∈W
| {z }
1 1
!
= ∑ +
( x,y)∈W x ( x + y ) y ( x + y )
 
1 1 1
= ∑ + +1 = ∑ + 1.
( x,y)∈W |
x ( x + y ) y ( x + y ) ( x,y)∈W
xy
{z }
y+x 1
= =
xy ( x + y) xy

Comparing this with (759), we obtain

1 1 1
∑ + ∑
xy ( x,y)∈Z xy
= ∑
xy
+1
( x,y)∈W ( x,y)∈W

1 1
Subtracting ∑ from both sides of this equality, we obtain ∑ = 1.
( x,y)∈W xy ( x,y)∈ Z xy
This solves Exercise 8.3.1.

December 25, 2021


Math 235 notes page 768

Second solution to Exercise 8.3.1 (sketched). Let us rename the set Z as Zn , to stress its
1
dependence on n. Thus, we must compute ∑ . We claim that
( x,y)∈ Zn xy

1
∑ xy
= 1.
( x,y)∈ Zn

We shall prove this by induction on n:


1
Induction base: It is easy to see that ∑ = 1 for n = 1 (since the only
( x,y)∈ Zn xy
element of Z1 is the pair (1, 1)).
Induction step: Let m > 1 be an integer. Assume (as the induction hypothesis)
1 1
that ∑ = 1. We must prove that ∑ = 1.
( x,y)∈ Zm−1 xy ( x,y)∈ Zm xy
We shall achieve this by analyzing how Zm differs from Zm−1 . Recall the defini-
tions of these two sets:

• The set Zm consists of all pairs ( x, y) ∈ [m]2 satisfying x ⊥ y and x + y > m.

• The set Zm−1 consists of all pairs ( x, y) ∈ [m − 1]2 satisfying x ⊥ y and x + y >
m − 1.

Thus, roughly speaking, the sets Zm and Zm−1 agree in “most” of their elements.
To make this more precise, let us see which elements of Zm fail to belong to Zm−1 :

• An element ( x, y) ∈ Zm will always belong to Zm−1 , unless one of x and y


equals m (because x + y > m always implies x + y > m − 1, whereas ( x, y) ∈
[m]2 implies ( x, y) ∈ [m − 1]2 unless one of x and y equals m). Hence, the
1
sum ∑ can be split as follows:
( x,y)∈ Zm xy

1 1 1
∑ xy
= ∑ xy
+ ∑ xy
. (764)
( x,y)∈ Zm ( x,y)∈ Zm ; ( x,y)∈ Zm ;
( x,y)∈ Zm−1 one of x and y equals m

We can likewise analyze which elements of Zm−1 fail to belong to Zm :

• An element ( x, y) ∈ Zm−1 will always belong to Zm , unless x + y = m (because


x + y > m − 1 implies x + y > m unless x + y = m, whereas ( x, y) ∈ [m − 1]2
1
always implies ( x, y) ∈ [m]2 ). Hence, the sum ∑ can be split as
( x,y)∈ Zm−1 xy
follows:
1 1 1
∑ xy
= ∑ + ∑
xy ( x,y)∈Z ; xy
. (765)
( x,y)∈ Z m −1 ( x,y)∈ Z ; m −1 m −1
( x,y)∈ Zm x +y=m

December 25, 2021


Math 235 notes page 769

Now, subtracting (765) from (764), we obtain

1 1
∑ − ∑
xy ( x,y)∈ xy
( x,y)∈ Zm Z m −1
   
1 1  1 1 
∑ ∑ ∑ ∑
 
= + − + 

( x,y)∈ Zm ;
xy ( x,y)∈ Zm ;
xy  ( x,y)∈ Z
xy ( x,y)∈ Z
xy 
m −1 ; m −1 ;
( x,y)∈ Zm−1 one of x and y equals m ( x,y)∈ Zm x +y=m
1 1 1 1
= ∑ − ∑
xy ( x,y)∈ xy
+ ∑ xy
− ∑ xy
( x,y)∈ Zm ; Z m −1 ; ( x,y)∈ Zm ; ( x,y)∈ Zm−1 ;
( x,y)∈ Zm−1 ( x,y)∈ Zm one of x and y equals m x +y=m
| {z } | {z } | {z }
=0 = ∑ = ∑
(since these two sums are equal) ( x,y)∈[m]2 ; ( x,y)∈[m−1]2 ;
x ⊥y; x ⊥y;
( x =m or y=m) x +y=m

1 1
= ∑ xy
− ∑ xy
. (766)
( x,y)∈[m]2 ; ( x,y)∈[m−1]2 ;
x ⊥y; x ⊥y;
( x =m or y=m) x +y=m

Now, let us simplify the first sum on the right hand side. A pair ( x, y) ∈ [m]2
satisfying x ⊥ y cannot satisfy x = m and y = m simultaneously (because this
would mean that m ⊥ m, but this is impossible because of m > 1). Hence, we can

December 25, 2021


Math 235 notes page 770

1
split the sum ∑ as follows:
( x,y)∈[m]2 ;
xy
x ⊥y;
( x =m or y=m)

1 1 1
∑ xy
= ∑ xy
+ ∑ xy
( x,y)∈[m]2 ; ( x,y)∈[m]2 ; ( x,y)∈[m]2 ;
x ⊥y; x ⊥y; x ⊥y;
( x =m or y=m) x =m but not y=m y=m but not x =m
| {z } | {z }
1 1
= ∑ = ∑
y∈[m]; my x ∈[m]; xm
m⊥y; x ⊥m;
not y=m not x =m
1 1
= ∑ = ∑
y∈[m−1]; my x ∈[m−1]; xm
m⊥y x ⊥m

1 1
= ∑ my
+ ∑ xm
y∈[m−1]; x ∈[m−1];
m⊥y x ⊥m
| {z }
1
=∑
x ∈[m−1]; m (m − x )
m⊥m− x
(here, we have substituted m− x for y in the sum)
1 1
= ∑ + ∑
m (m − x ) x∈[m−1]; xm
x ∈[m−1];
m⊥m− x x ⊥m
| {z }
= ∑
x ∈[m−1];
x ⊥m
(since it is not hard
to see that m⊥m− x is
equivalent to x ⊥m)
 
1 1 1 1
= ∑ + ∑
m (m − x ) x∈[m−1]; xm
= ∑ +
m (m − x ) xm
x ∈[m−1]; x ∈[m−1]; | {z }
x ⊥m x ⊥m x ⊥m
1
=
x (m − x )
1
= ∑ x (m − x )
. (767)
x ∈[m−1];
x ⊥m

December 25, 2021


Math 235 notes page 771

Meanwhile, the second sum on the right hand side of (766) rewrites as follows:

1 1
∑ xy
= ∑ x (m − x )
( x,y)∈[m−1]2 ; x ∈[m−1];
x ⊥y; x ⊥m− x
x +y=m
| {z }
= ∑
x ∈[m−1];
x ⊥m
(since it is not hard
to see that x ⊥m− x is
equivalent to x ⊥m)

here, we have substituted ( x, m − x )


 
 for ( x, y) in the sum, since the 
condition x + y = m allows rewriting y as m − x
1
= ∑ . (768)
x ∈[m−1];
x (m − x )
x ⊥m

In view of (767) and (768), we can rewrite (766) as

1 1 1 1
∑ − ∑
xy ( x,y)∈ xy
= ∑ − ∑
x (m − x ) x∈[m−1]; x (m − x )
= 0.
( x,y)∈ Zm Z m −1 x ∈[m−1];
x ⊥m x ⊥m

Hence,
1 1
∑ xy
= ∑ xy
=1 (by the induction hypothesis) .
( x,y)∈ Zm ( x,y)∈ Z m −1

This completes the induction step. Thus, Exercise 8.3.1 is solved again.

A.9.2. Discussion of Exercise 8.3.2


Discussion of Exercise 8.3.2. First and foremost: The two parts of Exercise 8.3.2 come
from different subjects, but agree in the rough idea of their solution, which is to
compute the area of a shape (in part (a)) or the size of a set (in part (b)) by first
computing the area of a larger shape or the size of a larger set, and then subtracting
the part that was overcounted. In the case of the size of a finite set (which is what
we have in part (b)), this is a trick we have used many times before (always relying
on the difference rule – i.e., on Theorem 7.1.8). In the case of the area of a shape,
the conceptual grounding is more sophisticated (areas require measure theory to
rigorously define, whereas the size of a finite set is one of the most basic notions in
mathematics); but the idea is the same.

December 25, 2021


Math 235 notes page 772

Solution to Exercise 8.3.2 (sketched). (a) The two half-circles subdivide the quarter-
circle into four regions. We denote the areas of these four regions by b, r, x, y in the
following way:
C

x r

b y

A B .
444 Thus, the area of the red region is r, whereas the area of the blue region is b.
We claim that r = b.
Indeed, let a = | AB| = | AC |. Thus, the quarter-circle has radius a; hence, its area
1
is πa2 . In other words,
4
1
b + r + x + y = πa2 (769)
4
(since the quarter-circle has been subdivided into four regions with areas b, r, x, y,
and thus its area is b + r + x + y).
1 1
However, the lower semicircle has diameter AB and thus radius | AB| = a.
2 | {z } 2
=a
 2
1 1 1
Hence, its area is π a = πa2 . In other words,
2 2 8

1 2
b+y = πa (770)
8
(since the lower semicircle has been subdivided into two regions with areas b and
y, and thus its area is b + y).
A similar argument (using the upper semicircle instead of the lower one) shows
1
that b + x = πa2 . Subtracting this equality from (769), we obtain (b + r + x + y) −
8
444 Here is how to define b, r, x, y without referencing the picture: We shall refer to the semicircle
with diameter AB as the lower semicircle. We shall refer to the semicircle with diameter AC as
the upper semicircle. Let A (U ) denote the area of any shape U. Now, we set

b = A ((lower semicircle) ∩ (upper semicircle)) ;


r = A ((quarter-circle) \ ((lower semicircle) ∪ (upper semicircle))) ;
x = A ((upper semicircle) \ (lower semicircle)) ;
y = A ((lower semicircle) \ (upper semicircle)) .

December 25, 2021


Math 235 notes page 773

1 1 1
(b + x ) = πa2 − πa2 . This simplifies to r + y = πa2 . Comparing this with
4 8 8
(770), we obtain r + y = b + y. Hence, r = b. This solves Exercise 8.3.2 (a).
(b) Exercise 8.3.2 (b) is [17f-hw8s, Lemma 0.3], where I give three proofs. The
shortest of them is the second proof, which I will now reproduce:
The map σ is a permutation of [n], thus a bijection [n] → [n]. Hence, it has an
inverse map σ−1 . Now, the map
{i ∈ [ n ] | σ (i ) ≥ j } → {i ∈ [ n ] | i ≥ j } ,
i 7 → σ (i )
is clearly well-defined. Furthermore, this map is a bijection (indeed, its inverse
sends each i to σ−1 (i )). Hence, the bijection principle yields
|{i ∈ [n] | σ (i ) ≥ j}| = |{i ∈ [n] | i ≥ j}| .
In other words,
(# of all i ∈ [n] satisfying σ (i ) ≥ j) = (# of all i ∈ [n] satisfying i ≥ j) .
We have
 

# of all i ∈ [n] satisfying i ≥ j > σ (i )


 

| {z }
⇐⇒ (i ≥ j but not σ(i )≥ j)
= (# of all i ∈ [n] satisfying i ≥ j but not σ (i ) ≥ j)
= (# of all i ∈ [n] satisfying i ≥ j)
− (# of all i ∈ [n] satisfying i ≥ j and σ (i ) ≥ j)
(by the difference rule) and
 

# of all i ∈ [n] satisfying σ (i ) ≥ j > i


 

| {z }
⇐⇒ (σ(i )≥ j but not i ≥ j)
= (# of all i ∈ [n] satisfying σ (i ) ≥ j but not i ≥ j)
= (# of all i ∈ [n] satisfying σ (i ) ≥ j)
| {z }
=(# of all i ∈[n] satisfying i ≥ j)
(this has been shown above)
 

− # of all i ∈ [n] satisfying σ (i ) ≥ j and i ≥ j


 
| {z }
⇐⇒ (i ≥ j and σ(i )≥ j)
(by the difference rule)
= (# of all i ∈ [n] satisfying i ≥ j)
− (# of all i ∈ [n] satisfying i ≥ j and σ (i ) ≥ j) .

December 25, 2021


Math 235 notes page 774

Comparing these two equalities, we obtain

(# of all i ∈ [n] satisfying i ≥ j > σ (i )) = (# of all i ∈ [n] satisfying σ (i ) ≥ j > i ) .

This solves Exercise 8.3.2 (b).


Let us illustrate the claim of Exercise 8.3.2 (b) on an example:
Example A.9.1. Let n = 12 and let j = 6. Let σ be the permutation of
[n] that sends 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 to 9, 2, 6, 4, 8, 10, 1, 3, 7, 5, 12, 11, respec-
tively. As in Example 6.2.4 and Example 6.2.7, we can represent σ by a diagram:

1 3 2 5 4

7 9 6 10 8 12 11
.

Here, we have drawn the j − 1 nodes 1, 2, . . . , j − 1 above the red line, and drawn
the remaining n − j + 1 nodes j, j + 1, . . . , n below the red line. Now,

(# of all i ∈ [n] satisfying i ≥ j > σ (i ))

is the # of all arrows that cross the red line from bottom to top, whereas

(# of all i ∈ [n] satisfying σ (i ) ≥ j > i )

is the # of all arrows that cross the red line from top to bottom. (We assume
that no arrow crosses the red line more than once; this can be achieved, e.g., by
making all arrows straight.) Hence, Exercise 8.3.2 (b) says that the # of arrows
crossing the red line from bottom to top equals the # of arrows crossing the
red line from top to bottom. Stated in this way, this feels rather intuitive –
particularly if one remembers that the arrows form several disjoint cycles, and
each cycle must enter the top region as often as it leaves it. It is essentially a
manifestation of the “what goes in must come out” principle. This thinking can
actually be made rigorous, leading to a different solution to Exercise 8.3.2 (b).
(See [17f-hw8s, Third proof of Lemma 0.3] for this solution.)

A.10. Homework set #9 discussion


The following are discussions of the problems on homework set #9 (Section 8.4).

December 25, 2021


Math 235 notes page 775

A.10.1. Discussion of Exercise 8.4.1 (TODO: add details!)


Discussion of Exercise 8.4.1. Exercise 8.4.1 is [18s-mt2s, Exercise 1]. For the sake of
completeness, let us copy the solution from [18s-mt2s]. We will first need an auxil-
iary concept:
Definition A.10.1. Let n ∈ N and d ∈ N. Let h ∈ [d]. An n-tuple
( x1 , x2 , . . . , xn ) ∈ [d]n will be called h-even if the number h occurs in it an even
number of times (i.e., the number of i ∈ [n] satisfying xi = h is even). (For
example, the 3-tuple (1, 4, 4) is 4-even and 3-even but not 1-even.)
This definition generalizes the concept of “1-even” used in Exercise 7.8.1. Let us
now state the following generalization of Exercise 7.8.1:
Proposition A.10.2. Let n ∈ N, and let d be a positive integer. Let h ∈ [d]. Then,
1 n
the # of h-even n-tuples in [d]n is d + ( d − 2) n .

2
Indeed, Exercise 7.8.1 is the particular case of Proposition A.10.2 for h = 1; but
conversely, Proposition A.10.2 can be derived from Exercise 7.8.1 by “renaming 1
as h”.
Here is a rigorous way to make this “renaming” argument:
Proof of Proposition A.10.2 (sketched). There is clearly some permutation σ of [d] such that
σ (1) = h. (For example, we can let σ be the transposition swapping 1 with h when h 6= 1,
and otherwise we can just set σ = id.) Fix such a σ. It is easy to see that the map
[d]n → [d]n ,
( x1 , x2 , . . . , xn ) 7→ (σ ( x1 ) , σ ( x2 ) , . . . , σ ( xn ))
(that is, the map that applies σ to each entry of an n-tuple in [d]n ) is a bijection (since σ is
a bijection). Furthermore, an n-tuple ( x1 , x2 , . . . , xn ) ∈ [d]n is 1-even if and only if its image
(σ ( x1 ) , σ ( x2 ) , . . . , σ ( xn )) under this bijection is h-even (because the number 1 occurs in
the n-tuple ( x1 , x2 , . . . , xn ) at the same positions at which the number σ (1) = h occurs in
the n-tuple (σ ( x1 ) , σ ( x2 ) , . . . , σ ( xn ))). Thus, there is a bijection
1-even n-tuples in [d]n → h-even n-tuples in [d]n ,
 

( x1 , x2 , . . . , xn ) 7→ (σ ( x1 ) , σ ( x2 ) , . . . , σ ( xn )) .
Hence, we can use the bijection principle to see that
h-even n-tuples in [d]n = 1-even n-tuples in [d]n
 

= # of 1-even n-tuples in [d]n




1 n
d + ( d − 2) n

= (by our solution to Exercise 7.8.1) .
2
1 n
In other words, the # of h-even n-tuples in [d]n is d + (d − 2)n . This proves Proposition

2
A.10.2.
(Alternatively, of course, Proposition A.10.2 can be proved in the same way as we solved
Exercise 7.8.1, just with all “1”s in the appropriate places replaced by “h”s.)

December 25, 2021


Math 235 notes page 776

Solution to Exercise 8.4.1 (sketched). We first make the following claim:


Observation 1: Let h ∈ [d]. Then, the # of (n − 1)-tuples in [d]n−1 that are
1  n −1 n −1

not h-even is d − ( d − 2) .
2
[Proof of Observation 1: Proposition A.10.2 (applied to n − 1 instead of n) shows
n −1 1  n −1 n −1

that the # of h-even (n − 1)-tuples in [d] is d + ( d − 2) . In other
2
words,
  1  n −1 
# of h-even (n − 1) -tuples in [d]n−1 = d + ( d − 2 ) n −1 .
2
Now, the difference rule yields
 
n −1
# of (n − 1) -tuples in [d] that are not h-even
   
= # of all (n − 1) -tuples in [d]n−1 − # of h-even (n − 1) -tuples in [d]n−1
| {z } | {z }
= d n −1 1 n −1
= (d +(d−2)n−1 )
2
1  n −1  1  n −1 
= d n −1 − d + ( d − 2 ) n −1 = d − ( d − 2 ) n −1 .
2 2
n −1 1  n −1 n −1

In other words, the # of (n − 1)-tuples in [d] that are not h-even is d − ( d − 2) .
2
This proves Observation 1.]
We can construct each first-even n-tuple ( x1 , x2 , . . . , xn ) in [d]n as follows:
• First, we choose the value of x1 . We denote this value by h. There are d
options for this decision (since this value must belong to [d]).
• Next, we choose the (n − 1)-tuple ( x2 , x3 , . . . , xn ). Note that the entry h = x1
must occur an odd number of times in this (n − 1)-tuple ( x2 , x3 , . . . , xn ) (be-
cause we want the n-tuple ( x1 , x2 , . . . , xn ) to be first-even, so that x1 must oc-
cur an even number of times in this n-tuple; but the (n − 1)-tuple ( x2 , x3 , . . . , xn )
is missing its very first occurrence, and thus must contain it an odd number
of times). In other words, the (n − 1)-tuple ( x2 , x3 , . . . , xn−1 ) must not be h-
1  n −1 
even. Thus, there are d − (d − 2)n−1 options for this decision (since
2
Observation 1 yields that the number of (n − 1)-tuples in [d]n−1 that are not
1  n −1 n −1

h-even is d − ( d − 2) ).
2
Hence, the dependent product rule shows that the total # of first-even n-tuples
( x1 , x2 , . . . , xn ) in [d]n is
1  n −1  1  
d· d − ( d − 2 ) n −1 = d d n −1 − ( d − 2 ) n −1 .
2 2
This solves Exercise 8.4.1.

December 25, 2021


Math 235 notes page 777

A.10.2. Discussion of Exercise 8.4.2 (TODO: add details!)


Discussion of Exercise 8.4.2. Exercise 8.4.2 is a generalization of https://math.stackexchange.
com/questions/897948 (which is the particular case for p = 1). Let me sketch a
combinatorial and two algebraic solutions:
First solution to Exercise 8.4.2 (sketched). Let S be the 2n-element set {−1, −2, . . . , −n} ∪
{1, 2, . . . , n}. Let U be the set of all (n + p)-element subsets of S. For each i ∈ [n],
we let Ai be the set of all J ∈ U that contain neither i nor −i (that is, that satisfy
i∈/ J and −i ∈ / J). The Principle of Inclusion and Exclusion (specifically, Theorem
7.8.6) shows that

(# of x ∈ U satisfying x ∈
/ Ai for all i ∈ [n])
= ∑ (−1)| I | (# of x ∈ U satisfying x ∈ Ai for all i ∈ I ) . (771)
I ⊆[n]

Now, let us compute both the left and the right hand side of this equality, and
see what it then turns into.
The left hand side is an easy counting problem: We have

(# of x ∈ U satisfying x ∈ / Ai for all i ∈ [n])


= (# of J ∈ U satisfying J ∈ / Ai for all i ∈ [n])
(here, we have renamed the index x as J )
= (# of J ∈ U such that each i ∈ [n] satisfies either i ∈ J or − i ∈ J )
(by the definition of Ai )
 
n
= · 2n − p . (772)
p

Indeed, the last equality sign here follows from the dependent product rule, since
the following decision procedure can be used to construct a set J ∈ U such that
each i ∈ [n] satisfies either i ∈ J or −i ∈ J:

• We choose the p elements i ∈ [n] for which J will contain both i and −i.
(Make sure  understand why there should be exactly p such elements!)
 you
n
There are options for this decision.
p
• For each of the remaining n − p elements i ∈ [n], we decide whether J will
contain i or −i. (Indeed, J will have to contain exactly one of i and −i for each
of these i.) These are n − p decisions, and each of them allows for 2 options;
thus, we have 2n− p options here in total.

The right hand side of (771) is even easier to compute: If I is any subset of [n],

December 25, 2021


Math 235 notes page 778

then

(# of x ∈ U satisfying x ∈ Ai for all i ∈ I )


= (# of J ∈ U satisfying J ∈ Ai for all i ∈ I )
(here, we have renamed the index x as J )
= (# of J ∈ U such that each i ∈ [n] satisfies neither i ∈ J nor − i ∈ J )
(by the definition of Ai )
= (# of (n + p) -element subsets J of S \ (± I ))
(where ± I denotes the set I ∪ {−i | i ∈ I })
2n − 2 | I |
 
= (773)
n+p

(since |S \ (± I )| = |S| − |± I | = 2n − 2 | I |). Hence,


|{z} |{z}
=2n =2| I |

∑ (−1)| I | (# of x ∈ U satisfying x ∈ Ai for all i ∈ I )


I ⊆[n]
|  {z }
2n − 2 | I |

=
n+p
(by (773))
n
2n − 2 | I | 2n − 2 | I |
   
= ∑ (−1) |I|
n+p
= ∑ ∑ (−1) |I|
n+p
I ⊆[n] k =0 I ⊆[n];
|{z} | I |=k
n
=∑ ∑
| {z }

 
k =0 I ⊆[n]; n 2n 2k
=(−1)k
| I |=k k n+p
n
2n − 2k
  
n
= ∑ (−1) k
. (774)
k =0
k n + p

Hence, (771) becomes

(# of x ∈ U satisfying x ∈
/ Ai for all i ∈ [n])
= ∑ (−1)| I | (# of x ∈ U satisfying x ∈ Ai for all i ∈ I )
I ⊆[n]
n
2n − 2k
  
n
= ∑ (−1) k
(by (774)) .
k =0
k n+p

Comparing this with (772), we obtain


n
2n − 2k
      
k n n n− p n
∑ (−1) k n + p = p · 2 = 2 n− p
p
.
k =0

This solves Exercise 8.4.2.

December 25, 2021


Math 235 notes page 779

Our second solution to Exercise 8.4.2 is algebraic; it uses induction on n. The


main ingredient is the following simple lemma (which
 is generally quite useful for
n n
recursively simplifying sums of the form ∑ (−1)k a ):
k =0 k k
Lemma A.10.3. Let n be a positive integer. Let a0 , a1 , . . . , an be any n + 1 numbers.
Then,
n n −1
k n−1
   
k n
∑ (−1) k ak = ∑ (−1) k
( a k − a k +1 ) .
k =0 k =0

Proof of Lemma A.10.3. We have


n  
n
∑ (−1) k
k
ak
k =0 |{z }
n−1 n−1
 
= +
k−1 k
(by Theorem 4.3.7)
n
n−1 n−1
   
= ∑ (−1) k
+ ak
k =0 |
k−1 k
 {z }
n−1 n−1
 
=(−1)k ak +(−1)k ak
k−1 k
n 
k n−1 k n−1
    
= ∑ (−1) ak + (−1) ak
k =0
k − 1 k
n n
k n−1 k n−1
   
= ∑ (−1) ak + ∑ (−1) ak . (775)
k =0
k − 1 k =0
k

December 25, 2021


Math 235 notes page 780

n−1
 
/ N and thus
Now, 0 − 1 = −1 ∈ = 0 (by an application of (118)). Now,
0−1
n
n−1
 
∑ (−1) k − 1 ak
k

k =0
n
0 n−1 k n−1
   
= (−1) a0 + ∑ (−1) ak
0−1 k =1
k − 1
| {z }
=0
(here, we have split off the addend for k = 0 from the sum)
n
k n−1
 
= (−1) 0a0 + ∑ (−1)
0
a
| {z } k=1 k−1 k
=0
n n −1
n−1 n−1
   
= ∑ (−1) k
k − 1 k k∑
a = (−1) k +1
a
| {z } (k + 1) − 1 k+1
k =1 =0
=−(−1)k
|  {z  }
n−1
=
k
(here, we have substituted k + 1 for k in the sum)
n −1    n − 1 n −1
k n−1
 
= ∑ − (−1) k
ak+1 = − ∑ (−1) a k +1 . (776)
k =0
k k =0
k

∈ N. Hence,
Also, n ≥ 1 (since n is a positive integer), so that n − 1  Proposition
n−1

4.3.4 (applied to n − 1 and n instead of n and k) yields = 0 (since n >
n
n − 1). Now,
n
k n−1
 
∑ (−1) k
ak
k =0
n −1
n n−1 k n−1
   
= (−1) an + ∑ (−1) ak
n k = 0
k
| {z }
=0
(here, we have split off the addend for k = n from the sum)
n −1
k n−1
 
= (−1) 0an + ∑ (−1)
n
ak
| {z } k=0 k
=0
n −1
n−1
 
= ∑ (−1) k
k
ak . (777)
k =0

December 25, 2021


Math 235 notes page 781

Now, (775) becomes


n n n
n−1 k n−1
    
k n
∑ (−1) k ak = ∑ (−1) k − 1 ak + ∑ (−1)
k
k
ak
k =0 k =0 k =0
| {z  } | {z  }
n−1 n−1
 
n −1 n −1
=− ∑ (−1)k a k +1 = ∑ (−1)k ak
k =0 k k =0 k
(by (776)) (by (777))
n −1 n −1
n−1 k n−1
   
= − ∑ (−1) k
ak+1 + ∑ (−1) ak
k =0
k k =0
k
n −1 n −1
k n−1 k n−1
   
= ∑ (−1) ak − ∑ (−1) a k +1
k =0
k k =0
k
n −1 
k n−1 k n−1
    
= ∑ (−1) ak − (−1) a k +1
k =0 |
k k
 {z  }
n − 1
=(−1)k ( a k − a k +1 )
k
n −1
k n−1
 
= ∑ (−1) ( a k − a k +1 ) .
k =0
k

This proves Lemma A.10.3.


Second solution to Exercise 8.4.2. Forget that we fixed n and p. We proceed by induc-
tion on n:
Induction base: It is straightforward to see that each p ∈ Z satisfies
   
0 0− p 0
=2 . (778)
p p

December 25, 2021


Math 235 notes page 782

445Hence, it is easy to see that Exercise 8.4.2 holds for n = 0 446 .


Induction step: Let m be a positive integer. Assume (as the induction hypothesis)
that Exercise 8.4.2 holds for n = m − 1. We must prove that Exercise 8.4.2 holds for
n = m.
We have assumed that Exercise 8.4.2 holds for n = m − 1. In other words, each
p ∈ Z satisfies
m −1
m−1 2 (m − 1) − 2k m−1
    
∑ (−1) k
k m−1+ p
=2 m −1− p
p
. (779)
k =0

2m − 2k
 
Now, let p ∈ Z. Then, Lemma A.10.3 (applied to n = m and ak = )
m+p

445 Proof of (778): Let p ∈ Z. We are in one of the following three cases:
Case 1: We have p = 0.
Case 2: We have p > 0.
Case 3: We have p < 0.
Letusfirstconsider
 Case 1. In this case, we have p = 0. Thus, 20− p = 20−0 = 20 = 1, so that
0− p 0 0
2|{z} = . Thus, (778) holds. Hence, we have proved (778) in Case 1.
p p
=1
Let us now consider Case 2. In this   we have p > 0. Thus, Proposition
case,  4.3.4
 (applied to 0
0 0 − p 0
and p instead of n and k) yields that = 0. Comparing this with 2 = 0, we obtain
p p
| {z }
    =0
0 0
= 20− p . Hence, we have proved (778) in Case 2.
p p  
0
Finally, let us consider Case 3. In this case, we have p < 0. Thus, p ∈ / N, so that =0
    p  
0 0 0
(by an application of (118)). Comparing this with 20− p = 0, we obtain = 20 − p .
p p p
| {z }
=0
Hence, we have proved (778) in Case 3.
We have now proved (778) in all three Cases 1, 2 and 3. Thus, (778) always holds.
446 Proof. For each p ∈ Z, we have

0
2 · 0 − 2k 2·0−2·0
      
0 0 0
∑ (−1) k k
0+ p
= (−1)
| {z } 0 0+ p
k =0
=1 |{z} | {z }
=1
 
0
=
p
(since 2·0−2·0=0 and 0+ p= p)
   
0 0− p 0
= =2 (by (778)) .
p p

In other words, Exercise 8.4.2 holds for n = 0.

December 25, 2021


Math 235 notes page 783

yields
m
2m − 2k
  
m
∑ (−1) k k
m+p
k =0
m −1
k m−1 2m − 2k 2m − 2 (k + 1)
     
= ∑ (−1) − . (780)
k =0
k m + p m + p

2m − 2k 2m − 2 (k + 1)
   
We shall now simplify the difference − on the right
m+p m+p
side of this equality.
Indeed, it is easy to see that every n ∈ R and i ∈ R satisfy

n−2 n−2 n−2


       
n
− = +2 (781)
i i i−2 i−1
447 .

447 Proof of (781): Let n ∈ R and i ∈ R. Then, Theorem 4.3.7 (applied to k = i) yields

n−1 n−1
     
n
= +
i i−1 i
| {z } | {z }
n−1−1 n−1−1 n−1−1 n−1−1
       
= + = +
i−1−1 i−1 i−1 i
(by Theorem 4.3.7, (by Theorem 4.3.7,
applied to n−1 and i −1 applied to n−1 and i
instead of n and k) instead of n and k)
n−1−1 n−1−1 n−1−1 n−1−1
       
= + + +
i−1−1 i−1 i−1 i
n−1−1 n−1−1 n−1−1
     
= +2 +
i−1−1 i−1 i
n−2 n−2 n−2
     
= +2 +
i−2 i−1 i

n−2
 
(since n − 1 − 1 = n − 2 and i − 1 − 1 = i − 2). Subtracting from both sides of this
i
equality, we obtain
n−2 n−2 n−2
       
n
− = +2 .
i i i−2 i−1
Thus, (781) is proven.

December 25, 2021


Math 235 notes page 784

Now, for each k ∈ Z, we have

2m − 2k 2m − 2 (k + 1)
   

m+p m+p
2m − 2k 2m − 2k − 2
   
= − (since 2m − 2 (k + 1) = 2m − 2k − 2)
m+p m+p
2m − 2k − 2 2m − 2k − 2
   
= +2
m+ p−2 m+ p−1
(by (781) (applied to n = 2m − 2k and i = m + p))
2 (m − 1) − 2k 2 (m − 2) − 2k
   
= +2 . (782)
( m − 1) + ( p − 1) ( m − 1) + p

(since m + p − 2 = (m − 1) + ( p − 1) and m + p − 1 = (m − 1) + p and 2m − 2k −

December 25, 2021


Math 235 notes page 785

2 = 2 (m − 1) − 2k). Hence, (780) becomes


m
2m − 2k
  
k m
∑ (−1) k m+p
k =0
m −1
k m−1 2m − 2k 2m − 2 (k + 1)
     
= ∑ (−1) −
k =0
k m+p m+p
| {z } 
2 (m − 1) − 2k 2 (m − 2) − 2k
 
= +2
( m − 1) + ( p − 1) ( m − 1) + p
(by (782))
m −1
m−1 2 (m − 1) − 2k 2 (m − 2) − 2k
     
= ∑ (−1) k
+2
k =0
k ( m − 1 ) + ( p − 1 ) ( m − 1) + p
| {z } 
m−1 2 (m − 1) − 2k m−1 2 (m − 2) − 2k
   
=(−1)k +2·(−1)k
k ( m − 1) + ( p − 1) k ( m − 1) + p
m −1
k m−1 2 (m − 1) − 2k k m−1 2 (m − 2) − 2k
      
= ∑ (−1) + 2 · (−1)
k =0
k ( m − 1 ) + ( p − 1 ) k ( m − 1) + p
m −1
k m−1 2 (m − 1) − 2k
  
= ∑ (−1)
k ( m − 1) + ( p − 1)
|k=0 {z }


m 1
=2m−1−( p−1)
p−1
(by (779), applied to p−1 instead of p)
m −1
m−1 2 (m − 2) − 2k
 
+2· ∑ (−1) k
k ( m − 1) + p
k =0
| {z }

 
m 1
=2m −1− p
p
(by (779))
m−1 m−1
   
m−1−( p−1) m −1− p
= 2| + 2| · 2 {z
{z } p−1 } p
=2m − p =2(m−1− p)+1 =2m− p
(since m−1−( p−1)=m− p) (since (m−1− p)+1=m− p)
m−1 m−1 m−1 m−1
       
m− p
=2 + 2m − p =2 m− p
+ .
p−1 p p−1 p
Comparing this with

m−1 m−1
     
m− p m m− p
2 =2 + ,
p p−1 p
|{z 
}
m−1 m−1
 
= +
p−1 p
(by Theorem 4.3.7,
applied to n=m and k= p)

December 25, 2021


Math 235 notes page 786

we obtain
m
2m − 2k
    
m m− p m
∑ (−1) k k
m+p
=2
p
.
k =0
Forget that we fixed p. We thus have shown that every p ∈ Z satisfies
m
2m − 2k
    
k m m− p m
∑ (−1) k m + p
=2
p
.
k =0

In other words, Exercise 8.4.2 holds for n = m. This completes the induction step.
Thus, Exercise 8.4.2 is solved again.
Our third solution to Exercise 8.4.2 is algebraic as well, but unlike our rather
down-to-earth second solution above, it relies on several binomial identities (while
avoiding the use of induction). The first one is the following identity ([19fco-hw3s,
§6.6, Theorem 6.13]):
Lemma A.10.4. Let p ∈ N and q ∈ R. Then,
p
x−i x−p
    
p
∑ (−1) i i
q
=
q−p
for all x ∈ R.
i =0

References to the proof of Lemma A.10.4. Lemma A.10.4 is proved in [19fco-hw3s, §6.6,
Theorem 6.13]. (The proof proceeds by first reducing it to the case q ∈ N, which
constitutes [19fco-hw3s, Exercise 6], and then solving the latter exercise in four
different ways. The fourth solution is particularly of note, as it involves finite dif-
ferences of integer sequences, which are a variation on the finite differences of
polynomials we have seen in Example 5.4.2. It can easily be rewritten in terms of
the latter.)
Our next binomial identity is a mashup of Corollary 4.3.17 with the trinomial
revision formula:
Lemma A.10.5. Let n ∈ N and p ∈ Z. Then,
n     
n k n− p n
∑ k p =2 p
.
k =0

Proof of Lemma A.10.5. We are in one of the following three cases:


Case 1: We have p < 0.
Case 2: We have p > n.
Case 3: We have neither p < 0 nor p > n.

December 25, 2021


Math 235 notes page 787

Let us first consider Case 1. In  case, we have p <


 this  0. / N. Hence,
 Thus, p ∈
n n
(118) (applied to k = p) yields = 0. Hence, 2n− p = 0. Comparing this
p p
| {z }
=0
with
n     n  
n k n
∑ k p
= ∑
k
0 = 0,
k =0 | {z } k =0
=0
(by (118),
∈N)
since p/
    
n n k n
we obtain ∑ =2 n − p . Thus, Lemma A.10.5 is proved in Case 1.
k =0 k p p  
n
Let us next consider Case 2. In this case, we have p > n. Hence, = 0 (by
p
Proposition 4.3.4, applied to k = p).
Let k ∈ {0, 1, . . . , n}. Then, k ≤ n < p (since p > n), thus p> k. Hence,
k
Proposition 4.3.4 (applied to k and p instead of n and k) yields = 0. Hence,
   p
n k
= 0.
k p
| {z }
=0   
n k
Forget that we fixed k. We thus have proved the equality = 0 for
k p
each k ∈  1, . . ., n}. Summing these equalities over all k∈{0, 1, . . . , n}, we
{0,
n n k n n
obtain ∑ = ∑ 0 = 0. Comparing this with 2n− p = 0, we obtain
k =0 k p k =0 p
| {z }
     =0
n n k n
∑ = 2n − p . Thus, Lemma A.10.5 is proved in Case 2.
k =0 k p p
Let us finally consider Case 3. In this case, we have neither p < 0 nor p > n.
Hence, we have p ≥ 0 (since we don’t have p < 0) and p ≤ n (since we don’t have
p > n). From p ≤ n, we obtain n ≥ p, and thus n − p ∈ N. Also, from p ≥ 0, we
obtain − p ≤ 0 ≤ n − p (since n − p ∈ N) and p ∈ N. Now,
n n  
n−p
   
n k n
∑ k p
= ∑
p k−p
k =0 k =0
|  {z } 
n n−p
=
p k−p
(by Proposition 7.5.2
(applied to a=k and b= p))
  n 
n−p

n
p k∑
= . (783)
=0
k−p

December 25, 2021


Math 235 notes page 788

/ N (since k ≤ −1 < 0) and


However, each k ∈ {− p, − p + 1, . . . , −1} satisfies k ∈
thus
n−p
 
=0 (784)
k
(by (118)). Now,
n  n− p 
n−p n−p
 
∑ k−p = ∑ k
(here, we have substituted k for k − p in the sum)
k =0 k=− p
−1  n− p 
n−p n−p
 
= ∑ + ∑
k
k=− p | {z } k =0
k
| {z }
=0 =2n − p
(by (118) (by Corollary 4.3.17
(since k∈/N)) (applied to n− p instead of n))

(here, we have split the sum at k = 0 (since − p ≤ 0 ≤ n − p))


−1
= ∑ 0 +2n − p = 2n − p .
k=− p
| {z }
=0

Thus, (783) becomes


n      n 
n−p
    
n k n n n− p n− p n
∑ k p = p ∑ k−p = p 2 =2 p
.
k =0 k =0
| {z }
=2n − p

Thus, Lemma A.10.5 is proved in Case 3.


We have now proved Lemma A.10.5 in all three Cases 1, 2 and 3. Thus, Lemma
A.10.5 always holds.
We need yet another simple binomial identity (a “symmetric” form of the trino-
mial revision formula for nonnegative integer arguments):
Lemma A.10.6. Let n, i, k ∈ N. Then,

n−i n−k
     
n n
= .
i k k i

Proof of Lemma A.10.6. Theorem 7.5.4 (applied to a = n − i and b = k) yields


n−i n−k
     
n n
= . (785)
n−i k k (n − i ) − k
However, Theorem 4.3.10 (applied to i instead of k) yields
   
n n
= .
i n−i

December 25, 2021


Math 235 notes page 789

n−i
 
Multiplying both sides of this equality by , we obtain
k

n−i n−i
     
n n
=
i k n−i k
n−k
  
n
= (by (785)) . (786)
k (n − i ) − k
Now, we are in one of the following two cases:
Case 1: We have k ≤ n.
Case 2: We have k > n.
Let us first consider Case 1. In this case, we have k ≤ n. Thus, n − k ∈ N. Hence,
Theorem 4.3.10 (applied to n − k and i instead of n and k) yields

n−k n−k n−k


     
= = (787)
i (n − k) − i (n − i ) − k

(since (n − k ) − i = (n − i ) − k). Now, (786) becomes

n−i n−k n−k


        
n n n
= = .
i k k (n − i ) − k k i
|  {z  }
n−k
=
i
(by (787))

Thus, Lemma A.10.6 is proved in Case 1.  


n
Let us now consider Case 2. In this case, we have k > n. Thus, = 0 (by
k
Proposition 4.3.4). Now, (786) becomes

n−i n−k
     
n n
= = 0.
i k k (n − i ) − k
| {z }
=0

n−k
  
n
Comparing this with = 0, we obtain
k i
| {z }
=0

n−i n−k
     
n n
= .
i k k i

Thus, Lemma A.10.6 is proved in Case 2.


We have thus proved Lemma A.10.6 in both Cases 1 and 2. Thus, Lemma A.10.6
always holds.

December 25, 2021


Math 235 notes page 790

Third solution to Exercise 8.4.2 (sketched). It is easy to see that Exercise 8.4.2 holds if
n + p < 0 448 . Thus, we WLOG assume that n + p ≥ 0. Hence, n + p ∈ N (since
n + p is an integer).

448 Proof. Assume / N. Hence, each k ∈ {0, 1, . . . , n} satisfies


that n + p < 0. Then, n + p ∈
2n − 2k
 
= 0 (by (118)). Thus,
n+p
n n
2n − 2k
    
n k n
∑ (−1) k k
n+p
= ∑ (−1)
k
0 = 0. (788)
k =0 | {z } k=0
=0
 
n
On the other hand, p = (n + p) − |{z} / N. Hence,
n < 0 and thus p ∈ = 0 (by (118)). Thus,
| {z } p
<0 >0
 
n
2n − p = 0.
p
| {z }
=0

2n − 2k
    
n n n
k n − p
Comparing this with (788), we obtain ∑ (−1) = 2 . Hence, Exercise
k =0 k n + p p
8.4.2 is solved under the assumption that n + p < 0.

December 25, 2021


Math 235 notes page 791

Now, we have
n
2n − 2k
  
n
∑ (−1) k n + p
k

k =0
n
2n − 2i
   
i n
= ∑ (−1)
i =0
i n+p
 | {z }
(n − i ) + (n − i )

=
n+p
n−i n−i
 
n+ p
=∑
k =0 k n+p−k
(by Proposition 7.5.1,
applied to n−i, n−i and n+ p instead of x, y and n)
n n+ p 
n−i n−i
   
n
= ∑ (−1) i
∑ k
i =0
i k =0
n+p−k
|  {z }
n−i n−i
 
n
=∑
k =0 k n+p−k
(here, we have changed the upper range of the summation;
indeed, it is not hard to see that all addends with k>n
are zero, as are all addends with k>n+ p, so that the value
of the sum is not affected by our change)
n  n 
n−i n−i
  
n
= ∑ (−1) i
i k ∑ n+p−k
i =0 k =0
n n
n−i n−i
    
n
= ∑ ∑ (−1) i
i
k n+p−k
k =0 i =0 | {z }
n n−k
=
k i
(by Lemma A.10.6)
n n
n−k n−i
   
i n
= ∑ ∑ (−1)
k =0 i =0
k i n+p−k
n n
i n−k n−i
    
n
= ∑ ∑ (−1)
k =0
k i =0
i n+p−k
| {z }
n−k n−i
 
n−k
= ∑ (−1)i
i =0 i n+p−k
(here, we removed all addends with i >n−k,
since these addends were 0 anyway)
n n−k
n−k n−i
   
n
= ∑ ∑ (−1) i

k =0
k i =0
i n+p−k
|  {z  }
n − (n − k)
=
(n + p − k) − (n − k)
(by Lemma A.10.4,
applied to p=n−k and q=n+ p−k and x =n)

December 25, 2021


Math 235 notes page 792

n n   
n − (n − k)
    
n n k n− p n
= ∑ = ∑ =2
k =0
k (n + p − k) − (n − k) k = 0
k p p
| {z  }
k
=
p
(by Lemma A.10.5). This solves Exercise 8.4.2 again.

A.10.3. Discussion of Exercise 8.4.3 (TODO: add details!)


Discussion of Exercise 8.4.3. Exercise 8.4.3 is problem 11 from the IMO Shortlist 1991
(except that we have replaced the number 1991 by n). The key to the solution is the
following variant (and corollary) of Proposition 4.9.18:
Proposition A.10.7. Let a and b be two numbers such that a 6= 0. Let
( x0 , x1 , x2 , . . .) be an ( a, b)-recurrent sequence with x0 = 0 and x1 = 1. Let
n ∈ {1, 2, 3, . . .}. Then,
n −1
n − k n−2k k
 
1 1
( xn+1 + bxn−1 ) = ∑ a b .
n k =0
n−k k

 
0
Proof of Proposition A.10.7. We have n > 0 (since n ∈ {1, 2, 3, . . .}). Thus, =0
n
(by Proposition 4.3.4, applied to 0 and n instead of n and k).
We have n ∈ {1, 2, 3, . . .} ⊆ {−1, 0, 1, . . .}. Thus, Proposition 4.9.18 yields
n 
n − k n−2k k

x n +1 = ∑ a b
k =0
k
n −1 
n − k n−2k k n − n n−2n n
  
= ∑ a b + a b
k =0
k n
| {z }
0
= =0
n
(here, we have split off the addend for k = n from the sum)
n −1
n − k n−2k k
 
= ∑ a b + 0a n−2n n
{z b}
k =0
k |
=0
n −1 
n − k n−2k k

= ∑ a b . (789)
k =0
k

December 25, 2021


Math 235 notes page 793

From n ∈ {1, 2, 3, . . .}, we obtain n − 2 ∈ {−1, 0, 1, . . .}. Hence, Proposition 4.9.18


(applied to n − 2 instead of n) yields
n −2 
n − 2 − k (n−2)−2k k

x(n−2)+1 = ∑ a b
k =0
k
n −1 
n − 2 − ( k − 1)

= ∑ a(n−2)− 2( k −1)
b k −1
k =1 |
k−1 | {z }
n−2k
 {z  } (since (n−2=)−a 2(k−1)=n−2k)
n−k−1
=
k−1
(since n−2−(k−1)=n−k−1)
(here, we have substituted k − 1 for k in the sum)
n −1 
n − k − 1 n−2k k−1

= ∑ k−1
a b .
k =1

Multiplying both sides of this equality by b, we find


n −1 
n − k − 1 n−2k k−1 n−1 n − k − 1 n−2k k−1
  
bx(n−2)+1 = b ∑ a b = ∑ a |bb{z }
k =1
k−1 k =1
k−1
=bk
n −1
n − k − 1 n−2k k
 
= ∑ a b .
k =1
k − 1
Comparing this with
n −1 
n − k − 1 n−2k k n − 0 − 1 n−2·0 0 n−1 n − k − 1 n−2k k
    
∑ k−1 a b = 0−1 a b +∑
k − 1
a b
k =0 | {z } k =1
=0
(by (118)
(since 0−1/∈N))
(here, we have split off the addend for k = 0 from the sum)
n −1 
n − k − 1 n−2k k

| {z b} + ∑
n −2·0 0
= 0a a b
k = 1
k−1
=0
n −1 
n − k − 1 n−2k k

= ∑ a b ,
k =1
k − 1
we obtain
n −1 
n − k − 1 n−2k k

∑ k−1
a b = bx(n−2)+1 = bxn−1 (790)
k =0
(since (n − 2) + 1 = n − 1).
However, every k ∈ {0, 1, . . . , n − 1} satisfies
n−k n−k n−k−1
     
1 1
= + . (791)
n−k k n k k−1

December 25, 2021


Math 235 notes page 794

[Proof of (791): Let k ∈ {0, 1, . . . , n − 1}. Then, k ≤ n − 1 < n, so that k 6= n and


thus n − k 6= 0. Thus, we can divide by n − k. Also, we can divide by n (since
n > k ≥ 0 and thus n 6= 0).
Now, Lemma A.4.9 (applied to n − k instead of n) yields

n−k−1 n−k
   
(n − k) =k . (792)
k−1 k

Now,

n−k 1 n−k n−k n−k


        
1 1 1 k
− = − =
n−k k n k n−k n k n (n − k) k
| {z }
k
=
n (n − k)
n−k
 
1
= k
n (n − k) k
|  {z } 
n−k−1
=(n−k)
k−1
(by (792))
n−k−1 1 n−k−1
   
1
= (n − k) = .
n (n − k) k−1 n k−1

1 n−k
 
Adding to both sides of this equality, we find
n k

n−k 1 n−k 1 n−k−1 n−k n−k−1


         
1 1
= + = + .
n−k k n k n k−1 n k k−1

This proves (791).]

December 25, 2021


Math 235 notes page 795

Now,
n −1
n−k
 
1
∑ n − k k
an−2k bk
k =0 | {z }
 
n−k n−k−1
 
1
=  + 
n k k−1
(by (791))
n −1
n−k n−k−1
   
1
= ∑ + an−2k bk
k =0
n k k−1
1 n −1 n−k n−k−1
   
= ∑ + an−2k bk
n k =0 k k−1
1 n−1 n − k n−2k k 1 n−1 n − k − 1 n−2k k
   
= ∑ a b + ∑ a b
n k =0 k n k =0 k−1
| {z } | {z }
= x n +1 =bxn−1
(by (789)) (by (790))
1 1 1
= xn+1 + bxn−1 = ( xn+1 + bxn−1 ) .
n n n
This proves Proposition A.10.7.
Now, solving Exercise 8.4.3 is a matter of finding the right ( a, b)-recurrent se-
quence:
Solution to Exercise 8.4.3 (sketched). Set a = 1 and b = −1. Thus, a = 1 6= 0.
Consider the sequence ( g0 , g1 , g2 , . . .) defined in Example 4.7.7. This sequence
( g0 , g1 , g2 , . . .) is (1, −1)-recurrent. In other words, it is ( a, b)-recurrent (since a = 1
and b = −1). Moreover, it satisfies g0 = 0 and g1 = 1. Thus, Proposition A.10.7
(applied to xi = gi ) yields
n −1
n−k
 
1 1
( gn+1 + bgn−1 ) = ∑ n−2k
|a {z } bk
n k =0
n − k k |{z}
=1n−2k =(−1)k
(since a=1) (since b=−1)

n −1
n − k n−2k n −1
(−1)k n − k
   
1
= ∑ 1| {z } (−1) = ∑
k

k =0
n − k k k =0
n−k k
=1
n −1
(−1)i n − i
 
= ∑ .
i =0
n−i i

Hence,
 
n −1 i
n−i

(−1) 1 1
∑ n−i i
=
n
b g n −1  = ( g n +1 − g n −1 ) .
gn+1 + |{z}
n
i =0 =−1

December 25, 2021


Math 235 notes page 796

Thus, in order to solve Exercise 8.4.3, it suffices to prove the equality

gn+1 − gn−1 = (−1)(n+1)//3 (1 + [3 | n]) . (793)

But this is entirely straightforward: Both sides of this equality depend only on the
remainder n%6 (not on n itself), because the sequence ( g0 , g1 , g2 , . . .) is 6-periodic
(as we have seen in Example 4.7.7). Thus, in order to prove it for all positive
integers n, it suffices to prove it for all n ∈ {1, 2, 3, 4, 5, 6} only (since these 6 values
of n represent all possible remainders that n%6 can take). But this can be done
mechanically.449 This solves Exercise 8.4.3.

A.10.4. Discussion of Exercise 8.4.4 (TODO: add details!)


Discussion of Exercise 8.4.4. Exercise 8.4.4 is a quickie. The answers to both parts (a)
and (b) are “mn − 1 moves”. No matter how you are breaking up the chocolate, you
will always have it broken down into 1 × 1-pieces after mn − 1 moves (no fewer, no
more).
Indeed, any time you make a move, the # of pieces of chocolate increases by 1.
Thus, it will take precisely mn − 1 moves to get this # from its initial value 1 to
its final value mn (which it has to take if we have broken up the entire bar into
1 × 1-squares; after all, the total area of the chocolate is invariant).

449 Here are a few more details: Let us forget that we fixed n. Thus, we must prove (793) for all
positive integers n. In other words, we must prove that the two sequences

( gn+1 − gn−1 )n∈{1,2,3,...} = ( g2 − g0 , g3 − g1 , g4 − g2 , g5 − g3 , g6 − g4 , . . .)

and
 
(−1)(n+1)//3 (1 + [3 | n])
n∈{1,2,3,...}
 
2//3
= (−1) (1 + [3 | 1]) , (−1)3//3 (1 + [3 | 2]) , (−1)4//3 (1 + [3 | 3]) , . . .

are identical. But both of these two sequences are 6-periodic (indeed, the sequence
( gn+1 − gn−1 )n∈{1,2,3,...} is 6-periodic because the sequence ( g0 , g1 , g2 , . . .) is 6-periodic; mean-
 
while, the sequence (−1)(n+1)//3 (1 + [3 | n]) is 6-periodic because it is straightfor-
n∈{1,2,3,...}
ward to see that
(
(n+1)//3 1, if n%6 ∈ {0, 1, 5} ;
(−1) = and
−1, if n%6 ∈ {2, 3, 4}
(
1, if n%6 ∈ {1, 2, 4, 5} ;
1 + [3 | n ] =
2, if n%6 ∈ {0, 3}

for each n ∈ Z). Hence, in order to prove that these two sequences are identical, it suffices to
show that they agree in their first 6 entries. But this is mechanical.

December 25, 2021


Math 235 notes page 797

A.10.5. Discussion of Exercise 8.4.5 (TODO: add details!)


Discussion of Exercise 8.4.5. Exercise 8.4.5 is a simple application of invariants.
Indeed, if a state has the numbers a, b, c, d, e, f written into the 6 sectors as fol-
lows:

b
a c

f d
e

,
then we define the fingerprint of this state as the number a − b + c − d + e − f .
It is easy to see that each move leaves the fingerprint of the state unchanged
(since, for example,

( a + 1) − ( b + 1) + c − d + e − f = a − b + c − d + e − f

for any numbers a, b, c, d, e, f ). The fingerprint of the initial state (in which the
numbers are 1, 0, 1, 0, 0, 0) is 1 − 0 + 1 − 0 + 0 − 0 = 2; thus, it remains 2 throughout
the process. Hence, it can never become 0. This entails that the numbers can never
all become equal (because if all numbers are equal, then the fingerprint of the state
is a − a + a − a + a − a = 0). In other words, you cannot ensure that all six sectors
have the same number written in them. This solves Exercise 8.4.5.
Exercise 8.4.5 is [Engel98, Chapter 1, Example E3].

A.10.6. Discussion of Exercise 8.4.6 (TODO: add details!)


Discussion of Exercise 8.4.6. The word “maximum” is a red herring. In truth, no
matter what moves you make, the number of cents you will have gained by  the

n
end of the procedure (i.e., by the time you are left with n heaps) is always .
2
Here are two ways to prove this:
First proof: Apply strong induction on n. Let’s say that in the first move, you
split the original heap (with n chips) into one heap with a chips and one heap
with b chips; thus you gain ab cents. Note that a + b = n and a < n and b <
n. Then you keep making moves, until you have disassembled both heaps into 
a
many one-chip heaps. By the induction hypothesis, we know that you gain
2
b
cents from disassembling the a-chip heap (since a < n) and that you gain
2
cents from disassembling the b-chip heap (since b < n). Hence, in total, you gain

December 25, 2021


Math 235 notes page 798

         
a b a b n
ab + + cents. But since ab + + = (check this!), this shows
2 2  2 2 2
n
that you gain cents. This completes the induction step.
2
Second proof: Let me define a dispersed couple to mean a set {u, v} of two chips
that lie in different heaps. Of course, this concept depends on the state. In the
initial state, there are no dispersed couples, since all chips lie in the same heap. In
the end state (whenyou  are left with n heaps, each containing exactly one chip),
n
there are precisely dispersed couples (since any two distinct chips form a
2
dispersed couple). Thus, any set {u, v} of two chips becomes a dispersed couple in
one of your moves (and then remains a dispersed couple forever, since there are no
moves that would bring chips from different heaps back together). Furthermore,
the number of cents you gain from a move is precisely the number of dispersed
couples that are created by this move (i.e., the number of sets {u, v} of two chips
that were not a dispersed couple before the move, but are a dispersed couple after
the move). Thus, the total number of cents you gain during the game is the total
number
  of dispersed couples created by the end of the game. But this latter number
n
is (since the initial state has no dispersed couples, whereas the end state has
 2
n
of them). This, again, proves our claim.
2

A.10.7. Discussion of Exercise 8.4.7 (TODO: add details!)


Discussion of Exercise 8.4.7. Exercise 8.4.7 is Exercise 1 on the USAJMO 2019. For
now, I refer there (or to https://artofproblemsolving.com/wiki/index.php/2019_
USAJMO_Problems/Problem_1 or to https://www.maa.org/sites/default/files/
pdf/AMC/usamo/2019/2019-USAJMO-Solutions.pdf ) for the solution.

A.10.8. Discussion of Exercise 8.4.8 (TODO: add details!)


Discussion of Exercise 8.4.8. Exercise 8.4.8 is not just superficially similar to Exercise
8.2.7; it can also be solved by the same kind of reasoning. I shall outline the solution
briefly, mostly just focussing on what is different:
Solution to Exercise 8.4.8 (sketched). Let V be the set of all violinists. We identify any
state with the finite subset

{(i, v) | i ∈ Z, and v is a violinist staying in room i }

of Z × V. Thus, states are finite subsets of Z × V. For example, the state shown in
(400) is the subset
{(3, a) , (3, b) , (4, c) , (5, d) , (5, e)}

December 25, 2021


Math 235 notes page 799

of Z × V (assuming that the cells shown in (400) correspond to the rooms 1, 2, . . . , 11).
For another example, the subset {(1, α) , (1, β) , (4, γ)} of Z × V (with α, β, γ being
three distinct violinists) is the state in which the two violinists α and β are staying
in room 1 and the violinist γ is staying in room 4 (and there are no other violinists
in the hotel).
Thus, any move removes two pairs of the form (i, α) and (i, β) from the state and
inserts the two pairs (i − 1, α) and (i + 1, β) into the state. (Here, of course, α is the
violinist that moves to room i − 1, and β is the violinist that moves to room i + 1.)
If S ⊆ Z × V is any state, then Occ S shall denote the set of all occupied rooms
in S. Thus,
Occ S = {i | (i, v) ∈ S} .
This is a finite subset of Z.
We define the entropy of a state S to be the sum ∑ 2i (recalling that S is a finite
(i,v)∈S
subset of Z × V). This is a rational number (since the sum is finite).
It is easy to see that this entropy increases each night. In other words:
Claim 1: Whenever two violinists move apart, the entropy of the state
increases.
[Proof of Claim 1: Similar to the proof of Claim 1 in the solution to Exercise 8.2.7.]
Once again (as in the solution to Exercise 8.2.7), this is useful but not sufficient to
solve the exercise. Again, we need to show that only finitely many possible states
can be reached.
Let us do this. We let N be the # of violinists in the hotel. (Clearly, this # does
not change during the process.) We shall show that the violinists never move “too
far” away from their original rooms; more precisely, they will always stay within
2N rooms of the interval between the leftmost and the rightmost room occupied in
the initial state. We shall now make this precise.
Let S0 be the initial state. Consider a sequence of g (successive) moves, starting
from state S0 and leading to states S1 , S2 , S3 , . . . , Sg in this order (i.e., the first move
transforms state S0 into state S1 ; the next move transforms state S1 into state S2 ;
and so on). As in the solution to Exercise 8.2.7, we have
N = | S0 | = | S1 | = · · · = S g . (794)
We WLOG assume that N > 0. Thus, the sets S0 , S1 , . . . , Sg are nonempty finite
sets (because (794) shows that each of them has N elements); therefore, so are the
sets Occ (S0 ) , Occ (S1 ) , . . . , Occ Sg . Hence,
 the minima and maxima of these lat-
ter sets Occ (S0 ) , Occ (S1 ) , . . . , Occ Sg are well-defined. Let α = min (Occ (S0 ))
and ω = max (Occ (S0 )). (Note that the sets Occ (S0 ) , Occ (S1 ) , . . . , Occ Sg are
going to play some of the roles that the sets S0 , S1 , . . . , Sg used to play in our so-
lution to Exercise 8.2.7. In the latter solution, violinists could not be roommates,
which is why we didn’t have to introduce Occ S.)
Now, we shall see that the violinists don’t spread “too fast” through the hotel.
To be more specific, we claim the following:

December 25, 2021


Math 235 notes page 800

Claim 2: We have min (Occ (Si+1 )) ≥ min (Occ (Si )) − 1 for each i ∈
{0, 1, . . . , g − 1}.

[Proof of Claim 2: This is similar to proving Claim 2 in the solution of Exercise


8.2.7, but easier, since no violinist moves by more than 1 room in a single night.]
We next introduce another notation. If S is any finite subset of Z, then we define
the subset S0+ of Z by

S0+ = S ∪ {s + 1 | s ∈ S} = {i ∈ Z | i ∈ S or i − 1 ∈ S} .

In other words, S0+ is the set of all integers i that belong to S themselves or have
their left neighbor i − 1 belong to S. Clearly, for any finite subset S of Z, we have

S 0+ ≤ 2 · | S | (795)

(this follows easily from (277)) and

S ⊆ S 0+ . (796)

Our next claim shows that if at least one of two consecutive rooms is occupied at
some point, then this property will remain valid in all future states (even though it
will not always be the same room that is occupied, or even the same # of rooms):

Claim 3: We have (Occ (Si ))0+ ⊆ (Occ (Si+1 ))0+ for each i ∈ {0, 1, . . . , g − 1}.

[Proof of Claim 3: This is similar to proving Claim 3 in the solution of Exercise


8.2.7, but easier, since we only need to take care of two (not three) adjacent rooms.]
Let us draw some conclusions
 from Claim 3. It is not true that Occ (S0 ) ⊆
Occ (S1 ) ⊆ · · · ⊆ Occ Sg , since an occupied room can become unoccupied after a
move. However, Claim 3 shows that we have
0+
(Occ (S0 ))0+ ⊆ (Occ (S1 ))0+ ⊆ · · · ⊆ Occ Sg . (797)

In words, this is saying that if a room or the next room to its right is occupied at
some time, then it will always remain the case that this room or the next room is
occupied.
In the rest of this solution, we shall use the notation [ p, q] for the integer interval
{ p, p + 1, . . . , q}, just as we did in the solution of Exercise 8.2.7.
Our next claim will show that the leftmost occupied room will always remain to
the right of the room α − 2N (so it cannot “wander off” to the left too far):

Claim 4: Let m ∈ {0, 1, . . . , g}. Then, min (Occ (Sm )) > α − 2N.

[Proof of Claim 4: This is similar to proving Claim 4 in the solution of Exercise


8.2.7. This time, we need to use |Occ (Sm )| ≤ |Sm | = N.]

December 25, 2021


Math 235 notes page 801

Claim 5: Let m ∈ {0, 1, . . . , g}. Then, max (Occ (Sm )) < ω + 2N.
[Proof of Claim 5: This is similar to proving Claim 5 in the solution of Exercise
8.2.7.]
Now, Claim 4 and Claim 5 can be combined to the following:
Claim 6: Let m ∈ {0, 1, . . . , g}. Then, Sm ⊆ [α − 2N + 1, ω + 2N − 1] × V.
[Proof of Claim 6: Using Claim 4 and Claim 5, it is easy to see that Occ (Sm ) ⊆
[α − 2N + 1, ω + 2N − 1] (indeed, this can be proved just as we showed Claim 6 in
the solution of Exercise 8.2.7). However, it is easy to see that S ⊆ (Occ S) × V for
any state S ⊆ Z × V (indeed, this follows from the definition of Occ S). Applying
this to S = Sm , we obtain
Sm ⊆ Occ (Sm ) ×V ⊆ [α − 2N + 1, ω + 2N − 1] × V.
| {z }
⊆[α−2N +1,ω +2N −1]

This proves Claim 6.]


We note that ω = max (Occ (S0 )) ≥ min (Occ (S0 )) = α and thus |{z} | {z− 1} >
ω + 2N
≥α >−2N +1
(since N >0)
α − 2N + 1. Hence, the interval [α − 2N + 1, ω + 2N − 1] is nonempty, and its size
is
|[α − 2N + 1, ω + 2N − 1]| = (ω + 2N − 1) − (α − 2N + 1) + 1 = ω − α + 4N − 1.
Now, we can use (e.g.) the pigeonhole principle: Claim 1 entails that the entropy
of the state increases with every move. Thus,

(the entropy of S0 ) < (the entropy of S1 ) < · · · < the entropy of Sg .
Hence, the entropies of the g + 1 states S0 , S1 , . . . , Sg are distinct. Therefore, these
g + 1 states S0 , S1 , . . . , Sg must themselves be distinct. However, all these g + 1
states S0 , S1 , . . . , Sg are subsets of the set [α − 2N + 1, ω + 2N − 1] × V (by Claim 6).
Hence, we have found g + 1 distinct subsets of the set [α − 2N + 1, ω + 2N − 1] × V.
By the pigeonhole principle, this entails that
g + 1 ≤ (# of all subsets of [α − 2N + 1, ω + 2N − 1] × V )
= 2|[α−2N +1,ω +2N −1]×V | = 2|[α−2N +1,ω +2N −1]|·|V | = 2(ω −α+4N −1)·|V |
(since |[α − 2N + 1, ω + 2N − 1]| = ω − α + 4N − 1) .
In other words, g ≤ 2(ω −α+4N −1)·|V | − 1.
Now, forget that we fixed g and S1 , S2 , . . . , Sg . We thus have shown that any se-
quence of g (successive) moves, starting from state S0 , must satisfy g ≤ 2(ω −α+4N −1)·|V | −
1. In other words, there is no sequence of (successive) moves, starting from state S0 ,
that has more than 2(ω −α+4N −1)·|V | − 1 moves. In other words, the moves cannot
go on for more than 2(ω −α+4N −1)·|V | nights (if the initial state is S0 ). Hence, the
moving will stop after a finite number of days. This solves Exercise 8.4.8.

December 25, 2021


Math 235 notes page 802

Let me mention a major difference between Exercise 8.4.8 and Exercise 8.2.7: In
Exercise 8.4.8, if we treat the violinists as indistinguishable, then the final state (i.e.,
the set of rooms that are occupied after the moving has stopped) is independent
of the moves! That is, it does not matter which pairs of violinists choose to move
apart first; in all possible scenarios, the rooms that end up occupied at the end
will be the same. This result (which differs dramatically from the behavior of
final states in Exercise 8.2.7) appears, e.g., in [Klivan18, Proposition 5.2.1] (in much
greater generality); it is part of the theory of the chip-firing game (also known
as the abelian sandpile model) on graphs. There are now two books ([CorPer18],
[Klivan18]) out on this theory; in particular, [Klivan18, §5.3] explicitly describes
the final state in Exercise 8.4.8 in the case when all violinists start out in the same
room.

A.10.9. Discussion of Exercise 8.4.9 (TODO: add details!)


Discussion of Exercise 8.4.9. Exercise 8.4.9 is a particular case of the following more
general exercise (which, in turn, can be regarded as a particular case of [AlCuHu16,
Theorem 3.10, “extreme polynomial”]):
Exercise A.10.1. Fix a positive integer k ≥ 2 and two integers u ∈ N and v ∈
N. Define a sequence ( a0 , a1 , a2 , . . .) of positive rational numbers recursively by
setting
an = 1 for each n < k (798)
and
a n −1 a n − k +1 + u ( a n −1 + a n −2 + · · · + a n − k +1 ) + v
an = (799)
an−k
for each n ≥ k.

Prove that an is a positive integer for each integer n ≥ 0.

Solution to Exercise A.10.1 (sketched). This is similar to the above solution to Exercise
8.1.8, so we restrict ourselves to an outline.
Again, we begin by playing around with the recursive equation.
Let n be an integer satisfying n ≥ k + 1. Thus, n ≥ n − 1 ≥ k (since n ≥ k + 1);
hence, (799) holds. Multiplying both sides of (799) by an−k , we obtain

an an−k = an−1 an−k+1 + u ( an−1 + an−2 + · · · + an−k+1 ) + v. (800)

The same argument (applied to n − 1 instead of n) yields

an−1 an−k−1 = an−2 an−k + u ( an−2 + an−3 + · · · + an−k ) + v.

December 25, 2021


Math 235 notes page 803

Subtracting this equality from (800), we find


a n a n − k − a n −1 a n − k −1 = ( a n −1 a n − k +1 + u ( a n −1 + a n −2 + · · · + a n − k +1 ) + v )
− ( a n −2 a n − k + u ( a n −2 + a n −3 + · · · + a n − k ) + v )
= an−1 an−k+1 − an−2 an−k + uan−1 − uan−k .
Adding an−2 an−k + uan−k + an−1 an−k−1 to both sides of this equality, we obtain
an an−k + an−2 an−k + uan−k = an−1 an−k−1 + an−1 an−k+1 + uan−1 .
In other words,
a n − k ( a n + a n −2 + u ) = a n −1 ( a n − k +1 + a n − k −1 + u ) .
Dividing both sides of this equality by an−1 an−k , we obtain
a n + a n −2 + u a + a n − k −1 + u
= n − k +1 . (801)
a n −1 an−k
Now, forget that we fixed n. We thus have proved the equality (801) for each
integer n ≥ k + 1.
Now, let us define a number
a n + a n −2 + u
bn = (802)
a n −1
for each integer n ≥ 2. Thus, we have defined a sequence (b2 , b3 , b4 , . . .) of rational
numbers. It is easy to see that b2 , b3 , . . . , bk are integers (since ak−1 , ak−2 , . . . , a0 are
all equal to 1, and thus all denominators involved in computing b2 , b3 , . . . , bk are
1s).
Now, the equality (801) entails that
bn = bn−(k−1)
for each integer n ≥ k + 1 (because its left hand side is bn , while its right hand side
is bn−(k−1) ). In other words, bm+(k−1) = bm for each integer m ≥ 2. In other words,
the sequence (b2 , b3 , b4 , . . .) is (k − 1)-periodic. Thus, each entry of this sequence
equals one of the first k − 1 entries b2 , b3 , . . . , bk of this sequence. Since the first k − 1
entries b2 , b3 , . . . , bk of this sequence are integers (as we have seen above), we thus
conclude that each entry of this sequence is an integer. In other words, b2 , b3 , b4 , . . .
are integers.
From here on, we argue similarly to our above solution to Exercise 8.1.8: Solving
the equality (802) for an , we obtain
a n = bn a n − 1 − a n − 2 − u for each integer n ≥ 2.
Using this equality (and the fact that b2 , b3 , b4 , . . . are integers), we can prove (by a
straightforward strong induction on n) that an is a positive integer for each n ∈ N
(because the induction hypothesis yields that an−1 and an−2 are integers, so that
bn an−1 − an−2 − u is an integer, and the positivity follows from the statement of the
exercise). Thus, Exercise A.10.1 is solved.

December 25, 2021


Math 235 notes page 804

Exercise 8.4.9 is a particular case of Exercise A.10.1. (Namely, if we set k = 4 and


u = 0 and v = 1 in Exercise A.10.1, then the sequence ( a0 , a1 , a2 , . . .) becomes the
sequence (t0 , t1 , t2 , . . .) from Exercise 8.4.9.)

A.10.10. Discussion of Exercise 8.4.10 (TODO: add details!)


Discussion of Exercise 8.4.10. This is similar to the above solution to Exercise A.10.1,
so we restrict ourselves to an outline.
Let n be an integer satisfying n ≥ 4. The definition of the sequence (t0 , t1 , t2 , . . .)
yields
t2 + qtn−1 tn−2 + t2n−2
t n = n −1 ,
t n −3
so that
tn tn−3 = t2n−1 + qtn−1 tn−2 + t2n−2 .
The same argument (applied to n − 1 instead of n) yields

tn−1 tn−4 = t2n−2 + qtn−2 tn−3 + t2n−3 .

Subtracting this equality from the previous one, we find


   
tn tn−3 − tn−1 tn−4 = t2n−1 + qtn−1 tn−2 + t2n−2 − t2n−2 + qtn−2 tn−3 + t2n−3
= t2n−1 + qtn−1 tn−2 − qtn−2 tn−3 − t2n−3 .

Adding qtn−2 tn−3 + t2n−3 + tn−1 tn−4 + qtn−1 tn−3 to both sides of this equality, we
obtain

tn tn−3 + qtn−2 tn−3 + t2n−3 + qtn−1 tn−3


= t2n−1 + qtn−1 tn−2 + tn−1 tn−4 + qtn−1 tn−3 .

In other words,

tn−3 (tn + qtn−1 + qtn−2 + tn−3 ) = tn−1 (tn−1 + qtn−2 + qtn−3 + tn−4 ) .

Dividing both sides of this equality by tn−1 tn−2 tn−3 , we obtain

tn + qtn−1 + qtn−2 + tn−3 t + qtn−2 + qtn−3 + tn−4


= n −1 . (803)
t n −1 t n −2 t n −2 t n −3

Now, forget that we fixed n. We thus have proved the equality (803) for each
integer n ≥ 4.
Now, let us define a number
tn + qtn−1 + qtn−2 + tn−3
bn =
t n −1 t n −2

December 25, 2021


Math 235 notes page 805

for each integer n ≥ 3. Thus, we have defined a sequence (b3 , b4 , b5 , . . .) of rational


numbers. It is easy to see that b3 is an integer (since t2 = 1 and t1 = 1 and t3 ∈ Z).
Now, the equality (803) entails that

bn = bn − 1

for each integer n ≥ 4 (because its left hand side is bn , while its right hand side is
bn−1 ). In other words, b3 = b4 = b5 = · · · . Hence, all entries b3 , b4 , b5 , . . . of the
sequence (b3 , b4 , b5 , . . .) are integers (since b3 is an integer).
From here on, we can conclude our solution to Exercise 8.4.10 similarly to our
above solution to Exercise A.10.1.
Having solved Exercise 8.4.10, let me point out two generalizations (although I
only know how to solve one).
Exercise 8.4.10 is a particular case (for k = 3) of the following more general
exercise:
Exercise A.10.2. Fix a positive integer k ≥ 2 and an integer q ∈ N. Define a
sequence ( a0 , a1 , a2 , . . .) of positive rational numbers recursively by setting

an = 1 for each n < k (804)

and
a2n−1 + a2n−2 + · · · + a2n−k+1 + q ∑

a n −i a n − j
1≤ i < j ≤ k −1
an = (805)
an−k
for each n ≥ k.

Prove that an is a positive integer for each integer n ≥ 0.


Also, Exercise 8.4.10 is a particular case (for k = 3) of the following more general
exercise:
Exercise A.10.3. Fix some k ∈ {2, 3, 4} and an integer q ∈ N. Define a sequence
( a0 , a1 , a2 , . . .) of positive rational numbers recursively by setting

an = 1 for each n < k (806)

and
a2n−1 + a2n−2 + · · · + a2n−k+1 + qan−1 an−k+1

an = (807)
an−k
for each n ≥ k.

Prove that an is a positive integer for each integer n ≥ 0.

December 25, 2021


Math 235 notes page 806

Exercise A.10.2 and Exercise A.10.3 can be solved along the same lines as our
above solution to Exercise 8.4.10. (Alas, Exercise A.10.3 becomes false for k = 5
/ Z); this spoils the pattern somewhat.)
(indeed, for q = 1 and k = 5, we have a11 ∈

A.11. Homework set #10A discussion


The following are discussions of the problems on homework set #10A (Subsection
9.1.5).

A.11.1. Discussion of Exercise 9.1.4


Discussion of Exercise 9.1.4. The key to Exercise 9.1.4 is to recall the identity u2 −
v2 = (u − v) (u + v). So the exercise is about writing n as a product of two integers
of the form u − v and u + v. When can two integers be written in the form u − v
and u + v ? The answer to this turns out to be “exactly when they are congruent
modulo 2 (that is, have the same parity)”. Let us state this as a lemma450 :
Lemma A.11.1. Let a and b be two integers. Then:
(a) If a ≡ b mod 2, then there exist two integers u, v ∈ Z such that u + v = a
and u − v = b.
(b) If there exist two integers u, v ∈ Z such that u + v = a and u − v = b, then
a ≡ b mod 2.
a+b a−b
Proof of Lemma A.11.1. (a) Assume that a ≡ b mod 2. Let x = and y = .
2 2
a+b a−b a+b a−b
Thus, x + y = + = a and x − y = − = b.
2 2 2 2
a−b
From a ≡ b mod 2, we obtain 2 | a − b, and thus ∈ Z. In other words,
2
a−b
y ∈ Z (since y = ). Also, from x + y = a, we obtain x = a − y ∈ Z (since
2
a ∈ Z and y ∈ Z). We thus know that x and y are integers (since x ∈ Z and y ∈ Z)
and satisfy x + y = a and x − y = b. Hence, there exist two integers u, v ∈ Z such
that u + v = a and u − v = b (namely, u = x and v = y). This proves Lemma A.11.1
(a).
(b) Assume that there exist two integers u, v ∈ Z such that u + v = a and
u − v = b. Consider these u and v. From u + v = a, we obtain

a = u + v = u − v + |{z}
2 v ≡ u − v + 0v = u − v = b mod 2.
≡0 mod 2

This proves Lemma A.11.1 (b).

450 Note the similarity to Lemma A.4.5 (which we will not, however, use here).

December 25, 2021


Math 235 notes page 807

With Lemma A.11.1 in hand, we can quickly reduce Exercise 9.1.4 to showing
that n can be written as a product of two integers that have the same parity if and
only if n 6≡ 2 mod 4. But this is easy to check:
n
• If n is divisible by 4, then n = 2 · is a way to write n as a product of two
2
integers that have the same parity.

• If n is odd, then n = 1 · n is a way to write n as a product of two integers that


have the same parity.

• On the other hand, if n is neither divisible by 4 nor odd, then we cannot write
n as a product ab of two integers a and b that have the same parity, because
such a product must either be divisible by 4 (if a and b are both even) or be
odd (if a and b are both odd).

Now, it remains to observe that the statement “n is either divisible by 4 or odd” is


equivalent to “n 6≡ 2 mod 4”.
Just for the sake of completeness, here is a detailed version of the solution we
just outlined:
Solution to Exercise 9.1.4. We are in one of the following three cases:
Case 1: We have 4 | n.
Case 2: We have 2 - n.
Case 3: We have neither 4 | n nor 2 - n.
Let us first consider Case 1. In this case, we have 4 | n. Thus, n%4 = 0 451 .
Hence, n 6≡ 2 mod 4 452 .
n n n
From 4 | n, we obtain ∈ Z. Thus, 2 · is an even integer. In other words,
4 4 2
n n n
is an even integer (since 2 · = ). Therefore, ≡ 0 ≡ 2 mod 2. Hence, Lemma
4 2 2
n
A.11.1 (a) (applied to a = and b = 2) yields that there exist two integers u, v ∈ Z
2
n n
such that u + v = and u − v = 2 (since and 2 are integers). These two integers
2 2
u and v must necessarily satisfy n = u2 − v2 (since u2 − v2 = (u − v) (u + v) =
| {z } | {z }
=2 n
=
2
n
2 · = n). Hence, n can be represented in the form n = u − v for some u, v ∈ Z.
2 2
2
Thus, we have shown that both statements “n can be represented in the form
n = u2 − v2 for some u, v ∈ Z” and “n 6≡ 2 mod 4” are true (since we have shown
451 Proof. Proposition 3.3.2 (b) (applied to 4 and n instead of n and u) shows that we have 4 | n if and
only if n%4 = 0. Thus, we have n%4 = 0 (since 4 | n).
452 Proof. Assume the contrary. Thus, n ≡ 2 mod 4, so that 2 ≡ n mod 4. Hence, Proposition 3.3.2 (c)

(applied to 4, n and 2 instead of n, u and c) yields 2 = n%4 (since 2 ∈ {0, 1, . . . , 4 − 1}). Hence,
n%4 = 2 6= 0. This contradicts n%4 = 0. This contradiction shows that our assumption was
false; qed.

December 25, 2021


Math 235 notes page 808

that n 6≡ 2 mod 4). Therefore, these two statements are equivalent. In other words,
n can be represented in the form n = u2 − v2 for some u, v ∈ Z if and only if
n 6≡ 2 mod 4. Thus, Exercise 9.1.4 is solved in Case 1.
Let us next consider Case 2. In this case, we have 2 - n. In other words, n is odd.
Hence, n 6≡ 2 mod 4 453 .
On the other hand, n ≡ 1 mod 2 (since n is odd). Therefore, Lemma A.11.1
(a) (applied to a = n and b = 1) yields that there exist two integers u, v ∈ Z
such that u + v = n and u − v = 1. These two integers u and v must necessarily
satisfy n = u2 − v2 (since u2 − v2 = (u − v) (u + v) = 1 · n = n). Hence, n can be
| {z } | {z }
=1 =n
represented in the form n = u2 for some u, v ∈ Z.
− v2
Thus, we have shown that both statements “n can be represented in the form
n = u2 − v2 for some u, v ∈ Z” and “n 6≡ 2 mod 4” are true (since we have shown
that n 6≡ 2 mod 4). Therefore, these two statements are equivalent. In other words,
n can be represented in the form n = u2 − v2 for some u, v ∈ Z if and only if
n 6≡ 2 mod 4. Thus, Exercise 9.1.4 is solved in Case 2.
Finally, let us consider Case 3. In this case, we have neither 4 | n nor 2 - n. Thus,
4 - n (since we don’t have 4 | n) and 2 | n (since we don’t have 2 - n). From 2 | n, we
n n n
obtain ∈ Z. In other words, is an integer. This integer cannot be even454 ,
2 2 2
and therefore must be odd. Hence, we have n ≡ 2 mod 4 455 . Thus, we don’t have
n 6≡ 2 mod 4. Also, we have n ≡ 0 mod 2 (since 2 | n).
Now, let u, v ∈ Z be integers satisfying n = u2 − v2 . We shall derive a con-
tradiction. Indeed, set a = u + v and b = u − v. Thus, Lemma A.11.1 (b) yields
a ≡ b mod 2 (since u + v = a and u − v = b). Also, n = u2 − v2 = (u + v) (u − v) =
| {z } | {z }
=a =b
ab. If the integer b was odd, then we would have b ≡ 1 mod 2 and therefore
n = |{z}a b
|{z} ≡ 1 · 1 = 1 6≡ 0 mod 2, which would contradict n ≡ 0 mod 2.
≡b≡1 mod 2 ≡1 mod 2
Hence, the integer b cannot be odd. Thus, b must be even. In other words, b = 2q
for some integer q. Consider this q. Also, a ≡ b ≡ 0 mod 2 (since b is even); hence,
the integer a is even. In other words, a = 2p for some integer p. Consider this p.
453 Proof. Assume the contrary. Thus, n ≡ 2 mod 4. Hence, Proposition 3.2.6 (e) (applied to n, 2, 4
and 2 instead of a, b, n and m) yields n ≡ 2 mod 2 (since 2 | 4). Hence, n ≡ 2 ≡ 0 mod 2; in
other words, n is even. That is, 2 | n. This contradicts 2 - n. This contradiction shows that our
assumption was false; qed.
454 Proof. Assume the contrary. Thus, the integer n is even. In other words, 2 | n ; therefore,
n n 2 2
2 ∈ Z. In other words, n ∈ Z (since 2 = n ). Hence, 4 | n. But this contradicts 4 - n.
2 4 2 4
This contradiction shows that our assumption was false; qed.
455 Proof. The integer n is odd. In other words, n = 2u + 1 for some u ∈ Z. Consider this u.
2 2
n
Multiplying the equality = 2u + 1 by 2, we obtain n = 2 (2u + 1) = |{z} 4 u + 2 ≡ 0u + 2 =
2
≡0 mod 4
2 mod 4.

December 25, 2021


Math 235 notes page 809

Now, n = |{z} b = (2p) (2q) = 4pq shows that 4 | n; but this contradicts 4 - n.
a |{z}
=2p =2q
Forget that we fixed u, v. We thus have obtained a contradiction for any two
integers u, v ∈ Z satisfying n = u2 − v2 . Hence, no two such integers u, v exist. In
other words, n cannot be represented in the form n = u2 − v2 for some u, v ∈ Z.
Thus, we have shown that both statements “n can be represented in the form
n = u2 − v2 for some u, v ∈ Z” and “n 6≡ 2 mod 4” are false (since we have shown
that we don’t have n 6≡ 2 mod 4). Therefore, these two statements are equivalent.
In other words, n can be represented in the form n = u2 − v2 for some u, v ∈ Z if
and only if n 6≡ 2 mod 4. Thus, Exercise 9.1.4 is solved in Case 3.
We have now solved Exercise 9.1.4 in all three Cases 1, 2 and 3. Thus, our solution
to Exercise 9.1.4 is complete.

A.11.2. Discussion of Exercise 9.1.5 (TODO: add details!)


Discussion of Exercise 9.1.5. I don’t remember where I found Exercise 9.1.5. It is, in
some sense, a (noticeably) harder version of Exercise 9.1.4. I will only sketch the
solution, after first outhousing part of it into the following lemma:
Lemma A.11.2. Let n be a positive integer that is neither a prime nor a power
of 2. Then, there exist two integers a ≥ 3 and b ≥ 3 satisfying 2n = ab and
a 6≡ b mod 2.

Proof of Lemma A.11.2 (sketched). First of all, we recall that n is not a power of 2.
Hence, the number n has at least one odd prime divisor d (since otherwise, the
prime factorization of n would only consist of 2’s, but this would mean that n is
a power of 2). Consider such a d. Thus, n = de for some positive integer e (since
d is a positive divisor of n). Moreover, d ≥ 3 (since d is an odd prime). Note that
n 6= d (since n is not a prime, but d is a prime), and thus e 6= 1 (since otherwise, we
would have e = 1 and thus n = d |{z} e = d, which would contradict n 6= d). Hence,
=1
e ≥ 2 (since e is a positive integer) and thus 2e ≥ 2 · 2 = 4 ≥ 3.
Now, from n = de, we obtain 2n = 2de = d (2e). Moreover, the two integers d
and 2e satisfy d ≥ 3 and 2e ≥ 3 and d 6≡ 2e mod 2 (since d is odd while 2e is even).
Hence, there exist two integers a ≥ 3 and b ≥ 3 satisfying 2n = ab and a 6≡ b mod 2
(namely, a = d and b = 2e). This proves Lemma A.11.2.
We can now solve Exercise 9.1.5:
Solution to Exercise 9.1.5 (sketched). We must prove the following two claims:
 
u
Claim 1: If n can be represented in the form n = uv − for some
2
u, v ∈ Z satisfying v ≥ u ≥ 3, then n is neither a prime nor a power of
2.

December 25, 2021


Math 235 notes page 810

Claim 2: If n is neither a prime


 nor a power of 2, then n can be repre-
u
sented in the form n = uv − for some u, v ∈ Z satisfying v ≥ u ≥ 3.
2
 
u
[Proof of Claim 1: Assume that n can be represented in the form n = uv −
2
for some u, v ∈ Z satisfying v ≥ u ≥ 3. Consider these u, v. Thus,
u ( u − 1) u−1
   
u
n = uv − = uv − = u v− .
2 2 2
| {z }
u ( u − 1)
=
2
Multiplying this equality by 2, we get
u−1
 
2n = 2u v − = u (2v − u + 1) .
2
Set w = 2v − u + 1. Then, 2n = u (2v − u + 1) = uw. Hence, u and w are divisors
| {z }
=w
of 2n. Both of these divisors are ≥ 3 (since u ≥ 3 and w = 2 |{z} 1 ≥
v −u + |{z}
≥u ≥0
2u − u + 0 = u ≥ 3), and furthermore have different parity (since their difference
u − |{z}
w = u − (2v − u + 1) = 2 (u − v) − 1 is odd). Thus, one of these two
=2v−u+1
divisors must be odd. Hence, 2n has an odd divisor that is ≥ 3 (since both of these
divisors are ≥ 3). This shows that 2n is not a power of 2 (since a power of 2 has no
odd divisor that is ≥ 3 456 ). Hence, n is not a power of 2 either.
It remains to show that n is not a prime. Indeed, assume the contrary. Thus, n
is a prime. Hence, from n | 2n = uw, we conclude that we have n | u or n | w (by
Theorem 9.1.8, applied to p = n, a = u and b = w). If n | u, then u ≥ n (since
u ≥ 3 is positive) and therefore 2n = |{z} w ≥ n · 3 = 3n > 2n, which is clearly
u |{z}
≥n ≥3
absurd. The same argument (with the roles of u and w interchanged) yields an
absurd conclusion if n | w. Thus, neither n | u nor n | w can hold. This contradicts
the fact that we have n | u or n | w. This contradiction completes our proof of
Claim 1.]
[Proof of Claim 2: Assume that n is neither a prime nor a power of 2. Thus, Lemma
A.11.2 shows that there exist two integers a ≥ 3 and b ≥ 3 satisfying 2n = ab and
a 6≡ b mod 2. Consider these a and b.
We WLOG assume that b ≥ a (since we can otherwise achieve this by swapping
a with b).
We have a 6≡ b mod 2. In other words, 2 - a − b. Thus, a − b is odd, so that we
have a − b ≡ 1 mod 2. However, a + b ≡ a − b mod 2 (since ( a + b) − ( a − b) = 2b
456 This is easiest to see using prime factorization.

December 25, 2021


Math 235 notes page 811

is clearly even). Therefore, a + b ≡ a − b ≡ 1 mod 2. In other words, a + b is odd.


a+b−1
Hence, a + b − 1 is even, so that ∈ Z.
2
a+b−1
Set u = a and v = . Then, both u and v are integers (since u = a ∈ Z
2
a+b−1
and v = ∈ Z). Moreover, the definitions of u and v yield
2
a+b−1
 
u (2v − u + 1) = a 2 · − a + 1 = ab = 2n.
2

Solving this equality for n, we find

u (2v − u + 1) u ( u − 1)
 
u
n= = uv − = uv − .
2 | {z2 } 2

u
=
2

Furthermore, u = a ≥ 3. Moreover,
a+b−1 a+a−1
v= ≥ (since b ≥ a)
2 2
1
a −
= |{z} > u−1
2
=u |{z}
<1

and thus v ≥ u (since v and u are  integers).


 Hence, v ≥ u ≥ 3. Thus, n can be
u
represented in the form n = uv − for some u, v ∈ Z satisfying v ≥ u ≥ 3
2
(indeed, we have just found such u, v). This proves Claim 2.]
With Claim 1 and 2 proved, we have solved Exercise 9.1.5.

A.11.3. Discussion of Exercise 9.1.6


Discussion of Exercise 9.1.6. Both parts of Exercise 9.1.6 are important results in num-
ber theory (see, e.g., [Grinbe19c, Corollary 5.6] and [Grinbe19c, Proposition 3.1]).
Let us give two solutions:
First solution to Exercise 9.1.6. (a) Let k ∈ {1, 2, . . . , p − 1}. Thus, k ∈ {1, 2, . . . , p − 1} ⊆
{0, 1, . . . , p − 1} and p ≡ 0 mod p. Hence, Exercise 9.1.2 (applied to a = p and
b = 0) yields    
p 0
≡ mod p. (808)
k k

December 25, 2021


Math 235 notes page 812

However, from k ∈ {1, 2, . . ., p− 1}, we obtain k ≥ 1 > 0. Hence,


  Proposition
0 p
4.3.4 (applied to n = 0) yields = 0. Thus, (808) rewrites as ≡ 0 mod p. In
  k k
p
other words, p | . This solves Exercise 9.1.6 (a).
k
(b) Let k ∈ {0, 1, . . . , p − 1}. It is clear that p −1 ≡ 0 − 1 = −1 mod p.
|{z}
≡0 mod p
Hence, Exercise 9.1.2 (applied to a = p − 1 and b = −1) yields

p−1 −1
   
≡ = (−1)k mod p (by (122)) .
k k

This solves Exercise 9.1.6 (b).


Second solution to Exercise 9.1.6. (a) Let k ∈ {1, 2, . . . , p − 1}. Then, Exercise 4.5.4 (b)
(applied to n = p and m = k) yields
 
gcd ( p, k) p
∈ Z. (809)
p k

However, k is coprime to p (by Proposition 9.1.5, applied to i = k). In other words,


gcd (k, p) = 1. Now, Proposition 3.4.4 (b) (applied to a = p and  b = k) yields
p
   
gcd ( p, k) p 1 p k
gcd ( p, k) = gcd (k, p) = 1. Hence, = = . Thus, (809)
p k p k p
rewrites as follows:  
p
k
∈ Z.
p
 
p
In other words, p | . This solves Exercise 9.1.6 (a) again.
k
(b) We proceed by induction  k:
on
p−1

Induction base: We have = 1 (by (119), applied to n = p − 1) and (−1)0 =
0
p−1
 
1. Thus, = 1 ≡ 1 = (−1)0 mod p. In other words, Exercise 9.1.6 (b) holds
0
for k = 0.
Induction step: Let m ∈ {1, 2, . . . , p − 1}. Assume (as the induction hypothesis)
that Exercise 9.1.6 (a) holds for k = m − 1. We must show that Exercise 9.1.6 (b)
holds for k = m.
 We have assumed that Exercise 9.1.6 (b) holds for k = m − 1. In other words,
p−1
≡ (−1)m−1 mod p.
m−1

December 25, 2021


Math 235 notes page 813

   
p p
But Exercise 9.1.6 (a) (applied to k = m) yields p | . In other words, ≡
m m
0 mod p. In view of
p−1 p−1
     
p
= + (by Theorem 4.3.7, applied to n = p and k = m) ,
m m−1 m
p−1 p−1
   
this rewrites as + ≡ 0 mod p. In other words,
m−1 m
p−1 p−1
   
≡− ≡ − (−1)m−1 = (−1)m mod p.
m m−1
| {z }
≡(−1)m−1 mod p

In other words, Exercise 9.1.6 (b) holds for k = m. This completes the induction
step. Thus, Exercise 9.1.6 (b) is solved (again).

A.11.4. Discussion of Exercise 9.1.7


Discussion of Exercise 9.1.7. Exercise 9.1.7 is a classical and important fact (in par-
ticular, it is the main tool in the proof of the Chevalley–Warning theorem). The
following solution, which strategically uses our Corollary 7.8.8, is probably the
shortest:457
Solution to Exercise 9.1.7. From k ∈ {0, 1, . . . , p − 2}, we obtain k ≤ p − 2 < p − 1.
Hence, Corollary 7.8.8 (a) (applied to n = p − 1 and m = k) yields
p −1
p−1 k
 
∑ (−1) p −1− i
i
i = 0.
i =0

However,
p −1 p −1
p−1
 
∑ (−1) p −1− i
i
ik ≡ ∑ (−1) p−1−i (−1)i ik
i =0 i =0
| {z }
=(−1)( p−1−i)+i =(−1) p−1
| {z }
i
≡(−1) mod p (since ( p−1−i )+i = p−1)
(by Exercise 9.1.6 (b)
(applied to i instead of k))
p −1 p −1
= ∑ (−1) p−1 ik = (−1) p−1 ∑ ik ,
i =0 i =0

so that
p −1 p −1
p−1 k
 
(−1) p −1
∑i k
≡ ∑ (−1) p −1− i
i
i = 0 mod p.
i =0 i =0
457 See [Grinbe19a, proof of Lemma 3.8] for a different solution.

December 25, 2021


Math 235 notes page 814

Multiplying both sides of this congruence by (−1) p−1 , we find


p −1
(−1) p −1
(−1) p −1
∑ ik ≡ (−1) p−1 0 = 0 mod p.
i =0

In view of
p −1 p −1
(−1) p−1 (−1) p−1 ∑ ik = ∑ ik ,
| {z } i =0 i =0
p −1 2 2( p −1)
=((−1) ) =(−1) =1
(since 2( p−1) is even)

p −1
this rewrites as ∑ ik ≡ 0 mod p. This solves Exercise 9.1.7.
i =0

A.11.5. Discussion of Exercise 9.1.8


Discussion of Exercise 9.1.8. Exercise 9.1.8 is Problem #10501 (b) from the American
Mathematical Monthly (suggested by Roger B. Eggleton; see [EggWes98] for the
solution); it also appears (in a fairly representative particular case) as problem
#2175 in Crux Mathematicorum (proposed by Christopher J. Bradley). See OEIS
Sequence A063647 for more references.
Solution to Exercise 9.1.8. Let U denote the set of all pairs ( j, k) of positive integers
1 1 1
satisfying − = . Then, |U | is the # of such pairs. Thus, |U | = u (since u was
j k n
defined to be the # of such pairs).
Let V be the set of all integers i ∈ [n − 1] satisfying i | n2 .

December 25, 2021


Math 235 notes page 815

For each ( j, k ) ∈ U, we have n − j ∈ V 458 . Hence, we can define a map

f : U → V,
( j, k) 7→ n − j.

Consider this map f .


We shall now construct an inverse to this map f . Indeed, if x ∈ V, then

458 Proof. 1 1 1
Let ( j, k) ∈ U. Thus, ( j, k ) is a pair of positive integers satisfying − = (by the
j k n
1 1 1 1 1 1
definition of U). From − = , we obtain − − = 0. Now,
j k n j k n
 
1 1 1
(n − j) (n + k) − n2 = kn − jn − jk = njk − − = 0.
j k n
| {z }
=0

Hence, (n − j) (n + k ) = n2 . Thus, n − j | n2 (since n − j and n + k are integers). Moreover, j ≥ 1


(since j is a positive integer), so that n − j ≤ n − 1. On the other hand, n + k is a positive
|{z}
≥1
integer (since n and k are positive integers). Hence, n + k 6= 0. Thus, from (n − j) (n + k) = n2 ,
n2
we obtain n − j = . Thus, n − j is positive (since n and n + k are positive). Combining this
n+k
with n − j ≤ n − 1, we obtain 0 < n − j ≤ n − 1. Thus, n − j ∈ {1, 2, . . . , n − 1} (since n − j is an
integer). In other words, n − j ∈ [n − 1] (since [n − 1] = {1, 2, . . . , n − 1}).
We now know that n − j is an integer and satisfies n − j ∈ [n − 1] and n − j | n2 . In other
words, n − j is an integer i ∈ [n − 1] satisfying i | n2 . In other words, n − j ∈ V (since V is the
set of all integers i ∈ [n − 1] satisfying i | n2 ). Qed.

December 25, 2021


Math 235 notes page 816

n2
 
n − x, −n ∈U 459 . Hence, we can define a map
x

g : V → U,
n2
 
x 7→ n − x, −n .
x

Consider this map g.


Now, f ◦ g = id 460 and g ◦ f = id 461 . Thus, the two maps f and g are
459 Proof. Let x ∈ V. Thus, x is an integer i ∈ [n − 1] satisfying i | n2 (since V was defined to be the
set of all such integers i). In other words, x is an integer satisfying x ∈ [n − 1] and x | n2 .
From x ∈ [n − 1] = {1, 2, . . . , n − 1}, we obtain 1 ≤ x ≤ n − 1. Hence, x ≥ 1 > 0. Thus, x 6= 0.
n2 n2
Hence, from x | n2 , we obtain ∈ Z. Hence, − n ∈ Z as well (since n ∈ Z). In other words,
x x
n2
− n is an integer.
x
n2 n2
Moreover, x ≤ n − 1 < n, so that > (since n2 > 0 (because n is positive)). Hence,
x n
n2 n2 n2 n2
> = n, so that − n > 0. Hence, − n is a positive integer (since we already know
x n x x
n 2
that − n is an integer). Also, n − x > 0 (since x < n), so that n − x is a positive integer (since
x
n − x is an integer).
n2 n2
 
Now, we know that n − x, − n is a pair of positive integers (since n − x and − n are
x x
1 1 1
positive integers) satisfying − 2 = (this equality can be checked by a straightfor-
n−x n n
−n
x
n2

ward computation). In other words, n − x, − n is a pair ( j, k) of positive integers satisfying
x
n2
 
1 1 1
− = . In other words, n − x, − n ∈ U (since U is the set of all such pairs ( j, k)). Qed.
j k n x  2 
460 Proof. Let x ∈ V. Then, the definition of g yields g ( x ) = n − x, n − n . Applying the map f
x
to both sides of this equality, we find

n2
 
f ( g ( x )) = f n − x, −n = n − (n − x ) = x = id ( x ) .
x

Hence, ( f ◦ g) ( x ) = f ( g ( x )) = id ( x ).
Forget that we fixed x. We thus have shown that ( f ◦ g) ( x ) = id ( x ) for each x ∈ V. In other
words, f ◦ g = id.
461 Proof. Let y ∈ U. Then, y is a pair ( j, k ) of positive integers satisfying 1 − 1 = 1 (since U is the
j k n
set of all such pair ( j, k)). Consider this ( j, k). Thus, y = ( j, k).
1 1 1
Solving the equality − = for k, we obtain
j k n

1 jn
k= = . (810)
1 1 n−j

j n

December 25, 2021


Math 235 notes page 817

mutually inverse. Hence, the map f is invertible, i.e., is bijective. In other words, f
is a bijection from U to V. Hence, the bijection principle yields |U | = |V |.
Now, recall that |U | = u. Hence,
 
2
u = |U | = |V | = the # of all integers i ∈ [n − 1] satisfying i | n

(since V is the set of all integers i ∈ [n − 1] satisfying i | n2 ). This solves Exercise


9.1.8.
As an aside, it is easy to solve Exercise 9.1.3 again using Exercise 9.1.8. (We leave
the details to the mythical interested reader.)

Applying the map g ◦ f to both sides of the equality y = ( j, k), we obtain


 
 
 
( g ◦ f ) (y) = ( g ◦ f ) (( j, k)) = g 
 f ( j, k)  = g (n − j)

 | {z } 
=n− j
(by the definition of f )
 
 
 
 
 
2
 
 n 
=  n − ( n − j ),
 − n (by the definition of g)
| {z } |n −{z j 
 =j } 
 jn 
= = k
 
n−j
 
(by (810))

= ( j, k) = y = id (y) .

Forget that we fixed y. We thus have shown that ( g ◦ f ) (y) = id (y) for each y ∈ U. In other
words, g ◦ f = id.

December 25, 2021


Math 235 notes page 818

References
[17f-hw2s] Darij Grinberg, UMN Fall 2017 Math 4707 & Math 4990 homework set #2
with solutions, http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw2s.
pdf

[17f-hw3s] Darij Grinberg, UMN Fall 2017 Math 4990 homework set #3 with solu-
tions, http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw3os.pdf

[17f-hw4s] Darij Grinberg, UMN Fall 2017 Math 4990 homework set #4 with solu-
tions, http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw4os.pdf

[17f-hw6s] Darij Grinberg, UMN Fall 2017 Math 4990 homework set #6 with solu-
tions, http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw6os.pdf

[17f-hw7s] Darij Grinberg, UMN Fall 2017 Math 4990 homework set #7 with solu-
tions, http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw7os.pdf

[17f-hw8s] Darij Grinberg, UMN Fall 2017 Math 4990 homework set #8 with solu-
tions, http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw8os.pdf

[18f-hw2s] Darij Grinberg, UMN Fall 2018 Math 5705 homework set #2 with solu-
tions, http://www.cip.ifi.lmu.de/~grinberg/t/18f/hw2s.pdf

[18f-hw3s] Darij Grinberg, UMN Fall 2018 Math 5705 homework set #3 with solu-
tions, http://www.cip.ifi.lmu.de/~grinberg/t/18f/hw3s.pdf

[18f-hw4s] Darij Grinberg, UMN Fall 2018 Math 5705 homework set #4 with solu-
tions, http://www.cip.ifi.lmu.de/~grinberg/t/18f/hw4s.pdf

[18f-mt1s] Darij Grinberg, UMN Fall 2018 Math 5705 midterm #1 with solutions,
http://www.cip.ifi.lmu.de/~grinberg/t/18f/mt1s.pdf

[18s-hw2s] Darij Grinberg, UMN Spring 2018 Math 4707 homework set #2 with so-
lutions, http://www.cip.ifi.lmu.de/~grinberg/t/18s/hw2s.pdf

[18s-hw3s] Darij Grinberg, UMN Spring 2018 Math 4707 homework set #3 with so-
lutions, http://www.cip.ifi.lmu.de/~grinberg/t/18s/hw3s.pdf

[18s-mt1s] Darij Grinberg, UMN Spring 2018 Math 4707 midterm #1 with solutions,
http://www.cip.ifi.lmu.de/~grinberg/t/18s/mt1s.pdf

[18s-mt2s] Darij Grinberg, UMN Spring 2018 Math 4707 midterm #2 with solutions,
http://www.cip.ifi.lmu.de/~grinberg/t/18s/mt2s.pdf

[19s] Darij Grinberg, Introduction to Modern Algebra (UMN Spring 2019 Math
4281 notes), 1 October 2020.
http://www.cip.ifi.lmu.de/~grinberg/t/19s/notes.pdf

December 25, 2021


Math 235 notes page 819

[19s-hw0s] Darij Grinberg, UMN Spring 2019 Math 4281 homework set #0 with so-
lutions, http://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf

[19s-mt3s] Darij Grinberg, UMN Spring 2019 Math 4281 midterm #3 with solutions,
http://www.cip.ifi.lmu.de/~grinberg/t/19s/mt3s.pdf

[19fco] Darij Grinberg, Enumerative Combinatorics (Drexel Fall 2019 Math 222
notes), 18 September 2020.
http://www.cip.ifi.lmu.de/~grinberg/t/19fco/n/n.pdf

[19fco-hw0s] Darij Grinberg, Drexel Fall 2019 Math 222 homework set #0 with solu-
tions, http://www.cip.ifi.lmu.de/~grinberg/t/19fco/hw0s.pdf

[19fco-hw2s] Darij Grinberg, Drexel Fall 2019 Math 222 homework set #2 with solu-
tions, http://www.cip.ifi.lmu.de/~grinberg/t/19fco/hw2s.pdf

[19fco-hw3s] Darij Grinberg, Drexel Fall 2019 Math 222 homework set #3 with solu-
tions, http://www.cip.ifi.lmu.de/~grinberg/t/19fco/hw3s.pdf

[19fco-mt2s] Darij Grinberg, Drexel Fall 2019 Math 222 midterm #2 with solutions,
http://www.cip.ifi.lmu.de/~grinberg/t/19fco/mt2s.pdf

[Aigner07] Martin Aigner, A Course in Enumeration, Graduate Texts in Mathemat-


ics #238, Springer 2007.

[AigZie14] Martin Aigner, Günter M. Ziegler, Proofs from the Book, 6th edition,
Springer 2018.

[AlCuHu16] Joshua Alman, Cesar Cuenca, Jiaoyang Huang, Laurent phenomenon


sequences, Journal of Algebraic Combinatorics 43 (2016), pp. 589–633.

[AleKur91] P. Alekseev, L. Kurlyandchik, Summa minimumov i minimum summy,


Kvant 1991/3, pp. 49–55.
http://kvant.mccme.ru/1991/03/summa_minimumov_i_minimum_
summ.htm

[AndAnd03] Titu Andreescu, Dorin Andrica, 360 Problems for Mathematical Con-
tests, Gil 2003.

[AndAnd14] Titu Andreescu, Dorin Andrica, Equations with Solution in Terms of


Fibonacci and Lucas Sequences, An. St. Univ. Ovidius Constanta 22 (3),
2014, pp. 5–12.

[AndCri17] Titu Andreescu, Vlad Crisan, Mathematical Induction: A powerful and


elegant method of proof, XYZ Press 2017.

[AndDos10] Titu Andreescu, Gabriel Dospinescu, Problems from the Book, 2nd edi-
tion, XYZ Press 2010.

December 25, 2021


Math 235 notes page 820

[AndDos12] Titu Andreescu, Gabriel Dospinescu, Straight from the Book, XYZ Press
2012.
[AndEne11] Titu Andreescu, Bogdan Enescu, Mathematical Olympiad Treasures, 2nd
edition, Birkhäuser 2011.
[AndEri04] George E. Andrews, Kimmo Eriksson, Integer Partitions, Cambridge
University Press 2004.
[AndFen04] Titu Andreescu, Zuming Feng, A Path to Combinatorics for Undergrad-
uates: Counting Strategies, Springer 2004.
[AndTet18] Titu Andreescu, Marian Tetiva, Sums and Products, XYZ Press 2018.
[AnDoMu17] Titu Andreescu, Gabriel Dospinescu, Oleg Mushkarov, Number The-
ory: Concepts and Problems, XYZ Press 2017.
[AnFeLe01] Titu Andreescu, Zuming Feng, George Lee, Jr. (eds.), Mathematical
Olympiads 2000–2001: Problems and Solutions From Around the World,
MAA 2002.
[Armstro19] Drew Armstrong, MTH 309: Discrete Mathematics, Summer 2019, 9
August 2019.
https://www.math.miami.edu/~armstrong/309sum19.php
[Bartle15] Padraic Bartlett, various courses, 2015.
[BecGeo10] Matthias Beck, Ross Geoghegan, The Art of Proof: Basic Training for
Deeper Mathematics, Springer 2010.
http://math.sfsu.edu/beck/aop.html
[BeDeQu11] Arthur T. Benjamin, Halcyon Derks, Jennifer J. Quinn, The Combina-
torialization of Linear Recurrences, The Electronic Journal of Combina-
torics 18(2) (2011), #P12.
[BenPlo08] Arthur T. Benjamin and Sean S. Plott, A combinatorial approach to Fi-
bonomial coefficients, Fibonacci Quarterly 46/47, issue 1, pp. 7–9.
[BenQui03] Arthur T. Benjamin and Jennifer J. Quinn, Proofs that Really Count: The
Art of Combinatorial Proof, The Mathematical Association of America,
2003.
[BenQui08] Arthur T. Benjamin and Jennifer J. Quinn, An Alternate Approach to
Alternating Sums: A Method to DIE for, The College Mathematics Jour-
nal, Volume 39, Number 3, May 2008, pp. 191-202(12).
[BiFoFo95] Wang Zheng Bing, Robert Fokkink, Wan Fokkink, A Relation Between
Partitions and the Number of Divisors, The American Mathematical
Monthly 102, No. 4 (Apr., 1995), pp. 345–347.
https://www.cs.vu.nl/~wanf/pubs/partition.pdf

December 25, 2021


Math 235 notes page 821

[BMPrWe09] Mireille Bousquet-Mélou, James Propp, Julian West, Perfect match-


ings for the three-term Gale-Robinson sequences, The Electronic Journal
of Combinatorics 16 (2009), #R125.

[Bogart17] Kenneth P. Bogart, Combinatorics Through Guided Discovery, 2017.


http://bogart.openmathbooks.org/
Solutions available at https://math.dartmouth.edu/
news-resources/electronic/kpbogart/FDL-bogart/kpbogart-FDL.
tar.gz

[Bogomo19] Alexander Bogomolny, Cut the Knot, 2019.


https://www.cut-the-knot.org/
Use the Wayback Machine for some links that have disappeared.

[Bollob10] Béla Bollobás, The Art of Mathematics: Coffee Time in Memphis, Cam-
bridge University Press, 3rd printing 2010.

[Bona17] Miklós Bóna, A walk through combinatorics : an introduction to enumer-


ation and graph theory, World Scientific 2017.

[BorMea16] Peter Borg, Karen Meagher, The Katona cycle proof of the Erdös–Ko–Rado
theorem and its possibilities, Journal of Algebraic Combinatorics 43(4),
915–939.

[Bossae20] Jens Bossaert, Curiosa Mathematica, 27 March 2020.


https://users.ugent.be/~jebossae/docs/curiosa_2.pdf

[BoyDip12] William E. Boyce, Richard C. DiPrima, Elementary Differential Equa-


tions, 10th edition, Wiley 2012.

[BraTho05] David M. Bradley, Hugh Thomas, Peg Jumping for Fun and Profit,
arXiv:math/0411275v2.
https://arxiv.org/abs/math/0411275v2

[Brown20] K. S. Brown, A Quasi-Periodic Sequence, 10 May 2020, MathPages.


https://www.mathpages.com/home/kmath162/kmath162.htm

[Bruald09] Richard A. Brualdi, Introductory Combinatorics, 5th edition, Pearson


2009.

[Burton11] David M. Burton, Elementary Number Theory, 7th edition, McGraw-


Hill 2011.

[Caminh18] Antonio Caminha Muniz Neto, An Excursion through Elementary


Mathematics, Volume III: Discrete Mathematics and Polynomial Algebra,
Springer 2018.

December 25, 2021


Math 235 notes page 822

[Carl17] Merlin Carl, Wie kommt man drauf? Einführung in das mathematische
Problemlösen, Springer 2017.
See the Springer book page for solutions and additional exercises.

[CarSpe04] Gabriel D. Carroll, David Speyer, The Cube Recurrence, The Electronic
Journal of Combinatorics 11 (2014), #R73.

[ChaSed97] Gengzhe Chang, Thomas W. Sederberg, Over and Over Again, Anneli
Lax New Mathematical Library 39, The Mathematical Association of
America 1997.

[Chen08] Kuo-Jye Chen, Andrews’s argument proves a theorem of Zeckendorf,


Mathematical Medley 34 (2008), no. 1, pp. 13–15.

[Chen20] Evan Chen, various notes and problem collections on mathematical


olympiads, https://web.evanchen.cc/ . See, in particular, the OTIS
Excerpts ( https://web.evanchen.cc/excerpts.html ).

[Cirtoa06] Vasile Cirtoaje, Algebraic inequalities: old and new methods, Gil, Zalău
2006.

[ClaHef04] W. Edwin Clark, Jim Hefferon, Elementary Number Theory, 5 January


2004.
http://joshua.smcvt.edu/numbertheory/book.pdf

[Cohen78] Daniel I. A. Cohen, Basic techniques of combinatorial theory, John Wiley


& Sons 1978.

[CoLiOs15] David A. Cox, John Little, Donal O’Shea, Ideals, Varieties, and Algo-
rithms: An Introduction to Computational Algebraic Geometry and Com-
mutative Algebra, 4th edition, Springer 2015.

[Comtet74] Louis Comtet, Advanced Combinatorics: The Art of Finite and Infinite
Expansions, D. Reidel Publishing Company, 1974.

[ConradE] Keith Conrad, Euler’s theorem.


https://kconrad.math.uconn.edu/blurbs/ugradnumthy/eulerthm.
pdf

[CorPer18] Scott Corry, David Perkinson, Divisors and Sandpiles: An Introduction


to Chip-Firing, AMS 2018.
See https://web.archive.org/web/20180428212224/http:
//people.reed.edu/~davidp/divisors_and_sandpiles/draft_
01.28.2018.pdf for a preprint.

[CraPom05] Richard Crandall, Carl Pomerance, Prime Numbers: A Computational


Perspective, 2nd edition, Springer 2005.

December 25, 2021


Math 235 notes page 823

[Day16] Martin V. Day, An Introduction to Proofs and the Mathematical Vernacu-


lar, 7 December 2016.
https://web.archive.org/web/20180712152432/https://www.
math.vt.edu/people/day/ProofsBook/IPaMV.pdf .

[Dijkst80] Edsger W. Dijkstra, On a theorem by Lambek and Moser, Report


EWD753, 1980.
https://www.cs.utexas.edu/users/EWD/ewd07xx/EWD753.PDF

[DJMP11] Dusan Djukic, Vladimir Jankovic, Ivan Matic, Nikola Petrovic, The
IMO Compendium: A Collection of Problems Suggested for The Interna-
tional Mathematical Olympiads: 1959-2009, 2nd edition, Springer 2011.
See https://www.imomath.com/index.php?options=350&lmm=0 for
errata.

[DLPS16] Birgit van Dalen, Julian Lyczak, Quintijn Puite, Merlijn Staps,
Finaletraining Wiskunde Olympiade, 21 November 2016.
https://www.wiskundeolympiade.nl/phocadownload/
finaletraining/finaletraining_binnenwerk_uitwerkingen.pdf

[DuaOli13] Rui Duarte, António Guedes de Oliveira, A short proof of a famous


combinatorial identity, arXiv:1307.6693v1.
https://arxiv.org/abs/1307.6693v1

[Dudley12] Underwood Dudley, Elementary Number Theory, 2nd edition, Courier


2012.

[DynUsp06] E. B. Dynkin, V. A. Uspenskii, Mathematical Conversations: Multicolor


Problems, Problems in the Theory of Numbers, and Random Walks, Dover
2006.

[Edward05] Harold M. Edwards, Essays in Constructive Mathematics, Springer


2005.
See https://www.math.nyu.edu/faculty/edwardsh/eserrata.pdf
for errata.

[EggWes98] Roger B. Eggleton, Western Maryland College Problems Group,


AMM problem #10501 with solution, The American Mathematical
Monthly, 105 (4), pp. 372.

[Elman20] Richard Elman, Lectures on Abstract Algebra, 28 September 2020.


https://www.math.ucla.edu/~rse/algebra_book.pdf

[Emerso69] Edgar I. Emerson, Recurrent sequences in the equation DQ2 = R2 + N,


Fibonacci Quarterly 7 (1969), issue 3, pp. 231–242.

[Engel97] Konrad Engel, Sperner theory, Cambridge University Press 1997.

December 25, 2021


Math 235 notes page 824

[Engel98] Arthur Engel, Problem-Solving Strategies, Springer 1998.

[ErdSze78] P. Erdös, G. Szekeres, Some Number Theoretic Problems on Binomial Co-


efficients, Australian Math. Soc. Gazette 5 (1978), pp. 97–99.
http://bsmath.hu/~p_erdos/1978-46.pdf

[Euler190] Leonhard Euler, Consideratio quarumdam serierum, quae singularibus


proprietatibus sunt praeditae, Novi Commentarii academiae scien-
tiarum Petropolitanae 3, pp. 86–108, Euler archive #E190.

[Excali97] Anon, A Proof of The Lambek and Moser Theorem, Mathematical Excal-
ibur 4 (1), 1997–1998, p. 2.

[FinRos16] Benjamin Fine, Gerhard Rosenberger, Number theory: An introduction


via the distribution of primes, 2nd edition, Birkhäuser 2016.

[FomZel02] Sergey Fomin, Andrei Zelevinsky, The Laurent Phenomenon, Advances


in Applied Mathematics 28 (2002), pp. 119–144.

[Foucar12] Simon Foucart, Notes on Problem Solving, 2012.


https://www.math.tamu.edu/~foucart/teaching/notes/
PbSolving.pdf

[Frankl20] Peter Frankl, Old and new applications of Katona’s circle,


arXiv:2011.14252v1.

[Gale98] David Gale, Tracking the automatic ant and other mathematical explo-
rations, Springer 1998.

[GalQua20] Jean Gallier and Jocelyn Quaintance, Algebra, Topology, Differential Cal-
culus, and Optimization Theory For Computer Science and Engineering, 22
March 2020.
https://www.cis.upenn.edu/~jean/gbooks/geomath.html

[Galvin17] David Galvin, Basic discrete mathematics, 13 December 2017.


http://www-users.math.umn.edu/~dgrinber/comb/
60610lectures2017-Galvin.pdf
(The URL might change, and the text may get updated. In
order to reliably obtain the version of 13 December 2017,
you can use the archive.org Wayback Machine: https:
//web.archive.org/web/20180205122609/http://www-users.
math.umn.edu/~dgrinber/comb/60610lectures2017-Galvin.pdf .)

[Galvin20] David Galvin, Notre Dame Math 43900: Problem Solving in Math,
lecture notes (work in progress),
https://www3.nd.edu/~dgalvin1/43900/43900_F20/index.html
(follow the overleaf link, once there allow javascript and note the
“Download PDF” button).

December 25, 2021


Math 235 notes page 825

[Gardne91] Martin Gardner, Fractal Music, Hypercards and More..., W. H. Freeman


& Co. 1991.

[GelAnd17] Răzvan Gelca, Titu Andreescu, Putnam and Beyond, 2nd edition,
Springer 2017.

[Golomb76] Solomon W. Golomb, The “Sales Tax” Theorem, Mathematics Magazine


49 (1976), no. 4, pp. 187–189.

[GolTch83] E. Goles, M. Tchuente, Iterative behaviour of generalized majority func-


tions, Mathematical Social Sciences 4 (1983), pp. 197–204.

[Goodma15] Frederick M. Goodman, Algebra: Abstract and Concrete, edition 2.6, 1


May 2015.
http://homepage.math.uiowa.edu/~goodman/algebrabook.dir/
book.2.6.pdf .

[Gould72] H. W. Gould, A new greatest common divisor property of the binomial


coefficients, Fibonacci Quarterly 10 (1972), issue 6, pp. 579–584 and
628, errata in 11 (1973), issue 2, p. 168.

[Granvi05] Andrew Granville, Binomial coefficients modulo prime powers, preprint.


https://web.archive.org/web/20181024055320/http://ebooks.
bharathuniv.ac.in/gdlc1/gdlc1/EngineeringMergedLibraryv3.0/
AndrewGranville/BinomialCoefficientsModuloPrimePowers(5579)
/BinomialCoefficientsModuloPrimePowers-AndrewGranville.pdf

[Grinbe07] Darij Grinberg, The Vornicu-Schur inequality and its variations, 13 Au-
gust 2007.
http://www.cip.ifi.lmu.de/~grinberg/VornicuS.pdf

[Grinbe08] Natalia Grinberg, Lösungsstrategien: Mathematik für Nachdenker, Harri


Deutsch 2008.

[Grinbe15] Darij Grinberg, Notes on the combinatorial fundamentals of algebra, 10


January 2019.
http://www.cip.ifi.lmu.de/~grinberg/primes2015/sols.pdf
The numbering of theorems and formulas in this link might shift
when the project gets updated; for a “frozen” version whose num-
bering is guaranteed to match that in the citations above, see https:
//github.com/darijgr/detnotes/releases/tag/2019-01-10 .

[Grinbe16] Darij Grinberg, 18.781 (Spring 2016): Floor and arithmetic functions, 13
April 2019.

[Grinbe18] Darij Grinberg, Zeckendorf family identities generalized,


arXiv:1103.4507v2, 10 June 2018.

December 25, 2021


Math 235 notes page 826

[Grinbe19a] Darij Grinberg, The Lucas and Babbage congruences, 10 January 2019.

[Grinbe19b] Darij Grinberg, math.stackexchange answer #2786815 (answer to “The se-


lection of a linear recurrent sequence over the field is LRS too”), Mathe-
matics Stack Exchange.
https://math.stackexchange.com/q/2786815

[Grinbe19c] Darij Grinberg, Fleck’s binomial congruence using circulant matrices, 14


July 2019.

[GriSne07] Charles M. Grinstead, J. Laurie Snell, Introduction to Probability, 2nd


edition, 4 July 2006.

[GrKnPa94] Ronald L. Graham, Donald E. Knuth, Oren Patashnik, Concrete Math-


ematics, Second Edition, Addison-Wesley 1994.
See https://www-cs-faculty.stanford.edu/~knuth/gkp.html for
errata.

[Guicha20] David Guichard, An Introduction to Combinatorics and Graph Theory, 30


January 2020.
https://www.whitman.edu/mathematics/cgt_online/book/

[Gunder10] David S. Gunderson, Handbook of Mathematical Induction: Theory and


Applications, CRC Press 2010.

[Hadama09] Jacques Hadamard, Lessons in Geometry: I. Plane Geometry, AMS 2008.


https://bookstore.ams.org/mbk-57

[Hammac15] Richard Hammack, Book of Proof, 3.2rd edition, 24 July 2020.


https://www.people.vcu.edu/~rhammack/BookOfProof/

[Harju11] Tero Harju, Lecture Notes in Combinatorial Enumeration, 12 June 2016.


https://users.utu.fi/harju/combinenum/combinenum11.htm

[Heffer20] Jim Hefferon, Linear Algebra, 4th edition 2020.


http://joshua.smcvt.edu/linearalgebra

[Hender16] Nik Henderson, What is Zeckendorf’s Theorem?, 23 July 2016.


https://math.osu.edu/sites/math.osu.edu/files/henderson_
zeckendorf.pdf

[HilHog72] A. P. Hillman and V. E. Hoggatt, Jr., A Proof of Gould’s Pascal Hexagon


Conjecture, Fibonacci Quarterly 10 (1972), issue 6, pp. 579–584 and
598.

[Hoggat72] V. E. Hoggatt, Jr., Generalized Zeckendorf theorem, Fibonacci Quarterly


10 (1972), issue 1, pp. 89–93.

December 25, 2021


Math 235 notes page 827

[Honsbe12] Ross Honsberger, Episodes in Nineteenth and Twentieth Century Eu-


clidean Geometry, MAA 2012.

[Honsbe70] Ross Honsberger, Ingenuity in Mathematics, MAA 1970.

[Hung07] Pham Kim Hung, Secrets in Inequalities, volume 1, GIL 2007.

[Ivanov08] Nikolai V. Ivanov, Linear Recurrences, 17 January 2008.


https://nikolaivivanov.files.wordpress.com/2014/02/
ivanov2008arecurrence.pdf

[Ivanov18] O. A. Ivanov, Portal through Mathematics, Anneli Lax New Mathemat-


ical Library 52, MAA Press 2018.

[Jarvin20] Olli Järviniemi, Ollin Opas Olympiatason Ongelmanratkaisuun, 9


November 2020.
https://matematiikkakilpailut.fi/kirjallisuus/OOOO.pdf

[Jones75] James P. Jones, Diophantine Representation of the Fibonacci numbers, Fi-


bonacci Quarterly 13 (1975), issue 1, pp. 84–88.

[Joyce17] David Joyce, Introduction to Modern Algebra, 5 December 2017.


https://mathcs.clarku.edu/~djoyce/ma225/algebra.pdf

[Joyner08] W. D. Joyner, Mathematics of the Rubik’s cube, 19 August 2008.


https://web.archive.org/web/20160304122348/http://www.
permutationpuzzles.org/rubik/webnotes/ (link to the PDF at the
bottom).

[Jukna11] Stasys Jukna, Extremal Combinatorics with Applications in Computer


Science, 2nd edition, Springer 2011.
See http://www.thi.informatik.uni-frankfurt.de/~jukna/EC_
Book_2nd/index.html for a draft and errata.

[Kamp15] Peter H. van der Kamp, Somos-4 and Somos-5 are arithmetic divisibility
sequences, Journal of Difference Equations and Applications 22 (2016),
issue 4. See arXiv:1505.00194v1 for a preprint.

[Kedlay20] Kiran Kedlaya et al., The Putnam archive, 2020.


https://kskedlaya.org/putnam-archive/

[Klivan18] Caroline J. Klivans, The Mathematics of Chip-Firing, CRC Press 2018.

[Knapp16] Anthony W. Knapp, Basic Algebra, digital second edition 2016.


http://www.math.stonybrook.edu/~aknapp/download.html

[LamMos54] Joachim Lambek, Leo Moser, Inverse and Complementary Sequences of


Natural Numbers, The American Mathematical Monthly, 61 (7), Aug-
Sep 1954, pp. 454–458.

December 25, 2021


Math 235 notes page 828

[Larson83] Loren C. Larson, Problem-Solving Through Problems, Springer 1983.

[Lee07] Hojoo Lee, Topics in Inequalities: Theorems and Techniques, 8 August


2007.
https://www.isinj.com/mt-usamo/TopicsinInequalities1stedition-HojooLee(2007)
.pdf

[LeeShi19] Jonghyeon Lee, Heesung Shin, The chromatic polynomial for cy-
cle graphs, Korean J. Math. 27, No 2 (2019) pp. 525–534,
arXiv:1907.04320v1.

[LeLeMe16] Eric Lehman, F. Thomson Leighton, Albert R. Meyer, Mathematics for


Computer Science, revised Tuesday 6th June 2018,
https://courses.csail.mit.edu/6.042/spring18/mcs.pdf .

[LeLoPo08] Hojoo Lee, Tom Lovering, and Cosmin Pohoata, Infinity, 19 October
2008.
http://prac.im.pwr.wroc.pl/~kwasnicki/pl/o/infinity.pdf

[Lengye06] Tamás Lengyel, A counting based proof of the generalized Zeckendorf’s


theorem, Fibonacci Quarterly 44 (2006), issue 4, pp. 324–325.

[Liu68] C. L. Liu, Introduction to Combinatorial Mathematics, McGraw–Hill


1968.

[Liu85] C. L. Liu, Elements of discrete mathematics, 2nd edition, McGraw–Hill


1985.

[Loehr11] Nicholas A. Loehr, Bijective Combinatorics, Chapman & Hall/CRC


2011.

[Loehr19] Nicholas A. Loehr, An Introduction to Mathematical Proofs, CRC Press


2020.
See https://personal.math.vt.edu/nloehr/prfbook.html for er-
rata and solutions.

[Macgil17] Gary MacGillivray, Discrete Math Study Materials, 2017.


https://www.math.uvic.ca/faculty/gmacgill/guide/index.html

[Malouf92] Janice L. Malouf, An integer sequence from a rational recursion, Discrete


Mathematics 110 (1992), pp. 257–261.

[Markus83] Aleksei Ivanovich Markushevich, Recursion sequences, Mir Publishers,


Moscow, 2nd printing 1983.

[Mazur10] David R. Mazur, Combinatorics: A Guided Tour, MAA 2010.

[Mcclea17] John McCleary, Exercises in (Mathematical) Style: Stories of Binomial


Coefficients, 2nd printing, MAA Press 2018.

December 25, 2021


Math 235 notes page 829

[Melian01] María Victoria Melián, Linear recurrence relations with constant coeffi-
cients, 9 April 2001.
http://matematicas.uam.es/~mavi.melian/CURSO_15_16/web_
Discreta/recurrence.pdf

[MerJoh19] Mircea Merca, Warren P. Johnson, American Mathematical Monthly


problem #12022 with solution, The American Mathematical Monthly,
126:8 (2019), pp. 755–763.

[Mildor06] Thomas J. Mildorf, Olympiad Inequalities, 4 August 2006.


https://www.isinj.com/mt-usamo/OlympiadInequalities-ThomasMildorf(2006)
.pdf

[Narkie00] Władysław Narkiewicz, The Development of Prime Number Theory:


From Euclid to Hardy and Littlewood, Springer 2000.

[Neale17] Vicky Neale, Closing the Gap: The Quest to Understand Prime Numbers,
Oxford University Press 2017.

[Negut05] Andrei Negut, Problems for the Mathematical Olympiads, Gil 2005.

[Newste20] Clive Newstead, An Infinite Descent into Pure Mathematics, version 0.5
preview, 26 September 2020.
https://infinitedescent.xyz

[NiZuMo91] Ivan Niven, Herbert S. Zuckerman, Hugh L. Montgomery, An Intro-


duction to the Theory of Numbers, 5th edition, Wiley 1991.
See http://www-personal.umich.edu/~hlm/nzm/index.html for er-
rata and supplements.

[Pak10] Igor Pak, Lectures on Discrete and Polyhedral Geometry, 20 April 2010.
https://www.math.ucla.edu/~pak/geompol8.pdf

[Parvar11] Amir Hossein Parvardi, Lifting The Exponent Lemma (LTE), version 6,
7 April 2011.
https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.
221.5543

[PeWiZe97] Marko Petkovšek, Herbert S. Wilf, Doron Zeilberger, A=B, 27 April


1997, A.K. Peters 1996.
https://www.math.upenn.edu/~wilf/AeqB.html

[PolSze78] George Pólya, Gabor Szegő, Problems and Theorems in Analysis I,


Springer 1978 (reprinted 1998).

[Polya73] George Polya, How to Solve It: A New Aspect of Mathematical Method,
Princeton University Press, 2nd edition 1973.

December 25, 2021


Math 235 notes page 830

[Polya81] George Polya, Mathematical Discovery, combined edition, John Wiley


& Sons 1981.

[Poorte04] Alfred J. van der Poorten, Elliptic curves and continued fractions,
arXiv:math/0403225v3.

[Riorda68] John Riordan, Combinatorial Identities, Robert E. Krieger Publishing


Company, Huntington, NY 1979.

[RitHee13] Benoît Rittaud, Albrecht Heeffer, The Pigeonhole Principle, Two Cen-
turies Before Dirichlet, The Mathematical Intelligencer, 36(2), pp. 27–
29.

[Rivlin90] Theodore J. Rivlin, Chebyshev Polynomials: From Approximation Theory


to Algebra and Number Theory, 2nd edition, Wiley 1990.

[Russel16] Matthew Christopher Russell, Using experimental mathematics to con-


jecture and prove theorems in the theory of partitions and commutative and
non-commutative recurrences, PhD thesis at Rutgers University, 2016.

[Schole05] John Scholes aka kalva, Maths problems, ca. 2005.


The original site is no longer available, but parts of it have been
archived in several places:
https://webee.technion.ac.il/people/aditya/www.kalva.demon.
co.uk/
https://prase.cz/kalva/putnam.html
https://web.archive.org/web/20070930165736/http://www.
kalva.demon.co.uk/
https://web.archive.org/web/20020927115327/http://www.
kalva.demon.co.uk/

[Shapir76] L. W. Shapiro, A Catalan triangle, Discrete Mathematics 14 (1976), pp.


83–90.

[ShChYa62] David Oskarovich Shklarsky, Nikolai Nikolaevich Chentzov, Isaak


Moiseevich Yaglom, The USSR Olympiad Problem Book, Freeman 1962
(reprinted by Dover 1993).

[Smid09] Vita Smid, Inclusion-Exclusion Principle: Proof by Mathematical Induc-


tion, 2 December 2009.
https://faculty.math.illinois.edu/~nirobles/files453/iep_
proof.pdf

[SpeStu09] David Speyer, Bernd Sturmfels, Tropical Mathematics, Mathematics


Magazine 82 (2009), pp. 163–173.

[Spivey19] Michael Z. Spivey, The Art of Proving Binomial Identities, CRC Press
2019.

December 25, 2021


Math 235 notes page 831

[SpQuBa20] Eckard Specht, Erhard Quaisser, Patrick Bauermann, 50 Jahre Bun-


deswettbewerb Mathematik: Die schönsten Aufgaben, 2te Auflage,
Springer 2020.
[Stanle01] Richard P. Stanley, Enumerative Combinatorics, volume 2, Cambridge
University Press 2001.
See http://math.mit.edu/~rstan/ec/ for errata.
[Stanle11] Richard P. Stanley, Enumerative Combinatorics, volume 1, Second edi-
tion, version of 15 July 2011. Available at http://math.mit.edu/
~rstan/ec/ .
See http://math.mit.edu/~rstan/ec/ for errata.
[Stanle15] Richard P. Stanley, Catalan Numbers, 1st edition, Cambridge Univer-
sity Press 2015.
[Steele04] J. Michael Steele, The Cauchy–Schwarz Master Class: An Introduction to
the Art of Mathematical Inequalities, Cambridge University Press 2004.
See http://www-stat.wharton.upenn.edu/~steele/Publications/
Books/CSMC/CSMC_Errata.pdf for errata.
[Stein09] William Stein, Elementary Number Theory: Primes, Congruences, and
Secrets, Springer 2009.
[Steinb06] Mark Steinberger, Algebra, 31 August 2006.
https://web.archive.org/web/20180821125315/https://www.
albany.edu/~mark/algebra.pdf
[Strasz65] S. Straszewicz, Mathematical Puzzles and Problems from the Polish Math-
ematical Olympiads, Pergamon Press 1965.
[Strick20] Neil Strickland, Linear mathematics for applications, 11 February 2020.
https://neilstrickland.github.io/linear_maths/notes/linear_
maths.pdf
[Suksom20] Warut Suksompong, Graph Cycles and Olympiad Problems, Mathemat-
ics Magazine 93 (2020), pp. 284–287.
[Sved84] Marta Sved, Counting and Recounting: The Aftermath, The Mathemati-
cal Intelligencer 6 (1984), no. 2, pp. 44–45.
[Swanso20] Irene Swanson, Introduction with Analysis with Complex Numbers, 2020.
https://web.archive.org/web/20201012174324/https://people.
reed.edu/~iswanson/analysisconstructR.pdf
[TAoCP3] Donald A. Knuth, The Art of Computer Programming, volume 3: Sorting
and Searching, 2nd edition, Addison–Wesley 1998.
See https://www-cs-faculty.stanford.edu/~knuth/taocp.html for
errata.

December 25, 2021


Math 235 notes page 832

[TAoCP4A] Donald A. Knuth, The Art of Computer Programming, volume 4A: Com-
binatorial Algorithms, Part 1, Addison–Wesley 2011.
See https://www-cs-faculty.stanford.edu/~knuth/taocp.html for
errata.

[TatWin05] Leung Tat-Wing, The Method of Infinite Descent, Mathematical Excal-


ibur 10 (2005), nr. 4.

[Tomesc85] Ioan Tomescu, Problems in Combinatorics and Graph Theory, translated


by Robert A. Melter, John Wiley & Sons 1985.

[UspHea39] J. V. Uspensky, M. A. Heaslet, Elementary Number Theory, 1st edition,


McGraw-Hill 1939.
See https://projecteuclid.org/euclid.bams/1183502492 for some
corrections.

[VelWag20] Daniel J. Velleman, Stan Wagon, Bicycle or Unicycle? A Collection of


Intriguing Mathematical Puzzles, AMS/MAA Problem Books 36, MAA
Press 2020.

[Vorobi02] Nicolai N. Vorobiev, Fibonacci Numbers, Translated from the Russian


by Mircea Martin, Springer 2002 (translation of the 6th Russian edi-
tion).

[Wagner05] Carl G. Wagner, Basic Combinatorics, 14 February 2005.


http://www.math.utk.edu/~wagner/papers/comb.pdf

[Wagner08] David G. Wagner, C&O 330: Introduction to Combinatorial Enumeration,


9 August 2008.
https://web.archive.org/web/20110124001354/http://www.math.
uwaterloo.ca/~dgwagner/MATH249/co330.pdf

[Walker87] Elbert A. Walker, Introduction to Abstract Algebra, Random House-


/Birkhauser, New York, 1987.

[Wallis85] John Wallis, A Treatise of Algebra, London 1685.

[Wemyss14] Michael Wemyss, A very elementary proof that the Somos 5 sequence is
integer valued, 28 April 2014.
https://www.maths.gla.ac.uk/~mwemyss/Somos5proof.pdf

[White10a] Dennis White, Math 4707: Chromatic Polynomials, 3 November 2010.


http://www-users.math.umn.edu/~reiner/Classes/Chromatic.pdf

[White10b] Dennis White, Math 4707: Inclusion-Exclusion and Derangements, 18


October 2010.
http://www-users.math.umn.edu/~reiner/Classes/Derangements.
pdf

December 25, 2021


Math 235 notes page 833

[YagYag64] Akiva M. Yaglom, Isaac M. Yaglom, Challenging Mathematical Problems


with Elementary Solutions, volume I: Combinatorial Analysis and Probabil-
ity Theory, Holden-Day 1964 (reprinted by Dover 1987).

[YagYag67] Akiva M. Yaglom, Isaac M. Yaglom, Challenging Mathematical Problems


with Elementary Solutions, volume II: Problems from Various Branches of
Mathematics, Holden-Day 1967 (reprinted by Dover 1987).

[Yiu12] Paul Yiu, Problem Solving and Recreational Mathematics, 2 August 2012.
http://math.fau.edu/Yiu/Oldwebsites/PSRM2012/
00PSRM2012Chapters1to44.pdf

[Zagier96] Don Zagier, Problems posed at the St Andrews Colloquium, 1996.


http://www-groups.mcs.st-andrews.ac.uk/~john/Zagier/
Problems.html

[ZawHit09] Alexander Zawaira, Gavin Hitchcock, A Primer for Mathematics Com-


petitions, Oxford University Press 2009.

[Zeitz17] Paul Zeitz, The Art and Craft of Problem Solving, 3rd edition, Wiley
2017.

[Zhao20] Yufei Zhao, Math Olympiad training handouts, https://yufeizhao.


com/olympiad/ .

[Zill17] Dennis G. Zill, A First Course in Differential Equations with Modeling


Applications, Cengage 2017.

December 25, 2021

You might also like