// Numbas version: finer_feedback_settings {"duration": 900, "timing": {"timedwarning": {"message": "

There are 5 minutes remaining.

", "action": "warn"}, "allowPause": true, "timeout": {"message": "", "action": "none"}}, "metadata": {"licence": "None specified", "description": "

This is a quiz on truth tables.

"}, "navigation": {"onleave": {"message": "

Make sure you have filled in each box before you submit the quiz.

", "action": "preventifunattempted"}, "allowregen": false, "showfrontpage": true, "browse": true, "reverse": true, "showresultspage": "oncompletion", "preventleave": true}, "showstudentname": true, "showQuestionGroupNames": false, "feedback": {"showactualmark": false, "showanswerstate": false, "allowrevealanswer": false, "advicethreshold": 0, "feedbackmessages": [], "intro": "

Make sure you fill in each box before you hit submit.

\n

Print your exam to file at the end, so you have a record.

", "showtotalmark": true, "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "oncompletion", "showactualmarkwhen": "oncompletion", "showtotalmarkwhen": "always", "showanswerstatewhen": "oncompletion", "showadvicewhen": "never"}, "name": "Quiz 1 (Bob) ", "percentPass": "40", "question_groups": [{"pickQuestions": 1, "pickingStrategy": "all-ordered", "name": "Group", "questions": [{"name": "Propositions (v2)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Marie Nicholson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1799/"}], "parts": [{"shuffleAnswers": false, "variableReplacements": [], "minAnswers": 0, "layout": {"type": "all", "expression": ""}, "matrix": "marking_matrix", "choices": ["{all[select[0]][0]}", "{all[select[1]][0]}", "{all[select[2]][0]}", "{all[select[3]][0]}", "{all[select[4]][0]}", "{all[select[5]][0]}"], "scripts": {}, "maxMarks": 0, "minMarks": 0, "type": "m_n_x", "answers": ["Proposition", "Not a proposition"], "showCorrectAnswer": true, "warningType": "none", "maxAnswers": 0, "shuffleChoices": false, "marks": 0, "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup"}], "preamble": {"css": "", "js": ""}, "question_groups": [{"pickingStrategy": "all-ordered", "name": "", "questions": [], "pickQuestions": 0}], "advice": "

For the above we have:

\n

1.  {all[select[0]][0]}

\n

{all[select[0]][1]}

\n

2.  {all[select[1]][0]}

\n

{all[select[1]][1]}

\n

3.  {all[select[2]][0]}

\n

{all[select[2]][1]}

\n

4.  {all[select[3]][0]}

\n

{all[select[3]][1]}

\n

5.  {all[select[4]][0]}

\n

{all[select[4]][1]}

\n

6.  {all[select[5]][0]}

\n

{all[select[5]][1]}

", "rulesets": {}, "variable_groups": [], "type": "question", "variables": {"marking_matrix": {"group": "Ungrouped variables", "definition": "map([all[x][2],(all[x][2])*(-1)+1],x,select)", "templateType": "anything", "name": "marking_matrix", "description": ""}, "all": {"group": "Ungrouped variables", "definition": "[\n['Every real number is an even integer.','This is a proposition. It is false as there are real numbers which are not even integers, e.g. $1$.',1],\n ['Every even integer is a real number.','A proposition and true.',1],\n ['If $x$ and $y$ are real numbers and $5x=5y$, then $x=y$.','A true proposition as we can cancel off the 5s.',1],\n ['Lions and tigers.','This is not a proposition as there is no truth value we can determine.',0],\n ['Lions and tigers are animals.','This is a true proposition, at least in the standard interpretation of the words.',1],\n ['Some sets are finite.','A true proposition as, for example, the set $\\\\\\{1 \\\\\\}$ is finite.',1],\n ['The derivative of any polynomial of degree $5$ is a polynomial of degree $6$.','This is a false proposition (as the derivative is of degree $4$).',1],\n ['The smallest positive whole number is 2.','This is a proposition and false, as the smallest positive whole number is $1$.',1],\n ['$\\\\cos(x)=-1$.','This is not a proposition: its truth depends on the value of $x$.',0],\n ['If $n$ is a real number and $n$ is not zero then $n/n=1$.','This a proposition: it is true.',1],\n ['The integer $x$ is a multiple of $7$.','Not a proposition. Its truth depends on the value of $x$.',0],\n ['If the integer $x$ is a multiple of $7$, then it is divisible by $7$.','A true proposition.',1],\n ['Either the integer $x$ is a multiple of $7$, or it is not.','A proposition and true.',1],\n ['Call me Ishmael.','Not a proposition as we cannot ascertain a truth value.',0],\n ['Either $x>3$ or $x<0$.','Not a proposition: its truth depends on the value of $x$.',0],\n ['They like fishcakes.','Not a proposition. Its truth depends on who \"They\" are.',0],\n ['In the beginning.','Not a proposition: is neither true nor false.',0],\n ['Newcastle University is a much better place to get your degree.','Not a proposition. It depends on what \"better\" refers to.',0],\n ['To be or not to be.','Not a proposition: is neither true nor false.',0],\n ['Sunderland football club is at its peak.','Not a proposition. It depends on when it is said, and what \"peak\" means.',0],\n ['Newcastle United finished above Sunderland in the 2014-2015 Season.','A proposition. It is true, according to the records.',1],\n ['England and the UK are two different names for the same place.', 'A proposition. People from England may say it is true. They are wrong.',1],\n ['If $3x^2-2=0$ then $x=\\\\sqrt{2/3}$ or $x=-\\\\sqrt{2/3}$','A proposition. It does not depend what $x$ is. It is true.',1],\n ['Numbers $x$, $y$ and $z$ have the property that $x+y=z$.','Not a proposition, as its truth depends on the values of $x$, $y$ and $z$.',0],\n ['Numbers $x$, $y$ and $z$ have the property that $x+y>z$ or $x+y \\\\le z$.', 'A proposition. One or other of the conditions holds.',1] \n ]", "templateType": "anything", "name": "all", "description": ""}, "select": {"group": "Ungrouped variables", "definition": "shuffle(list(0..length(all)-1))[0..6]", "templateType": "anything", "name": "select", "description": ""}}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "notes": "", "description": "

Asks to determine whether or not 6 statements are propositions or not i.e. we can determine a truth value or not.

"}, "statement": "

Which of the following are propositions?

", "functions": {}, "tags": [], "showQuestionGroupNames": false, "ungrouped_variables": ["all", "select", "marking_matrix"], "variablesTest": {"condition": "", "maxRuns": 100}}, {"name": "Truth tables 3 ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Marie Nicholson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1799/"}], "variablesTest": {"condition": "a1 <>b1 and a2<>b2 and\nif(a='p' or a='\\\\neg p',b=random('q','\\\\neg q'),b=random('p','\\\\neg p'))\n", "maxRuns": "150"}, "tags": [], "variables": {"ev3": {"description": "", "templateType": "anything", "group": "Third Bracket", "definition": "bool_to_label(pre_ev3)", "name": "ev3"}, "ev2": {"description": "", "templateType": "anything", "group": "Second Bracket", "definition": "bool_to_label(pre_ev2)", "name": "ev2"}, "a2": {"description": "", "templateType": "anything", "group": "Third Bracket", "definition": "latex(latex_symbol_list[s[4]])", "name": "a2"}, "disq": {"description": "", "templateType": "anything", "group": "Truth values", "definition": "bool_to_label(q)", "name": "disq"}, "pre_ev2": {"description": "", "templateType": "anything", "group": "Second Bracket", "definition": "map(evaluate(convch(a1)+\" \"+conv(op2)+\" \"+convch(b1),[p[t],q[t]]),t,0..3)", "name": "pre_ev2"}, "op2": {"description": "", "templateType": "anything", "group": "Second Bracket", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "name": "op2"}, "disp": {"description": "", "templateType": "anything", "group": "Truth values", "definition": "bool_to_label(p)", "name": "disp"}, "op": {"description": "", "templateType": "anything", "group": "First Bracket", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "name": "op"}, "a1": {"description": "", "templateType": "anything", "group": "Second Bracket", "definition": "latex(latex_symbol_list[s[2]])", "name": "a1"}, "op1": {"description": "", "templateType": "anything", "group": "First and Second Brackets", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "name": "op1"}, "b2": {"description": "", "templateType": "anything", "group": "Third Bracket", "definition": "latex(latex_symbol_list[s[5]])", "name": "b2"}, "p": {"description": "", "templateType": "anything", "group": "Truth values", "definition": "[true,true,false,false]", "name": "p"}, "pre_t_value": {"description": "", "templateType": "anything", "group": "First and Second Brackets", "definition": "map(evaluate(pre_ev1[t]+\" \"+conv(op1)+\" \"+pre_ev2[t],[]),t,0..3)", "name": "pre_t_value"}, "op4": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "name": "op4"}, "latex_symbol_list": {"description": "", "templateType": "anything", "group": "Lists of symbols", "definition": "[\"p\",\"q\",\"\\\\neg p\",\"\\\\neg q\"]", "name": "latex_symbol_list"}, "op3": {"description": "", "templateType": "anything", "group": "Third Bracket", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "name": "op3"}, "pre_ev1": {"description": "", "templateType": "anything", "group": "First Bracket", "definition": "map(evaluate(convch(a)+\" \"+conv(op)+\" \"+convch(b),[p[t],q[t]]),t,0..3)", "name": "pre_ev1"}, "b": {"description": "", "templateType": "anything", "group": "First Bracket", "definition": "latex(latex_symbol_list[s[1]])", "name": "b"}, "pre_ev3": {"description": "", "templateType": "anything", "group": "Third Bracket", "definition": "map(evaluate(convch(a2)+\" \"+conv(op3)+\" \"+convch(b2),[p[t],q[t]]),t,0..3)", "name": "pre_ev3"}, "logic_symbol_list": {"description": "", "templateType": "anything", "group": "Lists of symbols", "definition": "[\"p\",\"q\",\"not p\",\"not q\"]", "name": "logic_symbol_list"}, "t_value": {"description": "", "templateType": "anything", "group": "First and Second Brackets", "definition": "bool_to_label(pre_t_value)", "name": "t_value"}, "s": {"description": "", "templateType": "anything", "group": "Lists of symbols", "definition": "repeat(random(0..3),6)", "name": "s"}, "ev1": {"description": "", "templateType": "anything", "group": "First Bracket", "definition": "bool_to_label(pre_ev1)", "name": "ev1"}, "final_value": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "bool_to_label(map(evaluate(pre_t_value[t]+\" \"+conv(op4)+\" \"+pre_ev3[t],[]),t,0..3))", "name": "final_value"}, "a": {"description": "", "templateType": "anything", "group": "First Bracket", "definition": "latex(latex_symbol_list[s[0]])", "name": "a"}, "b1": {"description": "", "templateType": "anything", "group": "Second Bracket", "definition": "latex(latex_symbol_list[s[3]])", "name": "b1"}, "q": {"description": "", "templateType": "anything", "group": "Truth values", "definition": "[true,false,true,false]", "name": "q"}}, "advice": "

