{"id":395,"date":"2008-11-30T19:25:22","date_gmt":"2008-11-30T18:25:22","guid":{"rendered":"http:\/\/www.walkingrandomly.com\/?p=395"},"modified":"2008-12-11T14:24:56","modified_gmt":"2008-12-11T13:24:56","slug":"mathematical-christmas-cards-walking-randomly-christmas-challenge","status":"publish","type":"post","link":"https:\/\/walkingrandomly.com\/?p=395","title":{"rendered":"Mathematical Christmas Cards &#8211; Walking Randomly Christmas Challenge"},"content":{"rendered":"<p>Now that December has arrived you may well be thinking of sending your loved ones a Christmas card so why not send them one based on some sort of Mathematics?  Even better &#8211; why not design it yourself?  Software packages such as <a href=\"http:\/\/www.wolfram.com\/\">Mathematica<\/a>, <a href=\"http:\/\/www.sagemath.org\/\">SAGE<\/a> and <a href=\"http:\/\/www.mathworks.com\/\">MATLAB<\/a> are absolutely perfect for this sort of thing since they combine a large amount of mathematical functionality with top quality plotting routines.  To see what I mean &#8211; let&#8217;s take a look at a Christmas greeting designed by the developers of the open source mathematical system, SAGE.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" src=\"\/images\/random\/padic-seasons-greetings.png\" alt=\"Seasons greetings from SAGE\" \/><\/p>\n<p>I have to confess that I <strong>do not have a clue<\/strong> about the mathematics behind the above greeting (something to do with a <a href=\"http:\/\/wiki.sagemath.org\/pics\">p-adic plot function<\/a> apparently) but maybe by the time Christmas comes around I will understand how it was created.  The SAGE source code you need to generate it is<\/p>\n<p><code><br \/>\nsage: P1 = Zp(3).plot(rgbcolor=(0,1,0))<br \/>\nsage: P2 = Zp(7).plot(rgbcolor=(1,0,0))<br \/>\nsage: P3 = text(\"$Seasons$ $Greetings$ \",(0.0,1.8))<br \/>\nsage: P4 = text(\"$from$ $everyone$ $at$ sagemath.org!\",(0.1,-1.6))<br \/>\nsage: (P1+P2+P3+P4).show(axes=False)<\/code><\/p>\n<p>I thought I would have at doing one and came up with the design below by re-using some Mathematica code from <a href=\"http:\/\/demonstrations.wolfram.com\/InflatingAKochSnowflake\/\">a Wolfram Demonstration<\/a>.  The design is based on a fractal called the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Koch_snowflake\">Koch Snowflake<\/a>.<\/p>\n<p><code><br \/>\nKoch[0] = {{0, 0}, {1, 0}, {1\/2, -(Sqrt[3]\/2)}, {0, 0}} \/\/ N;<br \/>\nKoch[n_] := Koch[n] =<br \/>\nModule[{s},<br \/>\nPartition[Koch[n - Sign[n]], 2, 1] \/. {a_, b_} :&gt; (s = b - a;<br \/>\n{a, a + s\/3, a + s\/3 + RotationTransform[Sign[n] 60 \u00b0][s\/3],a + 2 s\/3})] \/\/<br \/>\nAppend[Flatten[#, 1], Last[Koch[n - Sign[n]]]] &amp;;<br \/>\nGraphics[Line@Koch[5],<br \/>\nEpilog -&gt; Inset[Style[\"Merry Christmas\", 20], {Center, Center}, {Center,Center}]]<br \/>\n<\/code><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"alignnone\" src=\"\/images\/random\/xmas-koch.jpg\" alt=\"Merry Christmas Koch Curve\" \/><\/p>\n<p>OK, so it&#8217;s clear that I am no designer but how often do you get a Christmas card that comes complete with Source code?  This got me thinking, there must be people out there with better design skills than me &#8211; a great many of them in fact and so onto the challenge.<\/p>\n<p><strong>Your task is to design a Christmas message with a mathematical theme using any mathematical system or programming language of your choice.  Your design must be generated algorithmically (so you can&#8217;t design it in Photoshop and import it into Mathematica for example) and it must include source code.  Ideally, you should include a quick explanation of the mathematics you featured in your design.<br \/>\n<\/strong><\/p>\n<p>There will be no prizes I&#8217;m afraid other than kudos and praise from me but hopefully you&#8217;ll have fun doing it just the same.  You can get your designs to me in a number of ways: <a href=\"https:\/\/www.walkingrandomly.com\/?p=53\">email me<\/a>, post source code in the comments section or post your design on your own website and send me the link &#8211; whatever you feel is best.<\/p>\n<p>If you do not have access to a commercial maths package such as Mathematica, MAPLE or MATLAB then I suggest that you take a look at <a href=\"http:\/\/www.sagemath.org\/\">SAGE<\/a> which is completely free (in fact you should take a look at SAGE even if you DO have one of the commercial systems).<\/p>\n<p>Assuming some people actually respond to this post, I will post some of my favourites over the run up to Christmas.<\/p>\n<p>Have fun!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that December has arrived you may well be thinking of sending your loved ones a Christmas card so why not send them one based on some sort of Mathematics? Even better &#8211; why not design it yourself? Software packages such as Mathematica, SAGE and MATLAB are absolutely perfect for this sort of thing since [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6],"tags":[],"class_list":["post-395","post","type-post","status-publish","format-standard","hentry","category-general-math"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3swhs-6n","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=395"}],"version-history":[{"count":15,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/395\/revisions"}],"predecessor-version":[{"id":438,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/395\/revisions\/438"}],"wp:attachment":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}