Hacker News new | past | comments | ask | show | jobs | submit login

This is the contentious, formal-logicy part of the puzzle. "All my hats are green" as a logical statement, in most formal logic systems, would be true if I didn't own any hats (a so-called vacuous truth, because it doesn't mean anything, for similar reasons any statement conditioned on a false statement is true, e.g. "if 2+2=5, then I am god" is similarly vacuously true). So if I'm a liar and that statement is false, it must be false by me owning a non-green hat. But colloquially, people will usually break it down into the logical statement: "I own at least one hat and all my hats are green" (because most people don't consider vacuous truths to be relevant in most contexts), in which case it will be false if I own no hats

(other systems of logic exist which will attempt to resolve this. Forcing such statements to be false makes things much trickier formally, as does e.g. three-valued logic to try to avoid assigning truth or falsity to such statements)




Thanks for breaking that down for me.

I guess, to me, a programmer logician not a mathematician logician, the real problem for me here is the definition of "liar" as it applies to how we parse the problem statement's facts.


I'd argue that this bit of mathematical logic carries over to many programming languages. For example using LINQ expressions in C#:

https://dotnetfiddle.net/3QGurc




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: