{"id":2041,"date":"2020-04-20T14:27:34","date_gmt":"2020-04-20T17:27:34","guid":{"rendered":"https:\/\/www.blogs.unicamp.br\/zero\/?p=2041"},"modified":"2022-05-23T17:31:14","modified_gmt":"2022-05-23T20:31:14","slug":"creatures-of-xn-heads-part-4-5","status":"publish","type":"post","link":"https:\/\/www.blogs.unicamp.br\/zero\/2041\/","title":{"rendered":"Creatures of X^n heads (part 4\/5)"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"2041\" class=\"elementor elementor-2041\" data-elementor-settings=\"{&quot;ha_cmc_init_switcher&quot;:&quot;no&quot;}\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-82641f9 elementor-section-boxed elementor-section-height-default elementor-section-height-default jltma-glass-effect-no\" data-id=\"82641f9\" data-element_type=\"section\" data-e-type=\"section\" data-settings=\"{&quot;_ha_eqh_enable&quot;:false}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3f48392 jltma-glass-effect-no\" data-id=\"3f48392\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-ec25578 jltma-glass-effect-no elementor-widget elementor-widget-heading\" data-id=\"ec25578\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h4 class=\"elementor-heading-title elementor-size-default\"><a href=\"https:\/\/www.blogs.unicamp.br\/zero\/2020\/04\/20\/bichos-de-xn-cabecas-parte-4-5\/\">(Traduzir)<\/a><\/h4>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3b9b043 jltma-glass-effect-no elementor-widget elementor-widget-heading\" data-id=\"3b9b043\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h4 class=\"elementor-heading-title elementor-size-default\"><a href=\"https:\/\/www.blogs.unicamp.br\/zero\/2020\/04\/20\/creatures-of-xn-heads-part-3-5\/\">Creatures of X^n heads (part 3\/5)<\/a><\/h4>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0392ec0 jltma-glass-effect-no elementor-widget elementor-widget-text-editor\" data-id=\"0392ec0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p align=\"justify\">The color system example may seem daunting. But we can also compare the byte with an object popularly perceived as something less &#8220;computational&#8221;, the flute. A flute has 7 holes on top and 1 hole on the bottom. The flutist blows (equivalent to electrical energy) and decides which holes to plug or unplug. For each note there is then a combination of these 8 holes, some plugged and others uncapped (we assume for simplicity, that the flutist cannot leave a hole partially plugged). When reading a score and playing a melody, you are actually reading a sequence of bytes written in the language of musical scores, interpreting them as finger movements to plug and unplug holes and thus execute your code. Well-written and well-executed code generates the expected melody. In this case, the flutist would be a kind of processor that reads the code and executes it by means of a physical device (the flute) that has the sound as its output.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5da74de jltma-glass-effect-no elementor-widget elementor-widget-image\" data-id=\"5da74de\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"360\" height=\"133\" src=\"https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/flauta-doce.jpg\" class=\"attachment-large size-large wp-image-2016\" alt=\"\" srcset=\"https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/flauta-doce.jpg 360w, https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/flauta-doce-300x111.jpg 300w\" sizes=\"(max-width: 360px) 100vw, 360px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6064cda jltma-glass-effect-no elementor-widget elementor-widget-text-editor\" data-id=\"6064cda\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p align=\"center\">Example of flute with 8 Boolean variables.<\/p><p align=\"justify\">Back to computing, we also work directly with bytes from the ASCII code (American Standard Code for Information Interchange). This encodes a set of 128 signs, from letters of the alphabet, punctuation marks, mathematicians and other particulars that are not printable on the screen. However, 128 signals can be represented by 7 bits, and as we saw earlier, 1 byte has 8 bits, so what happens to this extra bit, if each character uses 8 bits and not just 7? This extra bit is used by the computer itself for different operations depending on the operating system.<\/p><p align=\"justify\">We can understand this 1-bit \u201creserve\u201d as a check digit, similar to the last digits of several identification documents.<\/p><p align=\"justify\">Let&#8217;s now exemplify the character size of the ASCII code and test if what we type really occupies this space. To do this, open the most basic text editor possible (the Windows Notepad software is a little less basic than we want, but if you don&#8217;t have another, it will do). In the case of the Lubuntu system used in this example, we have the LeafPad software, available for similar operating systems derived from Ubuntu (popularly known as Linux). This example will not work with more advanced editors like Office or LibreOffice.<\/p><p align=\"justify\">With the editor open write something, count how many characters you used, save the file. Select to see the file properties and verify that the file size will be the number of characters used in bytes. In the example below, I wrote the word \u201cexemplo\u201d in the Leafpad text editor, saved the file with the name x and opened its properties. Note in Total size of files: that its size is 7 bytes. Equivalent to the 7 letters I used in the word example. In this case, these basic editors do not support formatting such as bold, color changes, images, or other common actions in the editing of more refined texts, such as that of this editor himself.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d1e7e9e jltma-glass-effect-no elementor-widget elementor-widget-image\" data-id=\"d1e7e9e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"800\" height=\"386\" src=\"https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/2020-04-12-220217_1366x768_scrot.png\" class=\"attachment-large size-large wp-image-2017\" alt=\"\" srcset=\"https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/2020-04-12-220217_1366x768_scrot.png 881w, https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/2020-04-12-220217_1366x768_scrot-300x145.png 300w, https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/2020-04-12-220217_1366x768_scrot-768x370.png 768w, https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/2020-04-12-220217_1366x768_scrot-700x338.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-49cbb8e jltma-glass-effect-no elementor-widget elementor-widget-text-editor\" data-id=\"49cbb8e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p align=\"center\">Example file size with 7 characters.<\/p><p align=\"justify\">Let&#8217;s say that it is in this representation that the magic of programming takes place. Those who program (create or edit software) do not (except for very rare exceptions) in the language of the bits (0&#8217;s or 1&#8217;s), but (for textual programming languages) in the language of the bytes (0, 1, 2, 3 ,\u2026, 255) represented from the ASCII table. In this case, it is not uncommon to program in software such as Notepad or basic text editors, even though there are specific software to assist this writing, correcting syntax, warning of possible errors in the code, among other tips to assist the programmer in the production of this one. text that will be the code.<\/p><p align=\"justify\">But what makes the program work is the so-called compiler. The function of the compiler is similar to the Universal Turing Machine that we explained earlier (not that any compiler is equivalent to a Universal Turing Machine). In this case, it is software instructed to read what we have written and to take action from it. In fact, the compiler interprets our codes according to a sequence of meanings that define a specific programming language, translate it into the language of 0\u2019s and 1\u2019s and make the computer perform the requested actions.<\/p><p align=\"justify\">To exemplify this writing, we present the beginning of our own written and commented code in MatLab \/ Octave (mathematical software) to perform the interpolation of points (connect all points) in the plane by linear splines (line segments) or by cubic splines (curves) of a polynomial of degree 3). In this case, what appears written on a line after # is not considered by the compiler, it is a technique generally used to comment on the code, a way to make it easier for the programmer or other programmers to understand and understand the reasons for each command.<\/p><table width=\"100%\" cellspacing=\"0\" cellpadding=\"4\"><colgroup><col width=\"256*\" \/> <\/colgroup><tbody><tr><td valign=\"top\" width=\"100%\"><p align=\"justify\">clc # clean the screen<\/p><p align=\"justify\">clear all # clears all variables<\/p><p align=\"justify\">xfalso=[x1 x2 x3 \u2026 xm]; # change here for the x coordinate values<\/p><p align=\"justify\">yfalso=[y1 y2 y3 \u2026 ym]; # change here for the y coordinate values<\/p><p align=\"justify\">nfalso=length(xfalso); # measures the size of xfalso<\/p><p align=\"justify\">x(1)=xfalso(nfalso); # assigning the first x the last xfalso<\/p><p align=\"justify\">x(nfalso+2)=xfalso(1); # agiving the last x the first xfalso<\/p><p align=\"justify\">y(1)=yfalso(nfalso); # assigning the first x the last yfalso<\/p><p align=\"justify\">y(nfalso+2)=yfalso(1); # agiving the last x the first yfalso<\/p><\/td><\/tr><\/tbody><\/table><p align=\"justify\">Below we present a result of its application for a set of previously chosen points. On the left we have the plane points, in the center the interpolation by linear splines and on the right the interpolation by cubic splines.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-31d14dc jltma-glass-effect-no elementor-widget elementor-widget-image\" data-id=\"31d14dc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"800\" height=\"223\" src=\"https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/2020-04-12-220409_1366x768_scrot-1024x285.png\" class=\"attachment-large size-large wp-image-2018\" alt=\"\" srcset=\"https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/2020-04-12-220409_1366x768_scrot-1024x285.png 1024w, https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/2020-04-12-220409_1366x768_scrot-300x83.png 300w, https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/2020-04-12-220409_1366x768_scrot-768x213.png 768w, https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/2020-04-12-220409_1366x768_scrot-700x195.png 700w, https:\/\/www.blogs.unicamp.br\/zero\/wp-content\/uploads\/sites\/187\/2020\/04\/2020-04-12-220409_1366x768_scrot.png 1270w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-642239e jltma-glass-effect-no elementor-widget elementor-widget-text-editor\" data-id=\"642239e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p align=\"center\">Example of running the complete code.<\/p><p align=\"justify\">Although it seems an exaggeration to present this code here in the text, we consider it an important aspect that is sometimes lacking in texts related to scientific dissemination. Many people may have a misconception about what software is, where it comes from, how they are created\u2026 Thus, the code above is in the MatLab \/ Octave language, it was produced in a notepad and executed from a software that compiles texts \/ codes in this language. In lines 3 and 4 of the code, we replace the points we want to connect to x and y coordinates. When executing it, we generate the blue dots, the linear spline and the cubic spline.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e19b78d jltma-glass-effect-no elementor-widget elementor-widget-heading\" data-id=\"e19b78d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h4 class=\"elementor-heading-title elementor-size-default\"><a href=\"https:\/\/www.blogs.unicamp.br\/zero\/2020\/04\/20\/creatures-of-xn-heads-part-5-5\/\">Creatures of X^n heads (part 5\/5)<\/a><\/h4>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a2bc14e jltma-glass-effect-no elementor-widget elementor-widget-heading\" data-id=\"a2bc14e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h4 class=\"elementor-heading-title elementor-size-default\"><a href=\"https:\/\/www.blogs.unicamp.br\/zero\/\">Back to main page<\/a><\/h4>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2bc2b50 jltma-glass-effect-no elementor-widget elementor-widget-heading\" data-id=\"2bc2b50\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h4 class=\"elementor-heading-title elementor-size-default\"><a href=\"https:\/\/www.blogs.unicamp.br\/zero\/who-writes-the-posts\/\">Who writes the posts?<\/a><\/h4>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>5-part special on the creatures of X^n heads.<\/p>\n","protected":false},"author":434,"featured_media":2048,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"pgc_sgb_lightbox_settings":"","_vp_format_video_url":"","_vp_image_focal_point":[],"footnotes":""},"categories":[1211],"tags":[],"class_list":["post-2041","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-v-3-ed-2"],"_links":{"self":[{"href":"https:\/\/www.blogs.unicamp.br\/zero\/wp-json\/wp\/v2\/posts\/2041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blogs.unicamp.br\/zero\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blogs.unicamp.br\/zero\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blogs.unicamp.br\/zero\/wp-json\/wp\/v2\/users\/434"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blogs.unicamp.br\/zero\/wp-json\/wp\/v2\/comments?post=2041"}],"version-history":[{"count":9,"href":"https:\/\/www.blogs.unicamp.br\/zero\/wp-json\/wp\/v2\/posts\/2041\/revisions"}],"predecessor-version":[{"id":2134,"href":"https:\/\/www.blogs.unicamp.br\/zero\/wp-json\/wp\/v2\/posts\/2041\/revisions\/2134"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.blogs.unicamp.br\/zero\/wp-json\/wp\/v2\/media\/2048"}],"wp:attachment":[{"href":"https:\/\/www.blogs.unicamp.br\/zero\/wp-json\/wp\/v2\/media?parent=2041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blogs.unicamp.br\/zero\/wp-json\/wp\/v2\/categories?post=2041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blogs.unicamp.br\/zero\/wp-json\/wp\/v2\/tags?post=2041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}