// Numbas version: finer_feedback_settings
{"name": "why parentheses are important for implication", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"statement": "
In this question you are asked to construct a truth table for several expressions that use three logic variables $p,q,r$ in all their eight combinations.
\nRecall that $0$ means false and $1$ means true.
\n\n", "advice": "Use the truth tables for the \"and\" operator $\\wedge$ and the implication $\\Rightarrow$. Remember that $p\\Rightarrow q$ is true whenever $p$ is false or $q$ is true.
\n", "name": "why parentheses are important for implication", "variable_groups": [], "extensions": [], "ungrouped_variables": [], "functions": {"convch": {"language": "jme", "type": "string", "parameters": [["ch", "string"]], "definition": "switch(ch=\"\\\\neg p\",\"not p[t]\",ch=\"\\\\neg q\",\"not q[t]\",ch=\"p\",\"p[t]\",\"q[t]\")"}, "bool_to_label": {"language": "jme", "type": "number", "parameters": [["l", "list"]], "definition": "map(if(l[x],'T','F'),x,0..length(l)-1)"}, "conv": {"language": "jme", "type": "string", "parameters": [["op", "string"]], "definition": "switch(op=\"\\\\land\",\"and\",op=\"\\\\lor\",\"or\",\"implies\")"}, "evaluate": {"language": "javascript", "type": "number", "parameters": [["expr", "string"], ["dependencies", "list"]], "definition": "return scope.evaluate(expr);"}}, "parts": [{"prompt": "Complete the following truth table; enter $0$ for false and $1$ for true.
\n\n\n$p$ | $q$ | $r$ | $\\quad p\\Rightarrow q\\quad$ | $(p\\Rightarrow q)\\Rightarrow r$ | $\\quad q\\Rightarrow r\\quad$ | $p\\Rightarrow (q\\Rightarrow r)$ | $(p\\Rightarrow q)\\wedge (q\\Rightarrow r)$ |
\n\n0 | \n0 | \n0 | \n[[0]] | \n[[8]] | \n[[16]] | \n[[24]] | \n[[32]] | \n
\n\n0 | \n0 | \n1 | \n[[1]] | \n[[9]] | \n[[17]] | \n[[25]] | \n[[33]] | \n
\n\n0 | \n1 | \n0 | \n[[2]] | \n[[10]] | \n[[18]] | \n[[26]] | \n[[34]] | \n
\n\n0 | \n1 | \n1 | \n[[3]] | \n[[11]] | \n[[19]] | \n[[27]] | \n[[35]] | \n
\n\n1 | \n0 | \n0 | \n[[4]] | \n[[12]] | \n[[20]] | \n[[28]] | \n[[36]] | \n
\n\n1 | \n0 | \n1 | \n[[5]] | \n[[13]] | \n[[21]] | \n[[29]] | \n[[37]] | \n
\n\n1 | \n1 | \n0 | \n[[6]] | \n[[14]] | \n[[22]] | \n[[30]] | \n[[38]] | \n
\n\n1 | \n1 | \n1 | \n[[7]] | \n[[15]] | \n[[23]] | \n[[31]] | \n[[39]] | \n
\n\n
\n", "type": "gapfill", "variableReplacements": [], "showFeedbackIcon": true, "gaps": [{"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "0", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "0", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "0", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "0", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "0", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "0", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "0", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "0", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "0", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "0", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "0", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "0", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "0", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "0", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "0", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "0", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "0", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "0", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "0", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "0", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "0", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "0", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "0", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "0", "variableReplacementStrategy": "originalfirst"}, {"type": "patternmatch", "variableReplacements": [], "showFeedbackIcon": true, "displayAnswer": "1", "scripts": {}, "showCorrectAnswer": true, "matchMode": "regex", "marks": 1, "answer": "1", "variableReplacementStrategy": "originalfirst"}], "scripts": {}, "showCorrectAnswer": true, "marks": 0, "variableReplacementStrategy": "originalfirst"}, {"prompt": "From this truth table, is it safe and unambiguous to write down a logical statement $p\\Rightarrow q\\Rightarrow r$ without parentheses, and to allow that this is interpreted as `$p\\Rightarrow q$ and $q\\Rightarrow r$ '?
", "type": "1_n_2", "displayColumns": 0, "showFeedbackIcon": true, "minMarks": "0", "shuffleChoices": false, "showCorrectAnswer": true, "displayType": "radiogroup", "maxMarks": "5", "matrix": ["0", 0, 0, 0, "5", 0], "variableReplacements": [], "distractors": ["", "", "", "", "", ""], "scripts": {}, "marks": 0, "choices": ["Yes, it is safe and does not matter how this is interpreted because it always means the same.
", "Yes, it does not matter how this is interpreted because parentheses usually never matter.
", "No, we must not omit the parentheses because every mathematical statement is written including parentheses.
", "Yes, it is safe to omit the parentheses because it is clear that this would always mean we first evaluate $p\\Rightarrow q$ and then after that we consider the second implication arrow somehow.
\n", "No, because no two of the possible interpretations $(p\\Rightarrow q)\\Rightarrow r$ or $p\\Rightarrow (q\\Rightarrow r)$ or $(p\\Rightarrow q)\\wedge (q\\Rightarrow r)$ are equivalent.
", "Yes, because two of the interpretations $(p\\Rightarrow q)\\Rightarrow r$ or $p\\Rightarrow (q\\Rightarrow r)$ or $(p\\Rightarrow q)\\wedge (q\\Rightarrow r)$ are equivalent and the third one is usually not considered.
"], "variableReplacementStrategy": "originalfirst"}], "rulesets": {}, "variables": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "The expression $p\\Rightarrow q\\Rightarrow r$ is ambiguous.
"}, "tags": [], "variablesTest": {"maxRuns": "150", "condition": ""}, "preamble": {"js": "", "css": ""}, "type": "question", "contributors": [{"name": "Bernhard von Stengel", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1054/"}]}]}], "contributors": [{"name": "Bernhard von Stengel", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1054/"}]}