{"id":678,"date":"2008-08-29T16:00:27","date_gmt":"2008-08-29T23:00:27","guid":{"rendered":"https:\/\/www.reenigne.org\/blog\/?p=678"},"modified":"2008-09-16T10:00:49","modified_gmt":"2008-09-16T17:00:49","slug":"simplicity-density-function","status":"publish","type":"post","link":"https:\/\/www.reenigne.org\/blog\/simplicity-density-function\/","title":{"rendered":"Simplicity density function"},"content":{"rendered":"<p>A commenter on <a href=\"https:\/\/www.reenigne.org\/blog\/a-little-mathematical-game\">Tuesday's post<\/a> wondered what the density function of numbers with low complexity looks like. This seemed like an interesting question to me too, so I wrote some code to find out. This is the result:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"centerwide\" src=\"http:\/\/www.reenigne.org\/misc\/complexity.png\" alt=\"Simplicity density function\" \/><\/p>\n<p>I actually used a slight modification of the complexity metric (L(exp(x)) == L(-x) == L(log(x)) == L(x)+1, L(x+y) == L(x)+L(y)+1, L(0) == 1) and a postfix notation instead of a bracketing one. These are all the numbers x with L(x)&lt;=20. More than that and my program takes up too much memory without some serious optimization.<\/p>\n<p>The smooth curves and straight lines are functions of the real line (which is quite densely covered). The strong horizontal lines above and below the center (0) lines are +\u03c0i and -\u03c0i, which occur from taking the logarithm of a negative real number. There is a definite fractal nature to the image and lots of repetition (as one would expect, since every function is applied to every previously generated point up to the complexity limit).<\/p>\n<p>I didn't add duplicate elimination rules for duplicates that didn't appear until L(x)&gt;=8 or so, so some points are hotter than they should be, but I don't think fixing this would make the image look significantly different.<\/p>\n<p>The code is <a href=\"http:\/\/www.reenigne.org\/misc\/complexity.cpp\">here<\/a>. <a href=\"http:\/\/www.reenigne.org\/misc\/complex.h\">This<\/a> header file is also required for the Complex class, and this in turn requires <a href=\"http:\/\/www.reenigne.org\/misc\/vectors.h\">this<\/a> and <a href=\"http:\/\/www.reenigne.org\/misc\/rotors.h\">this<\/a>. The program is actually a sort of embryonic symbolic algebra program as it builds trees of expressions and pattern matches strings against them. It generates a 1280x1280 RGB image which I cropped down to 800x600. The colour palette is based on a thermal spectrum where temperature goes as an inverse seventh root of the number of hits on a pixel (no particular mathematical reason for that - I just think it makes it look nice). The points between black and red are fudged a bit.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A commenter on Tuesday's post wondered what the density function of numbers with low complexity looks like. This seemed like an interesting question to me too, so I wrote some code to find out. This is the result: I actually used a slight modification of the complexity metric (L(exp(x)) == L(-x) == L(log(x)) == L(x)+1, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-678","post","type-post","status-publish","format-standard","hentry","category-fractals"],"_links":{"self":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts\/678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/comments?post=678"}],"version-history":[{"count":6,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts\/678\/revisions"}],"predecessor-version":[{"id":785,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts\/678\/revisions\/785"}],"wp:attachment":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/media?parent=678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/categories?post=678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/tags?post=678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}