// Numbas version: exam_results_page_options {"name": "Applied Mathematics - Final Exam", "metadata": {"description": "

\n

", "licence": "None specified"}, "duration": 7200, "percentPass": "0", "showQuestionGroupNames": false, "shuffleQuestionGroups": true, "showstudentname": true, "question_groups": [{"name": "Tue, 14 Dec", "pickingStrategy": "all-shuffled", "pickQuestions": 1, "questionNames": ["", "", "", "", "", "", "", ""], "variable_overrides": [[], [], [], [], [], [], [], []], "questions": [{"name": "Union, complement, intersection v2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Peter Chapman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/210/"}], "tags": [], "metadata": {"description": "

Given some random finite subsets of the natural numbers, perform set operations $\\cap,\\;\\cup$ and complement.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

In this question, the universal set is  $\\mathcal{U}=\\{x \\in \\mathbb{N}\\; | 1 \\leq \\;x \\leq \\var{a}\\}$.

\n

Let:

\n

$A=\\{x \\in \\mathbb{N}\\;|\\;\\var{b}\\leq x \\leq \\var{c}\\}$.

\n

$B=\\{x \\in \\mathbb{N}\\;|\\;x \\gt \\var{d}\\}$.

\n

$C=\\{ x \\in \\mathbb{N}\\;|\\; x \\text{ divisible by } \\var{f}\\}$.

\n

\n

", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(14..18)", "description": "", "templateType": "anything", "can_override": false}, "universal": {"name": "universal", "group": "Ungrouped variables", "definition": "set(1..a)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(3..8)", "description": "", "templateType": "anything", "can_override": false}, "set3": {"name": "set3", "group": "Ungrouped variables", "definition": "set(mod_set(1,a,f))", "description": "", "templateType": "anything", "can_override": false}, "set2": {"name": "set2", "group": "Ungrouped variables", "definition": "set(d+1..a)", "description": "", "templateType": "anything", "can_override": false}, "f": {"name": "f", "group": "Ungrouped variables", "definition": "random(2,3,5,6)", "description": "", "templateType": "anything", "can_override": false}, "set1": {"name": "set1", "group": "Ungrouped variables", "definition": "set(b..c)", "description": "", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "random(7..9)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "a - random(2..4)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "c", "d", "f", "universal", "set1", "set2", "set3"], "variable_groups": [], "functions": {"mod_set": {"parameters": [["a", "number"], ["b", "number"], ["c", "number"]], "type": "list", "language": "javascript", "definition": "//returns all integers which are divisible by c betweeen a and b\nvar l=[];\nfor(var i=a;iEnumerate the following sets:

\n

a) $A \\cup C=\\;$[[0]]

\n

b) $\\overline{B} \\cap C=\\;$[[1]]

\n

c) $A \\cup \\overline{B}=\\;$[[2]]

\n

d) $(A \\cap B) \\cup C=\\;$[[3]]

\n

\n

Note that you input sets in the form set(a,b,c,..,z) .

\n

For example set(1,2,3)gives the set $\\{1,2,3\\}$.

\n

The empty set is input as set().

\n

It is safest to list all of the elements explicitly.

\n

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{set1 or set3}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{(universal - set2) and set3}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{set1 or (universal-set2)}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{(set1 and set2) or set3}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Union, complement, intersection", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Peter Chapman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/210/"}], "tags": ["complement", "elements", "intersection", "predicates", "set operations", "sets", "subsets", "union"], "metadata": {"description": "

Given some random finite subsets of the natural numbers, perform set operations $\\cap,\\;\\cup$ and complement.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

In this question, the universal set is  $\\mathcal{U}=\\{x \\in \\mathbb{N}\\; | \\;x \\leq \\var{a}\\}$.

\n

Let:

\n

$A=\\{x \\in \\mathbb{N}\\;|\\;\\var{b}\\leq x \\leq \\var{c}\\}$.

\n

$B=\\{x \\in \\mathbb{N}\\;|\\;x \\gt \\var{d}\\}$.

\n

$C=\\{ x \\in \\mathbb{N}\\;|\\; x \\text{ divisible by } \\var{f}\\}$.

\n

\n

", "advice": "", "rulesets": {}, "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(15..30)", "description": "", "templateType": "anything"}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "b+random(10..a-b)-1", "description": "", "templateType": "anything"}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(3..8)", "description": "", "templateType": "anything"}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "random(5..c-1)", "description": "", "templateType": "anything"}, "f": {"name": "f", "group": "Ungrouped variables", "definition": "random(2,3,5,6)", "description": "", "templateType": "anything"}, "universal": {"name": "universal", "group": "Ungrouped variables", "definition": "set(1..a)", "description": "", "templateType": "anything"}, "set1": {"name": "set1", "group": "Ungrouped variables", "definition": "set(b..c)", "description": "", "templateType": "anything"}, "set2": {"name": "set2", "group": "Ungrouped variables", "definition": "set(d+1..a)", "description": "", "templateType": "anything"}, "set3": {"name": "set3", "group": "Ungrouped variables", "definition": "set(mod_set(1,a,f))", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "c", "d", "f", "universal", "set1", "set2", "set3"], "variable_groups": [], "functions": {"mod_set": {"parameters": [["a", "number"], ["b", "number"], ["c", "number"]], "type": "list", "language": "javascript", "definition": "//returns all integers which are divisible by c betweeen a and b\nvar l=[];\nfor(var i=a;iEnumerate the following sets:

\n

a) $A \\cap B=\\;$[[0]]

\n

b) $B \\cap C=\\;$[[1]]

\n

c) $A \\cap \\overline{C}=\\;$[[2]]

\n

d) $(\\overline{A} \\cup C) \\cap B=\\;$[[3]]

\n

\n

Note that you input sets in the form set(a,b,c,..,z) .

\n

For example set(1,2,3)gives the set $\\{1,2,3\\}$.

\n

The empty set is input as set().

\n

Also some labour saving tips:

\n

If you want to input all integers between $a$ and $b$ inclusive then instead of writing all the elements you can input this as set(a..b).

\n

If you want to input all integers between $a$ and $b$ inclusive in steps of $c$ then this is input as set(a..b#c). So all odd integers from $-3$ to $28$ are input as set(-3..28#2).

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{set1 and set2}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{set2 and set3}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{set1 and (universal-set3)}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{((universal-set1) or set3) and set2}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Descriptive Statistics (P): Median", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Hayley Moore", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/495/"}], "functions": {}, "ungrouped_variables": ["v_less_9a", "v_less_9b", "v_more_11a", "v_more_11b", "v_between_9_11", "v_less_4a", "v_less_4b", "v_between_5_10", "v_more_10a", "v_more_10b"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

a)

\n

First, put the elements in increasing order, i.e.

\n

\\[ \\var{latex(join(sort([v_less_9a,v_more_11a,v_less_9b,v_between_9_11,v_more_11b]),','))} \\]

\n

The median of the set is the middle value in the sorted list. In this case, it's $\\var{v_between_9_11}$.

\n

b)

\n

First, put the elements in increasing order, i.e.

\n

\\[ \\var{latex(join(sort([v_less_4a,v_less_4b,v_between_5_10,v_more_10a,v_more_10b]),','))} \\]

\n

The median of the set is the middle value in the sorted list. In this case, it's $\\var{v_between_5_10}$.

", "rulesets": {}, "parts": [{"prompt": "

