// 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.

\n

Recall 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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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)$
000[[0]][[8]][[16]][[24]][[32]]
001[[1]][[9]][[17]][[25]][[33]]
010[[2]][[10]][[18]][[26]][[34]]
011[[3]][[11]][[19]][[27]][[35]]
100[[4]][[12]][[20]][[28]][[36]]
101[[5]][[13]][[21]][[29]][[37]]
110[[6]][[14]][[22]][[30]][[38]]
111[[7]][[15]][[23]][[31]][[39]]
\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/"}]}