// Numbas version: finer_feedback_settings {"name": "TL's copy of Truth tables 0", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "TL's copy of Truth tables 0", "tags": [], "metadata": {"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$.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "In the following question you are asked to construct a truth table for:
\n\\[\\var{a} \\var{op} \\var{b}.\\]
\nProvide your answer only as T if true, else F for False.
\n\n\n\n\n\n\n\n\n\n\n", "advice": "", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"disq": {"name": "disq", "group": "Truth values", "definition": "bool_to_label(q)", "description": "", "templateType": "anything", "can_override": false}, "ev1": {"name": "ev1", "group": "First Bracket", "definition": "bool_to_label(pre_ev1)", "description": "", "templateType": "anything", "can_override": false}, "pre_ev1": {"name": "pre_ev1", "group": "First Bracket", "definition": "map(evaluate(convch(a)+\" \"+conv(op)+\" \"+convch(b),[p[t],q[t]]),t,0..3)", "description": "", "templateType": "anything", "can_override": false}, "op": {"name": "op", "group": "First Bracket", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "description": "", "templateType": "anything", "can_override": false}, "p": {"name": "p", "group": "Truth values", "definition": "[true,true,false,false]", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "First Bracket", "definition": "latex(latex_symbol_list[s[0]])", "description": "", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Lists of symbols", "definition": "repeat(random(0..3),4)", "description": "", "templateType": "anything", "can_override": false}, "disp": {"name": "disp", "group": "Truth values", "definition": "bool_to_label(p)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "First Bracket", "definition": "latex(switch(a=\"p\",\"\\\\neg q\",a=\"q\",\"\\\\neg p\",a=\"\\\\neg p\",random(\"q\",\"\\\\neg q\"),random(\"p\",\"\\\\neg p\")))", "description": "", "templateType": "anything", "can_override": false}, "logic_symbol_list": {"name": "logic_symbol_list", "group": "Lists of symbols", "definition": "[\"p\",\"q\",\"not p\",\"not q\"]", "description": "", "templateType": "anything", "can_override": false}, "q": {"name": "q", "group": "Truth values", "definition": "[true,false,true,false]", "description": "", "templateType": "anything", "can_override": false}, "latex_symbol_list": {"name": "latex_symbol_list", "group": "Lists of symbols", "definition": "[\"p\",\"q\",\"\\\\neg p\",\"\\\\neg q\"]", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": "150"}, "ungrouped_variables": [], "variable_groups": [{"name": "Lists of symbols", "variables": ["logic_symbol_list", "latex_symbol_list", "s"]}, {"name": "First Bracket", "variables": ["a", "b", "op", "pre_ev1", "ev1"]}, {"name": "Second Bracket", "variables": []}, {"name": "Truth values", "variables": ["q", "p", "disp", "disq"]}], "functions": {"conv": {"parameters": [["op", "string"]], "type": "string", "language": "jme", "definition": "switch(op=\"\\\\land\",\"and\",op=\"\\\\lor\",\"or\",\"implies\")"}, "bool_to_label": {"parameters": [["l", "list"]], "type": "number", "language": "jme", "definition": "map(if(l[x],'T','F'),x,0..length(l)-1)"}, "evaluate": {"parameters": [["expr", "string"], ["dependencies", "list"]], "type": "number", "language": "javascript", "definition": "return scope.evaluate(expr);"}, "convch": {"parameters": [["ch", "string"]], "type": "string", "language": "jme", "definition": "switch(ch=\"\\\\neg p\",\"not p[t]\",ch=\"\\\\neg q\",\"not q[t]\",ch=\"p\",\"p[t]\",\"q[t]\")"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "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