// Numbas version: finer_feedback_settings {"name": "Luis's copy of Truth tables 2 (v2) -", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"extensions": [], "rulesets": {}, "preamble": {"css": "", "js": ""}, "tags": [], "parts": [{"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "gaps": [{"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{ev1[0]}", "displayAnswer": "{ev1[0]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{ev1[1]}", "displayAnswer": "{ev1[1]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{ev1[2]}", "displayAnswer": "{ev1[2]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{ev1[3]}", "displayAnswer": "{ev1[3]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{ev2[0]}", "displayAnswer": "{ev2[0]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{ev2[1]}", "displayAnswer": "{ev2[1]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{ev2[2]}", "displayAnswer": "{ev2[2]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{ev2[3]}", "displayAnswer": "{ev2[3]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{t_value[0]}", "displayAnswer": "{t_value[0]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{t_value[1]}", "displayAnswer": "{t_value[1]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{t_value[2]}", "displayAnswer": "{t_value[2]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{t_value[3]}", "displayAnswer": "{t_value[3]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{ev3[0]}", "displayAnswer": "{ev3[0]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{ev3[1]}", "displayAnswer": "{ev3[1]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{ev3[2]}", "displayAnswer": "{ev3[2]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{ev3[3]}", "displayAnswer": "{ev3[3]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{final_value[0]}", "displayAnswer": "{final_value[0]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{final_value[1]}", "displayAnswer": "{final_value[1]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{final_value[2]}", "displayAnswer": "{final_value[2]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}, {"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "unitTests": [], "matchMode": "regex", "scripts": {}, "showFeedbackIcon": true, "answer": "{final_value[3]}", "displayAnswer": "{final_value[3]}", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "marks": 1, "customMarkingAlgorithm": "", "type": "patternmatch"}], "scripts": {}, "showFeedbackIcon": true, "prompt": "
Complete the following truth table:
\n$p$ | $q$ | $\\var{a} \\var{op} \\var{b}$ | $\\var{a1} \\var{op2} \\var{b1}$ | $(\\var{a} \\var{op} \\var{b}) \\var{op1} (\\var{a1} \\var{op2} \\var{b1})$ | $\\var{a2} $ | $((\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1}))\\var{op4}\\var{a2} $ |
---|---|---|---|---|---|---|
$\\var{p[0]}$ | \n$\\var{q[0]}$ | \n[[0]] | \n[[4]] | \n[[8]] | \n[[12]] | \n[[16]] | \n
$\\var{p[1]}$ | \n$\\var{q[1]}$ | \n[[1]] | \n[[5]] | \n[[9]] | \n[[13]] | \n[[17]] | \n
$\\var{p[2]}$ | \n$\\var{q[2]}$ | \n[[2]] | \n[[6]] | \n[[10]] | \n[[14]] | \n[[18]] | \n
$\\var{p[3]}$ | \n$\\var{q[3]}$ | \n[[3]] | \n[[7]] | \n[[11]] | \n[[15]] | \n[[19]] | \n
In the following question you are asked to construct a truth table for:
\n\\[((\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1}))\\var{op4}\\var{a2}.\\]
\n\nEnter T if true, else enter F.
", "advice": "First we find the truth table for $\\var{a} \\var{op} \\var{b}$:
\n$p$ | $q$ | $\\var{a} \\var{op} \\var{b}$ |
---|---|---|
$\\var{p[0]}$ | \n$\\var{q[0]}$ | \n\n$\\var{ev1[0]}$ | \n
$\\var{p[1]}$ | \n$\\var{q[1]}$ | \n\n$\\var{ev1[1]}$ | \n
$\\var{p[2]}$ | \n$\\var{q[2]}$ | \n\n$\\var{ev1[2]}$ | \n
$\\var{p[3]}$ | \n$\\var{q[3]}$ | \n\n$\\var{ev1[3]}$ | \n
Then the truth table for $\\var{a1} \\var{op2} \\var{b1}$:
\n$p$ | $q$ | $\\var{a1} \\var{op2} \\var{b1}$ |
---|---|---|
$\\var{p[0]}$ | \n$\\var{q[0]}$ | \n$\\var{ev2[0]}$ | \n
$\\var{p[1]}$ | \n$\\var{q[1]}$ | \n$\\var{ev2[1]}$ | \n
$\\var{p[2]}$ | \n$\\var{q[2]}$ | \n$\\var{ev2[2]}$ | \n
$\\var{p[3]}$ | \n$\\var{q[3]}$ | \n$\\var{ev2[3]}$ | \n
Putting these together to find $(\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1})$:
\n\n$p$ | $q$ | $\\var{a} \\var{op} \\var{b}$ | $\\var{a1} \\var{op2} \\var{b1}$ | $(\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1})$ |
---|---|---|---|---|
$\\var{p[0]}$ | \n$\\var{q[0]}$ | \n$\\var{ev1[0]}$ | \n$\\var{ev2[0]}$ | \n$\\var{t_value[0]}$ | \n
$\\var{p[1]}$ | \n$\\var{q[1]}$ | \n$\\var{ev1[1]}$ | \n$\\var{ev2[1]}$ | \n$\\var{t_value[1]}$ | \n
$\\var{p[2]}$ | \n$\\var{q[2]}$ | \n$\\var{ev1[2]}$ | \n$\\var{ev2[2]}$ | \n$\\var{t_value[2]}$ | \n
$\\var{p[3]}$ | \n$\\var{q[3]}$ | \n$\\var{ev1[3]}$ | \n$\\var{ev2[3]}$ | \n$\\var{t_value[3]}$ | \n
Next we find the truth table for $\\var{a2}$:
\n$p$ | $q$ | $\\var{a2}$ |
---|---|---|
$\\var{p[0]}$ | \n$\\var{q[0]}$ | \n$\\var{ev3[0]}$ | \n
$\\var{p[1]}$ | \n$\\var{q[1]}$ | \n$\\var{ev3[1]}$ | \n
$\\var{p[2]}$ | \n$\\var{q[2]}$ | \n$\\var{ev3[2]}$ | \n
$\\var{p[3]}$ | \n$\\var{q[3]}$ | \n$\\var{ev3[3]}$ | \n
Putting this all together to obtain the truth table we want:
\n$p$ | $q$ | $(\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1})$ | $\\var{a2}$ | $((\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1}))\\var{op4}\\var{a2} $ |
---|---|---|---|---|
$\\var{p[0]}$ | \n$\\var{q[0]}$ | \n$\\var{t_value[0]}$ | \n$\\var{ev3[0]}$ | \n$\\var{final_value[0]}$ | \n
$\\var{p[1]}$ | \n$\\var{q[1]}$ | \n$\\var{t_value[1]}$ | \n$\\var{ev3[1]}$ | \n$\\var{final_value[1]}$ | \n
$\\var{p[2]}$ | \n$\\var{q[2]}$ | \n$\\var{t_value[2]}$ | \n$\\var{ev3[2]}$ | \n$\\var{final_value[2]}$ | \n
$\\var{p[3]}$ | \n$\\var{q[3]}$ | \n$\\var{t_value[3]}$ | \n$\\var{ev3[3]}$ | \n$\\var{final_value[3]}$ | \n
Create a truth table for a logical expression of the form $((a \\operatorname{op1} b) \\operatorname{op2}(c \\operatorname{op3} d))\\operatorname{op4}e $ where each of $a, \\;b,\\;c,\\;d,\\;e$ can be one the Boolean variables $p,\\;q,\\;\\neg p,\\;\\neg q$ and each of $\\operatorname{op1},\\;\\operatorname{op2},\\;\\operatorname{op3},\\;\\operatorname{op4}$ one of $\\lor,\\;\\land,\\;\\to$.
\nFor example: $((q \\lor \\neg p) \\to (p \\land \\neg q)) \\lor \\neg q$
", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Luis Hernandez", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2870/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Luis Hernandez", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2870/"}]}