// Numbas version: finer_feedback_settings {"name": "Truth tables 0 (v2)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [{"variables": ["logic_symbol_list", "latex_symbol_list", "s"], "name": "Lists of symbols"}, {"variables": ["a", "b", "op", "pre_ev1", "ev1"], "name": "First Bracket"}, {"variables": [], "name": "Second Bracket"}, {"variables": ["q", "p", "disp", "disq"], "name": "Truth values"}], "variables": {"disp": {"group": "Truth values", "templateType": "anything", "definition": "bool_to_label(p)", "description": "", "name": "disp"}, "q": {"group": "Truth values", "templateType": "anything", "definition": "[true,false,true,false]", "description": "", "name": "q"}, "disq": {"group": "Truth values", "templateType": "anything", "definition": "bool_to_label(q)", "description": "", "name": "disq"}, "b": {"group": "First Bracket", "templateType": "anything", "definition": "latex(switch(a=\"p\",\"\\\\neg q\",a=\"q\",\"\\\\neg p\",a=\"\\\\neg p\",random(\"q\",\"\\\\neg q\"),random(\"p\",\"\\\\neg p\")))", "description": "", "name": "b"}, "op": {"group": "First Bracket", "templateType": "anything", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "description": "", "name": "op"}, "latex_symbol_list": {"group": "Lists of symbols", "templateType": "anything", "definition": "[\"p\",\"q\",\"\\\\neg p\",\"\\\\neg q\"]", "description": "", "name": "latex_symbol_list"}, "s": {"group": "Lists of symbols", "templateType": "anything", "definition": "repeat(random(0..3),4)", "description": "", "name": "s"}, "ev1": {"group": "First Bracket", "templateType": "anything", "definition": "bool_to_label(pre_ev1)", "description": "", "name": "ev1"}, "a": {"group": "First Bracket", "templateType": "anything", "definition": "latex(latex_symbol_list[s[0]])", "description": "", "name": "a"}, "p": {"group": "Truth values", "templateType": "anything", "definition": "[true,true,false,false]", "description": "", "name": "p"}, "logic_symbol_list": {"group": "Lists of symbols", "templateType": "anything", "definition": "[\"p\",\"q\",\"not p\",\"not q\"]", "description": "", "name": "logic_symbol_list"}, "pre_ev1": {"group": "First Bracket", "templateType": "anything", "definition": "map(evaluate(convch(a)+\" \"+conv(op)+\" \"+convch(b),[p[t],q[t]]),t,0..3)", "description": "", "name": "pre_ev1"}}, "ungrouped_variables": [], "rulesets": {}, "name": "Truth tables 0 (v2)", "functions": {"convch": {"type": "string", "language": "jme", "definition": "switch(ch=\"\\\\neg p\",\"not p[t]\",ch=\"\\\\neg q\",\"not q[t]\",ch=\"p\",\"p[t]\",\"q[t]\")", "parameters": [["ch", "string"]]}, "evaluate": {"type": "number", "language": "javascript", "definition": "return scope.evaluate(expr);", "parameters": [["expr", "string"], ["dependencies", "list"]]}, "conv": {"type": "string", "language": "jme", "definition": "switch(op=\"\\\\land\",\"and\",op=\"\\\\lor\",\"or\",\"implies\")", "parameters": [["op", "string"]]}, "bool_to_label": {"type": "number", "language": "jme", "definition": "map(if(l[x],'T','F'),x,0..length(l)-1)", "parameters": [["l", "list"]]}}, "showQuestionGroupNames": false, "parts": [{"showCorrectAnswer": true, "scripts": {}, "gaps": [{"answer": "{ev1[0]}", "displayAnswer": "{ev1[0]}", "scripts": {}, "type": "patternmatch", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1}, {"answer": "{ev1[1]}", "displayAnswer": "{ev1[1]}", "scripts": {}, "type": "patternmatch", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1}, {"answer": "{ev1[2]}", "displayAnswer": "{ev1[2]}", "scripts": {}, "type": "patternmatch", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1}, {"answer": "{ev1[3]}", "displayAnswer": "{ev1[3]}", "scripts": {}, "type": "patternmatch", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "prompt": "
Complete the following truth table:
\n$p$ | $q$ | $\\var{a} \\var{op} \\var{b}$ |
---|---|---|
$\\var{disp[0]}$ | \n$\\var{disq[0]}$ | \n[[0]] | \n
$\\var{disp[1]}$ | \n$\\var{disq[1]}$ | \n[[1]] | \n
$\\var{disp[2]}$ | \n$\\var{disq[2]}$ | \n[[2]] | \n
$\\var{disp[3]}$ | \n$\\var{disq[3]}$ | \n[[3]] | \n
In the following question you are asked to construct a truth table for:
\n\\[\\var{a} \\var{op} \\var{b}.\\]
\n\nEnter T if true, else enter F.
\n\n\n\n\n\n\n\n\n\n\n", "tags": [], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "", "licence": "Creative Commons Attribution 4.0 International", "description": "Create a truth table for a logical expression of the form $a \\operatorname{op} b$ where $a, \\;b$ can be the Boolean variables $p,\\;q,\\;\\neg p,\\;\\neg q$ and $\\operatorname{op}$ one of $\\lor,\\;\\land,\\;\\to$.
\nFor example $\\neg q \\to \\neg p$.
"}, "variablesTest": {"condition": "", "maxRuns": "150"}, "advice": "Here is the truth table.
\n$p$ | $q$ | $\\var{a} \\var{op} \\var{b}$ |
---|---|---|
$\\var{disp[0]}$ | \n$\\var{disq[0]}$ | \n$\\var{ev1[0]}$ | \n
$\\var{disp[1]}$ | \n$\\var{disq[1]}$ | \n$\\var{ev1[1]}$ | \n
$\\var{disp[2]}$ | \n$\\var{disq[2]}$ | \n$\\var{ev1[2]}$ | \n
$\\var{disp[3]}$ | \n$\\var{disq[3]}$ | \n$\\var{ev1[3]}$ | \n