First we find the truth table for $\\var{a} \\var{op} \\var{b}$:

\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$$\\var{a} \\var{op} \\var{b}$
$\\var{disp[0]}$$\\var{disq[0]}$$\\var{ev1[0]}$
$\\var{disp[1]}$$\\var{disq[1]}$$\\var{ev1[1]}$
$\\var{disp[2]}$$\\var{disq[2]}$$\\var{ev1[2]}$
$\\var{disp[3]}$$\\var{disq[3]}$$\\var{ev1[3]}$
\n

Then the truth table for $\\var{a1} \\var{op2} \\var{b1}$:

\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$$\\var{a1} \\var{op2} \\var{b1}$
$\\var{disp[0]}$$\\var{disq[0]}$$\\var{ev2[0]}$
$\\var{disp[1]}$$\\var{disq[1]}$$\\var{ev2[1]}$
$\\var{disp[2]}$$\\var{disq[2]}$$\\var{ev2[2]}$
$\\var{disp[3]}$$\\var{disq[3]}$$\\var{ev2[3]}$
\n

Putting these together to find $(\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1})$:

\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\n
$p$$q$$\\var{a} \\var{op} \\var{b}$$\\var{a1} \\var{op2} \\var{b1}$$(\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1})$
$\\var{disp[0]}$$\\var{disq[0]}$$\\var{ev1[0]}$$\\var{ev2[0]}$$\\var{t_value[0]}$
$\\var{disp[1]}$$\\var{disq[1]}$$\\var{ev1[1]}$$\\var{ev2[1]}$$\\var{t_value[1]}$
$\\var{disp[2]}$$\\var{disq[2]}$$\\var{ev1[2]}$$\\var{ev2[2]}$$\\var{t_value[2]}$
$\\var{disp[3]}$$\\var{disq[3]}$$\\var{ev1[3]}$$\\var{ev2[3]}$$\\var{t_value[3]}$
\n

