// Numbas version: exam_results_page_options {"name": "Marie's copy of truth table with 3 logic variables", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"showQuestionGroupNames": false, "ungrouped_variables": [], "tags": ["truth table; logic"], "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

", "functions": {"evaluate": {"parameters": [["expr", "string"], ["dependencies", "list"]], "definition": "return scope.evaluate(expr);", "type": "number", "language": "javascript"}, "bool_to_label": {"parameters": [["l", "list"]], "definition": "map(if(l[x],'T','F'),x,0..length(l)-1)", "type": "number", "language": "jme"}, "conv": {"parameters": [["op", "string"]], "definition": "switch(op=\"\\\\land\",\"and\",op=\"\\\\lor\",\"or\",\"implies\")", "type": "string", "language": "jme"}, "convch": {"parameters": [["ch", "string"]], "definition": "switch(ch=\"\\\\neg p\",\"not p[t]\",ch=\"\\\\neg q\",\"not q[t]\",ch=\"p\",\"p[t]\",\"q[t]\")", "type": "string", "language": "jme"}}, "name": "Marie's copy of truth table with 3 logic variables", "metadata": {"description": "

Create a truth table with 3 logic variables to see if two logic expressions are equivalent.

", "licence": "Creative Commons Attribution 4.0 International"}, "rulesets": {}, "preamble": {"css": "", "js": ""}, "variablesTest": {"condition": "", "maxRuns": "150"}, "variables": {}, "variable_groups": [], "type": "question", "extensions": [], "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "questions": [], "pickQuestions": 0}], "statement": "

In this question you are asked to construct a truth table for the expressions

\n

$p\\Rightarrow(q\\wedge r)$ and $(p\\Rightarrow q)\\wedge (p\\Rightarrow r)$, using all possible combinations of truth values for $p,q,r$.

\n

Recall that $0$ means false and $1$ means true.

\n

\n

", "parts": [{"variableReplacementStrategy": "originalfirst", "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$$\\qquad q\\land r\\quad$$p\\Rightarrow(q\\land r)$$\\quad p\\Rightarrow q\\quad$$\\quad p\\Rightarrow r\\quad$$(p\\Rightarrow q)\\land(p\\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", "gaps": [{"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "0", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "0", "variableReplacements": [], "marks": 1}, {"variableReplacementStrategy": "originalfirst", "type": "patternmatch", "answer": "1", "scripts": {}, "showCorrectAnswer": true, "displayAnswer": "1", "variableReplacements": [], "marks": 1}], "showCorrectAnswer": true, "scripts": {}, "variableReplacements": [], "marks": 0}, {"variableReplacementStrategy": "originalfirst", "prompt": "

From this truth table, are the expressions $p\\Rightarrow(q\\land r)$ and $(p\\Rightarrow q)\\land (p\\Rightarrow r)$ logically equivalent?

", "choices": ["

Yes

", "

No

"], "variableReplacements": [], "maxMarks": "2", "marks": 0, "displayColumns": 0, "type": "1_n_2", "matrix": ["2", 0], "shuffleChoices": false, "distractors": ["", ""], "scripts": {}, "minMarks": "0", "displayType": "radiogroup", "showCorrectAnswer": true}], "contributors": [{"name": "Marie Nicholson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1799/"}]}]}], "contributors": [{"name": "Marie Nicholson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1799/"}]}