$\\var{v_less_9a},\\var{v_more_11a},\\var{v_less_9b},\\var{v_between_9_11},\\var{v_more_11b}$.

", "allowFractions": false, "variableReplacements": [], "maxValue": "v_between_9_11", "minValue": "v_between_9_11", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"prompt": "

$\\var{v_less_4a}, \\var{v_less_4b}, \\var{v_between_5_10},\\var{v_more_10a}, \\var{v_more_10b}$

", "allowFractions": false, "variableReplacements": [], "maxValue": "v_between_5_10", "minValue": "v_between_5_10", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "statement": "

Find the medians of the following sets of numbers. Enter your answers as whole numbers or fractions, not decimals.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"v_more_11b": {"definition": "random(12..15)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_more_11b", "description": ""}, "v_more_11a": {"definition": "random(12..15)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_more_11a", "description": ""}, "v_between_5_10": {"definition": "random(5..10)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_between_5_10", "description": ""}, "v_less_9b": {"definition": "random(1..8)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_less_9b", "description": ""}, "v_less_9a": {"definition": "random(1..8)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_less_9a", "description": ""}, "v_more_10a": {"definition": "random(10..20)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_more_10a", "description": ""}, "v_between_9_11": {"definition": "random(9..11)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_between_9_11", "description": ""}, "v_more_10b": {"definition": "random(10..20)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_more_10b", "description": ""}, "v_less_4a": {"definition": "random(1..3)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_less_4a", "description": ""}, "v_less_4b": {"definition": "random(1..3)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_less_4b", "description": ""}}, "metadata": {"notes": "", "description": "

Find the medians of two sets of data.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Vicky's copy of Standard deviation", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Vicky Hall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/659/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Paul Finley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2232/"}], "variablesTest": {"condition": "", "maxRuns": 100}, "tags": [], "variables": {"var2": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(variance(r1,true),3)", "name": "var2"}, "n": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "10", "name": "n"}, "overallvar": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "variance(sscores,true)", "name": "overallvar"}, "var1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(variance(r0,true),3)", "name": "var1"}, "sig1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(9..15)", "name": "sig1"}, "ssq2": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "sum(map(x^2,x,r1))", "name": "ssq2"}, "ssq1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "sum(map(x^2,x,r0))", "name": "ssq1"}, "mu": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(55..65)", "name": "mu"}, "overallmean": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "mean(sscores)", "name": "overallmean"}, "mean1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "mean(r0)", "name": "mean1"}, "stdevoverall": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stdev(sscores,true),1)", "name": "stdevoverall"}, "sscores": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "map(r0[x]+r1[x],x,0..n-1)", "name": "sscores"}, "r1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu,sig1)),n)", "name": "r1"}, "r0": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalSample(mu,sig0)),n)", "name": "r0"}, "stdev1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stdev(r0,true),1)", "name": "stdev1"}, "mean2": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "mean(r1)", "name": "mean2"}, "s": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "2", "name": "s"}, "stdev2": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stdev(r1,true),1)", "name": "stdev2"}, "total": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "'Total Score'", "name": "total"}, "exam1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "'Anatomy'", "name": "exam1"}, "exam2": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "'Cell Biology'", "name": "exam2"}, "sig0": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(6..12)", "name": "sig0"}, "tol": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "0", "name": "tol"}}, "advice": "

The solution to the first part is here – the other parts can be done in the same way.

\n

For {exam1} we have the mean is:

\n

\\[\\simplify[]{({r0[0]} + {r0[1]} + {r0[2]} + {r0[3]} + {r0[4]} + {r0[5]} + {r0[6]} + {r0[7]} + {r0[8]} + {r0[9]}) / {n} = {mean1}}\\]

\n

The sample variance is given by the formula:

\n

\\[\\textrm{Sample Variance} = \\frac{1}{n-1}\\left(\\sum_{j=1}^{n}x_j^2 -n\\mu^2\\right)\\]

\n

where the $x_j$ are the exam scores for {exam1}, $n=\\var{n}$ the number of students and $\\mu=\\var{mean1}$ the sample mean.

\n

We find that
\\[\\begin{eqnarray*}\\sum_{j=1}^{n}x_j^2 &=& \\simplify[]{({r0[0]}^2 + {r0[1]}^2 + {r0[2]}^2 + {r0[3]}^2 + {r0[4]}^2 + {r0[5]}^2 + {r0[6]}^2 + {r0[7]}^2 + {r0[8]}^2 + {r0[9]}^2)}\\\\ &=& \\var{ssq1}\\\\ \\\\ \\\\ n\\mu^2 &=&\\var{n} \\times\\var{mean1}^2\\\\ &=& \\var{n*mean1^2} \\end{eqnarray*} \\]
Hence substituting these values into the formula we find that:

\n

\\[\\begin{eqnarray*} \\textrm{Sample Variance} &=& \\frac{1}{\\var{n-1}}\\left(\\var{ssq1}-\\var{n*mean1^2}\\right)\\\\ &=& \\var{var1} \\end{eqnarray*} \\] to 3 decimal places.

\n

The Sample Standard Deviation is then the square root of the Sample Variance i.e.

\n

Sample Standard Deviation = $\\sqrt{\\var{var1}} = \\var{stdev1}$ to one decimal place.

", "statement": "\n \n \n

The following table gives the examination marks in {exam1} and in {exam2} and their total for a group of $n=\\var{n}$ students.

\n \n \n \n \n \n \n \n \n \n \n \n
{exam1}$\\var{r0[0]}$$\\var{r0[1]}$$\\var{r0[2]}$$\\var{r0[3]}$$\\var{r0[4]}$$\\var{r0[5]}$$\\var{r0[6]}$$\\var{r0[7]}$$\\var{r0[8]}$$\\var{r0[9]}$Mean = $\\var{mean1}$
{exam2}$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$$\\var{r1[5]}$$\\var{r1[6]}$$\\var{r1[7]}$$\\var{r1[8]}$$\\var{r1[9]}$Mean = $\\var{mean2}$
{total}$\\var{sscores[0]}$$\\var{sscores[1]}$$\\var{sscores[2]}$$\\var{sscores[3]}$$\\var{sscores[4]}$$\\var{sscores[5]}$$\\var{sscores[6]}$$\\var{sscores[7]}$$\\var{sscores[8]}$$\\var{sscores[9]}$Mean = $\\var{overallmean}$
\n \n \n \n

Find the sample standard deviation for each of {exam1}, {exam2} and Total Score.

\n \n ", "variable_groups": [], "metadata": {"description": "

Two ordered data sets, each with 10 numbers. Find the sample standard deviation for each and for their sum.

", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "gaps": [{"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "correctAnswerStyle": "plain", "minValue": "{stdev1-tol}", "maxValue": "{stdev1+tol}", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "allowFractions": false, "mustBeReducedPC": 0, "type": "numberentry", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "unitTests": [], "correctAnswerFraction": false}], "type": "gapfill", "unitTests": [], "sortAnswers": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "prompt": "\n \n \n

{exam1}

\n \n \n \n

Sample Standard Deviation = [[0]] (to one decimal place)