Next we find the truth table for $\\var{a2} \\var{op3} \\var{b2}$:

\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$$\\var{a2} \\var{op3} \\var{b2}$
$\\var{disp[0]}$$\\var{disq[0]}$$\\var{ev3[0]}$
$\\var{disp[1]}$$\\var{disq[1]}$$\\var{ev3[1]}$
$\\var{disp[2]}$$\\var{disq[2]}$$\\var{ev3[2]}$
$\\var{disp[3]}$$\\var{disq[3]}$$\\var{ev3[3]}$
\n

Putting this all together to obtain the truth table we want:

\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$$(\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1})$$\\var{a2} \\var{op3} \\var{b2}$$((\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1}))\\var{op4}(\\var{a2} \\var{op3} \\var{b2})$
$\\var{disp[0]}$$\\var{disq[0]}$$\\var{t_value[0]}$$\\var{ev3[0]}$$\\var{final_value[0]}$
$\\var{disp[1]}$$\\var{disq[1]}$$\\var{t_value[1]}$$\\var{ev3[1]}$$\\var{final_value[1]}$
$\\var{disp[2]}$$\\var{disq[2]}$$\\var{t_value[2]}$$\\var{ev3[2]}$$\\var{final_value[2]}$
$\\var{disp[3]}$$\\var{disq[3]}$$\\var{t_value[3]}$$\\var{ev3[3]}$$\\var{final_value[3]}$
", "statement": "

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

