// Numbas version: finer_feedback_settings {"name": "Truth tables 0 ", "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"}], "name": "Truth tables 0 ", "parts": [{"sortAnswers": false, "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
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
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$.
", "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}.\\]
\n\nEnter T if true, else enter F.
\n\n\n\n\n\n\n\n\n\n\n", "variables": {"disq": {"templateType": "anything", "description": "", "definition": "bool_to_label(q)", "name": "disq", "group": "Truth values"}, "ev1": {"templateType": "anything", "description": "", "definition": "bool_to_label(pre_ev1)", "name": "ev1", "group": "First Bracket"}, "pre_ev1": {"templateType": "anything", "description": "", "definition": "map(evaluate(convch(a)+\" \"+conv(op)+\" \"+convch(b),[p[t],q[t]]),t,0..3)", "name": "pre_ev1", "group": "First Bracket"}, "op": {"templateType": "anything", "description": "", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "name": "op", "group": "First Bracket"}, "p": {"templateType": "anything", "description": "", "definition": "[true,true,false,false]", "name": "p", "group": "Truth values"}, "a": {"templateType": "anything", "description": "", "definition": "latex(latex_symbol_list[s[0]])", "name": "a", "group": "First Bracket"}, "s": {"templateType": "anything", "description": "", "definition": "repeat(random(0..3),4)", "name": "s", "group": "Lists of symbols"}, "disp": {"templateType": "anything", "description": "", "definition": "bool_to_label(p)", "name": "disp", "group": "Truth values"}, "b": {"templateType": "anything", "description": "", "definition": "latex(switch(a=\"p\",\"\\\\neg q\",a=\"q\",\"\\\\neg p\",a=\"\\\\neg p\",random(\"q\",\"\\\\neg q\"),random(\"p\",\"\\\\neg p\")))", "name": "b", "group": "First Bracket"}, "logic_symbol_list": {"templateType": "anything", "description": "", "definition": "[\"p\",\"q\",\"not p\",\"not q\"]", "name": "logic_symbol_list", "group": "Lists of symbols"}, "q": {"templateType": "anything", "description": "", "definition": "[true,false,true,false]", "name": "q", "group": "Truth values"}, "latex_symbol_list": {"templateType": "anything", "description": "", "definition": "[\"p\",\"q\",\"\\\\neg p\",\"\\\\neg q\"]", "name": "latex_symbol_list", "group": "Lists of symbols"}}, "preamble": {"js": "", "css": ""}, "tags": [], "ungrouped_variables": [], "type": "question", "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/"}]}