\n \n "}, {"showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "gaps": [{"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "correctAnswerStyle": "plain", "minValue": "{stdev2-tol}", "maxValue": "{stdev2+tol}", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "allowFractions": false, "mustBeReducedPC": 0, "type": "numberentry", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "unitTests": [], "correctAnswerFraction": false}], "type": "gapfill", "unitTests": [], "sortAnswers": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "prompt": "\n \n \n

{exam2}

\n \n \n \n

Sample Standard Deviation = [[0]] (to one decimal place)

\n \n "}, {"showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "gaps": [{"showCorrectAnswer": true, "marks": 1, "customMarkingAlgorithm": "", "correctAnswerStyle": "plain", "minValue": "{stdevoverall-tol}", "maxValue": "{stdevoverall+tol}", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "allowFractions": false, "mustBeReducedPC": 0, "type": "numberentry", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "unitTests": [], "correctAnswerFraction": false}], "type": "gapfill", "unitTests": [], "sortAnswers": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "prompt": "\n \n \n

{total}

\n \n \n \n

Sample Standard Deviation = [[0]] (to one decimal place)

\n \n "}], "ungrouped_variables": ["overallmean", "mean1", "mean2", "overallvar", "ssq1", "ssq2", "total", "exam2", "tol", "exam1", "stdev1", "stdev2", "var1", "var2", "sig1", "sig0", "stdevoverall", "r0", "r1", "n", "mu", "s", "sscores"], "preamble": {"js": "", "css": ""}, "functions": {}, "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "type": "question"}, {"name": "Truth tables quiz", "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/"}], "tags": [], "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 $ where each of $a, \\;b,\\;c,\\;d,\\;e$ can be one the Boolean variables $p,\\;q,\\;\\neg p,\\;\\neg q$ and each of $\\operatorname{op1},\\;\\operatorname{op2},\\;\\operatorname{op3},\\;\\operatorname{op4}$ one of $\\lor,\\;\\land,\\;\\to$.

\n

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

", "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})\\var{op1}(\\var{a1} \\var{op2} \\var{b1}))\\var{op4}\\var{a2}.\\]

\n

\n

Enter T if true, else enter F.

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n

