<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Logic Puzzle on kenji.blog</title><link>http://kenji.blog/en/tags/logic-puzzle/</link><description>Recent content in Logic Puzzle on kenji.blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>kenjinote</copyright><lastBuildDate>Thu, 10 Sep 2026 10:00:00 +0900</lastBuildDate><atom:link href="http://kenji.blog/en/tags/logic-puzzle/index.xml" rel="self" type="application/rss+xml"/><item><title>The Unexpected Hanging Paradox: The Day a Logically "Absolutely Impossible" Test Takes Place</title><link>http://kenji.blog/en/p/unexpected-hanging-paradox/</link><pubDate>Thu, 10 Sep 2026 10:00:00 +0900</pubDate><guid>http://kenji.blog/en/p/unexpected-hanging-paradox/</guid><description>&lt;img src="http://kenji.blog/p/unexpected-hanging-paradox/img/unexpected_hanging.jpg" alt="Featured image of post The Unexpected Hanging Paradox: The Day a Logically "Absolutely Impossible" Test Takes Place" />&lt;h2 id="1-the-teachers-absolute-declaration">1. The Teacher&amp;rsquo;s &amp;ldquo;Absolute Declaration&amp;rdquo;
&lt;/h2>&lt;p>On the way home one Friday, a math teacher made a terrifying announcement to his students.&lt;/p>
&lt;p>&lt;strong>&amp;ldquo;Next week, on some day from Monday to Friday, I will give a &amp;lsquo;surprise test&amp;rsquo; exactly once.&lt;/strong>
&lt;strong>However, if you can definitely predict &amp;rsquo;the test is today&amp;rsquo; on the morning of that day, it won&amp;rsquo;t be a surprise, so the test will not be given on that day.&amp;rdquo;&lt;/strong>&lt;/p>
&lt;p>Hearing this declaration, the students trembled. It meant they had to spend every day in fear, wondering when the test would be held.
However, Student A, the brightest in the class, suddenly smiled and stood up.&lt;/p>
&lt;p>&amp;ldquo;Everyone, you can rest easy. &lt;strong>It is absolutely impossible for a surprise test to be held next week. It&amp;rsquo;s logically impossible!&lt;/strong>&amp;rdquo;&lt;/p>
&lt;p>With full confidence, Student A began to write the following &amp;ldquo;perfect logic&amp;rdquo; on the blackboard.&lt;/p>
&lt;hr>
&lt;h2 id="2-student-as-proof-by-perfect-logic">2. Student A&amp;rsquo;s Proof by &amp;ldquo;Perfect Logic&amp;rdquo;
&lt;/h2>&lt;p>Student A&amp;rsquo;s proof uses a mathematical technique of &lt;strong>thinking backwards from &amp;ldquo;Friday&amp;rdquo; (backward reasoning)&lt;/strong>.&lt;/p>
&lt;h3 id="step-1-eliminate-the-possibility-of-friday">Step 1: Eliminate the Possibility of Friday
&lt;/h3>&lt;blockquote>
&lt;p>Suppose the test was not given for the four days of Monday, Tuesday, Wednesday, and Thursday.
Then, the only day left is &amp;ldquo;Friday.&amp;rdquo;
On the morning of Friday, the students would be able to &lt;strong>definitely predict&lt;/strong>, &amp;ldquo;Today is the only day left, so the test is definitely today!&amp;rdquo;
According to the teacher&amp;rsquo;s declaration, &amp;ldquo;It will not be given on a day it can be predicted,&amp;rdquo; so it is logically impossible to give a surprise test on Friday.
&lt;strong>Therefore, there will absolutely be no test on Friday.&lt;/strong>&lt;/p>
&lt;/blockquote>
&lt;h3 id="step-2-eliminate-the-possibility-of-thursday">Step 2: Eliminate the Possibility of Thursday
&lt;/h3>&lt;blockquote>
&lt;p>It is confirmed that there is no test on Friday.
This means that the last possible day the test can be given is &amp;ldquo;Thursday.&amp;rdquo;
Suppose the test was not given for the three days of Monday, Tuesday, and Wednesday.
Then, the only remaining possibility is Thursday (Friday has already been eliminated).
On the morning of Thursday, the students would be able to definitely predict, &amp;ldquo;The test is today!&amp;rdquo;
&lt;strong>Therefore, there will absolutely be no test on Thursday either.&lt;/strong>&lt;/p>
&lt;/blockquote>
&lt;h3 id="step-3-all-days-of-the-week-disappear">Step 3: All Days of the Week Disappear
&lt;/h3>&lt;blockquote>
&lt;p>We just need to repeat the same logic.
If there&amp;rsquo;s no Thursday, the last day becomes Wednesday. Thus, if there is no test until Tuesday, it could be predicted on Wednesday morning, so Wednesday also disappears.
If Wednesday disappears, Tuesday disappears, and Monday disappears too.
&lt;strong>Conclusion: As long as the teacher&amp;rsquo;s rules are followed, it is absolutely impossible to give a surprise test on any day from Monday to Friday!&lt;/strong>&lt;/p>
&lt;/blockquote>
&lt;div class="mermaid">graph TD
Fri["Friday morning&lt;br>(No test Mon-Thu)"] -->|"Predictable as 'Only Friday left'"| NoFri["Test impossible on Friday"]
Thu["Thursday morning&lt;br>(No test Mon-Wed)"] -->|"Predictable as 'Not Friday so it must be today'"| NoThu["Test impossible on Thursday"]
Wed["Wednesday morning"] -->|"Predictable as 'Not Thu/Fri so it must be today'"| NoWed["Test impossible on Wednesday"]
Tue["Tuesday morning"] -->|"Predictable similarly"| NoTue["Test impossible on Tuesday"]
Mon["Monday morning"] -->|"Predictable similarly"| NoMon["Test impossible on Monday"]
NoFri -.-> Thu
NoThu -.-> Wed
NoWed -.-> Tue
NoTue -.-> Mon
style NoFri fill:#ff9999,stroke:#333
style NoThu fill:#ff9999,stroke:#333
style NoWed fill:#ff9999,stroke:#333
style NoTue fill:#ff9999,stroke:#333
style NoMon fill:#ff9999,stroke:#333&lt;/div>
&lt;p>The students in the class rejoiced. Student A&amp;rsquo;s logic seemed perfect, with no loopholes anywhere.
They spent the weekend playing around and having fun, and welcomed Monday without studying for the test at all.&lt;/p>
&lt;p>Monday&amp;hellip; There was no test. &amp;ldquo;See!&amp;rdquo;
Tuesday&amp;hellip; There was no test. &amp;ldquo;Just like Student A said!&amp;rdquo;&lt;/p>
&lt;p>And then, on &lt;strong>Wednesday morning&lt;/strong>.
&lt;em>Clatter!&lt;/em> The classroom door opened, the teacher came in, and said:&lt;/p>
&lt;p>&lt;strong>&amp;ldquo;Alright, clear your desks. We&amp;rsquo;re going to start the surprise test now!&amp;rdquo;&lt;/strong>&lt;/p>
&lt;p>The students fell into a panic.
&amp;ldquo;W-Why!? We &lt;strong>completely didn&amp;rsquo;t predict&lt;/strong> that there would be a test on Wednesday!&amp;rdquo;&lt;/p>
&lt;p>The teacher smiled smugly.
&lt;strong>&amp;ldquo;See, you couldn&amp;rsquo;t predict it, could you? My &amp;lsquo;declaration&amp;rsquo; was completely correct, and the surprise test was established according to the rules.&amp;rdquo;&lt;/strong>&lt;/p>
&lt;hr>
&lt;h2 id="3-where-did-the-logic-go-wrong">3. Where Did the Logic Go Wrong?
&lt;/h2>&lt;p>Even though Student A&amp;rsquo;s proof looked perfect, why did a &amp;ldquo;perfect surprise test&amp;rdquo; actually take place in reality?
This problem is originally called the &amp;ldquo;Unexpected Hanging Paradox,&amp;rdquo; and ever since it was devised by the Swedish mathematician Lennart Ekbom in the 1940s, it has continued to trouble philosophers and logicians.&lt;/p>
&lt;p>Actually, there is still no unified view that &amp;ldquo;this is the one absolute correct answer&amp;rdquo; to this paradox. However, there are some leading approaches to resolving it.&lt;/p>
&lt;h3 id="approach-1-paradox-of-knowledge-epistemology">Approach 1: &amp;ldquo;Paradox of Knowledge (Epistemology)&amp;rdquo;
&lt;/h3>&lt;p>The biggest pitfall in Student A&amp;rsquo;s reasoning was that &lt;strong>he incorporated the premise that &amp;ldquo;the teacher&amp;rsquo;s declaration is 100% true&amp;rdquo; into his own prediction&lt;/strong>.&lt;/p>
&lt;p>The teacher&amp;rsquo;s declaration consists of two conditions: &amp;ldquo;Give a test next week (P)&amp;rdquo; and &amp;ldquo;Do not give it on a day it can be predicted (Q).&amp;rdquo;
If there has been no test up to Friday, the student thinks, &amp;ldquo;If the declaration is correct, it must be today,&amp;rdquo; but at the same time, room for doubt is born: &amp;ldquo;If I can predict it&amp;rsquo;s today, it violates Q of the declaration. In that case, wasn&amp;rsquo;t the declaration P (give a test) itself a lie in the first place?&amp;rdquo;&lt;/p>
&lt;p>As a result of the collision between the belief that &amp;ldquo;the teacher&amp;rsquo;s words are absolutely correct&amp;rdquo; and &amp;ldquo;logical reasoning,&amp;rdquo; the students held the false conclusion (belief) that &amp;ldquo;the teacher will not give the test,&amp;rdquo; and as a result, no matter when the test was given, they ended up in an &amp;ldquo;unexpected (surprise)&amp;rdquo; state.&lt;/p>
&lt;h3 id="approach-2-paradox-of-self-reference">Approach 2: &amp;ldquo;Paradox of Self-Reference&amp;rdquo;
&lt;/h3>&lt;p>Let&amp;rsquo;s convert the teacher&amp;rsquo;s words into a logical formula.
Let the teacher&amp;rsquo;s claim be $S$.
$S =$ &amp;ldquo;I will give a test on a certain day $T$. And, you will not be able to predict that day $T$.&amp;rdquo;&lt;/p>
&lt;p>This claim has a &lt;strong>&amp;ldquo;self-referential structure&amp;rdquo;&lt;/strong> where its truth or falsehood changes depending on how the students receive it itself (the declaration). Just like the &amp;ldquo;Liar Paradox (&amp;lsquo;This sentence is a lie&amp;rsquo;)&amp;rdquo;, it has the property of causing logical reasoning to loop infinitely.&lt;/p>
&lt;hr>
&lt;h2 id="4-surprise-tests-lurking-in-daily-life">4. &amp;ldquo;Surprise Tests&amp;rdquo; Lurking in Daily Life
&lt;/h2>&lt;p>This paradox is applied not only to mathematics but also to our everyday lives.&lt;/p>
&lt;p>&lt;strong>[The Dilemma of the Surprise Party]&lt;/strong>&lt;/p>
&lt;blockquote>
&lt;p>Suppose a friend declares, &amp;ldquo;I&amp;rsquo;m going to throw a surprise party for your birthday this month!&amp;rdquo;
Hearing this, you guess every day, &amp;ldquo;Is it today? Is it tomorrow?&amp;rdquo;
If there is no party even by the last day of the month, you end up reasoning that in order to satisfy the condition of a &amp;ldquo;surprise (unpredictable)&amp;rdquo;, it absolutely cannot be done on the last day&amp;hellip;
However, in reality, if a cake suddenly appears around the middle of the month, you receive a perfect surprise, thinking, &amp;ldquo;I was really surprised!&amp;rdquo;&lt;/p>
&lt;/blockquote>
&lt;hr>
&lt;h2 id="5-conclusion">5. Conclusion
&lt;/h2>&lt;p>&amp;ldquo;The Unexpected Hanging Paradox&amp;rdquo; brilliantly expresses &lt;strong>the difficulty of including the human state of &amp;lsquo;knowing (predicting)&amp;rsquo; itself into logical calculations&lt;/strong>.&lt;/p>
&lt;p>What we think of as &amp;ldquo;perfect reasoning&amp;rdquo; might actually be nothing more than a castle built on sand, resting on the baseless belief that &amp;ldquo;the other party will absolutely follow the rules.&amp;rdquo;
Next time a teacher says, &amp;ldquo;I&amp;rsquo;m giving a surprise test,&amp;rdquo; it seems the most rational thing to do is to stop twisting logic and just quietly study every day.&lt;/p></description></item></channel></rss>