// Numbas version: finer_feedback_settings {"name": "Julie's copy of Truth tables 0 (v2)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "preamble": {"css": "", "js": ""}, "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$.
\nFor example $\\neg q \\to \\neg p$.
", "licence": "Creative Commons Attribution 4.0 International"}, "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"]}], "extensions": [], "ungrouped_variables": [], "name": "Julie's copy of Truth tables 0 (v2)", "variables": {"disp": {"description": "", "definition": "bool_to_label(p)", "name": "disp", "templateType": "anything", "group": "Truth values"}, "p": {"description": "", "definition": "[true,true,false,false]", "name": "p", "templateType": "anything", "group": "Truth values"}, "q": {"description": "", "definition": "[true,false,true,false]", "name": "q", "templateType": "anything", "group": "Truth values"}, "latex_symbol_list": {"description": "", "definition": "[\"p\",\"q\",\"\\\\neg p\",\"\\\\neg q\"]", "name": "latex_symbol_list", "templateType": "anything", "group": "Lists of symbols"}, "b": {"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", "templateType": "anything", "group": "First Bracket"}, "pre_ev1": {"description": "", "definition": "map(evaluate(convch(a)+\" \"+conv(op)+\" \"+convch(b),[p[t],q[t]]),t,0..3)", "name": "pre_ev1", "templateType": "anything", "group": "First Bracket"}, "disq": {"description": "", "definition": "bool_to_label(q)", "name": "disq", "templateType": "anything", "group": "Truth values"}, "ev1": {"description": "", "definition": "bool_to_label(pre_ev1)", "name": "ev1", "templateType": "anything", "group": "First Bracket"}, "s": {"description": "", "definition": "repeat(random(0..3),4)", "name": "s", "templateType": "anything", "group": "Lists of symbols"}, "op": {"description": "", "definition": "latex(random(\"\\\\lor\",\"\\\\land\"))", "name": "op", "templateType": "anything", "group": "First Bracket"}, "logic_symbol_list": {"description": "", "definition": "[\"p\",\"q\",\"not p\",\"not q\"]", "name": "logic_symbol_list", "templateType": "anything", "group": "Lists of symbols"}, "a": {"description": "", "definition": "latex(latex_symbol_list[s[0]])", "name": "a", "templateType": "anything", "group": "First Bracket"}}, "parts": [{"showCorrectAnswer": true, "scripts": {}, "gaps": [{"showCorrectAnswer": true, "scripts": {}, "matchMode": "regex", "showFeedbackIcon": true, "displayAnswer": "{ev1[0]}", "answer": "{ev1[0]}", "marks": 1, "variableReplacements": [], "type": "patternmatch", "variableReplacementStrategy": "originalfirst"}, {"showCorrectAnswer": true, "scripts": {}, "matchMode": "regex", "showFeedbackIcon": true, "displayAnswer": "{ev1[1]}", "answer": "{ev1[1]}", "marks": 1, "variableReplacements": [], "type": "patternmatch", "variableReplacementStrategy": "originalfirst"}, {"showCorrectAnswer": true, "scripts": {}, "matchMode": "regex", "showFeedbackIcon": true, "displayAnswer": "{ev1[2]}", "answer": "{ev1[2]}", "marks": 1, "variableReplacements": [], "type": "patternmatch", "variableReplacementStrategy": "originalfirst"}, {"showCorrectAnswer": true, "scripts": {}, "matchMode": "regex", "showFeedbackIcon": true, "displayAnswer": "{ev1[3]}", "answer": "{ev1[3]}", "marks": 1, "variableReplacements": [], "type": "patternmatch", "variableReplacementStrategy": "originalfirst"}], "showFeedbackIcon": true, "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
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", "type": "question", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}]}