ue1.ms 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. .TL
  2. ADM UE1
  3. .AU
  4. strlst
  5. .SH
  6. motivation
  7. .PP
  8. This document outlines exercises 6, 11, 15, 20, 24.
  9. .EQ
  10. define implies `~~=>`
  11. define so `~:`
  12. define is `~~=~~`
  13. .EN
  14. .SH
  15. e6
  16. .PP
  17. Using induction, prove the following:
  18. .EQ
  19. sum from n to j=2 {j(j-1)} is {(n - 1) n (n + 1)} over 3 ,~ (n >= 2)
  20. .EN
  21. .PP
  22. .BX "induction basis"
  23. .EQ
  24. 2~ (2 - 1) is {(2 - 1) ~2~ (2 + 1)} over 3 is {3 over 3} 2~ (2 - 1) is 2~ (2 - 1)
  25. .EN
  26. .PP
  27. .BX "induction step"
  28. .EQ
  29. P(n) implies P(n + 1)
  30. .EN
  31. .EQ
  32. sum from {j = 2} to {n + 1}
  33. times ~j (j-1) mark is
  34. {n~ (n + 1) (n + 2)} over 3
  35. .EN
  36. .EQ
  37. sum from {j = 2} to {n}
  38. times ~j (j-1)
  39. times (n+1) n lineup is
  40. {(n - 1) ~n~ (n + 1)} over 3 + (n+1)n
  41. .EN
  42. .EQ
  43. lineup is {(n-1) bold {~(n+1) ~n} + 3~ bold {(n+1)~n}} over 3
  44. .EN
  45. .EQ
  46. lineup is {bold {(n+1)~n} ~(n-1+3)} over 3
  47. .EN
  48. .EQ
  49. lineup is {bold {(n+1)~n} ~(n+2)} over 3
  50. .EN
  51. .BX q.e.d.
  52. .SH
  53. e11
  54. .PP
  55. .EQ
  56. F sub 0 = 0, F sub 1 = 1,~ F sub {n+2} = F sub {n + 1} + F sub n,~ n ... roman {natural number}
  57. .EN
  58. .PP
  59. Using induction, prove the following:
  60. .EQ
  61. define pexp `{1 + sqrt 5} over 2`
  62. define qexp `{1 - sqrt 5} over 2`
  63. define fibdef `F sub $1 is
  64. 1 over sqrt 5 left [
  65. left ( pexp right ) sup $1 -
  66. left ( qexp right ) sup $1
  67. right ]`
  68. define fibshort `1 over sqrt 5 left [
  69. p sup $1 -
  70. q sup $1
  71. right ]`
  72. fibdef(n)
  73. .EN
  74. .PP
  75. .BX "induction basis"
  76. .EQ
  77. fibdef(0) is 1 over sqrt 5 (1 - 1) is 0
  78. .EN
  79. .EQ
  80. fibdef(1) is 1 over {2 sqrt 5} (1 + sqrt 5 - 1 + sqrt 5) is {2 sqrt 5} over {2 sqrt 5} is 1
  81. .EN
  82. .PP
  83. .BX "induction step"
  84. .EQ
  85. p = pexp,~ q = qexp
  86. so F sub n is 1 over sqrt 5 ( p sup n - q sup n )
  87. .EN
  88. .EQ
  89. F sub n+2 = F sub n+1 + F sub n
  90. .EN
  91. .EQ
  92. fibshort(n+2) mark is fibshort(n+1) + fibshort(n)
  93. .EN
  94. .EQ
  95. p sup n+2 - q sup n+2
  96. lineup is p sup n+1 - q sup n+1 + p sup n - q sup n
  97. .EN
  98. .EQ
  99. p sup n+2 - q sup n+2
  100. lineup is { p sup n+2 } over p - { q sup n+2 } over q + { p sup n+2 } over p sup 2 - { q sup n+2 } over q sup 2
  101. .EN
  102. .EQ
  103. p sup n+2 - q sup n+2
  104. lineup is p sup n+2
  105. ~left [ 1 over p + 1 over p sup 2 right ]
  106. - q sup n+2
  107. ~left [ 1 over q + 1 over q sup 2 right ]
  108. delim $$
  109. .EN
  110. .PP
  111. At this point, we observe the very particular structure $ p sup n+2 - q sup n+2 = p sup n+2 times ~r - q sup n+2 times ~k $ and note that in order for this equation to be valid, we need $ r = 1 $ and $ k = 1 $ to be true. We continue our proof by examining $ r $ and $ k $ separately.
  112. .EQ
  113. 1
  114. mark is 1 over p + 1 over {p sup 2}
  115. is 1 over q + 1 over {q sup 2}
  116. .EN
  117. .EQ
  118. lineup is 1 over { ( pexp ) } + 1 over { ( pexp ) sup 2 }
  119. is 1 over { ( qexp ) } + 1 over { ( qexp ) sup 2 }
  120. .EN
  121. .EQ
  122. lineup is 1 over { ( 1 over 2 (1 + sqrt 5 )) } + 1 over { ( 1 over 2 (1 + sqrt 5 )) sup 2 }
  123. is 1 over { ( 1 over 2 (1 - sqrt 5 )) } + 1 over { ( 1 over 2 (1 - sqrt 5 )) sup 2 }
  124. .EN
  125. .EQ
  126. lineup is 2 over { (1 + sqrt 5 ) } + 4 over { ( 1 + sqrt 5 ) sup 2 }
  127. is 2 over { (1 - sqrt 5 ) } + 4 over { ( 1 - sqrt 5 ) sup 2 }
  128. .EN
  129. .EQ
  130. lineup is { 2~ (1 + sqrt 5 ) + 4 } over { (1 + sqrt 5 ) sup 2 }
  131. is { 2~ (1 - sqrt 5 ) + 4 } over { (1 - sqrt 5 ) sup 2 }
  132. .EN
  133. .EQ
  134. lineup is { 2~ (1 + sqrt 5 ) + 4 } over { 1 sup 2 + 2~ sqrt 5 + { sqrt 5 } sup 2 }
  135. is { 2~ (1 - sqrt 5 ) + 4 } over { 1 sup 2 - 2~ sqrt 5 + { sqrt 5 } sup 2 }
  136. .EN
  137. .EQ
  138. lineup is { 2 + 2~sqrt 5 + 4 } over { 1 + 2~ sqrt 5 + 5 }
  139. is { 2 - 2~sqrt 5 + 4 } over { 1 - 2~ sqrt 5 + 5 }
  140. .EN
  141. .EQ
  142. lineup is {6 + 2~ sqrt 5 } over {6 + 2~ sqrt 5 }
  143. is {6 - 2~ sqrt 5 } over {6 - 2~ sqrt 5 }
  144. .EN
  145. .EQ
  146. 1 lineup is 1 is 1
  147. .EN
  148. .PP
  149. .BX q.e.d.
  150. .SH
  151. e15
  152. .PP
  153. The following is assumed to be true
  154. .EQ
  155. x sub 0 = 1,~ x sub {k+1} is x sub k + 18k + 15,~ k >= 0
  156. .EN
  157. .PP
  158. Using induction, prove that the following closed form expression is identical:
  159. .EQ
  160. x sub n is (3n + 1) sup 2 ,~ n >= 0
  161. .EN
  162. .BX "induction basis"
  163. .EQ
  164. x sub 0 is (3 times 0 + 1) sup 2 = 1 sup 2 = 1
  165. .EN
  166. .BX "induction step"
  167. .EQ
  168. x sub n+1 is (3 (n+1) + 1) sup 2 = x sub k+1 = x sup n + 18n + 15,~ n = k
  169. .EN
  170. .EQ
  171. (3(n+1) + 1) sup 2 mark is (3n + 1) sup 2 + 18n + 15
  172. .EN
  173. .EQ
  174. (3n + 4) sup 2 lineup is 9n sup 2 + 2 times 3n times 1 + 1 sup 2 + 18n + 15
  175. .EN
  176. .EQ
  177. 9n sup 2 + 24n + 16 lineup is 9n sup 2 + 6n + 18n + 1 + 15
  178. .EN
  179. .EQ
  180. 24n lineup is 24n
  181. .EN
  182. .PP
  183. .BX q.e.d.
  184. .SH
  185. e20
  186. .PP
  187. Given the predicate
  188. .EQ
  189. P sub initial (A) so 3n + 2 sup n <= 3 sup n
  190. .EN
  191. .PP
  192. Find the $ n >= x $ for which the predicate is valid using induction.
  193. .EQ
  194. define pinit `3 times $1 + 2 sup $1 <= 3 sup $1`
  195. pinit(0) ,~ 1 <= 1 ,~ roman valid
  196. .EN
  197. .EQ
  198. pinit(1) ,~ 10 <= 9 ,~ roman { invalid! }
  199. .EN
  200. .EQ
  201. pinit(2) ,~ 5 <= 3 ,~ roman { invalid! }
  202. .EN
  203. .EQ
  204. pinit(3) ,~ 17 <= 27 ,~ roman valid
  205. .EN
  206. .PP
  207. We make the assumption that for $ n >= x ,~ x = 3 $, and begin our proof:
  208. .EQ
  209. 3 sup n+1 = 3 sup n times 3 mark ~~>=~~ 3(n+1) + 2 sup n+1 = 3n + 3 + 2 sup n times 2
  210. .EN
  211. .PP
  212. We make use of our initial assumption $ P sub initial (A) $ by retransforming it:
  213. .EQ
  214. 3n + 2 sup n mark ~~<=~~ 3 sup n
  215. .EN
  216. .EQ
  217. 2 sup n lineup ~~<=~~ bold { 3 sup n - 3n }
  218. .EN
  219. .PP
  220. Now we substitue $ 2 sup n $ for $ (3 sup n - 3n) $ (printed bold above), a term that is at least as big, and continue our previous line of thought:
  221. .EQ
  222. 3 sup n+1 = 3 times 3 sup n mark ~~>=~~ 3n + 3 + 2 sup n times 2
  223. .EN
  224. .EQ
  225. 3 times 3 sup n lineup ~~>=~~ 3n + 3 + bold { (3 sup n - 3n) } times 2
  226. .EN
  227. We transform the right hand side into a different form:
  228. .EQ
  229. 3n + 3 + bold { (3 sup n - 3n) } times 2
  230. mark is 3n + 3 + 2 times 3 sup n - 6n
  231. .EN
  232. .EQ
  233. lineup is 3 sup n times 2 + 3 - 3n
  234. .EN
  235. .PP
  236. At this point, the clever reader might have wondered about the $ (3 - 3n) $ part in particular, noticing a most interesting property:
  237. .EQ
  238. n >= 3 implies 3 - 3n <= 0
  239. .EN
  240. .PP
  241. In essence, $ 3 - 3n $ will never produce a number that would
  242. .UL increase
  243. our previous term, allowing us to suggest the following:
  244. .EQ
  245. bold { 3 sup n times 2 } + 3 - 3n ~~<=~~ mark bold { 3 sup n times 2 }
  246. .EN
  247. .EQ
  248. lineup bold { 3 sup n times 2 } ~~<=~~ 3 sup n times 3 = 3 sup n+1
  249. .EN
  250. .PP
  251. .BX q.e.d.
  252. .SH
  253. e24
  254. .PP
  255. Disprove $ roman max( a, b ) = a = b $, given the following predicate and proof:
  256. .EQ
  257. a, b >= 0 ,~ P(A) so a = b
  258. .EN
  259. .BX "induction basis"
  260. .EQ
  261. P(0) so max(a, b) = 0 implies a = b = 0
  262. .EN
  263. .BX "induction step"
  264. .EQ
  265. P(A) implies P(A+1) so max(a, b) = n implies max(a, b) = n + 1
  266. .EN
  267. .EQ
  268. max(a, b) = n + 1 implies max(a - 1, b - 1) = n so a-1 = b-1 implies a = b
  269. .EN
  270. .PP
  271. This proof has a specific problem, best showed by inserting a few test values:
  272. .EQ
  273. max(a, b) mark is 2 so a = b = 2
  274. .EN
  275. .EQ
  276. implies max(a - 1, b - 1) lineup is 2 - 1 so a - 1 is b - 1 is 1
  277. .EN
  278. .EQ
  279. max(a, b) mark is 1 so a = b = 1
  280. .EN
  281. .EQ
  282. implies max(a - 1, b - 1) lineup is 1 - 1 so a - 1 is b - 1 is 0
  283. .EN
  284. .EQ
  285. max(a, b) mark is 0 so a = b = 0
  286. .EN
  287. .EQ
  288. implies max(a - 1, b - 1) lineup is 0 - 1 so a - 1 is b - 1 is 0 - 1
  289. .EN
  290. .PP
  291. This proof makes it valid for us to suggest $ a is b is 0 - 1 $, but the proof condition also requires $ a, b >= 0 $, a contradiction! Thus, $ a, b $ are not elements of the natural numbers, invalidating the initial condition.
  292. .SH
  293. e26
  294. .PP
  295. $ P(A) so ~sqrt 5~ $ is irrational.
  296. .PP
  297. To prove that $ sqrt 5 $ is indeed irrational, let's try proving the opposite:
  298. .EQ
  299. undef is
  300. P(B) : sqrt 5~ roman { is~rational }
  301. define is `~~=~~`
  302. implies sqrt 5 is p over q
  303. .EN
  304. .EQ
  305. 5 is p sup 2 over q sup 2 ~~~~~ 5 q sup 2 mark is p sup 2 ~~~~~ 5 ~|~ (5q sup 2 ) implies 5 ~|~ p sup 2 so p is 5 times r
  306. .EN
  307. .EQ
  308. 5q sup 2 lineup is (5r) sup 2 is 25 r sup 2
  309. .EN
  310. .EQ
  311. q sup 2 lineup is 5 r sup 2 ~~~~~ 5 ~|~ (5r sup 2 ) implies 5 ~|~ q sup 2 so q = 5 times k
  312. .EN
  313. .EQ
  314. (5k) sup 2 is 25k sup 2 lineup is 5r sup 2
  315. .EN
  316. .EQ
  317. 5 lineup is { 5r sup 2 } over { 5k sup 2 }
  318. .EN
  319. .EQ
  320. sqrt 5 lineup is r over k
  321. .EN
  322. .PP
  323. In the beginning we defined $ sqrt 5 $ to be $ p smallover q $, where $ p, q $ are factors that automatically assume smallest possible values because of the reductions applicable to rational numbers. But here we clearly show $ sqrt 5 $ to be a smaller set of factors $ r smallover k $:
  324. .EQ
  325. P(B) implies sqrt 5 is r over k < p over q
  326. .EN
  327. .PP
  328. A contradiction!
  329. .EQ
  330. not~ P(B) < = > P(A)
  331. .EN
  332. .PP
  333. .BX q.e.d.