// Numbas version: exam_results_page_options {"name": "Truth table", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"evaluate": {"definition": "return scope.evaluate(expr);", "type": "number", "parameters": [["expr", "string"], ["dependencies", "list"]], "language": "javascript"}, "bool_to_label": {"definition": "map(if(l[x],'T','F'),x,0..length(l)-1)", "type": "number", "parameters": [["l", "list"]], "language": "jme"}, "conv": {"definition": "switch(op=\"\\\\land\",\"and\",op=\"\\\\lor\",\"or\",\"implies\")", "type": "string", "parameters": [["op", "string"]], "language": "jme"}, "convch": {"definition": "switch(ch=\"\\\\neg p\",\"not p[t]\",ch=\"\\\\neg q\",\"not q[t]\",ch=\"p\",\"p[t]\",\"q[t]\")", "type": "string", "parameters": [["ch", "string"]], "language": "jme"}}, "ungrouped_variables": ["op1", "t_value"], "name": "Truth table", "tags": [], "advice": "

\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
", "rulesets": {}, "parts": [{"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\n\n\n\n
$p$$q$$\\neg p \\wedge q$$p \\to \\neg q$$(\\neg p \\wedge q) \\vee (p \\to \\neg q)$
TT[[0]][[4]][[8]]
TF[[1]][[5]][[9]]
FT[[2]][[6]][[10]]
FF[[3]][[7]][[11]]
\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": false, "displayAnswer": "{ev1[0]}", "scripts": {}, "answer": "F", "marks": 1, "type": "patternmatch"}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": false, "displayAnswer": "{ev1[1]}", "scripts": {}, "answer": "F", "marks": 1, "type": "patternmatch"}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": false, "displayAnswer": "{ev1[2]}", "scripts": {}, "answer": "T", "marks": 1, "type": "patternmatch"}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": false, "displayAnswer": "{ev1[3]}", "scripts": {}, "answer": "F", "marks": 1, "type": "patternmatch"}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": false, "displayAnswer": "{ev2[0]}", "scripts": {}, "answer": "F", "marks": 1, "type": "patternmatch"}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": false, "displayAnswer": "{ev2[1]}", "scripts": {}, "answer": "T", "marks": 1, "type": "patternmatch"}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": false, "displayAnswer": "{ev2[2]}", "scripts": {}, "answer": "T", "marks": 1, "type": "patternmatch"}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": false, "displayAnswer": "{ev2[3]}", "scripts": {}, "answer": "T", "marks": 1, "type": "patternmatch"}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": false, "displayAnswer": "{t_value[0]}", "scripts": {}, "answer": "F", "marks": 1, "type": "patternmatch"}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": false, "displayAnswer": "{t_value[1]}", "scripts": {}, "answer": "T", "marks": 1, "type": "patternmatch"}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": false, "displayAnswer": "{t_value[2]}", "scripts": {}, "answer": "T", "marks": 1, "type": "patternmatch"}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": false, "displayAnswer": "{t_value[3]}", "scripts": {}, "answer": "T", "marks": 1, "type": "patternmatch"}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "statement": "

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

\n

\\[((\\neg p \\wedge q) \\vee (p \\to \\neg q).\\]

\n

\n

Enter T if true, else enter F.

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n

", "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": ["a1", "b1", "op2", "pre_ev2", "ev2"], "name": "Second Bracket"}, {"variables": ["p", "q", "disp", "disq"], "name": "Truth values"}], "variablesTest": {"maxRuns": "150", "condition": "a1 <>b1 and\nif(a='p' or a='\\\\neg p',b=random('q','\\\\neg q'),b=random('p','\\\\neg p'))\n"}, "preamble": {"css": "", "js": ""}, "variables": {"a": {"definition": "latex(latex_symbol_list[s[0]])", "templateType": "anything", "group": "First Bracket", "name": "a", "description": ""}, "disq": {"definition": "bool_to_label(q)", "templateType": "anything", "group": "Truth values", "name": "disq", "description": ""}, "b": {"definition": "latex(latex_symbol_list[s[1]])", "templateType": "anything", "group": "First Bracket", "name": "b", "description": ""}, "op1": {"definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "templateType": "anything", "group": "Ungrouped variables", "name": "op1", "description": ""}, "op2": {"definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "templateType": "anything", "group": "Second Bracket", "name": "op2", "description": ""}, "latex_symbol_list": {"definition": "[\"p\",\"q\",\"\\\\neg p\",\"\\\\neg q\"]", "templateType": "anything", "group": "Lists of symbols", "name": "latex_symbol_list", "description": ""}, "disp": {"definition": "bool_to_label(p)", "templateType": "anything", "group": "Truth values", "name": "disp", "description": ""}, "t_value": {"definition": "bool_to_label(map(evaluate(pre_ev1[t]+\" \"+conv(op1)+\" \"+pre_ev2[t],[]),t,0..3))", "templateType": "anything", "group": "Ungrouped variables", "name": "t_value", "description": ""}, "a1": {"definition": "latex(latex_symbol_list[s[2]])", "templateType": "anything", "group": "Second Bracket", "name": "a1", "description": ""}, "p": {"definition": "[true,true,false,false]", "templateType": "anything", "group": "Truth values", "name": "p", "description": ""}, "s": {"definition": "repeat(random(0..3),4)", "templateType": "anything", "group": "Lists of symbols", "name": "s", "description": ""}, "q": {"definition": "[true,false,true,false]", "templateType": "anything", "group": "Truth values", "name": "q", "description": ""}, "b1": {"definition": "latex(latex_symbol_list[s[3]])", "templateType": "anything", "group": "Second Bracket", "name": "b1", "description": ""}, "ev1": {"definition": "bool_to_label(pre_ev1)", "templateType": "anything", "group": "First Bracket", "name": "ev1", "description": ""}, "ev2": {"definition": "bool_to_label(pre_ev2)", "templateType": "anything", "group": "Second Bracket", "name": "ev2", "description": ""}, "op": {"definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "templateType": "anything", "group": "First Bracket", "name": "op", "description": ""}, "pre_ev2": {"definition": "map(evaluate(convch(a1)+\" \"+conv(op2)+\" \"+convch(b1),[p[t],q[t]]),t,0..3)", "templateType": "anything", "group": "Second Bracket", "name": "pre_ev2", "description": ""}, "logic_symbol_list": {"definition": "[\"p\",\"q\",\"not p\",\"not q\"]", "templateType": "anything", "group": "Lists of symbols", "name": "logic_symbol_list", "description": ""}, "pre_ev1": {"definition": "map(evaluate(convch(a)+\" \"+conv(op)+\" \"+convch(b),[p[t],q[t]]),t,0..3)", "templateType": "anything", "group": "First Bracket", "name": "pre_ev1", "description": ""}}, "metadata": {"notes": "", "description": "

Removed the variability.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Peter Chapman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/210/"}]}]}], "contributors": [{"name": "Peter Chapman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/210/"}]}