Propositional logic and truth tables
Warm-upHumanIs the statement “If is even, then is divisible by ” true or false?
Is the statement “If is even, then is divisible by ” true or false?
Which statement is the contrapositive of “If a shape is a square, then it is a rectangle”?
Which statement is the negation of “If it is a public holiday, then the bakery is closed”?
What is the negation of “Amara speaks Hausa and Yoruba”?
How many rows does the truth table of have?
Which of these formulas are tautologies? (Choose all that apply.)
Each card has a letter on one side and a whole number on the other. You see E, M, 6 and 3. Rule: “If a card has a vowel on one side, then it has an even number on the other.” Which cards must you turn over to check the rule? (Choose all that apply.)
Which statement is the negation of “Every whole number divisible by is divisible by ”?
Which Lean statement says that a conditional is equivalent to its contrapositive (for all propositions p and q)?
Write is_tautology(f, n), which returns True exactly when the Python function f of n boolean arguments returns True for every combination of arguments. Then write equivalent(f, g, n) using it. (Hint: itertools.product([True, False], repeat=n) lists all rows.)