[math-fun] Intuitively simple trig functions
A few years ago I was delighted to find that calculating pi to arbitrary precision can be made simple enough for even a programmer to understand. I finally got around to finding an algorithm for computing sines and cosines that similarly relies only on high school algebra and trig. I wrote it up here with pictures and source code: http://credentiality2.blogspot.com/2010/06/few-years-ago-my-brother-in-law-a...
Is there a geometric way to understand the Taylor series for sin and cos? The closest I've been able to find is a combinatorical explanation (below), but it doesn't seem to help much. The paper "Objects of Categories as Complex Numbers" by Marcelo Fiore and Tom Leinster and says that under certain conditions, objects can behave as though they had complex cardinalities. It turns out that data types of typed programming languages satisfy the conditions; the data structure T = T^2 + T + 1 of trees with 2 (ordered), 1, or 0 children, behaves like "i". It is not the case that T^4 is isomorphic to the one-element set, but T^5 = T. Since it's a countably infinite set, this may seem obvious, but there's a way of constructing the isomorphism using only distributivity and the defining isomorphism above, so the cardinality is also preserved. Also, there's an isomorphism T^2 = B where B = {0,1} x B + empty = 2B + 1 is the set of binary strings, with cardinality -1. You may have seen this before in the guise of 2-adic numbers: 1 + 2 + 4 + 8 + 16 + ... = -1, since ...111111 + 1 = 0 The type constructor Exp(X) = 1 + X + X^2/2 + X^3/6 + ... is the set of unordered lists (of any length n) of items of type X. The "n!" in the denominator expresses the fact that all permutations of an unordered list are equivalent. So the data structure Exp(T X) = 1 + TX + (TX)^2/2 + (TX)^3/6 + ... is the set of unordered lists of (T, X) ordered pairs. This splits up naturally: = (1 + T^2 X^2/2 + ...) + T(X + T^2 X^3/6 + ...) = Cos(X) + T Sin(X) where Cos(X) = \sum B^n X^2n/2n! Sin(X) = \sum B^n X^(2n+1)/(2n+1)! Specifically, Cos(X) is the set of structures consisting of n binary strings and an unordered list of 2n Xs, while Sin(X) is the set of structures consisting of n binary strings and an unordered list of 2n+1 Xs. On Sat, Jun 12, 2010 at 2:27 AM, Jason <jason@lunkwill.org> wrote:
A few years ago I was delighted to find that calculating pi to arbitrary precision can be made simple enough for even a programmer to understand.
I finally got around to finding an algorithm for computing sines and cosines that similarly relies only on high school algebra and trig.
I wrote it up here with pictures and source code:
http://credentiality2.blogspot.com/2010/06/few-years-ago-my-brother-in-law-a...
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
-- Mike Stay - metaweta@gmail.com http://www.cs.auckland.ac.nz/~mike http://reperiendi.wordpress.com
participants (2)
-
Jason -
Mike Stay