\n

\\[((\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1}))\\var{op4}(\\var{a2} \\var{op3} \\var{b2}).\\]

\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"}, {"variables": ["a2", "b2", "op3", "pre_ev3", "ev3"], "name": "Third Bracket"}, {"variables": ["op1", "pre_t_value", "t_value"], "name": "First and Second Brackets"}], "metadata": {"description": "

Create a truth table for a logical expression of the form $((a \\operatorname{op1} b) \\operatorname{op2}(c \\operatorname{op3} d))\\operatorname{op4}(e \\operatorname{op5} f) $ where each of $a, \\;b,\\;c,\\;d,\\;e,\\;f$ can be one the Boolean variables $p,\\;q,\\;\\neg p,\\;\\neg q$ and each of $\\operatorname{op1},\\;\\operatorname{op2},\\;\\operatorname{op3},\\;\\operatorname{op4},\\;\\operatorname{op5}$ one of $\\lor,\\;\\land,\\;\\to$.

\n

For example: $((q \\lor \\neg p) \\to (p \\land \\neg q)) \\to (p \\lor q)$

", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "gaps": [{"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{ev1[0]}", "showFeedbackIcon": true, "answer": "{ev1[0]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{ev1[1]}", "showFeedbackIcon": true, "answer": "{ev1[1]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{ev1[2]}", "showFeedbackIcon": true, "answer": "{ev1[2]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{ev1[3]}", "showFeedbackIcon": true, "answer": "{ev1[3]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{ev2[0]}", "showFeedbackIcon": true, "answer": "{ev2[0]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{ev2[1]}", "showFeedbackIcon": true, "answer": "{ev2[1]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{ev2[2]}", "showFeedbackIcon": true, "answer": "{ev2[2]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{ev2[3]}", "showFeedbackIcon": true, "answer": "{ev2[3]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{t_value[0]}", "showFeedbackIcon": true, "answer": "{t_value[0]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{t_value[1]}", "showFeedbackIcon": true, "answer": "{t_value[1]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{t_value[2]}", "showFeedbackIcon": true, "answer": "{t_value[2]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{t_value[3]}", "showFeedbackIcon": true, "answer": "{t_value[3]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{ev3[0]}", "showFeedbackIcon": true, "answer": "{ev3[0]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{ev3[1]}", "showFeedbackIcon": true, "answer": "{ev3[1]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{ev3[2]}", "showFeedbackIcon": true, "answer": "{ev3[2]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{ev3[3]}", "showFeedbackIcon": true, "answer": "{ev3[3]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{final_value[0]}", "showFeedbackIcon": true, "answer": "{final_value[0]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{final_value[1]}", "showFeedbackIcon": true, "answer": "{final_value[1]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{final_value[2]}", "showFeedbackIcon": true, "answer": "{final_value[2]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}, {"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{final_value[3]}", "showFeedbackIcon": true, "answer": "{final_value[3]}", "variableReplacementStrategy": "originalfirst", "unitTests": []}], "type": "gapfill", "unitTests": [], "sortAnswers": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "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\n\n\n\n\n\n\n\n
$p$$q$$\\var{a} \\var{op} \\var{b}$$\\var{a1} \\var{op2} \\var{b1}$$(\\var{a} \\var{op} \\var{b}) \\var{op1} (\\var{a1} \\var{op2} \\var{b1})$$\\var{a2} \\var{op3} \\var{b2}$$((\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1}))\\var{op4}(\\var{a2} \\var{op3} \\var{b2})$
$\\var{disp[0]}$$\\var{disq[0]}$[[0]][[4]][[8]][[12]][[16]]
$\\var{disp[1]}$$\\var{disq[1]}$[[1]][[5]][[9]][[13]][[17]]
$\\var{disp[2]}$$\\var{disq[2]}$[[2]][[6]][[10]][[14]][[18]]
$\\var{disp[3]}$$\\var{disq[3]}$[[3]][[7]][[11]][[15]][[19]]
"}], "ungrouped_variables": ["final_value", "op4"], "preamble": {"js": "", "css": ""}, "functions": {"bool_to_label": {"language": "jme", "type": "number", "definition": "map(if(l[x],'T','F'),x,0..length(l)-1)", "parameters": [["l", "list"]]}, "evaluate": {"language": "javascript", "type": "number", "definition": "return scope.evaluate(expr);", "parameters": [["expr", "string"], ["dependencies", "list"]]}, "convch": {"language": "jme", "type": "string", "definition": "switch(ch=\"\\\\neg p\",\"not p[t]\",ch=\"\\\\neg q\",\"not q[t]\",ch=\"p\",\"p[t]\",\"q[t]\")", "parameters": [["ch", "string"]]}, "conv": {"language": "jme", "type": "string", "definition": "switch(op=\"\\\\land\",\"and\",op=\"\\\\lor\",\"or\",\"implies\")", "parameters": [["op", "string"]]}}, "rulesets": {}, "type": "question"}]}], "type": "exam", "contributors": [{"name": "Marie Nicholson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1799/"}], "extensions": [], "custom_part_types": [], "resources": []}