# OK to post homework # RDB, 2022-03-04, HW12 # 1. with(ListTools): DecDigits := proc(a, K) Reverse(convert(op(1, evalf(a, K)), base, 10)): end: # 2. WrongDigits := proc(a, b, K) local A, B: A := DecDigits(a, K): B := DecDigits(b, K): select(k -> A[k] <> B[k], [seq(1..K)]): end: read "C15.txt": # 3. # There is no mathematician with a PhD with the initials R. N. according to the # Mathematics Genealogy Project. # So, whoever R.D. North is, they probably didn't get a PhD in math! # 4. Archimedes := proc(k, N) [k * 2^N * sin(Pi / k / 2^N), k * 2^N * tan(Pi / k / 2^N)]: end: # 5. # We want k * ATAN(a) + ATAN(b) = 1, or b = tan(1 - k * ATAN(a)). # We want the b which is closest to 0. The exact values of k which give zero # are # 1 - k * ATAN(a) = n * pi # for any integer n. Thus, we want # k = (1 - n * pi) / ATAN(a). # This is not going to be an integer, but we can take the integer nearest it. # There's some theorem that says the fractional parts of n * x are # equidistributed when x is irrational, so I suspect that for almost all a # there is no "best" candidate for n.