Mystery curve, animated

As a follow-on to my previous post, here’s an animation (17MB) showing how the “mystery curve” arises as a sum of circular motions:

Recall that the equation for the curve is f(t) = e^{it} + \frac{1}{2} e^{6it} + \frac{i}{3} e^{-14it}. The big blue circle corresponds to the e^{it} term—it is a circle of radius 1 and makes one complete revolution before the animation restarts. The medium orange circle corresponds to \frac{1}{2} e^{6it}: it has a radius of 1/2 and rotates 6 times as fast as the blue circle. The small green circle corresponds to \frac{i}{3} e^{-14t}. It rotates 14 times as fast as the blue circle, but in the opposite direction. It has a radius of 1/3, and starts out 1/4 rotation out of phase with the others, since multiplying by i corresponds to a 1/4 rotation in the complex plane. (Notice that whenever the blue and orange circles are pointing in exactly the same direction, the green circle is perpendicular to them.)

One interesting thing to note is that addition of complex numbers is commutative—which means that we could just as well put the fast green circle in the middle, and the big blue circle next, and the orange circle on the outside, or any other ordering. The red point would always trace exactly the same curve.

Edited to add: can you see how the numbers 1, 6, and -14 result in 5-fold symmetry? Hint: how many times per day do the hands of a clock line up? (Farris proves this analytically in his book, but it wasn’t until staring at this animation that I feel like I really “got it”.)

Posted in complex numbers, geometry, programming | Tagged , , , , , , , | 6 Comments

Random cyclic curves

Princeton Press just sent me a review copy of a new book by Frank Farris called Creating Symmetry: The Artful Mathematics of Wallpaper Patterns. It looks amazing and I’m super excited to read it. Apparently John Cook has been reading it as well, and posted some Python code for generating this curve, which shows up towards the beginning of the book:

Mike Croucher also posted an interactive version using Jupyter notebook, where you can play with sliders to control the parameters of the curve and watch it evolve.

This is a plot of the parametric equation

f(t) = e^{it} + \frac{1}{2} e^{6it} + \frac{i}{3} e^{-14it}

in the complex plane. In general, Farris considers parametric equations of the form

f(t) = \sum_j a_j e^{n_j it},

where a_j are complex numbers, n_j are integers, and as usual i = \sqrt{-1}. All such equations correspond to cyclic plots in the complex plane; he analyzes what sorts of symmetry they will have based on the parameters n_j.

He also spends some time talking about the aesthetics of picking values for a_j and n_j that result in beautiful curves. Instead of making carefully considered choices in this kind of situations, I often like to employ randomness to just generate a bunch of different instantiations and see what comes up (although there is still a certain amount of art in choosing the distributions for the random parameters). So, here are 50 random curves. Each one has

  • Either 2, 3, or 4 terms
  • Exponents chosen uniformly at random from [-30, 30]
  • Coefficients chosen uniformly at random from the square in the complex plane from -1 - i to 1 + i.

I really like seeing these all together. They are not all great individually, but as a group, it’s fun seeing their differences, similarities, and idiosyncracies.

Don’t ask me what the parameters are for an individual curve because the program I used to generate them does not save the parameters anywhere! The code is here if you want to see it; of course it is written in Haskell and uses the diagrams framework.

Posted in complex numbers, geometry, programming | Tagged , , , , , | 24 Comments

The blog lives! and Secrets of Creation Trilogy

I haven’t written here in a really long time! But the blog has not been abandoned, just on hiatus. I have recently started blogging again so you can expect more posts in the near future! In the meanwhile, here’s what I’ve been up to:

I also want to help spread the word that Matthew Watkins’ wonderful Secrets of Creation Trilogy has been republished in a new edition by Liberalis Books. I previously reviewed the first and second books in the trilogy (tl;dr: they are fabulous). I have now read the third book in the trilogy (depicted above), which is just as fabulous, though I never reviewed it here. And if you don’t believe me you can see what others (including Sir Roger Penrose and Clifford Pickover) have said about it. I highly recommend that you check them out if you haven’t already!

Posted in Uncategorized | 2 Comments

Permutation flower

Permutation flower

Image | Posted on by | Tagged , , | 1 Comment

Factorization diagram posters!

I’ve finally gotten around to making a nice factorization diagram poster:

You can buy high-quality prints from Imagekind. (If you order soon you should have them before Christmas! =) I’m really quite happy with imagekind, the print quality is fantastic and the prices seem reasonable. You can choose among different sizes—I suggest 32"x20" ($26 on the default matte paper, + shipping), but the next smaller size (24"x15", $17) is probably OK too.

If you have ideas for variant posters you’d like to see, let me know (though I probably won’t be able to do anything until after the new year).

Note that Jeremy also has a variety of factorization diagram posters for sale.

For more information, including links to the source code, a high-resolution PNG, and other things, see this factorization diagrams page.

