-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.typ
More file actions
3153 lines (2575 loc) · 176 KB
/
main.typ
File metadata and controls
3153 lines (2575 loc) · 176 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#import "@local/typst-template:0.40.0": *
#show: template.with(
title: [DSA],
authorship: (
(
name: "Adam Martinez",
affiliation: "University of Life",
email: "staying@never.land",
),
),
)
= The Algorithm Design Manual
== Introduction to Algorithm Design
/ Problem 1-9: \
The algorithm proves correct because the evolution of the resulting polynomial leads to a
progressive multiplication of the unknown by all former factors, such that the largest exponent of
the unknown in the polynomial remains the largest polynomial at the end of the multiplication.
Because the additional sum in the multiplication is also multiplied by the same additional factor
of $x$ so long as the control variable is less than the smallest factor, namely 0, we can state
that the last factor in the resulting polynomial will always avoid multiplication by the
polynomial (i.e. the last constant factor is not multiplied by the unknown, as the problem expects
from the polynomial of the form provided in the statement.)
/ Problem 1-10: \
The algorithm considers the whole sequence for as many iterations as there are elements of the
sequence minus 1. Throuhgout such iterations, the algorithm considers comparisons between all
elements of each of the subsequences that have not yet been sorted, such that all numbers that are
in their right order-statistic will always remain in the tail end of the original sequence. This
makes for an incrementally smaller amount of comparisons across iterations, as each iteration
discards the last elements of the last subsequence formed through iterations, knowing the
order-statistic of the elements is that of incremental ordering.
/ Problem 1-11: \
The problem is solved through a recursive procedure whereby the base assumption is that the GCD of
a number and 0 is always going to be that number. Based on this, it performs the modulo operation
between the numbers knowing that the residue of integer division represents the imprecission with
which a number cannot be divided by another number. This operation also denotes the fact that the
left operand is capable of being divided by all prime factors of the number to the left, such that
if that is not the case, we are provided with a residue. This being the difference between the
largest factor of a given number right before reaching the target number, it itself can be used as
the object of the next modulo operation with the number whose multiple did not quite hit the goal;
this will produce an increasingle smaller sequence of numbers that try to "fill up" the entirety
of the original number by performing the largest possible division and only stopping once such
that division yields a modulo 0 (i.e. the number yield by integer division is indeed the largest
possible number fitting the ever present difference between the initial numbers' largest prime
factors; an alternative definition for the GCD.)
/ Problem 1-12: \
The problem statement provides information on one of the basic formulas for sums. This formula is
a consequence of summing some number starting at 1 to some other number $>= 0$. The base
assumption in the induction is that the target number $n$ in the sum
$
sum^n_(i = 0) i
$
is expected to recurse for numbers larger than $n = 0$. Thus, the recurrence relation on the
evaluation of the function (i.e. not on its time complexity) is
$
f(n, i) = cases(
n & "if" i = n\,,
0 & "if" n = 0\,,
i + f(n, i + 1) & "otherwise".
)
$ <p112-rec-rel>
Assumming that $i = 1$ at the start of the call, the resulting stack would look something like the
following.
$
i + f(n, i + f(n, dots.c space n)) = (n dot (n + 1)) / 2.
$ <p112-gen-stack>
Surely the factor taking on the value of $n$ must be equal to the same factor as the one in the
resulting formula. This is due to the fact that we always perform $n$ sums. Now, the reason why
the formula is capable of generalizing the behavior of all terms in the sum to $(n + 1) / 2$ is
yet unknown to me. Say we took $n = 4$. In this case, we would see ourselves with the following
call stack as per the recurrence relation described in @p112-rec-rel.
$
1 + f(4, 1 + f(4, 1 + f(4, 1 + f(4, 1)))).
$
Or maybe my assumption on the function's recurrence is wrong for the case where $i != n, 0$. This
is likely the case, because otherwise the recursion would not be discrete for discrete values of
$n$. Thus, reformulated, the function's evaluation recurrence could be as follows.
$
f(n, i) = cases(
n & "if" i = n\,,
0 & "if" i = 0\,,
i + f(n, i + 1) & "otherwise".
)
$
This relation turned out to be the same as the one initially formulated in @p112-rec-rel. That
likely means what's wrong was my base assumption on the generalized behavior of the recursed stack
in @p112-gen-stack.
If that is, indeed, the case, then the real generalized behavior would look something like the
following.
$
i + f(n, i + 1) => (i + 1) + f(n, (i + 1) + 1) => dots.c & => (i + 1 + dots.c + 1) + f(n, n) \
& => (n - 1) + f(n, n).
$
Based on the observation of the behavior of the function, it seems like by the end iteration, once
$i = n$, the additional factor $(i + 1 + dots.c + 1)$ is likely to evaluate to $n - 1$. Thus, for
some $n = 4$, the development of the above formula would be as follows.
$
1 + f(4, 1 + 1) & => (1 + 1) & + & f(4, (1 + 1) + 1) \
& => ((1 + 1) + 1) & + & f(4, ((1 + 1) + 1) + 1) \
& => & & (((1 + 1) + 1) + 1).
$
Upon unwinding the stack, the above formulation would end up looking like the sum of all integer
values going from 1 to $n = 4$, indeed.
$
1 + f(4, 1 + 1) & => (1 + 1) & + & ((1 + 1) + 1) + (((1 + 1) + 1) + 1) \
& => ((1 + 1) + 1) & + & (((1 + 1) + 1) + 1) \
& => & & (((1 + 1) + 1) + 1). \
$ <p112-rewind>
#v(-.5em)
#un-math[$
1 + (1 + 1) + ((1 + 1) + 1) + (((1 + 1) + 1) + 1).
$]
Clearly, we're performing an $n$ number of sums, and thus that explains the $n$ factor in the
resulting formula, but I can't quite figure out the reason behind the $(n + 1) / 2$ factor. It
seems as if the generalization of the sum of any number $n$ from 1 to such number $n$ is dominated
by half the integer following such number. For $n = 4$, $(n + 1) / 2 = 5 / 2$, and thus
$4 dot 5 / 2 = 8 / 2 dot 5 / 2 = 40 / 4 = 10$.
Maybe the relation is drawn from the participating sums in the resulting expression; Where the
last factor is always known to be $n$ and the first factor is always known to be 1, the middle
factors ought have some relationship to the last factor such that $(n + 1) / 2$ produces the right
result. Surely there is a pattern in the evolution of those middle factors between the target $n$
and the initial 1.
Say we took $n = 3$. One would easily realize that the middle factors in $1 + dots.c + n$ ought
sum to $n - 1$, for $1 + 1$, the factor following the initial 1, is the only one between it and
this $n$. Unlike with $n = 3$, though, $n = 4$ yields a different expression in terms of $n$ for
the middle factors: $n + 1$. I can't quite discern a pattern in the signs, beyond a possibly
even/odd-relationship, which I am lead to believe will not help much for larger values of $n$.
For $n = 5$, the middle terms add up to 9, which indeed, yields $n + 4$. Maybe this describes a
series related to powers of 2? Further, for $n = 6$, the middle terms sum to $n + 8$. Indeed, it
seems as if the added factor could be described in terms of a power of 2 or possibly a fraction
with denominator 2. What about $n = 7$? The mid-terms sum to $n + 13$. Welp. No power of 2 nor
fraction with denominator 2 can possibly describe 13.
But maybe there's still hope for a pattern; It seems as if the sum of the considered $n$ with the
additional factor of the mid-terms of the prior $n$, namely $n - 1$, seem to add up to a number
that, subtracting 2, yields the right mid-terms for the current value of $n$. Take $n = 5$.
Considering the sum for $n - 1$ yields mid-terms $(n - 1) + 1$, one can state that
$n + (n + 1 - 2) = n + 4$. Indeed, because the mid-terms of some $n$ integrate those of $n - 1$,
we can express them in terms of $n - 1$'s sum of mid-terms.
Take now $n = 6$. The mid-terms for $n - 1 = 5$, yield $(n - 1) + 4$, and thus
$n + (n + 4 - 2) = n + 8$. As it turns out, that is, indeed, the sum of the mid-terms of $n = 6$.
But let us test in full the results of our prior findings; Take now $n = 7$. For $n - 1 = 6$, we
have just described how the mid-terms are given by $(n - 1) + 8$, so the mid-terms of $n = 7$
should be described by $n + (n + 8 - 2) = n + 13$. Well, that seems like a fine result, indeed.
Let us test now the mid-terms for $n = 8$, where we know the mid-terms of $n - 1 = 7$ to be
$(n - 1) + 13$, we should also know the mid-terms of $n = 8$ to be $n + (n + 13 - 2) = n + 19$.
This, indeed, provides the correct result, as it is proven by the fact that
$
sum_(i = 0)^(n = 8) i = (n dot (n + 1)) / 2 = (8 dot (8 + 1)) / 2 & = 36. \
36 - (8 + 1) & = 27.
$
The issue in our formulation lies now in the fact that the sum of some number $n$ depends on
knowing not only the sum of the mid-terms for the sum of $n - 1$, but on being capable of
expressing those terms in the form $(n - 1) + k$, where $k$ is the key number in computing the
mid-terms of $n$ through the expression $n + (n + k - 2)$, such that the total sum may be
expressed as
$
underbrace(n + (n + k - 2), #[mid-terms]) + overbrace((n + 1), #[initial and final terms]).
$
For this, though, there may still be a pattern yet to be exploited. Consider the value of $k$ as
we moved through $n = 5, 6, 7, 8$.
$
n = 5 & => k = 4, \
n = 6 & => k = 8, \
n = 7 & => k = 13, \
n = 8 & => k = 19.
$
Further examination leads to $n = 9 => k = 26, n = 10, k = 34$. I struggle now to see the pattern
I believed there to exist. Maybe there's some relationship in the way these numbers add up
together?
$
& "For" & n && = & 5, & k && = & 4 & => & 4 - 5 & = & -1, \
& "For" & n && = & 6, & k && = & 8 & => & 8 - 6 & = & 2, \
& "For" & n && = & 7, & k && = & 13 & => & 13 - 7 & = & 6, \
& "For" & n && = & 8, & k && = & 19 & => & 19 - 8 & = & 11, \
& "For" & n && = & 9, & k && = & 26 & => & 26 - 9 & = & 17, \
& "For" & n && = & 10, & k && = & 34 & => & 34 - 10 & = & 24, \
& "For" & n && = & 11, & k && = & 54 & => & 54 - 11 & = & 43. \
$
The value of $k$ is wrong for all of the above; $k$ is supposed to be factor in $(n - 1) + k$ used
to compute the mid-terms of $n - 1$. With this correction, maybe we can find another pattern in
these results?
$
& "For" & n && = & 6, & k && = & 4 , \
& "For" & n && = & 7, & k && = & 8 , \
& "For" & n && = & 8, & k && = & 7 , \
& "For" & n && = & 9, & k && = & 19, \
& "For" & n && = & 10, & k && = & 26, \
& "For" & n && = & 11, & k && = & 34. \
$
There doesn't seem to be a pattern in this series. Let us rewind back to the point where we
concluded that the total number of sums is equal to the multiplication of $n$, namely, to
@p112-rewind.
At that point, we had concluded that we performed $n$ sums, but we weren't capable of deriving the
meaning behind the $(n + 1) / 2$ factor. Now, were we to compute $n dot n$, we would be computing
$n$ sums of the value of $n$, of which to compute the sum as we know, we would be required to
subtract from each of those $n$ terms an increasingly larger term $k$.
This relationship, for some discrete $n = 4$, translates as follows.
$
4 + 4 + 4 + 4 & = && (1 + 1 + 1 + 1) & + & (1 + 1 + 1 + 1) + \
& && (1 + 1 + 1 + 1) & + & (1 + 1 + 1 + 1). \
& => && (1 + 1 + 1 + 1 - 3) & + & (1 + 1 + 1 + 1 - 2) + \
& && (1 + 1 + 1 + 1 - 1) & + & (1 + 1 + 1 + 1). \
$
This leads to the following conclusion, as per the recurrence relation defined in @p112-rec-rel.
$
sum_(i = 1)^(n) i = n^2 - sum_(i = 1)^(n - 1) i = n^2 - ((n - 1)^2 - (dots.c - 0)), "for" n >= 0.
$
To avoid computing the sum in terms of another sum, we may choose to compute $(n + 1) dot n$,
which for a discrete value $n = 4$ yields
$
5 + 5 + 5 + 5 & = && (1 + 1 + 1 + 1 + 1) & + & (1 + 1 + 1 + 1 + 1) + \
& && (1 + 1 + 1 + 1 + 1) & + & (1 + 1 + 1 + 1 + 1). \
& => && (1 + 1 + 1 + 1 + 1 - 2) & + & (1 + 1 + 1 + 1 + 1 - 1) + \
& && (1 + 1 + 1 + 1 + 1 - 0) & + & (1 + 1 + 1 + 1 + 1). \
$
I see it now. Computing $n$ sums of $n + 1$ yields a set of terms where, compared with the sum
proper, we can compute it one of two ways, from the right or from the left. Mathematically
speaking, this means each unit subsum of $n + 1$ yields a value that is equal to the same subsum
minus an increasingly smaller $k$, where $1 <= k < n + 1$.
This implies that for some term $n$, its sum in terms of $n + 1$ is given by
$
sum_(i = 1)^n i = & (1 + 1 + dots.c + 1_(n + 1) - n)_1 + (1 + 1 + dots.c + 1_(n + 1) - (n - 1))_2 + dots.c \
& dots.c + (1 + 1 + dots.c + 1_(n + 1) - 1)_n.
$
Because the series described by the ever-present negative term $n - k$, where $0 <= k < n$, can
further expand in the development of the sum to
$
sum_(i = 1)^n i & = && (n + 1)_1 + (n + 1)_2 + dots.c + (n + 1)_n - (n + (n - 1) + dots.c + 1) \
& = && (n + 1)_1 + (n + 1)_2 + dots.c + (n + 1)_n - ((n + 1) + n + dots.c + 1) \
& = && (n + 1)_1 + (n + 1)_2 + dots.c + (n + 1)_n - ((n + 1) + (n + 1) + dots.c + 1) \
& = && (n + 1)_1 + (n + 1)_2 + dots.c + (n + 1)_n - (n / 2 dot (n + 1)) \
& = && n dot (n + 1) - n / 2 dot (n + 1) \
& = && (n dot (n + 1)) / 2.
$ <p112-basic-sum-c1>
And this proves the sum formula correct. The key was in finding the equivalence between a sum of
integer terms $[n, 1]$ to be $(n dot (n + 1)) / 2$. If we look closely at the sum
$n + (n - 1) + dots.c + 1$, we realize that by grouping the first and last term, we consistently
form $n + 1$ terms, that on an even $n$ produce a division of the initial $n$-sized group into
$n / 2$ subsets of $n + 1$. On odd values of $n$, the sequence always yields the expression
$(n + 1) + (n + 1) + dots.c + (n + 1) / 2$, where there are $floor(n / 2) dot (n + 1)$ terms akin
to the prior terms, and one $(n + 1) / 2$ term, totaling
$
floor(n / 2) dot (n + 1) + (n + 1) / 2 & = ((n - 1) dot (n + 1)) / 2 + (n + 1) / 2 \
& = ((n - 1 + 1) dot (n + 1)) / 2 \
& = (n dot (n + 1)) / 2.
$ <p112-basic-sum-c2>
/ Problem 1-13: \
The problem asks for another famous formula on sums, that being a polynomial where the $i$ control
variable is squared. Proving this should be easier than the prior formula because I can account
for that formula as a true statement not requiring proof. The next statement to prove should also
be fairly simple to prove considering it raises the constant exponential factor to 3.
The formula in question is
$
sum_(i = 1)^n i^2, "for" n >= 0.
$
This formula is really the same as the prior formula, whereby instead of considering a single
factor of $i$, I am to consider two factors of $i$.
$
sum_(i = 1)^n i dot i = & ((1 + 1 + dots.c + 1_(n + 1) - n) &dot& (1 + 1 + dots.c + 1_(n + 1) - n)) &&+ \
& ((1 + 1 + dots.c + 1_(n + 1) - (n - 1)) &dot& (1 + 1 + dots.c + 1_(n + 1) - (n - 1))) &&+ dots.c + \
& ((1 + 1 + dots.c + 1_(n + 1) - 1) &dot& (1 + 1 + dots.c + 1_(n + 1) - 1)).&&
$
Factorization can now be performed in terms of the additional $n$-term in each of the sum terms,
as the same $n$-term is mutliplying both expansions of each value of $i$ throughout the series.
This can be done by considering, for generalization purposes, the first term $((n + 1) - n)^2$,
which we can develop through the binomial theorem.
$
((n + 1) - n)^2 & = && sum_(k = 0)^(j = 2) binom(j, k) dot (n + 1)^(j - k) dot (-n)^k \
& = && 2! / (0! (2 - 0)!) dot (n + 1)^(2 - 0) dot (-n)^0 + \
& && 2! / (1! (2 - 1)!) dot (n + 1)^(2 - 1) dot (-n)^1 + \
& && 2! / (2! (2 - 2)!) dot (n + 1)^(2 - 2) dot (-n)^2 \
& = && (n + 1)^2 - 2n(n + 1) + n^2.
$ <p113-first-binom>
The first term in the expression can further yield another expansion of the binomial theorem.
$
(n + 1)^2 = sum_(k = 0)^(j = 2) binom(j, k) dot n^(j - k) dot 1^k
= & 2! / (0!(2 - 0)!) dot n^(2 - 0) dot 1 + \
& 2! / (1!(2 - 1)!) dot n^(2 - 1) dot 1 + \
& 2! / (2!(2 - 2)!) dot n^(2 - 2) dot 1 \
= & n^2 + 2n + 1.
$ <p113-second-binom>
Thus the complete expression for the first term of the sum proves correct as per the following
resolution, where @p113-second-binom is plugged into @p113-first-binom.
$
n^2 + 2n + 1 - 2n(n + 1) + n^2 = 1.
$
The result from @p113-first-binom should be generalizable to any term of the sum, such that
$
sum_(i = 1)^(n) i^2 = & ((n + 1)^2 && - 2n(n + 1) && + n^2) && + \
& ((n + 1)^2 && - 2(n - 1)(n + 1) && + (n - 1)^2) && + dots.c + \
& ((n + 1)^2 && - 2(n + 1) && + 1). &&
$
Beyond this, I'm at a loss. The $(n + 1)^2$ term can be extracted from all expressions into the
constant $n dot (n^2 + 2n + 1)$ as per @p113-second-binom.
$
n dot (n^2 + 2n + 1) = n^3 + 2n^2 + n.
$
Which would make the sum evaluate to
$
sum_(i = 1)^n i^2 = (n^3 + 2n^2 + n) + & (-2n & dot & (n + 1) && + n^2) && + \
& (-2(n - 1) & dot & (n + 1) && + (n - 1)^2) && + dots.c + \
& (-2 & dot & (n + 1) && + 1). &&
$
Upon further observation, we can separate the $-2(n + 1)$ factor as it seems ever present in all
terms of the sum.
$
sum_(i = 1)^n i^2 = (n^3 + 2n^2 + n) - 2(n + 1)(n + (n - 1) + dots.c + 1) + (n^2 + (n - 1)^2 + dots.c + 1).
$
This is looking really good. From @p112-basic-sum-c1 and @p112-basic-sum-c2, we know that the
factor multiplying $-2(n + 1)$ is $(n dot (n + 1)) / 2$, which lets us rewrite the present sum as
$
sum_(i = 1)^n i^2 = (n^3 + 2n^2 + n) - (n + 1)(n dot (n + 1)) + (n^2 + (n - 1)^2 + dots.c + 1).
$ <p113-sum-binom-last>
The last thing remaining to solve for is the last term of the sum. This seems very much akin to
the results obtained in @p112-basic-sum-c1 and @p112-basic-sum-c2, but I believe there to be a
more intricate algebraic manipulation involved, considering each of the subsequent terms to the
initial $n^2$ are expansions of the binomial theorem.
Still, something similar should apply to this. Let us evaluate the expansion of the second term,
namely, $(n - 1)^2$, to see if there is some repeating pattern.
$
(n - 1)^2 = sum_(k = 0)^(j = 2) binom(j, k) dot n^(j - k) dot (-1)^k &=&&
2! / (0!(2 - 0)!) dot n^(2 - 0) dot (-1)^0 + \
&&& 2! / (1!(2 - 1)!) dot n^(2 - 1) dot (-1)^1 + \
&&& 2! / (2!(2 - 2)!) dot n^(2 - 2) dot (-1)^2 \
&=&& n^2 -2n + 1.
$
From this result, we know for sure that the first and last terms are the ones yielding $n^2$ and a
positive $b$, respectively.
Before going into the term where $k = 1$, I believe we can model the term where $k = 2$ as a
series ${1, 2, dots.c, n - 1}$. In the context of our sum, this is described by
$sum_(i = 1)^(n - 1) i$, which itself is equivalent to the sum $(sum_(i = 1)^n i) - 1$. Because we
already proved in @p112-basic-sum-c1 and @p112-basic-sum-c2 such formula, we can state that the
sum of all terms $k = 2$ for each and every term of the last term in @p113-sum-binom-last is
$(n dot (n + 1)) / 2 - 1$.
We've already figured out the pattern of all binomial expansions of @p113-sum-binom-last for terms
$k = 0$ and $k = 2$, but let's formalize them before jumping to $k = 1$. In our latest iteration
on $sum_(i = 1)^n i^2$, the last term contains a single $n^2$ term, followed by the sum of the
binomial expansions of $(n - l)^2$ where $1 <= l <= n - 1$. We have found that the term $k = 0$ of
each of those binomial expansions always yields the term $n^2$, so the last term in
@p113-sum-binom-last contains the initial $n^2$ and $(n - 1) dot n^2$, totaling $n dot n^2 = n^3$.
Additionally, we have found that the term $k = 2$ for each of those binomial expansions can itself
be modeled after the formula we proved in @p112-basic-sum-c1 and @p112-basic-sum-c2. This term
always evaluates to one of $1, dots.c, n - 1$, so the sum for each expansion in
@p113-sum-binom-last is
$
sum_(i = 1)^(n - 1) i = sum_(i = 1)^n (i) - 1 = (n dot (n + 1)) / 2 - 1.
$
Thus, so far we have found that the last term in @p113-sum-binom-last evaluates, pending of the
value for each expansion on $k = 1$, denoted $k_s$, to
$
(n^2 + (n - 1)^2 + dots.c + 1) = n^3 + k_s + (n dot (n + 1)) / 2 - 1.
$ <p113-sum-binom-last-expansion>
Now, onto finding a pattern for each expansion's $k = 1$ term. As per the binomial theorem,
whenever $k$ takes on the value of 1, the following expression evaluates, for some $b$ in the
range $-(n - 1) <= b <= -1$.
$
dots.c + underbrace(2! / (1!(2 - 1)!) dot n^(2 - 1), 2n) dot b^1 + dots.c
$
Because $b$ is always known to be a negative factor, we can further extract constant components,
such that the expression evaluates solely to $-2n dot abs(b)$. Because we also know $b$ takes on a
well-defined range of values, we can model this after a sum.
$
-2n dot abs(b) = -2n dot sum_(i = 1)^(n - 1) i = -2n dot (sum_(i = 1)^n (i) - 1) & = -2n dot ((n dot (n + 1)) / 2 - 1) \
& = -(n^2 dot (n + 1)) + 2n \
& = -n^3 - n^2 + 2n.
$ <p113-ks>
Having found the total sum of each expansion's term for $k = 1$, we can reformulate
@p113-sum-binom-last-expansion by substituting the $k_s$ term with the result of @p113-ks.
$
(n^2 + (n - 1)^2 + dots.c + 1) & = n^3 + (-n^3 - n^2 + 2n) + (n dot (n + 1)) / 2 - 1 \
& = -n^2 + 2n + (n^2 + n) / 2 - 1 \
& = -n^2 / 2 + (5n) / 2 - 1.
$ <p113-sum-binom-last-final>
Back to @p113-sum-binom-last, we can now consider substituting in the expression obtained in
@p113-sum-binom-last-final.
$
sum_(i = 1)^n i^2 & = (n^3 + 2n^2 + n) && - (n + 1)(n dot (n + 1)) && + (-n^2 + 5n - 2) / 2 \
& = n^3 + 2n^2 + n && - (n^3 + 2n^2 + n) && + (-n^2 + 5n - 2) / 2 \
& = (-n^2 + 5n - 2) / 2. && &&
$
That doesn't look like the result on Skiena's book. No matter, moving on.
/ Problem 1-14: \
Now we're proving a very much similar formula to the above, which could benefit from the same
findings and that will hopefully help me sort out the actual procedure I followed with the prior
proof.
The formula in question is
$
sum_(i = 1)^n i^3 = (n^2 dot (n + 1)^2) / 4, "for" n >= 0.
$
As per the prior proof, we can express this in terms of @p112-basic-sum-c1, such that
$
sum_(i = 1)^n i dot i dot i = &(((n + 1) - n&)& &dot& ((n + 1) - n&)& &dot& ((n + 1) - n&)&&)& &&+ \
&(((n + 1) - (n - 1)&)& &dot& ((n + 1) - (n - 1)&)& &dot& ((n + 1) - (n - 1)&)&&)& &&+ dots.c + \
&(((n + 1) - 1&)& &dot& ((n + 1) - 1&)& &dot& ((n + 1) - 1&)&&).
$ <p114-start>
The pattern follows that each term is equivalent to an expansion of the binomial theorem. A
consequence of that is that the original sum may be rewritten in terms of another sum.
$
sum_(i = 1)^n i^3 = sum_(j = 0)^(n - 1) ((n + 1) - (n - j))^3.
$
The expansion of the binomial theorem thus follows, such that we are left with 4 different terms
participating in the new sum.
$
sum_(j = 0)^(n - 1) ((n + 1) - (n - j))^3 &= sum_(j = 0)^(n - 1) (&& sum_(k = 0)^(l = 3) binom(l, k) dot (n + 1)^(l - k) dot (-(n - j))^k) \
&= sum_(j = 0)^(n - 1) (&& 3! / (0!(3 - 0)!) dot (n + 1)^(3 - 0) dot (-(n - j))^0 + \
&&& 3! / (1!(3 - 1)!) dot (n + 1)^(3 - 1) dot (-(n - j))^1 + \
&&& 3! / (2!(3 - 2)!) dot (n + 1)^(3 - 2) dot (-(n - j))^2 + \
&&& 3! / (3!(3 - 3)!) dot (n + 1)^(3 - 3) dot (-(n - j))^3).
$
For the sake of clarity and space, I will treat each individual term of the sum separately.
$
sum_(j = 0)^(n - 1) 3! / (0!(3 - 0)!) dot (n + 1)^(3 - 0) dot (j - n)^0 & =
sum_(j = 0)^(n - 1) (n + 1)^3 \
& = (n + 1)^3 dot n.
$
$
sum_(j = 0)^(n - 1) 3! / (1!(3 - 1)!) dot (n + 1)^(3 - 1) dot (j - n)^1 &=
sum_(j = 0)^(n - 1) 3 dot (n + 1)^2 dot (j - n) \
&= 3 dot (n + 1)^2 dot sum_(j = 0)^(n - 1) j - n \
&= 3 dot (n + 1)^2 dot ((n dot (n + 1)) / 2 - n - n^2).
$
The following terms require another binomial expansion of which, much like the present one, I will
treat separately on a term-by-term basis.
$
sum_(j = 0)^(n - 1) 3! / (2!(3 - 2)!) dot (n + 1)^(3 - 2) dot (j - n)^2 &=
sum_(j = 0)^(n - 1) 3 dot (n + 1) dot &&(j - n)^2 \
&= 3 dot (n + 1) dot sum_(j = 0)^(n - 1) &&(j - n)^2 \
&= 3 dot (n + 1) dot sum_(j = 0)^(n - 1) (&&sum_(k = 0)^(l = 2) binom(l, k) dot j^(l - k) dot (-n)^k) \
&= 3 dot (n + 1) dot sum_(j = 0)^(n - 1) (&&2! / (0!(2 - 0)!) dot j^(2 - 0) dot (-n)^0 + \
&&&2! / (1!(2 - 1)!) dot j^(2 - 1) dot (-n)^1 + \
&&&2! / (2!(2 - 2)!) dot j^(2 - 2) dot (-n)^2).
$ <p114-binomfirst>
$
sum_(j = 0)^(n - 1) 3! / (3!(3 - 3)!) dot (n + 1)^(3 - 3) dot (j - n)^3 &=
sum_(j = 0)^(n - 1) &&(j - n)^3 \
&= sum_(j = 0)^(n - 1) (&&sum_(k = 0)^(l = 3) binom(l, k) dot j^(l - k) dot (-n)^k) \
&= sum_(j = 0)^(n - 1) (&&3! / (0!(3 - 0)!) dot j^(3 - 0) dot (-n)^0 + \
&&&3! / (1!(3 - 1)!) dot j^(3 - 1) dot (-n)^1 + \
&&&3! / (2!(3 - 2)!) dot j^(3 - 2) dot (-n)^2 + \
&&&3! / (3!(3 - 3)!) dot j^(3 - 3) dot (-n)^3).
$ <p114-binomsecond>
Following, we resolve each term of the final binomial on @p114-binomfirst, assumming true the
statement $sum_(i = 1)^n i^2 = (n dot (n + 1) dot (2n + 1)) / 6$.
$
sum_(j = 0)^(n - 1) 2! / (0!(2 - 0)!) dot j^(2 - 0) dot (-n)^0 & = sum_(j = 0)^(n - 1) j^2 \
& = sum_(j = 1)^n (j^2) - n^2 \
& = (n dot (n + 1) dot (2n + 1)) / 6 - n^2 \
& = ((n^2 + n) dot (2n + 1) - 6n^2) / 6 \
& = (2n^3 + n^2 + 2n^2 + n - 6n^2) / 6 \
& = (2n^3 - 3n^2 + n) / 6.
$
$
sum_(j = 0)^(n - 1) 2! / (1!(2 - 1)!) dot j^(2 - 1) dot (-n)^1 & = sum_(j = 0)^(n - 1) -2n j \
& = -2n dot ((n dot (n + 1)) / 2 - n) \
& = -2n dot (n^2 - n) / 2 \
& = -n^3 + n^2.
$
$
sum_(j = 0)^(n - 1) 2! / (2!(2 - 2)!) dot j^(2 - 2) dot (-n)^2 & = sum_(j = 0)^(n - 1) n^2 \
& = n^2 dot sum_(j = 0)^(n - 1) 1 \
& = n^3.
$
Next, we resolve each term of the final binomial of @p114-binomsecond.
$
sum_(j = 0)^(n - 1) 3! / (0!(3 - 0)!) dot j^(3 - 0) dot (-n)^0 = sum_(j = 0)^(n - 1) j^3.
$ <p114-falsestart>
Or not. @p114-falsestart can be expressed in terms of the formula we are performing this whole
proof for, which makes everything we've done until now for this problem useless.
$
sum_(j = 0)^(n - 1) j^3 = sum_(j = 1)^(n - 1) j^3 = sum_(j = 1)^n (j^3) - n^3.
$
Time to try a different approach. Let's rewind back to the point where we hadn't yet formulated
the conclusion on this being an instance of the binomial theorem; Namely, let's go back to
@p114-start.
No luck solving this. Moving on.
/ Problem 1-15: \
Another proof, this time of the formula
$
sum_(i = 1)^n i(i + 1)(i + 2) = (n(n + 1)(n + 2)(n + 3)) / 4.
$
This time we are not told to solve by induction so there may be some alternative way out of this.
I think can get this somewhere. Let's consider the more simplified form of the initial sum.
$
sum_(i = 1)^n i(i + 1)(i + 2) = sum_(i = 1)^n (i^2 + i)(i + 2) = sum_(i = 1)^n i^3 + 3i^2 + 2i.
$
From the formulas that were shown to be true on the previous proofs (though not by my hand,) we
can solve this by separating each term of the sum such that
$
sum_(i = 1)^n i^3 + 3i^2 + 2i = sum_(i = 1)^n i^3 + 3 dot sum_(i = 1)^n i^2 + 2 dot sum_(i = 1)^n i.
$ <p115-initial>
Now, proceeding as follows with each term separately.
$
sum_(i = 1)^n i^3 = (n^2(n + 1)^2) / 4 = (n^2(n^2 + 2n + 1)) / 4 = (n^4 + 2n^3 + n^2) / 4.
$
$
3 dot sum_(i = 1)^n i^2 = 3 dot (n(n + 1)(2n + 1)) / 6 = 3 dot ((n^2 + n)(2n + 1)) / 6 = (2n^3 + 3n^2 + n) / 2.
$
$
2 dot sum_(i = 1)^n i = 2 dot (n(n + 1)) / 2 = n^2 + n.
$
Now, putting these all back together into @p115-initial, we get
$
sum_(i = 1)^n i^3 + 3i^2 + 2i & = (n^4 + 2n^3 + n^2) / 4 + (2n^3 + 3n^2 + n) / 2 + n^2 + n \
& = (n^4 + 2n^3 + n^2 + 4n^3 + 6n^2 + 2n + 4n^2 + 4n) / 4 \
& = (n^4 + 6n^3 + 11n^2 + 6n) / 4.
$
The form we have arrived to is likely the non-factorized version of the result initially provided
and expected to prove. This implies we can perform some form of factorization to get this sorted
out, and maybe get to the same result.
To factorize the polynomial on the numerator, I believe there was some procedure I don't quite
remember. Time to think. I believe the roots of the polynomial to be
$(n - 0)(n + 1)(n + 2)(n + 3)$, which aligns with the expected result's numerator.
Now, technically speaking, this is not completely correct because I used elements of proofs that
were only stated true for values of $n >= 0$, while this particular proof did not bound the range
of $n$. Still, moving on.
/ Problem 1-16: \
We're going back to proofs by induction. This time constrained by some $a != 1$ and $n >= 1$.
$
sum_(i = 0)^n a^i = (a^(n + 1) - 1) / (a - 1).
$
This is fairly obvious when thinking in binary because one can simply state that
$mono(1111) = mono(10000) - mono(0001)$. And because $a = 2$ in the above formula for this
example, the denominator resolves pretty easily.
The thing here is that, for say 3, there's not much bandwith to work with. All bases above 2 are
not something I can personally easily compute something in, so there is not much I can say there
is going into it. Based on what the formula says, there must be a relationship between the
grouping of numbers making up single digits in some base $a$, and the number of digits that
correpond in that base to a full power of the base.
In base 2, such computation resolves to 1. This makes a fair amount of sense becuase there's one
digit per power and thus one goes from $2^0$ to $2^1$ by toggling the bits at position 0 or those
at position 1.
But what about base 3 and larger bases? We know that each power represents a position for bits in
binary, so technically we should be expecting a similar translation for other bases. The only
pattern I see here is that for any given base, there exist as many in-between numbers between
whole powers of such base that is equal to the number denoting the base times the targeted power
(thus accounting for the numbers that came before it until the immediate prior power) minus one.
This makes sense for both base 2 and base 3 because we can state that any power in base 2 will
compute to
$
2^0 & = && 1, \
2^1 & = && 2, "and thus there are" 2 dot 1 - 1 = 1 "numbers between this and the prior power", \
2^2 & = && 4, "and thus there are" 2 dot 2 - 1 = 3 "numbers between this and the prior power", \
& dots.c && \
2^n & = && k, "and thus there are" 2n - 1 "numbers between this and the prior power".
$
If we further generalize this for any base $a$ and try to compute the amount of numbers between
any power $n$ and the base power $n_0 = 0$, we can technically state that there will be $a^n$
numbers. If we account also for the number making up the power, there will be $a^n + 1$ numbers.
Then we also know that out of those $a^n$ numbers coming before it, if we divide them into groups
of... nothing.
Moving on.
/ Problem 1-17: \
Another proof by induction. This time I think I can get through it just fine, though I'm not sure
if the resulting proof would count as being inductive in nature. Anyway, here goes the formula.
$
sum_(i = 1)^n 1 / (i(i + 1)) = n / (n + 1), "for" n >= 1.
$
So if we manipulate the statement, we can technically see that there is a binomial expansion with
negative exponential factor. Considering the binomial theorem applies to any such factor in $NN$,
we should be capable of reformulating the expression such that
$
sum_(i = 1)^n (i^2 + i)^(-1) = sum_(i = 1)^n sum_(k = 0)^(j = -1) binom(j, k) dot (i^2)^(j - k) dot i^k.
$
And that is completely wrong, because apparently $NN$ is made out of $ZZ^+$, which doesn't cover
the $-1$ factor.
If I think in terms of separating the factors in the denominator, technically we can state that
$
sum_(i = 1)^n 1 / i dot 1 / (i + 1).
$
Just as $sum_(i = 1)^n i$ is an increasingly larger number that sums the elements from the series
${1, 2, dots.c, n}$, $1 / i$ defines the sum of increasingly smaller numbers as each larger value
of $i$ denotes a smaller subdivision of the unit value. Without offering much proof, we could say
that the sum of the first $1 / ({1, 2, dots.c, n})$ values would produce an approximation in $RR$
to $n$.
That much I can figure from the initial statement, as it shows how the $n$ factor is the
numerator. Now, if the initial sum were only $sum_(i = 1)^n 1 / i$, the result couldn't have that
$n / (n + 1)$, so it's quite likely the denominator is given by the second factor; Namely,
$1 / (i + 1)$.
Now, the second factor denotes an even smaller number, computing an approximation in $RR$ to
$n + 1$. This may or may not mean that if we compute the multiplication of each term of the sum,
as the statement expects, we will obtain a number that is always smaller than $1 / 2$, considering
the starting value is $i dot (i + 1), "for" i >= 1 "given" n >= 1$.
What I believe to be the natural conclusion of adding together $1 / i dot 1 / (i + 1)$ and
$1 / (i + 1) dot 1 / (i + 2)$ is that the number resulting after $n$ sums should be smaller than
$1 / n$ but still approximate to $n / (n + 1)$, considering the denominator is given by a factor
larger than any number smaller than $n$.
Thus, if it is an approximation to $n$ by some factor larger than $n$, then surely the resulting
sum should be equal to, at the very least, $n + 1$. But this is not an estimation problem; I'm
wrong.
No matter, moving on.
/ Problem 1-18: \
Another proof by induction. This time we ought show that
$
n^3 + 2n "is divisible by" 3 "for all" n >= 0.
$
Alright, so maybe this can be solved by trying to unwrap the polynomial expression. $n^3$ is
technically the multiplication $n dot n dot n$, which lets us factor this as
$
n dot n dot n + 2n = n dot (n^2 + 2).
$ <p118-initial>
When I think of a number being divisible by 3, two things come to mind; solving for a number
modulo 3 with result 0, and having all digits of the number add up to a smaller, known multiple
of 3.
I'm not so sure about the mathematical certainty of the latter statement, so maybe the way to
solve this is by considering a reduction of $n(n^2 + 2)$ that yields another number we can compute
modulo 3.
The base hypothesis is that there ought be some expression $n_0$ whereby $n_0 (mod 3) = 0$.
Maybe the key here is in distinguishing that some number $n$ may or may not be factorized into
prime numbers including 3. Then, if $n$ includes the prime factor 3, we may reformulate
@p118-initial into the following statement.
$
n dot n dot (n / 3 dot 3) + 2n, "for any" n "with prime factor 3".
$
This could be one case of the recurrence relation, but it's technically not correct, because 3 is
supposed to be dividing the whole statement, so the above would actually be
$
(n dot n dot (n / 3 dot 3)) / 3 + (2n) / 3.
$
Or maybe it's correct, because the $n$ factor also participates in $2n$, so the next recursive
call would be
$
(n dot n dot (n / 3)) / 3 + (2 dot n / 3) / 3 = (n dot n dot n) / 9 + (2n) / 9.
$
So maybe the recurrence is defined by an ever smaller factor of $1 / {3^1, 3^2, dots.c, 3^k}$
dividing $n^3 + 2n$ on each recursive call of the $k$ total calls. This would sort of make sense,
considering one can compute those factors without having $n^3 + 2n$ be divisible by them, in terms
of $3$.
$
n^3 / 9 + (2n) / 9 = n^3 / 3 dot 1 / 3 + (2n) / 3 dot 1 / 3.
$
This would end up resolving to, in general terms, the following expression.
$
(n^3 / 3 dot 1 / 3 dot dots.c dot 1 / 3) + ((2n) / 3 dot 1 / 3 dot dots.c dot 1 / 3).
$ <p118-infrecursion>
Of course, the base case mentioned before for some expression $n_0 (mod 3) = 0$ is always being
hit, so @p118-infrecursion doesn't indicate the existence of a converging factor $1 / 3$.
Though maybe the expression to find isn't that for which the initial $n$ is already a multiple of
3, but rather that where $n$ is not a multiple of 3. In that case, we should state that
$
n (mod 3) != 0 "so" n^3 / 3 + (2n) / 3 (mod 3) = 0.
$
This doesn't hold at all, because I'm assumming the $n$ term is the central term for which the
search for an Euclidean division with 3 should produce residue 0. That could or could not be the
case, considering the problem statement only points towards the whole expression being divisible
by 3.
Maybe the fact that the whole expression is divisible by 3 is truly the base case of the
induction. That could make sense if what we were initially trying to check for was if
$n (mod 3) = 0$. But then again, this is not necessarily the thing we're trying to prove.
Or maybe the whole thing is wrong, and I'm actually supposed to compute for
$
((1 dot 2 dot dots.c dot n_p) dot (1 dot 2 dot dots.c dot n_p) dot (1 dot 2 dot dots.c dot n_p)) / 3 + (2 dot (1 dot 2 dot dots.c dot n_p)) / 3.
$
This considers the equivalent expression to the initial statement, only decomposing $n$ into each
of its prime factors. But this doesn't get me anywhere, because I was expecting I could then
factor out one of those prime factors and hope for the denominator to cancel out. That's not
possible, because it would require that #l-enum[$n$ have more than a single prime factor, and][the
combination of some prime factors in $n$ produce a 3].
For the case where $n = 0$, the above conditions always hold true, because we can simply assume
that all prime numbers can divide 0, and the result such Euclidean division will always have
residue 0. Then for $n = 0$, can consider those inner multiplications as containing 3, and thus,
they can factor out of both main terms of the expression, namely $n^3$ and $2n$, to continue
producing $n^3 + 2n, "for" n = 0$.
No matter, moving on.
/ Problem 1-19: \
Another proof by induction, whereby I'm expected to show that a tree with $n$ vertices and $m$
edges, has $m = n - 1$.
Considering the definition of a tree is that of a graph $G = (V, E)$ where $|E| = |V| - 1$, and
where the graph is both connected and acyclic, these two latter statements force an implication
over the number of edges in the total degree of each node. Given a vertex $i in V$, this node may
only have upwards of $n - 1$ edges, such that assumming no cycle is allowed (and trees are not
multigraphs,) such vertex may only connect to every other vertex, the total of which is denoted as
$|V - {i}| = |V| - 1$.
For some other vertex $j in V$, if the edge $(i, j) in E$ already exists, as per the prior
statements, one can only consider the existence of that single edge, namely $(i, j) in E$, because
otherwise the graph would have a cycle from edge
$(j, k) in E "for some" k in V "where" (i, k) in E$. Assumming as well that no self-loops are
allowed, the only edge is that which was already considered from node $i$.
And I think this is a good enough proof.
/ Problem 1-20: \
The last proof by induction of this chapter. I must show that the following statement holds true.
$
sum_(i = 1)^n i^3 = (sum_(i = 1)^n i)^2.
$ <p120-initial>
Which goes to say that the sum of the cubes of the first $n in NN$ numbers is equal to squaring
the total sum of those first $n$ numbers.
Assumming true the formulas that each one of #l-enum[$sum_(i = 1)^n i^3$, and][$sum_(i = 1)^n i$]
expand to, I think this should be fairly simple to prove. But the resulting conclusion is likely
not going to be inductive in nature.
$
(sum_(i = 1)^n i)^2 = ((n(n + 1)) / 2)^2 = (n(n + 1))^2 / 2^2 = (n^2(n + 1)^2) / 4 = sum_(i = 1)^n i^3.
$
This is by no means a proof, so I must think further.
If we think about what the left-hand side of @p120-initial expands to, maybe we can find a
pattern.
$
sum_(i = 1)^n i^3 = (1 dot 1 dot 1) + (2 dot 2 dot 2) + dots.c + (n dot n dot n).
$
Upon factoring one term in each of those cubes, one can see that the resulting expression can be
further manipulated into the form $(1 + 2 + dots.c + n)(1^2 + 2^2 + dots.c + n^2)$.
$
(1 dot 1 dot 1) + (2 dot 2 dot 2) + dots.c + (n dot n dot n) = 1(1 dot 1) + 2(2 dot 2) + dots.c + n(n dot n).
$
Or not. But maybe it can expand to
$
1(1 dot 1) + 2(2 dot 2) + dots.c + n(n dot n) & = && 1(1 dot 1) + (1 + 1)(2 dot 2) + dots.c + \
& && (1 + 1 + dots.c + 1_n)(n dot n) \
& = && (sum_(j = 1)^1 1)(1 dot 1) + (sum_(j = 1)^2 1)(2 dot 2) + dots.c + \
& && (sum_(j = 1)^n 1)(n dot n).
$
This implies the left-hand side of @p120-initial may be rewritten as
$
sum_(i = 1)^n i^3 = sum_(i = 1)^n i^2 dot sum_(j = 1)^i 1.
$
Still, this doesn't provide much value, because it's obvious from the following statement.
$
sum_(i = 1)^n i^3 = sum_(i = 1)^n i dot i dot i = sum_(i = 1)^n sum_(j = 1)^i 1 dot sum_(j = 1)^i 1 dot sum_(j = 1)^i 1.
$
Still, this is meant to be proven by induction. So there must be a way of considering, on a
term-by-term basis, that the resulting relationship, namely the right-hand side of @p120-initial,
holds true.
So let's think smaller. Let's consider only the term for which $i = 1$, which is ever present,
considering the sum starts there, unless $n = 0$ and we assume that $0 in NN$.
$
1 dot 1 dot 1 = 1 dot 1.
$
What about $i = 1, 2, 3, 4$?
$
& (1 dot 1 dot 1) + (2 dot 2 dot 2) && = (1 + 2) & dot & (1 + 2). \
& (1 dot 1 dot 1) + (2 dot 2 dot 2) + (3 dot 3 dot 3) && = (1 + 2 + 3) & dot & (1 + 2 + 3) \
& (1 dot 1 dot 1) + (2 dot 2 dot 2) + (3 dot 3 dot 3) + (4 dot 4 dot 4) && = (1 + 2 + 3 + 4) & dot & (1 + 2 + 3 + 4).
$
Maybe we can start thinking from the right-hand side of @p120-initial instead. Let's take $n = 2$.
$
(1 + 2) dot (1 + 2) = (1 dot 1) + (1 dot 2) + (2 dot 1) + (2 dot 2).
$
No matter, moving on.
/ Problem 1-21: \
I'm asked about the total number of pages in the books I own and whether that number is around 1
million pages. Then I'm also asked to estimate whether the total number of pages in my school
library is also around that number.
I am completely confident that I don't own enough books to total 1 million pages, based on the
fact I own less than 100 books and assumming most of them are below 1000 pages, they don't even
get to $10^2 dot 10^3 = 10^5$ pages, which would be the bare minimum for this estimate.
In my school library, this would be hard to estimate, considering I've never been inside of it.
Still, I know there's three floors to it, each of about $150 space "m"^2$. I'll try to estimate
the number of bookshelves in each floor, prior to the number of books in each bookshelf and
finally the number of pages per book on average (aiming for an upper bound on all three
heuristics.)
The floors are about $150 space "m"^2$, based on the fact they're not exactly twice as big as my
house but definitely near that (my house is $91 space "m"^2$.) In each floor, let's assume there
are bookshelves all around its perimeter, and some throughout the inner area. Let's proceed first
with the bookshelves in the perimeter.
Based on observation, I'd wager the floors are pretty near the shape of a rectangle, which would
imply its sides are approximately $150 / 10 = 15 "m" times 10 "m"$. I would say a bookshelf takes
up about $5 "m"$ in length, and I believe its width to be of about $40 "cm"$. Based on these
estimates, the shorter sides of each floor should have $10 / 5 = 2$ bookshelves, while the longer
sides should have $15 / 5 = 3$ bookshelves. This would total $3 + 2 = 5 dot 3 = 15$ bookshelves
from the perimeter of all floors.
Let's compute now an approximate over the total number of bookshelves in the inner area of the
rectangle. In what I consider to be a standard middle bookshelf layout for a library, each shelf
is set up horizontally, such that each side of it (considering the longest stride as the _side_;
Its length) should face the shorter sides of the overarching rectangle. This means that if the
width of each bookshelf is about $40 "cm"$ and the corridor between bookshelves is of about
$3 space "m"$, there must be $(15 "m") / (3 + 0.4 "m") approx 4$ bookshelves in the inner area of
each floor. This totals $4 dot 3 = 12$ bookshelves in the inner area of the whole library.
The total number of bookshelves in the library is now at $15 + 12 = 27$ bookshelves. Assumming
each bookshelf is about $4 "m"$ tall considering each floor is about $7 "m"$ tall, and each
shelf's divided into about $40 "cm"$ tall levels, there's space for $(4 "m") / (0.4 "m") = 10$
book levels per shelf.
If each book is, on average, $5 "cm"$ wide and we considered the length of the shelves to be
standing at $5 "m"$, then each level can hold an estimate of $(5 "m") / (0.05 "m") = 100$ books.
Thus each shelf holds $10 "levels" dot 100 space "books"/"level" = 1000$ books. Accounting for
each of the 27 shelves we computed before, this makes up
$27 "shelves" dot 1000 space "books"/"shelf" = 27000$ books in the entire library.
Assumming each book is, on average, between 500 and 1000 pages, so about $(1000 + 500) / 2 = 750$
pages long, then the total number of pages ought be $27000 dot 750 approx 20$ million pages.
Accounting for books that are less than the lower end of the average (i.e. less than 500 pages,)
this would still make for a number well above 1 million pages.
/ Problem 1-22: \
This one asks about the amount of words on Skiena's book.