// Numbas version: finer_feedback_settings {"name": "Truth tables or", "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$.

\n

For 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": []}, {"name": "Second Bracket", "variables": []}, {"name": "Truth values", "variables": ["q", "p", "disp", "disq"]}], "extensions": [], "ungrouped_variables": [], "name": "Truth tables or", "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"}, "disq": {"description": "", "definition": "bool_to_label(q)", "name": "disq", "templateType": "anything", "group": "Truth values"}, "q": {"description": "", "definition": "[true,false,true,false]", "name": "q", "templateType": "anything", "group": "Truth values"}, "s": {"description": "", "definition": "repeat(random(0..3),4)", "name": "s", "templateType": "anything", "group": "Lists of symbols"}, "logic_symbol_list": {"description": "", "definition": "[\"p\",\"q\",\"not p\",\"not q\"]", "name": "logic_symbol_list", "templateType": "anything", "group": "Lists of symbols"}, "latex_symbol_list": {"description": "", "definition": "[\"p\",\"q\",\"\\\\neg p\",\"\\\\neg q\"]", "name": "latex_symbol_list", "templateType": "anything", "group": "Lists of symbols"}}, "parts": [{"showCorrectAnswer": true, "scripts": {}, "gaps": [{"showCorrectAnswer": true, "scripts": {}, "matchMode": "regex", "showFeedbackIcon": true, "displayAnswer": "T", "answer": "T", "marks": 1, "variableReplacements": [], "type": "patternmatch", "variableReplacementStrategy": "originalfirst"}, {"showCorrectAnswer": true, "scripts": {}, "matchMode": "regex", "showFeedbackIcon": true, "displayAnswer": "T", "answer": "T", "marks": 1, "variableReplacements": [], "type": "patternmatch", "variableReplacementStrategy": "originalfirst"}, {"showCorrectAnswer": true, "scripts": {}, "matchMode": "regex", "showFeedbackIcon": true, "displayAnswer": "T", "answer": "T", "marks": 1, "variableReplacements": [], "type": "patternmatch", "variableReplacementStrategy": "originalfirst"}, {"showCorrectAnswer": true, "scripts": {}, "matchMode": "regex", "showFeedbackIcon": true, "displayAnswer": "F", "answer": "F", "marks": 1, "variableReplacements": [], "type": "patternmatch", "variableReplacementStrategy": "originalfirst"}], "showFeedbackIcon": true, "prompt": "

Complete the following truth table:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$P$$Q$$P \\lor Q$
TT[[0]]
TF[[1]]
FT[[2]]
FF[[3]]
", "marks": 0, "variableReplacements": [], "type": "gapfill", "variableReplacementStrategy": "originalfirst"}], "tags": [], "advice": "", "functions": {"evaluate": {"definition": "return scope.evaluate(expr);", "language": "javascript", "parameters": [["expr", "string"], ["dependencies", "list"]], "type": "number"}, "convch": {"definition": "switch(ch=\"\\\\neg p\",\"not p[t]\",ch=\"\\\\neg q\",\"not q[t]\",ch=\"p\",\"p[t]\",\"q[t]\")", "language": "jme", "parameters": [["ch", "string"]], "type": "string"}, "bool_to_label": {"definition": "map(if(l[x],'T','F'),x,0..length(l)-1)", "language": "jme", "parameters": [["l", "list"]], "type": "number"}, "conv": {"definition": "switch(op=\"\\\\land\",\"and\",op=\"\\\\lor\",\"or\",\"implies\")", "language": "jme", "parameters": [["op", "string"]], "type": "string"}}, "variablesTest": {"maxRuns": "150", "condition": ""}, "statement": "

In the following question you are asked to construct a truth table for:

\n

\n

$P \\lor Q$ 

\n

Enter 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/"}]}