{"id":1413,"date":"2023-04-24T15:04:59","date_gmt":"2023-04-24T14:04:59","guid":{"rendered":"https:\/\/blog.univ-angers.fr\/mathsinfo\/?p=1413"},"modified":"2023-04-28T12:42:38","modified_gmt":"2023-04-28T11:42:38","slug":"binary-plot","status":"publish","type":"post","link":"https:\/\/blog.univ-angers.fr\/mathsinfo\/2023\/04\/24\/binary-plot\/","title":{"rendered":"Binary plot"},"content":{"rendered":"\n<p>David, un coll\u00e8gue enseignant, <a rel=\"noreferrer noopener\" href=\"https:\/\/twitter.com\/david_cobac\/status\/1649699876890968064\" data-type=\"URL\" data-id=\"https:\/\/twitter.com\/david_cobac\/status\/1649699876890968064\" target=\"_blank\">a post\u00e9 un tweet<\/a> sur l&rsquo;utilisation du mode de repr\u00e9sentation <strong>Truth<\/strong> sur les anciennes <a rel=\"noreferrer noopener\" href=\"https:\/\/youtu.be\/NH_E8PSwMuc\" target=\"_blank\">calculatrices HP 48G<\/a>. Voici son premier r\u00e9sultat, le tapis de Sierpinski :<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-53.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-53.png\" alt=\"\" class=\"wp-image-1414\" width=\"378\" height=\"239\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-53.png 911w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-53-300x189.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-53-768x485.png 768w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-53-475x300.png 475w\" sizes=\"auto, (max-width: 378px) 100vw, 378px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>Avec cette \u00e9quation tr\u00e8s courte :<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/FuYYWOrXoAA_e8Z.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/FuYYWOrXoAA_e8Z.png\" alt=\"\" class=\"wp-image-1418\" width=\"321\" height=\"157\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/FuYYWOrXoAA_e8Z.png 393w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/FuYYWOrXoAA_e8Z-300x147.png 300w\" sizes=\"auto, (max-width: 321px) 100vw, 321px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><span style=\"text-decoration: underline\">Quelques explications<\/span> : R\u2192B permet de convertir un nombre en binaire. Pour chaque abscisse <strong>X<\/strong> (entre 0 et 63) et chaque <strong>Y<\/strong> (entre 0 et 63), on regarde s&rsquo;ils ont au moins <span style=\"text-decoration: underline\">un bit en commun<\/span> dans leurs \u00e9critures binaires respectives. Par exemple si <strong>X<\/strong> = 12 = 1<strong>1<\/strong>00b et <strong>Y<\/strong> = 6 = <strong>1<\/strong>10b ont un bit en commun \u00e0 la 3e position, on affiche dans ce cas un pixel noir \u00e0 l&rsquo;\u00e9cran.<\/p>\n\n\n\n<p>A partir de l\u00e0 j&rsquo;ai trouv\u00e9 la page <a rel=\"noreferrer noopener\" href=\"https:\/\/mathworld.wolfram.com\/BinaryPlot.html\" target=\"_blank\">Binary Plot du site Wollfram<\/a> avec quelques visuels que j&rsquo;ai voulu reproduire en Python.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-57.png\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-57.png\" alt=\"\" class=\"wp-image-1422\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-57.png 320w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-57-300x225.png 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><figcaption class=\"wp-element-caption\">Les puissances 3, 2 et 1 des entiers de 1 \u00e0 160<\/figcaption><\/figure>\n<\/div>\n\n\n<pre class=\"wp-block-code\"><code>from kandinsky import *\n\nfor y in range(30):\n n = 2 ** y\n for x in range(160):\n    for i in range(3): \n     if x ** (i + 1) &amp; n &gt; 0:\n       fill_rect(2 * x, 214 - 63 * i - 4 * y, 2, 4, (0, 0, 0))<\/code><\/pre>\n\n\n\n<p>En Python il est tr\u00e8s simple de faire des op\u00e9rations bit \u00e0 bit. Pour le \u00ab\u00a0ET\u00a0\u00bb on utilise <strong>&amp;<\/strong>. Par exemple :<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-65.png\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-65.png\" alt=\"\" class=\"wp-image-1437\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-65.png 320w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-65-300x225.png 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><figcaption class=\"wp-element-caption\">1100b AND 110b donne 100b = 4<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Pour le \u00ab\u00a0OU\u00a0\u00bb le symbole est |. Par exemple 12 | 6 = 14 car 1100b | 110b = 1110b<\/p>\n\n\n\n<p>Et le \u00ab\u00a0OU EXCLUSIF\u00a0\u00bb par ^. Par exemple 12 ^ 6 = 10 car 1100b ^110b = 1010b<\/p>\n\n\n\n<p>Passons \u00e0 la repr\u00e9sentation des coefficients binomiaux :<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-58.png\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-58.png\" alt=\"\" class=\"wp-image-1423\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-58.png 320w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-58-300x225.png 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><a href=\"https:\/\/my.numworks.com\/python\/schraf\/creatures\" target=\"_blank\" rel=\"noreferrer noopener\">Les scripts (biblioth\u00e8que PIL et NUMWORKS) sont ici<\/a>.<\/p>\n\n\n\n<p>En bas \u00e0 gauche les coefficients (\u00e9crits en binaires) qui apparaissent dans les d\u00e9veloppements de (a+b)^0, (a+b)^1, (a+b)^3 etc.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-59.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-59.png\" alt=\"\" class=\"wp-image-1424\" width=\"263\" height=\"84\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>Quelques formes amusantes apparaissent !<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-60.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-60-1024x614.png\" alt=\"\" class=\"wp-image-1425\" width=\"406\" height=\"244\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-60-1024x614.png 1024w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-60-300x180.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-60-768x461.png 768w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-60-1536x921.png 1536w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-60-2048x1229.png 2048w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-60-500x300.png 500w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/a><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-61.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-61-1024x626.png\" alt=\"\" class=\"wp-image-1426\" width=\"408\" height=\"250\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-61-1024x626.png 1024w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-61-300x183.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-61-768x469.png 768w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-61-1536x939.png 1536w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-61-2048x1252.png 2048w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-61-491x300.png 491w\" sizes=\"auto, (max-width: 408px) 100vw, 408px\" \/><\/a><figcaption class=\"wp-element-caption\">L&rsquo;image \u00e0 droite a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9e par l&rsquo;IA DALL E<\/figcaption><\/figure>\n<\/div>\n\n\n<p>On peut \u00e9galement repr\u00e9senter la suite de Fibonacci :<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-62.png\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"498\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-62.png\" alt=\"\" class=\"wp-image-1428\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-62.png 700w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-62-300x213.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-62-422x300.png 422w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><figcaption class=\"wp-element-caption\">Les 700 premiers termes de la suite<\/figcaption><\/figure>\n<\/div>\n\n\n<p><a href=\"https:\/\/my.numworks.com\/python\/schraf\/bin_fibo\" target=\"_blank\" rel=\"noreferrer noopener\">Les scripts sont ici<\/a>.<\/p>\n\n\n\n<p>Enfin, l&rsquo;id\u00e9e m&rsquo;est venue de repr\u00e9senter la <strong>conjecture de Syracuse<\/strong> (on part d&rsquo;un entier, s&rsquo;il est pair on le divise par 2 sinon on le multiplie par 3 et on ajoute 1, la conjecture pr\u00e9tend que l&rsquo;on arrivera \u00e0 <strong>1<\/strong> au bout d&rsquo;un certain temps). Avec <strong>N<\/strong> = 27 comme d\u00e9part on arrive \u00e0 1 au bout de <strong>111<\/strong> it\u00e9rations (appel\u00e9 temps de vol) et le maximum atteint est <strong>9232<\/strong>.<\/p>\n\n\n\n<p>Repr\u00e9sentons les termes de la suite sous forme binaire :<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-63.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"612\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-63-1024x612.png\" alt=\"\" class=\"wp-image-1429\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-63-1024x612.png 1024w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-63-300x179.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-63-768x459.png 768w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-63-1536x917.png 1536w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-63-500x300.png 500w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-63.png 1902w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Suite de Syracuse en partant de N = 27<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Il est alors assez facile de lire la valeur exacte de chacune des colonnes, par exemple du maximum. Il suffit de rep\u00e9rer les num\u00e9ros de lignes (En bas = 0). Sur le visuel on lit les lignes 4, 10 et 13. Le nombre correspondant est donc 2^4 + 2^10 + 2^13 = 9232.<\/p>\n\n\n\n<p> <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Autres exemples<\/h2>\n\n\n\n<p><a href=\"https:\/\/my.numworks.com\/python\/schraf\/bin_art\" target=\"_blank\" rel=\"noreferrer noopener\">Script NUMWORKS pour les \u00ab\u00a0spirales\u00a0\u00bb<\/a><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-66.png\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-66.png\" alt=\"\" class=\"wp-image-1441\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-66.png 320w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-66-300x225.png 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><figcaption class=\"wp-element-caption\">tan(x * y \/ 3) &gt; sin(y \/ 2)<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-67.png\"><img loading=\"lazy\" decoding=\"async\" width=\"393\" height=\"192\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-67.png\" alt=\"\" class=\"wp-image-1442\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-67.png 393w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-67-300x147.png 300w\" sizes=\"auto, (max-width: 393px) 100vw, 393px\" \/><\/a><figcaption class=\"wp-element-caption\">\u00ab X Y * 4 \/. TAN Y 2 \/ SIN &gt; \u00bb (En mode radians)<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-72.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"585\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-72-1024x585.png\" alt=\"\" class=\"wp-image-1453\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-72-1024x585.png 1024w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-72-300x171.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-72-768x439.png 768w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-72-500x286.png 500w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-72.png 1400w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Version HD avec biblioth\u00e8que PIL<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-68.png\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-68.png\" alt=\"\" class=\"wp-image-1446\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-68.png 320w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-68-300x225.png 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><figcaption class=\"wp-element-caption\">cos(x \/ (y + 1) * 10) &gt; sin( y \/ 5)<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-70.png\"><img loading=\"lazy\" decoding=\"async\" width=\"393\" height=\"192\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-70.png\" alt=\"\" class=\"wp-image-1448\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-70.png 393w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-70-300x147.png 300w\" sizes=\"auto, (max-width: 393px) 100vw, 393px\" \/><\/a><figcaption class=\"wp-element-caption\">\u00ab X Y 1 + \/ 12 * COS Y 2 \/ SIN &gt; \u00bb (En mode radians)<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-74.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"585\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-74-1024x585.png\" alt=\"\" class=\"wp-image-1457\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-74-1024x585.png 1024w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-74-300x171.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-74-768x439.png 768w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-74-500x286.png 500w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-74.png 1400w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Version HD<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-71.png\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-71.png\" alt=\"\" class=\"wp-image-1451\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-71.png 320w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-71-300x225.png 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><figcaption class=\"wp-element-caption\">sin(x * x \/ (y + 1) * 2) &gt;= sin( y \/ (x + 1) * 10)<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-76.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"585\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-76-1024x585.png\" alt=\"\" class=\"wp-image-1460\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-76-1024x585.png 1024w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-76-300x171.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-76-768x439.png 768w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-76-500x286.png 500w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-76.png 1400w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Version HD<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-77.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-77-1024x683.png\" alt=\"\" class=\"wp-image-1463\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-77-1024x683.png 1024w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-77-300x200.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-77-768x512.png 768w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-77-450x300.png 450w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-77.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">sin(x \/ 8) % 1 &gt; sin(y \/ 8) % 1<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-78.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-78-1024x683.png\" alt=\"\" class=\"wp-image-1465\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-78-1024x683.png 1024w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-78-300x200.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-78-768x512.png 768w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-78-450x300.png 450w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-78.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">sqrt(x) % 1 &gt;= sqrt(y) % 1<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/tapis.png\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/tapis.png\" alt=\"\" class=\"wp-image-1468\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/tapis.png 320w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/tapis-300x225.png 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><figcaption class=\"wp-element-caption\">Tapis de Sierpinski<\/figcaption><\/figure>\n<\/div>\n\n\n<pre class=\"wp-block-code\"><code>from kandinsky import *\n\ndef tapis(x, y):\n  while x &gt; 0 and y &gt; 0:\n    if x % 3 == 1 and y % 3 == 1: return 0\n    x \/\/= 3\n    y \/\/= 3\n  return 1  \n\nfor y in range(222):\n  for x in range(320):\n    if tapis(x, y): set_pixel(x, 221 - y, (0,) * 3)<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-79.png\"><img loading=\"lazy\" decoding=\"async\" width=\"729\" height=\"729\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-79.png\" alt=\"\" class=\"wp-image-1470\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-79.png 729w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-79-300x300.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-79-150x150.png 150w\" sizes=\"auto, (max-width: 729px) 100vw, 729px\" \/><\/a><figcaption class=\"wp-element-caption\">Version HD : 729 * 729 pixels (729 = 3^6)<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-80.png\"><img loading=\"lazy\" decoding=\"async\" width=\"393\" height=\"192\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-80.png\" alt=\"\" class=\"wp-image-1473\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-80.png 393w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-80-300x147.png 300w\" sizes=\"auto, (max-width: 393px) 100vw, 393px\" \/><\/a><\/figure>\n<\/div>\n\n\n<pre class=\"wp-block-code\"><code>@ Adaptation d'un script de David Cobac pour HP-48\n\n\u00ab 3 PICK 3 MOD \u00bb 'MOD3 STO\n\u00ab 3 \/ IP SWAP \u00bb 'IP3 STO\n{ (0 0) (130 63) X 0 (0 0) TRUTH Y } 'PPAR STO\n\n\u00ab X Y \nWHILE DUP2 *\n MOD3 MOD3 *\n 1 \u2260 *\nREPEAT\n IP3 IP3\nEND\n* NOT \u00bb 'EQ STO\n\n\u00ab ERASE DRAW {} PVIEW \u00bb 'TAP STO\n\nLancez TAP\n\n\nVersion 2 :\n\n\u00ab X Y \nWHILE DUP2 DUP2\n 3 MOD SWAP 3 MOD\n * 1 \u2260 * *\nREPEAT\n 3 \/ IP SWAP 3 \/ IP\nEND\n* NOT \u00bb<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-81.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-81-1024x768.png\" alt=\"\" class=\"wp-image-1486\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-81-1024x768.png 1024w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-81-300x225.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-81-768x576.png 768w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-81-1536x1152.png 1536w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-81-400x300.png 400w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2023\/04\/image-81.png 1984w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">R\u00e9sultat sur HP 50g apr\u00e8s environ&#8230; 50 minutes !<\/figcaption><\/figure>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>David, un coll\u00e8gue enseignant, a post\u00e9 un tweet sur l&rsquo;utilisation du mode de repr\u00e9sentation Truth sur les anciennes calculatrices HP 48G. Voici son premier r\u00e9sultat, le tapis de Sierpinski : Avec cette \u00e9quation tr\u00e8s courte : Quelques explications : R\u2192B &hellip; <a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/2023\/04\/24\/binary-plot\/\">Continuer la lecture <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":4913,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1413","post","type-post","status-publish","format-standard","hentry","category-non-classe"],"_links":{"self":[{"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/posts\/1413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/users\/4913"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/comments?post=1413"}],"version-history":[{"count":39,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/posts\/1413\/revisions"}],"predecessor-version":[{"id":1474,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/posts\/1413\/revisions\/1474"}],"wp:attachment":[{"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/media?parent=1413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/categories?post=1413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/tags?post=1413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}