", "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\n\n\n\n
$p$$q$$\\var{a} \\var{op} \\var{b}$
$\\var{p[0]}$$\\var{q[0]}$$\\var{ev1[0]}$
$\\var{p[1]}$$\\var{q[1]}$$\\var{ev1[1]}$
$\\var{p[2]}$$\\var{q[2]}$$\\var{ev1[2]}$
$\\var{p[3]}$$\\var{q[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{p[0]}$$\\var{q[0]}$$\\var{ev2[0]}$
$\\var{p[1]}$$\\var{q[1]}$$\\var{ev2[1]}$
$\\var{p[2]}$$\\var{q[2]}$$\\var{ev2[2]}$
$\\var{p[3]}$$\\var{q[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{p[0]}$$\\var{q[0]}$$\\var{ev1[0]}$$\\var{ev2[0]}$$\\var{t_value[0]}$
$\\var{p[1]}$$\\var{q[1]}$$\\var{ev1[1]}$$\\var{ev2[1]}$$\\var{t_value[1]}$
$\\var{p[2]}$$\\var{q[2]}$$\\var{ev1[2]}$$\\var{ev2[2]}$$\\var{t_value[2]}$
$\\var{p[3]}$$\\var{q[3]}$$\\var{ev1[3]}$$\\var{ev2[3]}$$\\var{t_value[3]}$
\n

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

\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{p[0]}$$\\var{q[0]}$$\\var{ev3[0]}$
$\\var{p[1]}$$\\var{q[1]}$$\\var{ev3[1]}$
$\\var{p[2]}$$\\var{q[2]}$$\\var{ev3[2]}$
$\\var{p[3]}$$\\var{q[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{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1}))\\var{op4}\\var{a2} $
$\\var{p[0]}$$\\var{q[0]}$$\\var{t_value[0]}$$\\var{ev3[0]}$$\\var{final_value[0]}$
$\\var{p[1]}$$\\var{q[1]}$$\\var{t_value[1]}$$\\var{ev3[1]}$$\\var{final_value[1]}$
$\\var{p[2]}$$\\var{q[2]}$$\\var{t_value[2]}$$\\var{ev3[2]}$$\\var{final_value[2]}$
$\\var{p[3]}$$\\var{q[3]}$$\\var{t_value[3]}$$\\var{ev3[3]}$$\\var{final_value[3]}$
", "rulesets": {}, "variables": {"op4": {"name": "op4", "group": "Ungrouped variables", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "description": "", "templateType": "anything"}, "pre_ev3": {"name": "pre_ev3", "group": "Last ", "definition": "map(evaluate(convch(a2),[bool_p[t],bool_q[t]]),t,0..3)", "description": "", "templateType": "anything"}, "latex_symbol_list": {"name": "latex_symbol_list", "group": "Lists of symbols", "definition": "[\"p\",\"q\",\"\\\\neg p\",\"\\\\neg q\"]", "description": "", "templateType": "anything"}, "bool_p": {"name": "bool_p", "group": "Truth values", "definition": "[true,true,false,false]", "description": "", "templateType": "anything"}, "q": {"name": "q", "group": "Truth values", "definition": "bool_to_label([true,false,true,false])", "description": "", "templateType": "anything"}, "ev1": {"name": "ev1", "group": "First Bracket", "definition": "bool_to_label(pre_ev1)", "description": "", "templateType": "anything"}, "pre_ev1": {"name": "pre_ev1", "group": "First Bracket", "definition": "map(evaluate(convch(a)+\" \"+conv(op)+\" \"+convch(b),[bool_p[t],bool_q[t]]),t,0..3)", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "First Bracket", "definition": "latex(latex_symbol_list[s[0]])", "description": "", "templateType": "anything"}, "ev2": {"name": "ev2", "group": "Second Bracket", "definition": "bool_to_label(pre_ev2)", "description": "", "templateType": "anything"}, "logic_symbol_list": {"name": "logic_symbol_list", "group": "Lists of symbols", "definition": "[\"p\",\"q\",\"not p\",\"not q\"]", "description": "", "templateType": "anything"}, "op1": {"name": "op1", "group": "First and Second Brackets", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "description": "", "templateType": "anything"}, "ev3": {"name": "ev3", "group": "Last ", "definition": "bool_to_label(pre_ev3)", "description": "", "templateType": "anything"}, "s": {"name": "s", "group": "Lists of symbols", "definition": "repeat(random(0..3),6)", "description": "", "templateType": "anything"}, "final_value": {"name": "final_value", "group": "Ungrouped variables", "definition": "bool_to_label(pre_final_value)", "description": "", "templateType": "anything"}, "bool_q": {"name": "bool_q", "group": "Truth values", "definition": "[true,false,true,false]", "description": "", "templateType": "anything"}, "b": {"name": "b", "group": "First Bracket", "definition": "latex(latex_symbol_list[s[1]])", "description": "", "templateType": "anything"}, "op": {"name": "op", "group": "First Bracket", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "description": "", "templateType": "anything"}, "pre_t_value": {"name": "pre_t_value", "group": "First and Second Brackets", "definition": "map(evaluate(pre_ev1[t]+\" \"+conv(op1)+\" \"+pre_ev2[t],[]),t,0..3)", "description": "", "templateType": "anything"}, "t_value": {"name": "t_value", "group": "First and Second Brackets", "definition": "bool_to_label(pre_t_value)", "description": "", "templateType": "anything"}, "pre_ev2": {"name": "pre_ev2", "group": "Second Bracket", "definition": "map(evaluate(convch(a1)+\" \"+conv(op2)+\" \"+convch(b1),[bool_p[t],bool_q[t]]),t,0..3)", "description": "", "templateType": "anything"}, "op2": {"name": "op2", "group": "Second Bracket", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "description": "", "templateType": "anything"}, "b1": {"name": "b1", "group": "Second Bracket", "definition": "latex(latex_symbol_list[s[3]])", "description": "", "templateType": "anything"}, "a2": {"name": "a2", "group": "Last ", "definition": "latex(random(\"\\\\neg p\",\"\\\\neg q\"))", "description": "", "templateType": "anything"}, "a1": {"name": "a1", "group": "Second Bracket", "definition": "latex(latex_symbol_list[s[2]])", "description": "", "templateType": "anything"}, "pre_final_value": {"name": "pre_final_value", "group": "Ungrouped variables", "definition": "map(evaluate(pre_t_value[t]+\" \"+conv(op4)+\" \"+pre_ev3[t],[]),t,0..3)", "description": "", "templateType": "anything"}, "p": {"name": "p", "group": "Truth values", "definition": "bool_to_label([true,true,false,false])", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "a1 <>b1 and\nif(a='p' or a='\\\\neg p',b=random('q','\\\\neg q'),b=random('p','\\\\neg p'))\n", "maxRuns": "150"}, "ungrouped_variables": ["pre_final_value", "op4", "final_value"], "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": ["a1", "b1", "op2", "pre_ev2", "ev2"]}, {"name": "Truth values", "variables": ["p", "q", "bool_p", "bool_q"]}, {"name": "Last ", "variables": ["a2", "pre_ev3", "ev3"]}, {"name": "First and Second Brackets", "variables": ["op1", "pre_t_value", "t_value"]}], "functions": {"conv": {"parameters": [["op", "string"]], "type": "string", "language": "jme", "definition": "switch(op=\"\\\\land\",\"and\",op=\"\\\\lor\",\"or\",\"implies\")"}, "convch": {"parameters": [["ch", "string"]], "type": "string", "language": "jme", "definition": "switch(ch=\"\\\\neg p\",\"not bool_p[t]\",ch=\"\\\\neg q\",\"not bool_q[t]\",ch=\"p\",\"bool_p[t]\",\"bool_q[t]\")"}, "bool_to_label": {"parameters": [["l", "list"]], "type": "number", "language": "jme", "definition": "map(if(l[x],'T','F'),x,0..length(l)-1)"}, "evaluate": {"parameters": [["expr", "string"], ["dependencies", "list"]], "type": "number", "language": "javascript", "definition": "return scope.evaluate(expr);"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "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{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1}))\\var{op4}\\var{a2} $
$\\var{p[0]}$$\\var{q[0]}$[[0]][[4]][[8]][[12]][[16]]
$\\var{p[1]}$$\\var{q[1]}$[[1]][[5]][[9]][[13]][[17]]
$\\var{p[2]}$$\\var{q[2]}$[[2]][[6]][[10]][[14]][[18]]
$\\var{p[3]}$$\\var{q[3]}$[[3]][[7]][[11]][[15]][[19]]
", "gaps": [{"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{ev1[0]}", "displayAnswer": "{ev1[0]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{ev1[1]}", "displayAnswer": "{ev1[1]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{ev1[2]}", "displayAnswer": "{ev1[2]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{ev1[3]}", "displayAnswer": "{ev1[3]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{ev2[0]}", "displayAnswer": "{ev2[0]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{ev2[1]}", "displayAnswer": "{ev2[1]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{ev2[2]}", "displayAnswer": "{ev2[2]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{ev2[3]}", "displayAnswer": "{ev2[3]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{t_value[0]}", "displayAnswer": "{t_value[0]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{t_value[1]}", "displayAnswer": "{t_value[1]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{t_value[2]}", "displayAnswer": "{t_value[2]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{t_value[3]}", "displayAnswer": "{t_value[3]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{ev3[0]}", "displayAnswer": "{ev3[0]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{ev3[1]}", "displayAnswer": "{ev3[1]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{ev3[2]}", "displayAnswer": "{ev3[2]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{ev3[3]}", "displayAnswer": "{ev3[3]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{final_value[0]}", "displayAnswer": "{final_value[0]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{final_value[1]}", "displayAnswer": "{final_value[1]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{final_value[2]}", "displayAnswer": "{final_value[2]}", "matchMode": "regex"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": "0.5", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{final_value[3]}", "displayAnswer": "{final_value[3]}", "matchMode": "regex"}], "sortAnswers": false}]}, {"name": "Truth tables 4 (v2)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "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", "r", "bool_p", "bool_q", "bool_r"], "name": "Truth values"}, {"variables": ["a2", "pre_ev3", "c2", "d2", "ev3"], "name": "Last "}, {"variables": ["op1", "pre_t_value", "t_value"], "name": "First and Second Brackets"}], "variables": {"a": {"group": "First Bracket", "templateType": "anything", "definition": "latex(latex_symbol_list[s[0]])", "description": "", "name": "a"}, "op": {"group": "First Bracket", "templateType": "anything", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "description": "", "name": "op"}, "op4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "description": "", "name": "op4"}, "a1": {"group": "Second Bracket", "templateType": "anything", "definition": "latex(latex_symbol_list[s[2]])", "description": "", "name": "a1"}, "op2": {"group": "Second Bracket", "templateType": "anything", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "description": "", "name": "op2"}, "c2": {"group": "Last ", "templateType": "anything", "definition": "latex(switch(a2=\"\\\\neg p\",\"p\",a2=\"\\\\neg q\",\"q\",\"r\"))", "description": "", "name": "c2"}, "d2": {"group": "Last ", "templateType": "anything", "definition": "switch(a2=\"\\\\neg p\",p,a2=\"\\\\neg q\",q,r)", "description": "", "name": "d2"}, "logic_values": {"group": "Ungrouped variables", "templateType": "anything", "definition": "transpose(bool_matrix(cart(3)))", "description": "", "name": "logic_values"}, "ev1": {"group": "First Bracket", "templateType": "anything", "definition": "bool_to_label(pre_ev1)", "description": "", "name": "ev1"}, "b": {"group": "First Bracket", "templateType": "anything", "definition": "latex(latex_symbol_list[s[1]])", "description": "", "name": "b"}, "ev3": {"group": "Last ", "templateType": "anything", "definition": "bool_to_label(pre_ev3)", "description": "", "name": "ev3"}, "p": {"group": "Truth values", "templateType": "anything", "definition": "bool_to_label(list_to_boolean(list(logic_values[0])))", "description": "", "name": "p"}, "a2": {"group": "Last ", "templateType": "anything", "definition": "latex(random(\"\\\\neg p\",\"\\\\neg q\",\"\\\\neg r\"))", "description": "", "name": "a2"}, "bool_p": {"group": "Truth values", "templateType": "anything", "definition": "list_to_boolean(list(logic_values[0]))", "description": "", "name": "bool_p"}, "final_value": {"group": "Ungrouped variables", "templateType": "anything", "definition": "bool_to_label(pre_final_value)", "description": "", "name": "final_value"}, "pre_ev1": {"group": "First Bracket", "templateType": "anything", "definition": "map(evaluate(convch(a)+\" \"+conv(op)+\" \"+convch(b),[bool_p[t],bool_q[t],bool_r[t]]),t,0..7)", "description": "", "name": "pre_ev1"}, "q": {"group": "Truth values", "templateType": "anything", "definition": "bool_to_label(list_to_boolean(list(logic_values[1])))", "description": "", "name": "q"}, "latex_symbol_list": {"group": "Lists of symbols", "templateType": "anything", "definition": "[\"p\",\"q\",\"\\\\neg p\",\"\\\\neg q\",\"r\",\"\\\\neg r\"]", "description": "", "name": "latex_symbol_list"}, "pre_ev3": {"group": "Last ", "templateType": "anything", "definition": "map(evaluate(convch(a2),[bool_p[t],bool_q[t],bool_r[t]]),t,0..7)", "description": "", "name": "pre_ev3"}, "ev2": {"group": "Second Bracket", "templateType": "anything", "definition": "bool_to_label(pre_ev2)", "description": "", "name": "ev2"}, "bool_r": {"group": "Truth values", "templateType": "anything", "definition": "list_to_boolean(list(logic_values[2]))", "description": "", "name": "bool_r"}, "b1": {"group": "Second Bracket", "templateType": "anything", "definition": "latex(latex_symbol_list[s[3]])", "description": "", "name": "b1"}, "t_value": {"group": "First and Second Brackets", "templateType": "anything", "definition": "bool_to_label(pre_t_value)", "description": "", "name": "t_value"}, "r": {"group": "Truth values", "templateType": "anything", "definition": "bool_to_label(list_to_boolean(list(logic_values[2])))", "description": "", "name": "r"}, "pre_ev2": {"group": "Second Bracket", "templateType": "anything", "definition": "map(evaluate(convch(a1)+\" \"+conv(op2)+\" \"+convch(b1),[bool_p[t],bool_q[t],bool_r[t]]),t,0..7)", "description": "", "name": "pre_ev2"}, "pre_final_value": {"group": "Ungrouped variables", "templateType": "anything", "definition": "map(evaluate(pre_t_value[t]+\" \"+conv(op4)+\" \"+pre_ev3[t],[]),t,0..7)", "description": "", "name": "pre_final_value"}, "logic_symbol_list": {"group": "Lists of symbols", "templateType": "anything", "definition": "[\"p\",\"q\",\"not p\",\"not q\",\"r\",\"not r\"]", "description": "", "name": "logic_symbol_list"}, "s": {"group": "Lists of symbols", "templateType": "anything", "definition": "repeat(random(0..5),6)", "description": "", "name": "s"}, "bool_q": {"group": "Truth values", "templateType": "anything", "definition": "list_to_boolean(list(logic_values[1]))", "description": "", "name": "bool_q"}, "op1": {"group": "First and Second Brackets", "templateType": "anything", "definition": "latex(random(\"\\\\lor\",\"\\\\land\",\"\\\\to\"))", "description": "", "name": "op1"}, "pre_t_value": {"group": "First and Second Brackets", "templateType": "anything", "definition": "map(evaluate(pre_ev1[t]+\" \"+conv(op1)+\" \"+pre_ev2[t],[]),t,0..7)", "description": "", "name": "pre_t_value"}}, "ungrouped_variables": ["pre_final_value", "op4", "logic_values", "final_value"], "functions": {"conv": {"type": "string", "language": "jme", "definition": "switch(op=\"\\\\land\",\"and\",op=\"\\\\lor\",\"or\",\"implies\")", "parameters": [["op", "string"]]}, "cart": {"type": "list", "language": "jme", "definition": "if(n=2,[[true,true],[true,false],[false,true],[false,false]],map([true]+cart(n-1)[x],x,0..2^(n-1)-1)+map([false]+cart(n-1)[x],x,0..2^(n-1)-1))", "parameters": [["n", "number"]]}, "evaluate": {"type": "number", "language": "javascript", "definition": "return scope.evaluate(expr);", "parameters": [["expr", "string"], ["dependencies", "list"]]}, "bool_matrix": {"type": "matrix", "language": "jme", "definition": "matrix(map(map(if(c,1,0),c,row),row,m))", "parameters": [["m", "list"]]}, "convch": {"type": "string", "language": "jme", "definition": "switch(ch=\"\\\\neg p\",\"not bool_p[t]\",ch=\"\\\\neg q\",\"not bool_q[t]\",ch=\"p\",\"bool_p[t]\",ch=\"q\",\"bool_q[t]\",ch=\"r\",\"bool_r[t]\",\"not bool_r[t]\")", "parameters": [["ch", "string"]]}, "bool_to_label": {"type": "number", "language": "jme", "definition": "map(if(l[x],'T','F'),x,0..length(l)-1)", "parameters": [["l", "list"]]}, "list_to_boolean": {"type": "list", "language": "jme", "definition": "map(if(l[x]<>0,true,false),x,0..length(l)-1)", "parameters": [["l", "list"]]}}, "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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$p$$q$$r$$((\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1}))\\var{op4}\\var{a2} $
$\\var{p[0]}$$\\var{q[0]}$$\\var{r[0]}$[[0]]
$\\var{p[1]}$$\\var{q[1]}$$\\var{r[1]}$[[1]]
$\\var{p[2]}$$\\var{q[2]}$$\\var{r[2]}$[[2]]
$\\var{p[3]}$$\\var{q[3]}$$\\var{r[3]}$[[3]]
$\\var{p[4]}$$\\var{q[4]}$$\\var{r[4]}$[[4]]
$\\var{p[5]}$$\\var{q[5]}$$\\var{r[5]}$[[5]]
$\\var{p[6]}$$\\var{q[6]}$$\\var{r[6]}$[[6]]
$\\var{p[7]}$$\\var{q[7]}$$\\var{r[7]}$[[7]]
", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "useCustomName": false, "customName": "", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"answer": "{final_value[0]}", "displayAnswer": "{final_value[0]}", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "customName": "", "unitTests": [], "matchMode": "regex", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "showCorrectAnswer": true, "variableReplacements": [], "marks": 1}, {"answer": "{final_value[1]}", "displayAnswer": "{final_value[1]}", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "customName": "", "unitTests": [], "matchMode": "regex", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "showCorrectAnswer": true, "variableReplacements": [], "marks": 1}, {"answer": "{final_value[2]}", "displayAnswer": "{final_value[2]}", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "customName": "", "unitTests": [], "matchMode": "regex", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "showCorrectAnswer": true, "variableReplacements": [], "marks": 1}, {"answer": "{final_value[3]}", "displayAnswer": "{final_value[3]}", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "customName": "", "unitTests": [], "matchMode": "regex", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "showCorrectAnswer": true, "variableReplacements": [], "marks": 1}, {"answer": "{final_value[4]}", "displayAnswer": "{final_value[4]}", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "customName": "", "unitTests": [], "matchMode": "regex", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "showCorrectAnswer": true, "variableReplacements": [], "marks": 1}, {"answer": "{final_value[5]}", "displayAnswer": "{final_value[5]}", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "customName": "", "unitTests": [], "matchMode": "regex", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "showCorrectAnswer": true, "variableReplacements": [], "marks": 1}, {"answer": "{final_value[6]}", "displayAnswer": "{final_value[6]}", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "customName": "", "unitTests": [], "matchMode": "regex", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "showCorrectAnswer": true, "variableReplacements": [], "marks": 1}, {"answer": "{final_value[7]}", "displayAnswer": "{final_value[7]}", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "customName": "", "unitTests": [], "matchMode": "regex", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "patternmatch", "showCorrectAnswer": true, "variableReplacements": [], "marks": 1}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}], "variablesTest": {"condition": "a1 <>b1 and\nif(a='p' or a='\\\\neg p',b=random('q','\\\\neg q'),b=random('p','\\\\neg p'))\n", "maxRuns": "150"}, "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}.\\]

\n

\n

Enter T if true, else enter F.

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n

", "tags": [], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "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 $ where each of $a, \\;b,\\;c,\\;d,\\;e$ can be one the Boolean variables $p,\\;q,\\;r,\\;\\neg p,\\;\\neg q,\\;\\neg r$ and each of $\\operatorname{op1},\\;\\operatorname{op2},\\;\\operatorname{op3},\\;\\operatorname{op4}$ one of $\\lor,\\;\\land,\\;\\to$.

\n

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

"}, "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\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$$r$$\\var{a} \\var{op} \\var{b}$
$\\var{p[0]}$$\\var{q[0]}$$\\var{r[0]}$$\\var{ev1[0]}$
$\\var{p[1]}$$\\var{q[1]}$$\\var{r[1]}$$\\var{ev1[1]}$
$\\var{p[2]}$$\\var{q[2]}$$\\var{r[2]}$$\\var{ev1[2]}$
$\\var{p[3]}$$\\var{q[3]}$$\\var{r[3]}$$\\var{ev1[3]}$
$\\var{p[4]}$$\\var{q[4]}$$\\var{r[4]}$$\\var{ev1[4]}$
$\\var{p[5]}$$\\var{q[5]}$$\\var{r[5]}$$\\var{ev1[5]}$
$\\var{p[6]}$$\\var{q[6]}$$\\var{r[6]}$$\\var{ev1[6]}$
$\\var{p[7]}$$\\var{q[7]}$$\\var{r[7]}$$\\var{ev1[7]}$
\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\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$$r$$\\var{a1} \\var{op2} \\var{b1}$
$\\var{p[0]}$$\\var{q[0]}$$\\var{r[0]}$$\\var{ev2[0]}$
$\\var{p[1]}$$\\var{q[1]}$$\\var{r[1]}$$\\var{ev2[1]}$
$\\var{p[2]}$$\\var{q[2]}$$\\var{r[2]}$$\\var{ev2[2]}$
$\\var{p[3]}$$\\var{q[3]}$$\\var{r[3]}$$\\var{ev2[3]}$
$\\var{p[4]}$$\\var{q[4]}$$\\var{r[4]}$$\\var{ev2[4]}$
$\\var{p[5]}$$\\var{q[5]}$$\\var{r[5]}$$\\var{ev2[5]}$
$\\var{p[6]}$$\\var{q[6]}$$\\var{r[6]}$$\\var{ev2[6]}$
$\\var{p[7]}$$\\var{q[7]}$$\\var{r[7]}$$\\var{ev2[7]}$
\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\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$$r$$\\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{p[0]}$$\\var{q[0]}$$\\var{r[0]}$$\\var{ev1[0]}$$\\var{ev2[0]}$$\\var{t_value[0]}$
$\\var{p[1]}$$\\var{q[1]}$$\\var{r[1]}$$\\var{ev1[1]}$$\\var{ev2[1]}$$\\var{t_value[1]}$
$\\var{p[2]}$$\\var{q[2]}$$\\var{r[2]}$$\\var{ev1[2]}$$\\var{ev2[2]}$$\\var{t_value[2]}$
$\\var{p[3]}$$\\var{q[3]}$$\\var{r[3]}$$\\var{ev1[3]}$$\\var{ev2[3]}$$\\var{t_value[3]}$
$\\var{p[4]}$$\\var{q[4]}$$\\var{r[4]}$$\\var{ev1[4]}$$\\var{ev2[4]}$$\\var{t_value[4]}$
$\\var{p[5]}$$\\var{q[5]}$$\\var{r[5]}$$\\var{ev1[5]}$$\\var{ev2[5]}$$\\var{t_value[5]}$
$\\var{p[6]}$$\\var{q[6]}$$\\var{r[6]}$$\\var{ev1[6]}$$\\var{ev2[6]}$$\\var{t_value[6]}$
$\\var{p[7]}$$\\var{q[7]}$$\\var{r[7]}$$\\var{ev1[7]}$$\\var{ev2[7]}$$\\var{t_value[7]}$
\n

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

\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\n\n\n
$\\var{c2}$$\\var{a2}$
$\\var{d2[0]}$$\\var{ev3[0]}$
$\\var{d2[1]}$$\\var{ev3[1]}$
$\\var{d2[2]}$$\\var{ev3[2]}$
$\\var{d2[3]}$$\\var{ev3[3]}$
$\\var{d2[4]}$$\\var{ev3[4]}$
$\\var{d2[5]}$$\\var{ev3[5]}$
$\\var{d2[6]}$$\\var{ev3[6]}$
$\\var{d2[7]}$$\\var{ev3[7]}$
\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\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$$r$$(\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1})$$\\var{a2}$$((\\var{a} \\var{op} \\var{b})\\var{op1}(\\var{a1} \\var{op2} \\var{b1}))\\var{op4}\\var{a2} $
$\\var{p[0]}$$\\var{q[0]}$$\\var{r[0]}$$\\var{t_value[0]}$$\\var{ev3[0]}$$\\var{final_value[0]}$
$\\var{p[1]}$$\\var{q[1]}$$\\var{r[1]}$$\\var{t_value[1]}$$\\var{ev3[1]}$$\\var{final_value[1]}$
$\\var{p[2]}$$\\var{q[2]}$$\\var{r[2]}$$\\var{t_value[2]}$$\\var{ev3[2]}$$\\var{final_value[2]}$
$\\var{p[3]}$$\\var{q[3]}$$\\var{r[3]}$$\\var{t_value[3]}$$\\var{ev3[3]}$$\\var{final_value[3]}$
$\\var{p[4]}$$\\var{q[4]}$$\\var{r[4]}$$\\var{t_value[4]}$$\\var{ev3[4]}$$\\var{final_value[4]}$
$\\var{p[5]}$$\\var{q[5]}$$\\var{r[5]}$$\\var{t_value[5]}$$\\var{ev3[5]}$$\\var{final_value[5]}$
$\\var{p[6]}$$\\var{q[6]}$$\\var{r[6]}$$\\var{t_value[6]}$$\\var{ev3[6]}$$\\var{final_value[6]}$
$\\var{p[7]}$$\\var{q[7]}$$\\var{r[7]}$$\\var{t_value[7]}$$\\var{ev3[7]}$$\\var{final_value[7]}$
"}, {"name": "Predicates ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "ungrouped_variables": ["choices", "logic_exp", "t", "mm0", "mm1", "mm2"], "tags": ["logic", "logical expressions", "propositions"], "advice": "", "rulesets": {}, "parts": [{"maxAnswers": 0, "prompt": "

Let $p$ and $q$ denote respectively the propositions '{choices[0][0]}' and '{choices[0][1]}'.

", "matrix": "mm0", "shuffleAnswers": true, "minAnswers": 0, "marks": 0, "variableReplacements": [], "answers": ["{logic_exp[0]}", "{logic_exp[1]}", "{logic_exp[2]}", "{logic_exp[3]}", "{logic_exp[4]}", "{logic_exp[5]}", "{logic_exp[6]}", "{logic_exp[7]}", "{logic_exp[8]}"], "choices": ["{choices[0][2]}", "{choices[0][3]}", "{choices[0][4]}", "{choices[0][5]}"], "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "maxMarks": 0, "scripts": {}, "warningType": "none", "showCorrectAnswer": true, "type": "m_n_x", "shuffleChoices": true, "minMarks": 0, "layout": {"type": "all", "expression": ""}}, {"maxAnswers": 0, "prompt": "

Let $p$ and $q$ denote respectively the propositions '{choices[1][0]}' and '{choices[1][1]}'.

", "matrix": "mm1", "shuffleAnswers": true, "minAnswers": 0, "marks": 0, "variableReplacements": [], "answers": ["{logic_exp[0]}", "{logic_exp[1]}", "{logic_exp[2]}", "{logic_exp[3]}", "{logic_exp[4]}", "{logic_exp[5]}", "{logic_exp[6]}", "{logic_exp[7]}", "{logic_exp[8]}"], "choices": ["{choices[1][2]}", "{choices[1][3]}", "{choices[1][4]}", "{choices[1][5]}"], "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "maxMarks": 0, "scripts": {}, "warningType": "none", "showCorrectAnswer": true, "type": "m_n_x", "shuffleChoices": true, "minMarks": 0, "layout": {"type": "all", "expression": ""}}, {"maxAnswers": 0, "prompt": "

Let $p$ and $q$ denote respectively the propositions '{choices[2][0]}' and '{choices[2][1]}'.

", "matrix": "mm2", "shuffleAnswers": true, "minAnswers": 0, "marks": 0, "variableReplacements": [], "answers": ["{logic_exp[0]}", "{logic_exp[1]}", "{logic_exp[2]}", "{logic_exp[3]}", "{logic_exp[4]}", "{logic_exp[5]}", "{logic_exp[6]}", "{logic_exp[7]}", "{logic_exp[8]}"], "choices": ["{choices[2][2]}", "{choices[2][3]}", "{choices[2][4]}", "{choices[2][5]}"], "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "maxMarks": 0, "scripts": {}, "warningType": "none", "showCorrectAnswer": true, "type": "m_n_x", "shuffleChoices": true, "minMarks": 0, "layout": {"type": "all", "expression": ""}}], "statement": "

Choose the correct logical expression  for the following English sentences.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"mm1": {"definition": "map(map(if(choices[1][6][y]=x,1,0),x,0..8),y,0..3)", "templateType": "anything", "group": "Ungrouped variables", "name": "mm1", "description": ""}, "mm0": {"definition": "map(map(if(choices[0][6][y]=x,1,0),x,0..8),y,0..3)", "templateType": "anything", "group": "Ungrouped variables", "name": "mm0", "description": ""}, "mm2": {"definition": "map(map(if(choices[2][6][y]=x,1,0),x,0..8),y,0..3)", "templateType": "anything", "group": "Ungrouped variables", "name": "mm2", "description": ""}, "t": {"definition": "random(0,1,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "t", "description": ""}, "choices": {"definition": "[['It is snowing','I will go skiing',\n 'As it is not snowing I will go skiing.',\n 'It will snow if I don\\'t go skiing.',\n 'I will go skiing if it is snowing.',\n 'It is snowing and I may or may not go skiing.',\n [2,8,4,6,0,1,3,7,5]\n ],\n ['I am working at my studies', 'I am in the library',\n 'I am working at my studies in the library.',\n 'If I use the library then I am working at my studies.',\n 'If I am working at my studies then I am not in the library.',\n 'If I am in the library then I may not be working at my studies.',\n [1,7,0,6,8,2,3,4,5]\n ],\n ['It is sunny','I will carry an umbrella',\n 'If it is not sunny then I will carry an umbrella.',\n 'I carry an umbrella even if it is sunny.',\n 'If it is sunny then I may carry an umbrella.',\n 'If I carry an umbrella then the day always turns out to be sunny!',\n [8,4,6,7,0,1,2,5,3]\n \n]\n \n]", "templateType": "anything", "group": "Ungrouped variables", "name": "choices", "description": ""}, "logic_exp": {"definition": "['$\\\\neg p \\\\lor \\\\neg q$', \n '$p \\\\land q$', \n '$\\\\neg p \\\\land q$',\n '$p \\\\land \\\\neg q$',\n '$p \\\\to q$',\n '$\\\\neg p \\\\land \\\\neg q$',\n '$(p \\\\lor \\\\neg q) \\\\land p$',\n '$q \\\\to p$',\n '$\\\\neg p \\\\to q$'\n ]", "templateType": "anything", "group": "Ungrouped variables", "name": "logic_exp", "description": ""}}, "metadata": {"notes": "", "description": "

Given sentences involving propositions translate into logical expressions.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Pelle's copy of Ashley's copy of Andrew's copy of Matrices: Cramers Rule 3x3", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Pelle Englund", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2073/"}], "preamble": {"css": "", "js": ""}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["matrixA", "a11", "a12", "a21", "a22", "a13", "a23", "a31", "a32", "a33", "x1", "x2", "x3", "c1", "c2", "c3"], "variable_groups": [{"variables": ["matrixA1", "matrixA2", "matrixA3"], "name": "Cramer determinants"}], "variables": {"a31": {"group": "Ungrouped variables", "description": "", "definition": "random(0..10)", "templateType": "anything", "name": "a31"}, "a32": {"group": "Ungrouped variables", "description": "", "definition": "random(0..10)", "templateType": "anything", "name": "a32"}, "a21": {"group": "Ungrouped variables", "description": "", "definition": "random(0..10)", "templateType": "anything", "name": "a21"}, "a23": {"group": "Ungrouped variables", "description": "", "definition": "random(0..10)", "templateType": "anything", "name": "a23"}, "matrixA1": {"group": "Cramer determinants", "description": "", "definition": "matrix([c1,a12,a13],[c2,a22,a23],[c3,a32,a33])", "templateType": "anything", "name": "matrixA1"}, "a12": {"group": "Ungrouped variables", "description": "", "definition": "random(0..10)", "templateType": "anything", "name": "a12"}, "c2": {"group": "Ungrouped variables", "description": "", "definition": "a21*x1+a22*x2+a23*x3", "templateType": "anything", "name": "c2"}, "x2": {"group": "Ungrouped variables", "description": "", "definition": "random(-10..10 except 0)", "templateType": "anything", "name": "x2"}, "x1": {"group": "Ungrouped variables", "description": "", "definition": "random(-10..10 except 0)", "templateType": "anything", "name": "x1"}, "c1": {"group": "Ungrouped variables", "description": "", "definition": "a11*x1+a12*x2+a13*x3", "templateType": "anything", "name": "c1"}, "a33": {"group": "Ungrouped variables", "description": "", "definition": "random(0..10)", "templateType": "anything", "name": "a33"}, "a11": {"group": "Ungrouped variables", "description": "", "definition": "random(0..10)", "templateType": "anything", "name": "a11"}, "c3": {"group": "Ungrouped variables", "description": "", "definition": "a31*x1+a32*x2+a33*x3", "templateType": "anything", "name": "c3"}, "matrixA3": {"group": "Cramer determinants", "description": "", "definition": "matrix([a11,a12,c1],[a21,a22,c2],[a31,a32,c3])", "templateType": "anything", "name": "matrixA3"}, "a13": {"group": "Ungrouped variables", "description": "", "definition": "random(0..10)", "templateType": "anything", "name": "a13"}, "x3": {"group": "Ungrouped variables", "description": "", "definition": "random(-10..10 except 0)", "templateType": "anything", "name": "x3"}, "a22": {"group": "Ungrouped variables", "description": "", "definition": "random(0..10 except(a21*a12/a11))", "templateType": "anything", "name": "a22"}, "matrixA2": {"group": "Cramer determinants", "description": "", "definition": "matrix([a11,c1,a13],[a21,c2,a23],[a31,c3,a33])", "templateType": "anything", "name": "matrixA2"}, "matrixA": {"group": "Ungrouped variables", "description": "", "definition": "matrix([a11,a12,a13],[a21,a22,a23],[a31,a32,a33])", "templateType": "anything", "name": "matrixA"}}, "tags": [], "statement": "

Using Cramer's rule , solve the system of equations:

\n

$\\var{a11}x+\\var{a12}y+\\var{a13}z=\\var{c1}$

\n

$\\var{a21}x+\\var{a22}y+\\var{a23}z=\\var{c2}$

\n

$\\var{a31}x+\\var{a32}y+\\var{a33}z=\\var{c3}$

\n

\n

", "rulesets": {}, "parts": [{"type": "gapfill", "scripts": {}, "showFeedbackIcon": true, "gaps": [{"mustBeReducedPC": 0, "scripts": {}, "correctAnswerStyle": "plain", "allowFractions": false, "marks": 1, "correctAnswerFraction": false, "maxValue": "det(matrixA)", "showFeedbackIcon": true, "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "showCorrectAnswer": true, "minValue": "det(matrixA)", "notationStyles": ["plain", "en", "si-en"]}], "variableReplacementStrategy": "originalfirst", "prompt": "

What is the determinant of A=$\\var{matrixA}$?

\n

[[0]]

", "variableReplacements": [], "marks": 0, "showCorrectAnswer": true}, {"type": "gapfill", "scripts": {}, "showFeedbackIcon": true, "gaps": [{"mustBeReducedPC": 0, "scripts": {}, "correctAnswerStyle": "plain", "allowFractions": false, "marks": 1, "correctAnswerFraction": false, "maxValue": "det(matrixA1)", "showFeedbackIcon": true, "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "showCorrectAnswer": true, "minValue": "det(matrixA1)", "notationStyles": ["plain", "en", "si-en"]}, {"mustBeReducedPC": 0, "scripts": {}, "correctAnswerStyle": "plain", "allowFractions": false, "marks": 1, "correctAnswerFraction": false, "maxValue": "{x1}", "showFeedbackIcon": true, "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "showCorrectAnswer": true, "minValue": "{x1}", "notationStyles": ["plain", "en", "si-en"]}], "variableReplacementStrategy": "originalfirst", "prompt": "

Calculate $\\Delta_1$ [[0]]

\n

Hence, calculate ${x_1}$  [[1]]

", "variableReplacements": [], "marks": 0, "showCorrectAnswer": true}, {"type": "gapfill", "scripts": {}, "showFeedbackIcon": true, "gaps": [{"mustBeReducedPC": 0, "scripts": {}, "correctAnswerStyle": "plain", "allowFractions": false, "marks": 1, "correctAnswerFraction": false, "maxValue": "det(matrixA2)", "showFeedbackIcon": true, "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "showCorrectAnswer": true, "minValue": "det(matrixA2)", "notationStyles": ["plain", "en", "si-en"]}, {"mustBeReducedPC": 0, "scripts": {}, "correctAnswerStyle": "plain", "allowFractions": false, "marks": 1, "correctAnswerFraction": false, "maxValue": "{x2}", "showFeedbackIcon": true, "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "showCorrectAnswer": true, "minValue": "{x2}", "notationStyles": ["plain", "en", "si-en"]}], "variableReplacementStrategy": "originalfirst", "prompt": "

Calculate $\\Delta_2$[[0]]

\n

Hence, calculate ${y}$  [[1]]

", "variableReplacements": [], "marks": 0, "showCorrectAnswer": true}, {"type": "gapfill", "scripts": {}, "showFeedbackIcon": true, "gaps": [{"mustBeReducedPC": 0, "scripts": {}, "correctAnswerStyle": "plain", "allowFractions": false, "marks": 1, "correctAnswerFraction": false, "maxValue": "det(matrixA3)", "showFeedbackIcon": true, "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "showCorrectAnswer": true, "minValue": "det(matrixA3)", "notationStyles": ["plain", "en", "si-en"]}, {"mustBeReducedPC": 0, "scripts": {}, "correctAnswerStyle": "plain", "allowFractions": false, "marks": 1, "correctAnswerFraction": false, "maxValue": "{x3}", "showFeedbackIcon": true, "variableReplacements": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "showCorrectAnswer": true, "minValue": "{x3}", "notationStyles": ["plain", "en", "si-en"]}], "variableReplacementStrategy": "originalfirst", "prompt": "

Calculate $\\Delta_3$[[0]]

\n

Hence, calculate ${z}$  [[1]]

", "variableReplacements": [], "marks": 0, "showCorrectAnswer": true}], "advice": "

If \\[  A=\\left( \\begin{array}{ccc}
a_{11} & a_{12} & a_{13} \\\\a_{21} & a_{22} & a_{23}\\\\ a_{31} & a_{32} & a_{33}\\end{array} \\right),\\]

\n

\\[  C=\\left( \\begin{array}{ccc}
c_{1} \\\\ c_{2} \\\\c_{3} \\end{array} \\right),\\]

\n

Cramer's Rule : ${x_1}=\\frac{\\Delta_1}{\\Delta_0}$ ,  ${x_2}=\\frac{\\Delta_2}{\\Delta_0}$ , ${x_3}=\\frac{\\Delta_3}{\\Delta_0}$

\n

Where:\\[ \\Delta_0=\\left| \\begin{array}{ccc}
a_{11} & a_{12} & a_{13} \\\\a_{21} & a_{22} & a_{23}\\\\ a_{31} & a_{32} & a_{33}\\end{array} \\right|\\]

\n

\\[ \\Delta_1=\\left| \\begin{array}{ccc}
c_{1} & a_{12} & a_{13} \\\\c_{2} & a_{22} & a_{23}\\\\ c_{3} & a_{32} & a_{33}\\end{array} \\right|\\]

\n

\\[ \\Delta_2=\\left| \\begin{array}{ccc}
a_{11} & c_{1} & a_{13} \\\\a_{21} & c_{2} & a_{23}\\\\ a_{31} & c_{3} & a_{33}\\end{array} \\right|\\]

\n

\\[ \\Delta_3=\\left| \\begin{array}{ccc}
a_{11} & a_{12} & c_{1} \\\\a_{21} & a_{22} & c_{2}\\\\ a_{31} & a_{32} & c_{3}\\end{array} \\right|\\]

\n

 

\n

 

\n

 

\n

", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Cramers Rule applied to 3 simultaneous equations

"}, "functions": {}, "type": "question"}]}], "allowPrinting": false, "navigation": {"allowregen": false, "reverse": true, "browse": true, "allowsteps": false, "showfrontpage": true, "showresultspage": "oncompletion", "navigatemode": "sequence", "onleave": {"action": "warnifunattempted", "message": ""}, "preventleave": true, "startpassword": "fall2021"}, "timing": {"allowPause": false, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "warn", "message": ""}}, "feedback": {"showactualmark": false, "showtotalmark": false, "showanswerstate": false, "allowrevealanswer": false, "advicethreshold": 0, "intro": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "feedbackmessages": []}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "contributors": [{"name": "Amine SAAD", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14925/"}], "extensions": ["stats"], "custom_part_types": [], "resources": []}