Earlier quoted context omitted.
Thanks for posting this, because I'm a Python n00b and I had no idea what this line was doing: itertools.product((True, False), repeat=6) The site made it easy for me to spend 30 seconds figuring it out. My interpretation is that that line generates what I'll call a truth table (not sure if that's what it formally is) then brute force searches for rows that satisfy all of the listed constraints. I'd also hazard that…
I think you have the general idea down. But as you suspected it's not a truth table. It's all cross-product permutations (hence the name `product`) of six items from the set {True, False}. So that line is creating a iterator that looks like this: (True, True, True, True, True, True) (True, True, True, True, True, False) (True, True, True, True, False, True) (True, True, True, True, False, False) (True, True, True, Fa…
Which answer in this list is the correct answer to this question? (2017)
81–90 of 137 posts
Re: Which answer in this list is the correct answer to this question? (2017)
#82Earlier quoted context omitted.
What does it matter if the teacher is from Crete? Being a Cretan does not make one a cretan. You don’t need to be a stoic to realize that.
This is likely a reference to the Epimenides paradox. https://en.wikipedia.org/wiki/Epimenides_paradox
Re: Which answer in this list is the correct answer to this question? (2017)
#836 can not be true because if it where then 1,2,3,4 & 5 would be false, but that would make 5 true as well which is a contradiction, therefore 6 can only be false 1 Can not be true because we just determined 6 as false so 1 can only be false 3 can not be true because we just determined 1 as false so 3 can only be false With 1 and 3 now proven false, 2 can only be true if 4 is false, but if 2 is true then 4 would be tr…
Everyone in the comment thread seems to be focused on whether each proposition can be true. This is looking for your keys under the lamppost despite the fact that you dropped them in the dark. It's easy to determine whether a proposition can be true. But the question doesn't ask about that. It just asks "which of these is the correct answer to this question?" There are no stated criteria for being the correct answer,…
Re: Which answer in this list is the correct answer to this question? (2017)
#84I didn't see a logical explanation that explains why an option is correct or not, so here's one: Q Which answer in this list is the correct answer to this question? 1. All of the below. 2. None of the below. 3. All of the above. 4. One of the above. 5. None of the above. 6. None of the above. I'll assume "is the answer" to be "True" and "is not the answer" to be "False" in my explanations to make it more readable. Le…
> If 5 is False, it means all of the above 5 - 1, 2 , 3, 4 are True That is incorrect. "Not All False" does not imply "All True."
Re: Which answer in this list is the correct answer to this question? (2017)
#85I didn't see a logical explanation that explains why an option is correct or not, so here's one: Q Which answer in this list is the correct answer to this question? 1. All of the below. 2. None of the below. 3. All of the above. 4. One of the above. 5. None of the above. 6. None of the above. I'll assume "is the answer" to be "True" and "is not the answer" to be "False" in my explanations to make it more readable. Le…
Re: Which answer in this list is the correct answer to this question? (2017)
#86Here is a single python statement that solves the problem: print([ q for q in itertools.product((True, False), repeat=6) if q == ( all(q[1:]), # 1. All of the below. not any(q[2:]), # 2. None of the below. all(q[:2]), # 3. All of the above. any(q[:3]), # 4. One of the above. not any(q[:4]), # 5. None of the above. not any(q[:5]), # 6. None of the above. ) ]) https://gist.github.com/lovasoa/f2b4ed93e755bf4172583d28f20…
A less clever solution, using the wonderful z3 import z3 answers = [z3.Bool(f"answer{i}") for i in range(1,7)] implications = [ z3.And(answers[1:]), # All of the below z3.Not(z3.Or(answers[2:])), # None of the below z3.And(answers[:2]), # All of the above z3.Or(answers[:3]), # Any of the above z3.Not(z3.Or(answers[:4])), # None of the above z3.Not(z3.Or(answers[:5]))] # None of the above constraints = [z3.Implies(ans…
It just so happens that the first result Z3 finds is the correct one. But if you exclude that result with an additional constraint, it will find another. (This is general is a good way to check your work.)
(I just did the same exact exercise with Z3 and CVC4, but using SMTLIBv2 syntax.)
Re: Which answer in this list is the correct answer to this question? (2017)
#87Earlier quoted context omitted.
A less clever solution, using the wonderful z3 import z3 answers = [z3.Bool(f"answer{i}") for i in range(1,7)] implications = [ z3.And(answers[1:]), # All of the below z3.Not(z3.Or(answers[2:])), # None of the below z3.And(answers[:2]), # All of the above z3.Or(answers[:3]), # Any of the above z3.Not(z3.Or(answers[:4])), # None of the above z3.Not(z3.Or(answers[:5]))] # None of the above constraints = [z3.Implies(ans…
Not enough constraints. You must (EDIT: should? see discussion below) also constrain that there is exactly one `answer{i}` which is true, and all the implications should be equalities (else, for example, 6 is a valid answer, even though that would imply 5 is true and thus contradict 6). It just so happens that the first result Z3 finds is the correct one. But if you exclude that result with an additional constraint,…
Re: Which answer in this list is the correct answer to this question? (2017)
#88With Z3 : https://rise4fun.com/z3 (declare-const a Bool) (declare-const b Bool) (declare-const c Bool) (declare-const d Bool) (declare-const e Bool) (declare-const f Bool) (define-fun conjecture () Bool (and (= a (and b c d e f)) (= b (and (not b) (not c) (not d) (not e) (not f))) (= c (and a b)) (= d (or a b c)) (= e (and (not a) (not b) (not c) (not d))) (= f (and (not a) (not b) (not c) (not d) (not e))) (xor a b…
Also I don't know the specifics of the language that tool uses, but typically variadic XOR simply constrains that an odd number of its operands are true. (It so happens that there are no solutions to this problem with 3 or 5 true answers.)
Re: Which answer in this list is the correct answer to this question? (2017)
#89An expert system answer (Prolog, CLIPS) would be cool to see here.
Using the clpb library [0]: solution([A1,A2,A3,A4,A5,A6]) :- sat(A1 =:= A2*A3*A4*A5*A6), sat(A2 =:= ~(A3+A4+A5+A6)), sat(A3 =:= A1*A2), sat(A4 =:= A1+A2+A3), sat(A5 =:= ~(A1+A2+A3+A4)), sat(A6 =:= ~(A1+A2+A3+A4+A5)). [0] https://www.metalevel.at/prolog/puzzles
Re: Which answer in this list is the correct answer to this question? (2017)
#90Earlier quoted context omitted.
Not enough constraints. You must (EDIT: should? see discussion below) also constrain that there is exactly one `answer{i}` which is true, and all the implications should be equalities (else, for example, 6 is a valid answer, even though that would imply 5 is true and thus contradict 6). It just so happens that the first result Z3 finds is the correct one. But if you exclude that result with an additional constraint,…
I don't think there is any constraint that a single answer is true, otherwise the exercise wouldn't list "All of them" as a possibility.
But you may be right. I detest word puzzles for exactly this type of ambiguity.
Same goes for implication vs. equality. Why "should" 5 being true contradict 6 being correct? Just because 5 happens to be true doesn't necessarily mean it is "the" "correct" answer. The "real" answer depends on an interpretation of the English-language formulation that most people will apply, but not all.