{"id":62,"date":"2010-07-12T21:40:19","date_gmt":"2010-07-12T20:40:19","guid":{"rendered":"http:\/\/www.sebcharrot.com\/blog\/?p=62"},"modified":"2010-07-12T21:40:19","modified_gmt":"2010-07-12T20:40:19","slug":"but-would-they-be-neighbours-like-this","status":"publish","type":"post","link":"http:\/\/www.sebcharrot.com\/blog\/but-would-they-be-neighbours-like-this\/","title":{"rendered":"But would they be neighbours like this?"},"content":{"rendered":"<div id=\"attachment_277\" style=\"width: 710px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2010\/07\/1845313508_a5a9ca39f9_o.jpg\"><img aria-describedby=\"caption-attachment-277\" loading=\"lazy\" class=\"size-full wp-image-277\" src=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2010\/07\/1845313508_a5a9ca39f9_o.jpg\" alt=\"Photo by lorenzaccio* CC BY\" width=\"700\" height=\"1016\" srcset=\"http:\/\/www.sebcharrot.com\/blog\/wp-content\/uploads\/2010\/07\/1845313508_a5a9ca39f9_o.jpg 700w, http:\/\/www.sebcharrot.com\/blog\/wp-content\/uploads\/2010\/07\/1845313508_a5a9ca39f9_o-207x300.jpg 207w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><p id=\"caption-attachment-277\" class=\"wp-caption-text\"><a href=\"http:\/\/www.flickr.com\/photos\/lorenzaccio\/1845313508\/\">Photo<\/a> by lorenzaccio* <a href=\"http:\/\/creativecommons.org\/licenses\/by-nc-sa\/2.0\/\">CC BY<\/a><\/p><\/div>\n<p>The &#8220;Doors to Heaven and Hell&#8221; riddle. It&#8217;s an oldie and a goodie. I&#8217;m sure everyone&#8217;s pretty familiar with it, but in case you&#8217;re not here&#8217;s a quick recap:<\/p>\n<blockquote><p>Bad news, you&#8217;ve just died. You find yourself in a nondescript hallway with two identical doors, each guarded by a man. You realise you&#8217;re holding a scrap of paper. It reads:<\/p>\n<p>1. One of these doors leads to Heaven, one leads to Hell.<br \/>\n2. The man guarding Hell&#8217;s door always lies. The man guarding Heaven&#8217;s door always tell the truth.<br \/>\n3. You may ask one of them one question.<\/p>\n<p>(Note: You also can&#8217;t use any external reference points e.g &#8220;Does 1 + 1 = 2?&#8221; You have to limit your questions to the men and their situation. Nor can you do a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Karl_Pilkington\">Karl Pilkington<\/a> and try to trick God into coming to the door to sign for his post)<\/p><\/blockquote>\n<p>So if you were to ask them, &#8220;Where does your door lead?&#8221; the man guarding Heaven would say &#8220;Heaven&#8221;, <em>as would the man guarding hell<\/em> (since he&#8217;d lie). That would be a bad question, since if you asked either of them, they would give the same answer. The aim of the riddle is to ask a question which is guaranteed to let you know which door leads to heaven and which leads to hell. The good thing is, there <em>is<\/em> a solution.<\/p>\n<p>The answer is annoyingly simple once you hear it. The correct question to ask is &#8220;If I was to ask the other guy what door he was guarding, what would he say?&#8221; If you happened to ask the man guarding heaven, he&#8217;d know the other guy was guarding hell, and he&#8217;d know he&#8217;d lie, so he&#8217;d say &#8220;Heaven&#8221;. Likewise if you happened to ask the man guarding Hell what the other guy would say, he&#8217;d know the guy guarding heaven would say &#8220;Heaven&#8221;, so he&#8217;d lie and say &#8220;Hell&#8221;. The answer they give is the answer to which door they&#8217;re guarding.<\/p>\n<p>In fact there are several variations of the question which you could ask (E.g. &#8220;If I was to ask the other guy what door you were guarding, what would he say?&#8221;) Another interesting variation is &#8220;If I were to ask you what door you were guarding, what would you say?&#8221;. The liar&#8217;s process would have to be:<\/p>\n<p>1. OK, I&#8217;m guarding hell<br \/>\n2. If he was to ask me what door I was guarding, I&#8217;d say &#8220;Heaven&#8221;<br \/>\n3. But I need to lie about the answer to (2)<\/p>\n<p>And he&#8217;d have to say &#8220;Hell&#8221;. So you&#8217;d know he was guarding hell.<\/p>\n<p>The same principle behind each of these questions is the principle of chaining their systems in series. Let&#8217;s use some logic gates to show you what I mean.<\/p>\n<p>So a basic NOT gate (or inverter) takes in a value and returns its opposite.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2010\/07\/logic_notgate.jpg\"><img loading=\"lazy\" width=\"294\" height=\"54\" class=\"aligncenter size-full wp-image-64\" title=\"Not Gate\" src=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2010\/07\/logic_notgate.jpg\" alt=\"That's not a knife that's a spoon\" \/><\/a><\/p>\n<p>So 0 goes in, 1 come out. Another way to put this:<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2010\/07\/logic_heavenhell_alt.jpg\"><img loading=\"lazy\" width=\"300\" height=\"52\" class=\"aligncenter size-medium wp-image-66\" title=\"Liar Process\" src=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2010\/07\/logic_heavenhell_alt-300x52.jpg\" alt=\"\" srcset=\"http:\/\/www.sebcharrot.com\/blog\/wp-content\/uploads\/2010\/07\/logic_heavenhell_alt-300x52.jpg 300w, http:\/\/www.sebcharrot.com\/blog\/wp-content\/uploads\/2010\/07\/logic_heavenhell_alt.jpg 389w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Hell goes in, heaven come out. The liar in the riddle is a basic inverter. He is forced to tell the opposite of what he knows is the truth. The truth-teller, on the other hand, does nothing to the truth. The input travels unmolested through his &#8220;process&#8221;.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2010\/07\/logic_heavenheaven_alt.jpg\"><img class=\"aligncenter size-medium wp-image-67\" title=\"Truth-teller Process\" src=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2010\/07\/logic_heavenheaven_alt-300x46.jpg\" alt=\"\" \/><\/a><\/p>\n<p>Asking one of these guys what the other would say guarantees that we are passing our input through both processes. And we <em>know<\/em> that one of them is an inverter, and the other does nothing to the input. So with a question structured to invoke both processes, we know the output will be the negative of the answer we really want. And again, in logic gates:<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2010\/07\/logic_heavenhellsolution.jpg\"><img loading=\"lazy\" width=\"179\" height=\"300\" class=\"aligncenter size-medium wp-image-73\" title=\"Heaven Hell Solution\" src=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2010\/07\/logic_heavenhellsolution-179x300.jpg\" alt=\"\" srcset=\"http:\/\/www.sebcharrot.com\/blog\/wp-content\/uploads\/2010\/07\/logic_heavenhellsolution-179x300.jpg 179w, http:\/\/www.sebcharrot.com\/blog\/wp-content\/uploads\/2010\/07\/logic_heavenhellsolution.jpg 184w\" sizes=\"(max-width: 179px) 100vw, 179px\" \/><\/a><\/p>\n<p>Similarly, my alternative &#8220;What would you say if I were to ask you&#8230;&#8221; example is the equivalent of passing the input twice through the inverter. In other words, the input would exit the process having been inverted twice, thereby having suffered no modifications.<\/p>\n<p>Interesting stuff. And who&#8217;d have thought I&#8217;d actually find some use for my logic-gate knowledge?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The &#8220;Doors to Heaven and Hell&#8221; riddle. It&#8217;s an oldie and a goodie. I&#8217;m sure everyone&#8217;s pretty familiar with it, but in case you&#8217;re not here&#8217;s a quick recap: Bad news, you&#8217;ve just died. You find yourself in a nondescript hallway with two identical doors, each guarded by a man. You realise you&#8217;re holding a&hellip;&nbsp;<a href=\"http:\/\/www.sebcharrot.com\/blog\/but-would-they-be-neighbours-like-this\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">But would they be neighbours like this?<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"categories":[9,23,15],"tags":[98,108,111,150],"_links":{"self":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/posts\/62"}],"collection":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/comments?post=62"}],"version-history":[{"count":0,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/posts\/62\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/media?parent=62"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/categories?post=62"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/tags?post=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}