{"id":1,"date":"2022-08-12T11:11:13","date_gmt":"2022-08-12T08:11:13","guid":{"rendered":"http:\/\/web.vu.lt\/ff\/s.toliautas\/?p=1"},"modified":"2022-08-12T23:53:10","modified_gmt":"2022-08-12T20:53:10","slug":"weave","status":"publish","type":"post","link":"https:\/\/web.vu.lt\/ff\/s.toliautas\/en\/2022\/08\/12\/weave\/","title":{"rendered":"Weave"},"content":{"rendered":"\u201c<a href=\"https:\/\/www.youtube.com\/watch?v=_91HbYkguwk&amp;t=52s\" target=\"_blank\" rel=\"noopener\">Don&#8217;t even know whose bed I&#8217;m in&#8230;<\/a>\u201d<\/p>\n<p>The (pseudo)code below generates a number of points in a plane or, simply put, a picture:<\/p>\n<hr \/>\n<pre>Goals = [(0, 0), (1, 0), (0.5, sqrt(3)\/2)];\r\ncurr = random(Goals);\r\n\r\nfor i = 1:N\r\n    dest = random(Goals);\r\n    next = 1\/2 * (curr + dest);\r\n    curr = next;<\/pre>\n<hr \/>\n<p>The process is defined by a set of goals (<em>Goals<\/em>), a single rule (move half-way (<em>1\/2<\/em>) to a chosen goal) and chance (<em>random()<\/em>). Can you predict how the picture of <em>N<\/em> points will look?<\/p>\n<p><!--more-->One possible result:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-233 size-full\" src=\"https:\/\/web.vu.lt\/ff\/s.toliautas\/wp-content\/uploads\/2022\/08\/chaos_game.gif\" alt=\"\" width=\"560\" height=\"420\" \/><\/p>\n<p>The final picture is fixed; it depends only on the goals and rule(s). However, the randomness ensures that its structure becomes clear only for large number of points, and each path to it (trajectory) may be different.<\/p>\n<p>I invite you to think why I&#8217;m choosing this particular example to introduce a blog.<\/p>\n<p>&nbsp;<\/p>\n<p>* * *<\/p>\n<p>&nbsp;<\/p>\n<p>I can already hear the protestations of those who find their inner self to be <em>obviously<\/em> richer than some trivial rule; also, why start with dunce-cap triangle? The fact is, for a complete <a href=\"https:\/\/www.youtube.com\/watch?v=LB5YkmjalDg\" target=\"_blank\" rel=\"noopener\">square<\/a> no structure ever emerges:<\/p>\n<span class=\"collapseomatic \" id=\"id69d67ee2aed14\"  tabindex=\"0\"     >Show<\/span><span id='swap-id69d67ee2aed14'  class='colomat-swap' style='display:none;'>Hide<\/span><div id=\"target-id69d67ee2aed14\" class=\"collapseomatic_content \">\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-238\" src=\"https:\/\/web.vu.lt\/ff\/s.toliautas\/wp-content\/uploads\/2022\/08\/chaos_game_rec.gif\" alt=\"\" width=\"560\" height=\"420\" \/><br \/>\n<\/div>\n<p>However, unreachable obstacles in the path result in&#8230; something completely different:<\/p>\n<span class=\"collapseomatic \" id=\"id69d67ee2aed25\"  tabindex=\"0\"     >Show<\/span><span id='swap-id69d67ee2aed25'  class='colomat-swap' style='display:none;'>Hide<\/span><div id=\"target-id69d67ee2aed25\" class=\"collapseomatic_content \">\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-243 size-full\" src=\"https:\/\/web.vu.lt\/ff\/s.toliautas\/wp-content\/uploads\/2022\/08\/chaos_game_rest.gif\" alt=\"\" width=\"560\" height=\"420\" \/><br \/>\n<\/div>\n<p>(Source code and comments will be provided in a separate entry.)","protected":false},"excerpt":{"rendered":"<p>Sorry, this entry is only available in Lietuvi\u0173.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3],"tags":[],"class_list":["post-1","post","type-post","status-publish","format-standard","hentry","category-coding","category-musings"],"_links":{"self":[{"href":"https:\/\/web.vu.lt\/ff\/s.toliautas\/en\/wp-json\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/web.vu.lt\/ff\/s.toliautas\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/web.vu.lt\/ff\/s.toliautas\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/web.vu.lt\/ff\/s.toliautas\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/web.vu.lt\/ff\/s.toliautas\/en\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":16,"href":"https:\/\/web.vu.lt\/ff\/s.toliautas\/en\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/web.vu.lt\/ff\/s.toliautas\/en\/wp-json\/wp\/v2\/posts\/1\/revisions\/253"}],"wp:attachment":[{"href":"https:\/\/web.vu.lt\/ff\/s.toliautas\/en\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/web.vu.lt\/ff\/s.toliautas\/en\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/web.vu.lt\/ff\/s.toliautas\/en\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}