Posted in arithmetic, counting, geometry, number theory, pattern, pictures, primes | Tagged , , | 7 Comments

PIE day

[This is part six in an ongoing series; previous posts can be found here: Differences of powers of consecutive integers, Differences of powers of consecutive integers, part II, Combinatorial proofs, Making our equation count, How to explain the principle of inclusion-exclusion?. However, this post is self-contained; no need to go back and read the previous ones just yet.]

“But”, I hear you protest, “Pi Day was ages ago!” Ah, but I didn’t say Pi Day, I said PIE Day. To clarify:

  • Pi Day: a day on which to celebrate the not-so-fundamental circle constant, \pi (March 14)
  • Pie Day: a day on which to eat pie (every day)
  • PIE Day: a day on which to explain the Principle of Inclusion-Exclusion (PIE). (That’s today!)

(Actually, I’m only going to begin explaining it today; it’s getting too long for a single blog post!) In any case, the overall goal is to finish up my long-languishing series on a combinatorial proof of a curious identity (though this post is self-contained so there’s no need to go back and reread that stuff yet). The biggest missing piece of the pie is… well, PIE! I’ve been having trouble figuring out a good way to explain it in sufficient generality—it’s one of those deceptively simple-seeming things which actually hides a lot of depth. Like a puddle which turns out to be a giant pothole. (Except more fun.)

In a previous post (now long ago) I asked for some advice and got a lot of great comments—if my explanation doesn’t make sense you can try reading some of those!

So, what’s the Principle of Inclusion-Exclusion all about? The basic purpose is to compute the total size of some overlapping sets.

To start out, here is a diagram representing some non-overlapping sets.

Each set is represented by a colored circle and labelled with the number of elements it contains. In this case, there are 25 people who like bobsledding (the red circle), six people who like doing laundry (the blue circle), and 99 people who like math (the green circle). The circles do not overlap at all, meaning that none of the people who like math also like laundry or bobsledding; none of the people who like doing laundry also like bobsledding or math; and so on. So, how many people are there in total? Well, that’s easy—just add the three numbers! In this case we get 130.

Now, consider this Venn diagram which shows three overlapping sets.

Again, I’ve labelled each region with the number of elements it contains. So there are two people who like bobsledding but not math or laundry; there are three people who like bobsledding and math but not laundry; there is one person who likes all three; and so on. It’s still easy to count the total number of elements: just add up all the numbers again (I get 14).

So what’s the catch?

The catch is that in many situations, we do not know the number of elements in each region! More typically, we know something like:

  • The total number of elements in each set. Say, we might know that there are 7 people who like bobsledding in total, but have no idea how many of those 7 like math or laundry; and similarly for the other two sets.

  • The total number of elements in each combination of sets. For example, we might know there are two people who like bobsledding and laundry—but we don’t know whether either of them likes math.

This is illustrated below for another instance of our ongoing example. The top row shows that there are sixteen people who like bobsledding in total, eleven who like laundry in total, and eighteen who like math—but again, these are total counts which tell us nothing about the overlap between the sets. (I’ve put each diagram in a box to emphasize that they are now independent—unlike in the first diagram in this post, having three separate circles does not imply that the circles are necessarily disjoint.) So 16 + 11 + 18 is probably too many because we would be counting some people multiple times. The next row shows all the intersections of two sets: there are three people who like bobsledding and laundry (who may or may not like math), eight people who like bobsledding and math; and six people who like laundry and math. Finally, there is one person who likes all three.

The question is, how can we deduce the total number of people, starting from this information?

Well, give it a try yourself! Once you have figured that out, think about what would happen if we added a fourth category (say, people who like gelato), or a fifth, or… In a future post I will explain more about the general principle.

Posted in combinatorics, counting | Tagged , , , , | 2 Comments

FARM 2013: call for demonstration proposals

Do you enjoy writing beautiful code to produce beautiful artifacts? Have something cool to show off at the intersection of functional programming and visual art, music, sound, modeling, visualization, or design?

The deadline for submitting a paper has passed, but the Workshop on Functional Art, Music, Modeling and Design (FARM 2013) is currently seeking proposals for 10-20 minute demonstrations to be given during the workshop. For example, a demonstration could consist of a short tutorial, an exhibition of some work, or even a livecoding performance. Slots for demonstrations will be shorter than slots for accepted papers, and will not be published as part of the formal proceedings, but can be a great way to show off interesting work and get feedback from other workshop participants. A demonstration slot could be a particularly good way to get feedback on work-in-progress.

A demo proposal should consist of a 1 page abstract, in PDF format, explaining the proposed content of the demonstration and why it would be of interest to the attendees of FARM. Proposals will be judged on interest and relevance to the stated goals and themes of the workshop.

Submissions can be made via EasyChair.

Posted in meta | Tagged , , , , , , , ,