{"id":102,"date":"2025-03-29T11:36:18","date_gmt":"2025-03-29T10:36:18","guid":{"rendered":"https:\/\/actilud.com\/info\/en\/?p=102"},"modified":"2025-03-29T11:59:42","modified_gmt":"2025-03-29T10:59:42","slug":"booleans","status":"publish","type":"post","link":"https:\/\/actilud.com\/info\/en\/booleans\/","title":{"rendered":"Booleans"},"content":{"rendered":"<h1>Introduction to Booleans<\/h1>\n<p>A Boolean is a two-state variable, which is generally assigned the values <em>\u200b\u200btrue<\/em> or <em>false.<\/em> In a zebra puzzle, the use of Booleans allows us to identify boxes whose behavior follows the same rules: the boxes identified by the same Boolean are either all true or all false. Thanks to them, a statement can be coded directly in the grids. Once the statement is entered, there is no need to return to it. Most zebra puzzle statements can be coded using Booleans: as soon as a statement is precise, it can be coded with Booleans. Imprecise statements do not allow immediate coding. In the grid below:<\/p>\n<ul>\n<li><em>Enzo arrived 2 minutes before Oc\u00e9ane<\/em> is a precise statement<\/li>\n<li><em>Enzo arrived before Oc\u00e9ane<\/em> is imprecise. To code it, you have to return to the statement several times, at different stages of the resolution.<\/li>\n<\/ul>\n<p>When solving a puzzle in a magazine, to represent a Boolean, you can write a letter in boxes. There are 26 letters in the alphabet, which is more than enough. For example, here&#8217;s a way to code the following proposition in the puzzle &#8220;Jogging on the Beach&#8221; as if it appeared in a magazine:<\/p>\n<blockquote><p>Enzo arrived 2 minutes before Oc\u00e9ane.<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2346 aligncenter\" src=\"https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens01.png\" sizes=\"auto, (min-width: 960px) 75vw, 100vw\" srcset=\"https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens01.png 433w, https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens01-300x297.png 300w\" alt=\"\" width=\"336\" height=\"332\" data-src=\"https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens01.png\" data-srcset=\"https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens01.png 433w, https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens01-300x297.png 300w\" data-sizes=\"(min-width: 960px) 75vw, 100vw\" \/><br \/>\nThis coding establishes the order relationships between the boxes in the <em>Enzo<\/em> line and the <em>Oc\u00e9ane<\/em> line . If Enzo runs for 51 minutes, then Oc\u00e9ane runs for 53 minutes \u2013 this is the Boolean <em>a.<\/em> The same applies to the other Booleans. We also see that some values \u200b\u200bare not possible and are represented by the <em>false<\/em> sign (the cross).<\/p>\n<p>This coding with letters taken from the alphabet works well on paper where the boxes are small.<\/p>\n<p>On the Actilud website, however, I chose a different representation. Each Boolean is formed by a letter and a number, and each letter is associated with a color. Booleans are displayed as colored dots:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2349 aligncenter\" src=\"https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens02.png\" sizes=\"auto, (min-width: 960px) 75vw, 100vw\" srcset=\"https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens02.png 429w, https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens02-300x298.png 300w, https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens02-150x150.png 150w\" alt=\"\" width=\"381\" height=\"378\" data-src=\"https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens02.png\" data-srcset=\"https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens02.png 429w, https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens02-300x298.png 300w, https:\/\/actilud.com\/info\/wp-content\/uploads\/2024\/08\/booleens02-150x150.png 150w\" data-sizes=\"(min-width: 960px) 75vw, 100vw\" \/><\/p>\n<p>The previous coding with the booleans {a, b, c, d} here becomes {a1, a2, a3, a4}.<\/p>\n<p>The advantage is to increase the overall readability of the grid. Indeed, using the same letter associated with different numbers for a given proposition makes it easy to identify the Booleans that fall under this proposition, since each letter is associated with a given color, here blue, which makes it obvious at a glance. But, from a purely logical point of view, the two representations are strictly equivalent.<\/p>\n<h1>Basic Mathematical Rules<\/h1>\n<p>We will need to know the basic rules of Boolean algebra. These rules are quite intuitive. Let a and b be two Booleans.<\/p>\n<h2>Rule of <em>and<\/em><\/h2>\n<blockquote><p>(a and b) is true only if a is true and b is true. In all other cases (a and b) is false.<\/p><\/blockquote>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td data-attr=\"\">\u00a0a\u2192<br \/>\nb\u2193<\/td>\n<td data-attr=\"\">FALSE<\/td>\n<td data-attr=\"\">TRUE<\/td>\n<\/tr>\n<tr>\n<td data-attr=\"\">FALSE<\/td>\n<td data-attr=\"\">FALSE<\/td>\n<td data-attr=\"\">FALSE<\/td>\n<\/tr>\n<tr>\n<td data-attr=\"\">TRUE<\/td>\n<td data-attr=\"\">FALSE<\/td>\n<td data-attr=\"\">TRUE<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This rule is cited for the record. We use it implicitly in integrams. Let us take the riddle &#8220;kites&#8221;. The statement formed by the compound proposition <em>Sandra plays for 30 minutes and has a blue kite<\/em> is true only if the two elements that constitute it, <em>Sandra plays for 30 minutes<\/em> and <em>Sandra has a blue kite<\/em> , are true. Now, since by principle the statements are true <em>,<\/em> the constituent elements are therefore always true.<\/p>\n<h2>Exclusive or rule <em>( or )<br \/>\n<\/em><\/h2>\n<blockquote><p>(a or b) is true only if one of the two Booleans is true. In particular, (a or b) is false if both a and b are false or true.<\/p><\/blockquote>\n<p>This rule is very widely used in integrams; it establishes the alternatives.<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td data-attr=\"\">\u00a0a\u2192<br \/>\nb\u2193<\/td>\n<td data-attr=\"\">FALSE<\/td>\n<td data-attr=\"\">TRUE<\/td>\n<\/tr>\n<tr>\n<td data-attr=\"\">FALSE<\/td>\n<td data-attr=\"\">FALSE<\/td>\n<td data-attr=\"\">TRUE<\/td>\n<\/tr>\n<tr>\n<td data-attr=\"\">TRUE<\/td>\n<td data-attr=\"\">TRUE<\/td>\n<td data-attr=\"\">FALSE<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>If both <em>a<\/em> and <em>b are true, either <\/em><em>(a or b)<\/em> is false. This is certainly true in alternatives. The chapter on alternatives is entirely devoted to this rule, so we won&#8217;t dwell on it. Let&#8217;s take a simple example to understand:<\/p>\n<blockquote><p>Nelly flies her kite for 30 minutes or 50 minutes.<\/p><\/blockquote>\n<p>We can clearly see that Nelly cannot drive for both 30 and 50 minutes. Only one of these two possibilities is correct. This is a typical case of <em>exclusive or. E<\/em><em>xclusive or<\/em> can be translated by the phrase: either\u2026, either\u2026, but at the cost of a certain heaviness in the sentence:<\/p>\n<blockquote><p>Nelly flies a kite for either 30 minutes or 50 minutes.<\/p><\/blockquote>\n<p>The expression <em>or<\/em> often takes on the mathematical meaning of <em>exclusive or.\u00a0<\/em><\/p>\n<p>Here is the associated video (in French for instance) ; if it doesn&#8217;t appear, refresh the page.<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/drive.google.com\/file\/d\/1OUJCXupiFTPuP56RiRBswawChS4l_21y\/preview\" width=\"640\" height=\"360\" allowfullscreen=\"allowfullscreen\" data-mce-fragment=\"1\">&lt;span<br \/>\nstyle=&#8221;display: inline-block; width: 0px; overflow: hidden;<br \/>\nline-height: 0;&#8221; data-mce-type=&#8221;bookmark&#8221;<br \/>\nclass=&#8221;mce_SELRES_start&#8221;&gt;\ufeff&lt;\/span&gt;&lt;span style=&#8221;display:<br \/>\ninline-block; width: 0px; overflow: hidden; line-height: 0;&#8221;<br \/>\ndata-mce-type=&#8221;bookmark&#8221; class=&#8221;mce_SELRES_start&#8221;&gt;\ufeff&lt;\/span&gt;<\/iframe><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction to Booleans A Boolean is a two-state variable, which is generally assigned the values \u200b\u200btrue or false. In a zebra puzzle, the use of Booleans allows us to identify boxes whose behavior follows the same rules: the boxes identified by the same Boolean are either all true or all false. Thanks to them, a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-zebra-puzzles-universal-techniques-to-solve-them-all"],"_links":{"self":[{"href":"https:\/\/actilud.com\/info\/en\/wp-json\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actilud.com\/info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actilud.com\/info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actilud.com\/info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actilud.com\/info\/en\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":3,"href":"https:\/\/actilud.com\/info\/en\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":120,"href":"https:\/\/actilud.com\/info\/en\/wp-json\/wp\/v2\/posts\/102\/revisions\/120"}],"wp:attachment":[{"href":"https:\/\/actilud.com\/info\/en\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actilud.com\/info\/en\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actilud.com\/info\/en\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}