// Numbas version: finer_feedback_settings {"name": "COM PGT 2025/26", "metadata": {"description": "

Post Graduate Taught COM programmes

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": false, "shuffleQuestionGroups": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], "variable_overrides": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], "questions": [{"name": "PA1 - Discrete Random Variable", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Lauren Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21504/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}, {"name": "Megan Oliver", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/23526/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

A random variable is a function that assigns a real number to each element of a sample space.

", "advice": "

a) Since we have a uniform distribution, each event is equally as likely to occur therefore the probability of each outcome is one divided by the total number of possible values which is $\\frac{1}{\\var{number}}$.

\n

b) Probabilites must add up to one. We can show this is the case by calculating $\\frac{1}{\\var{number}}\\times\\var{number}=\\frac{\\var{number}}{\\var{number}}={1}$.

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"number": {"name": "number", "group": "Ungrouped variables", "definition": "random(3 .. 7#1)", "description": "

Number of elements in sample space

", "templateType": "randrange", "can_override": false}, "set": {"name": "set", "group": "Ungrouped variables", "definition": "if(number=3,\"Red, Blue, Green\",if(number=4,\"Red, Blue, Green, Orange\",if(number=5,\"Red, Blue, Green, Orange, Pink\",if(number=6,\"Red, Blue, Green, Orange, Pink, Purple\",if(number=7,\"Red, Blue, Green, Orange, Pink, Purple, Yellow\",\"error\")))))", "description": "

Our sample space

", "templateType": "anything", "can_override": false}, "bracket_left": {"name": "bracket_left", "group": "Ungrouped variables", "definition": "\"{\"", "description": "", "templateType": "string", "can_override": false}, "bracket_right": {"name": "bracket_right", "group": "Ungrouped variables", "definition": "\"}\"", "description": "", "templateType": "string", "can_override": false}, "probability": {"name": "probability", "group": "Ungrouped variables", "definition": "1/number", "description": "

Probability of each event occuring

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["number", "set", "bracket_left", "bracket_right", "probability"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "a)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

If discrete random variable $X$ can take {number} possible values {bracket_left}{set}{bracket_right} and it has a uniform distribution, what is the probability of each outcome?

", "minValue": "probability", "maxValue": "probability", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "b)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What do all the probabilities of all the possible outcomes of a single event have to add up to?

", "minValue": "1", "maxValue": "1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "PA2 - Continuous Random Variables", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Lauren Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21504/"}, {"name": "Megan Oliver", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/23526/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Let $Y$ be a continuous random variable. Its probability density is $p(Y)$.

", "advice": "

a) A probabilty density function must satisfy the following properties:

\n\n

b) Calculating the integral we find,

\n

$\\int_{a}^b \\frac{1}{b-a} dx = \\left[ \\frac{x}{b-a} \\right]_a^b = \\frac{b}{b-a} - \\frac{a}{b-a} = \\frac{b-a}{b-a} = 1.$

\n

In part a) we see that one of the properties of a probability density function is that $\\int_{a}^b \\frac{1}{b-a} dx = 1$. Hence, calculating $\\int_{a}^b f_X(x) dx = 1$ means that all of the probability mass lies in the interval $[a,b]$.

\n

c) Expected value, $E[X]$ is calculated using the following formula, $E[X] = \\int_{-\\infty}^\\infty xf_X(x) dx.$

\n

Hence, 

\n

$E[X] = \\int_a^b \\frac{x}{b-a} dx = \\left[ \\frac{x^2}{2(b-a)} \\right]_a^b = \\frac{b^2-a^2}{2(b-a)}.$

\n

At this point we can use the sum of squares formula, $b^2-a^2 = (b+a)(b-a)$, to simplify the expression. So,

\n

$E[X] = \\frac{(b+a)(b-a)}{2(b-a)} = \\frac{b+a}{2}$.

\n

Use this link to find some resources which will help you revise this topic.

\n

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "m_n_2", "useCustomName": true, "customName": "a)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What properties must $p(Y)$ satisfy to be a probability density function?

", "minMarks": 0, "maxMarks": "2", "shuffleChoices": true, "displayType": "checkbox", "displayColumns": 0, "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "markingMethod": "score per matched cell", "choices": ["$\\int_{-\\infty}^\\infty p(Y) dY= 1$", "$\\int_{-\\infty}^\\infty p(Y) dY = \\infty$", "$p(Y)\\ge 0, \\forall y\\in\\mathbb{R}$", "$p(Y)\\ge 1, \\forall y\\in\\mathbb{R}$"], "matrix": ["1", 0, "1", 0], "distractors": ["", "", "", ""]}, {"type": "gapfill", "useCustomName": true, "customName": "b)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

A uniform continuous random variable, $X$ (non-zero between $a$ and $b$) is defined to have a probability density function of

\n

$f_X(x) = \\begin{cases} \\frac{1}{b - a} & a \\le x \\le b, \\\\ 0 & \\text{otherwise} \\end{cases}$

\n

Find the probability mass that lies in the interval $[a,b]$ by calculating $\\int_{a}^b \\frac{1}{b-a} dx=$ [[0]].

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "1", "maxValue": "1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "jme", "useCustomName": true, "customName": "c)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is the expected value of $X$ in terms of $a$ and $b$?

", "answer": "(b+a)/2", "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": [{"name": "a", "value": ""}, {"name": "b", "value": ""}]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "PA3 - Expected Value & Variance", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Lauren Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21504/"}, {"name": "Megan Oliver", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/23526/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

The probability density function of a random variable is:

\n

$f_Y(y) = \\begin{cases} \\var{function} & 0 \\le y \\le 1, \\\\ 0 & \\text{otherwise} \\end{cases}$

", "advice": "

{advice}

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"function0": {"name": "function0", "group": "Function0", "definition": "expression(safe(\"2y\"))", "description": "

function

", "templateType": "mathematical expression", "can_override": false}, "prob0": {"name": "prob0", "group": "Function0", "definition": "0.25", "description": "

P(y<0.5)

", "templateType": "anything", "can_override": false}, "expected0": {"name": "expected0", "group": "Function0", "definition": "expression(safe(\"2/3\"))", "description": "

Expected value

", "templateType": "mathematical expression", "can_override": false}, "squared0": {"name": "squared0", "group": "Function0", "definition": "expression(safe(\"0.5\"))", "description": "

Expected value to the power of 2

", "templateType": "mathematical expression", "can_override": false}, "variance0": {"name": "variance0", "group": "Function0", "definition": "expression(safe(\"1/18\"))", "description": "

Variance

", "templateType": "mathematical expression", "can_override": false}, "random": {"name": "random", "group": "Ungrouped variables", "definition": "random(0,1,0,1)", "description": "

Random number to decide which function will appear in the question 

", "templateType": "anything", "can_override": false}, "function": {"name": "function", "group": "Ungrouped variables", "definition": "if(random=0,function0,if(random=1,function1,0))", "description": "

Function selected to appear in the question 

", "templateType": "anything", "can_override": false}, "function1": {"name": "function1", "group": "Function1", "definition": "expression(safe(\"3y^2\"))", "description": "

Function 

", "templateType": "mathematical expression", "can_override": false}, "prob": {"name": "prob", "group": "Ungrouped variables", "definition": "if(random=0,prob0,if(random=1,prob1,0))", "description": "

P(y<1) for selected function 

", "templateType": "anything", "can_override": false}, "expected": {"name": "expected", "group": "Ungrouped variables", "definition": "if(random=0,expected0,if(random=1,expected1,0))", "description": "

Expected value for seleceted function 

", "templateType": "anything", "can_override": false}, "variance": {"name": "variance", "group": "Ungrouped variables", "definition": "if(random=0,variance0,if(random=1,variance1,0))", "description": "

variance for selected function 

", "templateType": "anything", "can_override": false}, "squared": {"name": "squared", "group": "Ungrouped variables", "definition": "if(random=0,squared0,if(random=1,squared1,0))", "description": "

Expected value to the power of two for selected function 

", "templateType": "anything", "can_override": false}, "prob1": {"name": "prob1", "group": "Function1", "definition": "0.125", "description": "

P(y<0.5)

", "templateType": "anything", "can_override": false}, "expected1": {"name": "expected1", "group": "Function1", "definition": "expression(safe(\"0.75\"))", "description": "

expected value 

", "templateType": "mathematical expression", "can_override": false}, "squared1": {"name": "squared1", "group": "Function1", "definition": "expression(safe(\"0.6\"))", "description": "

Expected value to the power of 2

", "templateType": "mathematical expression", "can_override": false}, "variance1": {"name": "variance1", "group": "Function1", "definition": "expression(safe(\"0.0375\"))", "description": "

Variance

", "templateType": "mathematical expression", "can_override": false}, "advice0": {"name": "advice0", "group": "Function0", "definition": "\"

a) To calculate $P(y<0.5)$ we must solve $\\\\int_0^{0.5} 2y dy.$

\\n

So, 

\\n

\\\\begin{align}\\\\int_0^{0.5} 2y dy &= \\\\left[y^2\\\\right]_0^{0.5} \\\\\\\\
&= (0.5)^{2} - (0)^{2} \\\\\\\\
&= 0.25 \\\\end{align}

\\n

Hence, $P(y<0.5) = 0.25.$

\\n

b) The formula for expected value is:

\\n

$E[Y] = \\\\int_{-\\\\infty}^{\\\\infty} y.f(y) dy.$

So,
\\\\begin{align}
E[Y] &= \\\\int_0^{1}y.2y dy \\\\\\\\
&= \\\\int_0^{1} 2y^2 dy \\\\\\\\
&= \\\\left[\\\\frac{2}{3}y^3\\\\right]_0^{1} \\\\\\\\
&= \\\\frac{2}{3}\\\\times1^3 - \\\\frac{2}{3} \\\\times 0^3 \\\\\\\\
&= \\\\frac{2}{3}.
\\\\end{align}

Hence, $E[Y] = \\\\frac{2}{3}$.


c)  Our formula for $E[Y^2]$ is:

$E\\\\left[Y^2\\\\right] = \\\\int_{-\\\\infty}^{\\\\infty} y^2.f(y) dy.$

\\n

So,

\\n

\\\\begin{align}
E\\\\left[Y^2\\\\right] &= \\\\int_{0}^{1} y^2.2y dy \\\\\\\\
&= \\\\int_{0}^{1} 2y^3 dy \\\\\\\\
&= \\\\left[\\\\frac{2}{4}y^4\\\\right]_0^{1} \\\\\\\\
&= \\\\frac{2}{4}\\\\times1^4 - \\\\frac{2}{4} \\\\times 0^4 \\\\\\\\
&= \\\\frac{2}{4} \\\\\\\\
&= 0.5.
\\\\end{align}

\\n

Hence, $E\\\\left[Y^2\\\\right] = 0.5$.

\\n

d) Now we can use everything we\\'ve calculated so far to find the variance,

\\n

\\\\begin{align}
E\\\\left[Y^2\\\\right] - E[Y]^2 &= 0.5 - \\\\left(\\\\frac{2}{3}\\\\right)^2 \\\\\\\\
&= 0.5 - \\\\frac{4}{9} \\\\\\\\
&= \\\\frac{1}{18}.
\\\\end{align}

\\n

Hence, $E\\\\left[Y^2\\\\right] - E[Y]^2 = \\\\frac{1}{18}$.

\"", "description": "

Advice

", "templateType": "long string", "can_override": false}, "advice": {"name": "advice", "group": "Ungrouped variables", "definition": "if(random=0,advice0,if(random=1,advice1,0))", "description": "

Advice for selected function 

", "templateType": "anything", "can_override": false}, "advice1": {"name": "advice1", "group": "Function1", "definition": "\"

a) To calculate $P(y<0.5)$ we must solve $\\\\int_0^{0.5}3y^2 dy.$

\\n

So, 

\\n

\\\\begin{align}\\\\int_0^{0.5}3y^2 dy &= \\\\left[\\\\frac{3}{3}y^3\\\\right]_0^{0.5} \\\\\\\\
&= (0.5)^3 - (0)^3 \\\\\\\\
&= 0.125 . \\\\end{align}

\\n

Hence, $P(y<0.5) = 0.125.$

\\n

b) The formula for expected value is:

\\n

$E[Y] = \\\\int_{-\\\\infty}^{\\\\infty} y.f(y) dy.$

So,
\\\\begin{align}
E[Y] &= \\\\int_0^{1}y.3y^2 dy \\\\\\\\
&= \\\\int_0^{1}3y^3 dy \\\\\\\\
&= \\\\left[\\\\frac{3}{4}y^4\\\\right]_0^{1} \\\\\\\\
&= \\\\frac{3}{4}\\\\times1^4 - \\\\frac{3}{4} \\\\times 0^4 \\\\\\\\
&= \\\\frac{3}{4} \\\\\\\\
&= 0.75.
\\\\end{align}

Hence, $E[Y] = 0.75$.


c)  Our formula for $E[Y^2]$ is:

$E\\\\left[Y^2\\\\right] = \\\\int_{-\\\\infty}^{\\\\infty} y^2.f(y) dy.$

\\n

So,

\\n

\\\\begin{align}
E\\\\left[Y^2\\\\right] &= \\\\int_{0}^{1} y^2.3y^2 dy \\\\\\\\
&= \\\\int_{0}^{1} 3y^4 dy \\\\\\\\
&= \\\\left[\\\\frac{3}{5}y^5\\\\right]_0^{1} \\\\\\\\
&= \\\\frac{3}{5}\\\\times1^5 - \\\\frac{1}{5} \\\\times 0^5 \\\\\\\\
&= \\\\frac{3}{5} \\\\\\\\
& = 0.6.
\\\\end{align}

\\n

Hence, $E\\\\left[Y^2\\\\right] = 0.6 $.

\\n

d) Now we can use everything we\\'ve calculated so far to find the variance,

\\n

\\\\begin{align}
E\\\\left[Y^2\\\\right] - E[Y]^2 &= 0.6 - 0.75^2 \\\\\\\\
&= 0.0375. \\\\\\\\
\\\\end{align}

\\n

Hence, $E\\\\left[Y^2\\\\right] - E[Y]^2 = 0.0375$.

\"", "description": "

advice

", "templateType": "long string", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["random", "function", "prob", "expected", "variance", "squared", "advice"], "variable_groups": [{"name": "Function0", "variables": ["function0", "prob0", "expected0", "squared0", "variance0", "advice0"]}, {"name": "Function1", "variables": ["function1", "prob1", "expected1", "squared1", "variance1", "advice1"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "a)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is $P(y<0.5)$?

", "minValue": "prob", "maxValue": "prob", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "jme", "useCustomName": true, "customName": "b)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is $E[Y]$?

", "answer": "{expected}", "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": true, "customName": "c)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is $E\\left[Y^2\\right]$

", "answer": "{squared}", "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": true, "customName": "d)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is $E\\left[Y^2\\right] - E[Y]^2$? (The variance)

", "answer": "{variance}", "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": []}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "PA4 - Data Table", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Lauren Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21504/"}, {"name": "Megan Oliver", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/23526/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

This table shows the proportion of nests with different numbers of eggs:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Clutch Size3456789
$P(C=c)${e3}{e4}{e5}{e6}{e7}{e8}{e9}
", "advice": "

a) {advicea}

\n

b) We want to calculate the expected number of eggs in the clutch.

\n

Since we have discrete data our formula for expected value is $E[X]=\\sum_{i=1}^nx_i\\cdot P(X=x_i)$, where:

\n\n

Hence,

\n

\\begin{align}
E[X] &= \\sum_{i=1}^nx_i\\cdot P(X=x_i) \\\\
&= 3\\cdot P(X=3) + 4\\cdot P(X=4) + 5\\cdot P(X=5) + 6\\cdot P(X=6) + 7\\cdot P(X=7) + 8\\cdot P(X=8) + 9\\cdot P(X=9) \\\\
&= 3\\cdot\\var{e3} + 4\\cdot\\var{e4} + 5\\cdot\\var{e5} + 6\\cdot\\var{e6} + 7\\cdot\\var{e7} + 8\\cdot\\var{e8} + 9\\cdot\\var{e9} \\\\
&= \\var{3*e3} +\\var{4*e4} + \\var{5*e5} + \\var{6*e6} + \\var{7*e7} +\\var{8*e8} + \\var{9*e9} \\\\
&= \\var{expected}
\\end{align}

\n

Hence, our expected number of eggs in the clutch is $\\var{round_exp}$ (rounded to two decimal places if necessary).

\n

c) Our formula for variance is $Var(X) = E[X^2] - E[X]^2.$

\n

We have already calculated $E[x]$ in part b so now we must find $E[X^2]$.

\n

So, 

\n

\\begin{align}
E[X^2] &= \\sum_{i=1}^nx_i^2\\cdot P(X=x_i) \\\\
&= 3^2\\cdot P(X=3) + 4^2\\cdot P(X=4) + 5^2\\cdot P(X=5) + 6^2\\cdot P(X=6) + 7^2\\cdot P(X=7) + 8^2\\cdot P(X=8) + 9^2\\cdot P(X=9) \\\\
&= 9\\cdot\\var{e3} + 16\\cdot\\var{e4} + 25\\cdot\\var{e5} + 36\\cdot\\var{e6} + 49\\cdot\\var{e7} + 64\\cdot\\var{e8} + 81\\cdot\\var{e9} \\\\
&= \\var{9*e3} +\\var{16*e4} + \\var{25*e5} + \\var{36*e6} + \\var{49*e7} +\\var{64*e8} + \\var{81*e9} \\\\
&= \\var{squared}.
\\end{align}

\n

Hence, 

\n

\\begin{align}
Var(X) &= E[X^2] - E[X]^2 \\\\
&= \\var{squared} - \\var{expected}^2 \\\\
&= \\var{squared} - \\var{expected^2} \\\\
&= \\var{variance}.
\\end{align}

\n

Therefore our variance in the number of eggs is $\\var{round_var}$ (rounded to two decimal places if necessary).

\n

d) We now want to find the expected number of chicks surviving. 

\n

Our formula for this will be $E[X]=\\sum_{i=1}^n\\sqrt{x_i}\\cdot P(X=x_i)$.

\n

So, 

\n

\\begin{align}
E[X] &= \\sum_{i=1}^n\\sqrt{x_i}\\cdot P(X=x_i) \\\\
&= \\sqrt{3}\\cdot P(X=3) + \\sqrt{4}\\cdot P(X=4) + \\sqrt{5}\\cdot P(X=5) + \\sqrt{6}\\cdot P(X=6) + \\sqrt{7}\\cdot P(X=7) + \\sqrt{8}\\cdot P(X=8) + \\sqrt{9}\\cdot P(X=9) \\\\
&= \\sqrt{3}\\cdot\\var{e3} + \\sqrt{4}\\cdot\\var{e4} + \\sqrt{5}\\cdot\\var{e5} + \\sqrt{6}\\cdot\\var{e6} + \\sqrt{7}\\cdot\\var{e7} + \\sqrt{8}\\cdot\\var{e8} + \\sqrt{9}\\cdot\\var{e9} \\\\
&= \\var{transform_exp}.
\\end{align}

\n

Hence, our expected number of chicks surviving is $\\var{round_Texp}$ to two decimal places.

\n

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"e9": {"name": "e9", "group": "Ungrouped variables", "definition": "0.02", "description": "

9 eggs in clutch

", "templateType": "anything", "can_override": false}, "e8": {"name": "e8", "group": "Ungrouped variables", "definition": "0.03", "description": "

8 eggs in clutch

", "templateType": "anything", "can_override": false}, "e6": {"name": "e6", "group": "Ungrouped variables", "definition": "0.33", "description": "

6 eggs in clutch

", "templateType": "anything", "can_override": false}, "e5": {"name": "e5", "group": "Ungrouped variables", "definition": "0.35", "description": "

5 eggs in clutch

", "templateType": "anything", "can_override": false}, "e3": {"name": "e3", "group": "Ungrouped variables", "definition": "0.01", "description": "

3 eggs in clutch

", "templateType": "anything", "can_override": false}, "e4": {"name": "e4", "group": "Ungrouped variables", "definition": "0.17", "description": "

4 eggs in clutch

", "templateType": "anything", "can_override": false}, "egg": {"name": "egg", "group": "Part a - probability ", "definition": "random(6,7,8)", "description": "

Clutch size for probability 

", "templateType": "anything", "can_override": false}, "eggprob": {"name": "eggprob", "group": "Part a - probability ", "definition": "if(egg=6, e6+e7+e8+e9, if(egg=7, e7+e8+e9, if(egg=8, e8+e9,0)))", "description": "

probaility for selected clutch size

", "templateType": "anything", "can_override": false}, "e7": {"name": "e7", "group": "Ungrouped variables", "definition": "0.09", "description": "

7 eggs in clutch

", "templateType": "anything", "can_override": false}, "expected": {"name": "expected", "group": "Part b & C - Expectation & Variance", "definition": "3*e3 + 4*e4 + 5*e5 + 6*e6 + 7*e7 + 8*e8 + 9*e9", "description": "

Expected number of eggs

", "templateType": "anything", "can_override": false}, "squared": {"name": "squared", "group": "Part b & C - Expectation & Variance", "definition": "3^2*e3 + 4^2*e4 + 5^2*e5 + 6^2*e6 + 7^2*e7 + 8^2*e8 + 9^2*e9", "description": "

E[X^2] for variance formula

", "templateType": "anything", "can_override": false}, "variance": {"name": "variance", "group": "Part b & C - Expectation & Variance", "definition": "squared - (expected)^2", "description": "

Variance

", "templateType": "anything", "can_override": false}, "round_exp": {"name": "round_exp", "group": "Part b & C - Expectation & Variance", "definition": "precround(expected,2)", "description": "

Expectation rounded to 2 d.p.

", "templateType": "anything", "can_override": false}, "round_var": {"name": "round_var", "group": "Part b & C - Expectation & Variance", "definition": "precround(variance,2)", "description": "

variation rounded to 2 d.p.

", "templateType": "anything", "can_override": false}, "transform_exp": {"name": "transform_exp", "group": "Part d - transform data ", "definition": "sqrt(3)*e3 + sqrt(4)*e4 + sqrt(5)*e5 + sqrt(6)*e6 + sqrt(7)*e7 + sqrt(8)*e8 + sqrt(9)*e9", "description": "

Expected value of data that has undergone a square root transformation 

", "templateType": "anything", "can_override": false}, "round_Texp": {"name": "round_Texp", "group": "Part d - transform data ", "definition": "precround(transform_exp,2)", "description": "

rounded number of expected chicks to survive 

", "templateType": "anything", "can_override": false}, "advice6": {"name": "advice6", "group": "Part a - probability ", "definition": "\"

We want the probability that there are 6 or more eggs in the clutch, i.e., $P(C\\\\geq6)$.

\\n

This means that the clutch could contain 6, 7, 8 or 9 eggs so, to calculate $P(C\\\\geq6)$, we use the following sum:

\\n

$P(C\\\\geq6)=P(C=6)+P(C=7)+P(C=8)+P(C=9)$.

\\n

So,

\\n

\\\\begin{align}
P(C\\\\geq6)&=\\\\var{e6}+\\\\var{e7}+\\\\var{e8}+\\\\var{e9} \\\\\\\\
&=\\\\var{eggprob}.
\\\\end{align}

\\n

Hence, the probability that there are 6 or more eggs in the clutch is $\\\\var{eggprob}$.

\"", "description": "", "templateType": "long string", "can_override": false}, "advice7": {"name": "advice7", "group": "Part a - probability ", "definition": "\"

We want the probability that there are 7 or more eggs in the clutch, i.e., $P(C\\\\geq7)$.

\\n

This means that the clutch could contain 7, 8 or 9 eggs so, to calculate $P(C\\\\geq7)$, we use the following sum:

\\n

$P(C\\\\geq7)=P(C=7)+P(C=8)+P(C=9)$.

\\n

So,

\\n

\\\\begin{align}
P(C\\\\geq7)&=\\\\var{e7}+\\\\var{e8}+\\\\var{e9} \\\\\\\\
&=\\\\var{eggprob}.
\\\\end{align}

\\n

Hence, the probability that there are 7 or more eggs in the clutch is $\\\\var{eggprob}$.

\"", "description": "", "templateType": "long string", "can_override": false}, "advice8": {"name": "advice8", "group": "Part a - probability ", "definition": "\"

We want the probability that there are 8 or more eggs in the clutch, i.e., $P(C\\\\geq8)$.

\\n

This means that the clutch could contain 8 or 9 eggs so, to calculate $P(C\\\\geq8)$, we use the following sum:

\\n

$P(C\\\\geq8)=P(C=8)+P(C=9)$.

\\n

So,

\\n

\\\\begin{align}
P(C\\\\geq8)&=\\\\var{e8}+\\\\var{e9} \\\\\\\\
&=\\\\var{eggprob}.
\\\\end{align}

\\n

Hence, the probability that there are 8 or more eggs in the clutch is $\\\\var{eggprob}$.

\"", "description": "", "templateType": "long string", "can_override": true}, "advicea": {"name": "advicea", "group": "Part a - probability ", "definition": "if(egg=6,advice6,if(egg=7,advice7,if(egg=8,advice8,0)))", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["e9", "e8", "e7", "e6", "e5", "e4", "e3"], "variable_groups": [{"name": "Part a - probability ", "variables": ["egg", "eggprob", "advice6", "advice7", "advice8", "advicea"]}, {"name": "Part b & C - Expectation & Variance", "variables": ["expected", "squared", "variance", "round_exp", "round_var"]}, {"name": "Part d - transform data ", "variables": ["transform_exp", "round_Texp"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "a)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is the probability that there are {egg} or more eggs in a clutch, i.e., $P(C\\geq\\var{egg})$?

", "minValue": "eggprob", "maxValue": "eggprob", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "b)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is the expected number of eggs?

\n

Round your answer to two decimal places if necessary.

", "minValue": "round_exp", "maxValue": "round_exp", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "c)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is the variance in the number of eggs?

\n

Round your answer to two decimal places if necessary.

", "minValue": "round_var", "maxValue": "round_var", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "d)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Let's assume that the number of surviving chicks can be estimated by computing the square-root of the clutch size. Compute the expected number of chicks to survive.

\n

Round your answer to two decimal places if necessary.

", "minValue": "round_Texp", "maxValue": "round_Texp", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "PB2 - Covariance & Independence", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Lauren Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21504/"}, {"name": "Megan Oliver", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/23526/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "", "advice": "

a) If two random variables are independent then we can assume that their covariance is 0. 

\n

The formula for covariance is:

\n

\\begin{align}
Cov(X,Y) &= E[XY] - E[X]E[Y].
\\end{align}

\n

By definition, if two random variables are independent then:

\n

\\begin{align}
E[XY] &= E[X]E[Y].
\\end{align}

\n

Hence, if we substute this back into our formula for covariance, we find

\n

\\begin{align}
Cov(X,Y) &= E[XY] - E[X]E[Y] \\\\
&= E[X]E[Y] - E[X]E[Y] \\\\
&= 0.
\\end{align}

\n

b) To calculate the covariance we can use the formula from part a), i.e., 

\n

\\begin{align}
Cov(X,Y) &= E[XY] - E[X]E[Y].
\\end{align}

\n

Hence, we must calculate $E[X]$, $E[Y]$, and $E[XY]$.

\n

First let us caculate $E[X]$,

\n

\\begin{align}
E[X] &= \\sum_{i=1}^3x_i\\cdot P(X=x_i) \\\\
&= (-1)\\cdot\\frac{1}{3} + 0\\cdot\\frac{1}{3} +1\\cdot\\frac{1}{3} \\\\
&= -\\frac{1}{3} + 0 + \\frac{1}{3} \\\\
&= 0.
\\end{align}

\n

Since $y=X^2$, the random variable $Y$ can take the value $0$ ($Y=0^2$) or $1$ ($Y=1^2=(-1)^2$) with the probabilities $\\frac{1}{3}$ and $\\frac{2}{3}$, respectively.

\n

Hence, 

\n

\\begin{align}
E[Y] &= \\sum_{i=1}^2y_i\\cdot P(Y=y_i) \\\\
&= 0\\cdot\\frac{1}{3} + 1\\cdot\\frac{2}{3} \\\\
&= \\frac{2}{3}.
\\end{align}

\n

Finally, we need to caluclate $E[XY]$,

\n

\\begin{align}
E[XY] &= \\sum_{i=1}^3x_i\\cdot y_i\\cdot P(X=x_i,Y=y_i) \\\\
&= (-1)\\cdot (-1)^2 \\cdot \\frac{1}{3} + 0 \\cdot 0^2 \\cdot\\frac{1}{3} +1\\cdot 1^2 \\cdot \\frac{1}{3} \\\\
&= -\\frac{1}{3} + 0 + \\frac{1}{3} \\\\
&= 0.
\\end{align}

\n

Thus, 

\n

\\begin{align}
Cov(X,Y) &= E[XY] - E[X]E[Y] \\\\
&= 0 - 0\\cdot \\frac{2}{3} \\\\
&= 0.
\\end{align}

c) No we cannot assume that $X$ and $Y$ are independent. Despite $Cov(X,Y)=0$ you can clearly see that $X$ and $Y$ are not independent variables since they are linearly related by $Y=X^2$.

\n

\n

Although two random variables being independent does mean that their covariance will be $0$, this doesn't mean that the opposite cannot be assumed true, as we have shown you can have a covariance of $0$ even when the random variables are not independent.

\n

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"expectedx": {"name": "expectedx", "group": "Ungrouped variables", "definition": "(-1)*1/3 + 0*1/3 + 1*1/3", "description": "

Expected value of x

", "templateType": "anything", "can_override": false}, "expectedy": {"name": "expectedy", "group": "Ungrouped variables", "definition": "((-1)^2 * 1/3) + (0^2 * 1/3) + (1^2 * 1/3)", "description": "

Expected value of y

", "templateType": "anything", "can_override": false}, "expectedxy": {"name": "expectedxy", "group": "Ungrouped variables", "definition": "(-1)*(-1)^2*1/3 + (0)*(0)^2*1/3 + (1)*(1)^2*1/3", "description": "

Expected value of xy

", "templateType": "anything", "can_override": false}, "covxy": {"name": "covxy", "group": "Ungrouped variables", "definition": "expectedxy - expectedx*expectedy", "description": "

Covariance

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["expectedx", "expectedy", "expectedxy", "covxy"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "a)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

If two random variables $X$ and $Y$ are independent, what is their covariance, i.e., $Cov(X,Y)$?

", "minValue": "0", "maxValue": "0", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "b)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Consider a discrete random variable $X$. You can see the possible values that $X$ can take, alongside the associated probabilities, in the table below.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$x$-101
$P(X=x)$$\\frac{1}{3}$$\\frac{1}{3}$$\\frac{1}{3}$
\n

We have a second random variable $Y$. Let $Y=X^2$.

\n

Calculate the covariance, i.e., $Cov(X,Y)$.

", "minValue": "covxy", "maxValue": "covxy", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "1_n_2", "useCustomName": true, "customName": "c)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Looking at your answer to part b, can we assume that $X$ and $Y$ are independent random variables?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["yes", "no"], "matrix": [0, "1"], "distractors": ["", ""]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "PB3 - Expected Value and Standard Deviation for a Combination of Linear Random Variables", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Lauren Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21504/"}, {"name": "Megan Oliver", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/23526/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Two independent random variables $U$ and $V$ are used to compute a new random variable $W$ where $W = \\var{scalar}U + V$.

", "advice": "

In general if we have a linear combination of two independent random variables $X$ and $Y$, where $a$ and $b$ are constants, the formulas for expected value and variance are as follows:

\n

\\begin{align}
E[aX + bY] &= aE[X] + bE[Y] \\\\
Var(aX+bY) &= a^2Var(X) + b^2Var(Y).
\\end{align}

\n

a) We want to find the expected value of $W$, i.e., $E[W]$.

\n

Recall that $W = \\var{scalar}U + V.$

\n

Hence, 

\n

\\begin{align}
E[W] &= \\var{scalar}E[U] + E[V] \\\\
&= \\var{scalar}*\\var{um} + \\var{vm} \\\\
&= \\var{scalar*um} + \\var{vm} \\\\
&= \\var{wm}.
\\end{align}

\n

Hence the expected value of $W$ is $\\var{wm}$.

\n

b) We want to find the standard deviation of $W$ ie., $\\sigma_W$. Let us first calculate the variance, i.e., $Var(W)$, since $\\sigma_W = \\sqrt{Var(W)}$.

\n

So, 

\n

\\begin{align}
Var(W) &= \\var{scalar}^2Var(U) + Var(V).
\\end{align}

\n

Here we need that $Var(U) = \\sigma_U^2 = \\var{usd}^2 = \\var{uvar}$ and $Var(V) = \\sigma_V^2 = \\var{vsd}^2 = \\var{vvar}$.

\n

So,

\n

\\begin{align}
&= \\var{scalar^2}\\cdot\\var{uvar} + \\var{vvar} \\\\
&= \\var{scalar^2*uvar} + \\var{vvar} \\\\
&= \\var{wvar}.
\\end{align}

\n

We now need to calculate the standard deviation of $W$.

\n

So, 

\n

\\begin{align}
\\sigma_W &= \\sqrt{Var(W)} \\\\
&= \\sqrt{\\var{wvar}} \\\\
&= \\var{wsd}.
\\end{align}

\n

Hence, the standard deviation of $W$ is $\\var{round_wsd}$ to two decimal places.

\n

\n

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"um": {"name": "um", "group": "Ungrouped variables", "definition": "random(2,3,4,5,6,7,8,9,10)", "description": "

mean of u

", "templateType": "anything", "can_override": false}, "vm": {"name": "vm", "group": "Ungrouped variables", "definition": "random(2,3,4,5,6,7,8,9,10)", "description": "

mean of v

", "templateType": "anything", "can_override": false}, "scalar": {"name": "scalar", "group": "Ungrouped variables", "definition": "random(2,3,4,5)", "description": "

scalar multiplier of u in linear combination of random variables

", "templateType": "anything", "can_override": false}, "wm": {"name": "wm", "group": "Ungrouped variables", "definition": "scalar*um + vm", "description": "

mean of w

", "templateType": "anything", "can_override": false}, "usd": {"name": "usd", "group": "Ungrouped variables", "definition": "random(1,2,3,4,5)", "description": "

standard deviation of u

", "templateType": "anything", "can_override": false}, "vsd": {"name": "vsd", "group": "Ungrouped variables", "definition": "random(1,2,3,4,5)", "description": "

standard deviation of v

", "templateType": "anything", "can_override": false}, "wvar": {"name": "wvar", "group": "Ungrouped variables", "definition": "(scalar^2)*uvar + vvar", "description": "

variance of w

", "templateType": "anything", "can_override": false}, "wsd": {"name": "wsd", "group": "Ungrouped variables", "definition": "sqrt(wvar)", "description": "

standard deviation of w

", "templateType": "anything", "can_override": false}, "uvar": {"name": "uvar", "group": "Ungrouped variables", "definition": "usd^2", "description": "

variance of u

", "templateType": "anything", "can_override": false}, "vvar": {"name": "vvar", "group": "Ungrouped variables", "definition": "vsd^2", "description": "

variance of v

", "templateType": "anything", "can_override": false}, "round_wsd": {"name": "round_wsd", "group": "Ungrouped variables", "definition": "precround(wsd,2)", "description": "

standard deviation of w rounded to 2 dp

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["um", "vm", "scalar", "wm", "usd", "vsd", "wvar", "wsd", "uvar", "vvar", "round_wsd"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "a)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

If the means of $U$ and $V$ are {um} and {vm}, respectively, what is the mean of $W$?

", "minValue": "wm", "maxValue": "wm", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "b)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

If the standard deviations of $U$ and $W$ are {usd} and {vsd}, resepctively, what is the standard deviation of $W$?

\n

If necessary, round your answer to two decimal places.

", "minValue": "round_wsd", "maxValue": "round_wsd", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "PC2 - Entropy", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Lauren Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21504/"}, {"name": "Megan Oliver", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/23526/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

We have information about nests and the number of eggs that they contain. The information is summarised in the following 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
Clutch Size$3$$4$$5$$6$$7$$8$$9$
$P(C=c)${p3}{p4}{p5}{p6}{p7}{p8}{p9}
", "advice": "

a) The formula for Shannon entropy is:

\n

\\begin{align}
H(x) &= -\\sum_{i=1}^n P(x_i)\\cdot ln(P(x_i)).
\\end{align}

\n

Calculating this using the information about Clutch sizes in the table gives,

\n

\\begin{align}
H(x) &= -\\left(\\var{p3}\\cdot ln(\\var{p3}) + \\var{p4}\\cdot ln(\\var{p4}) + \\var{p5}\\cdot ln(\\var{p5}) + \\var{p6}\\cdot ln(\\var{p6}) + \\var{p7}\\cdot ln(\\var{p7}) + \\var{p8}\\cdot ln(\\var{p8}) + \\var{p9}\\cdot ln(\\var{p9})\\right) \\\\
&= \\var{shanent}.
\\end{align}

\n

Hence, $H(x) = \\var{round_shanent}$ to two decimal places.

\n

b) An even clutch size will mean the nest contains $4$, $6$, or $8$ eggs. Therefore, 

\n

\\begin{align}
P(c\\text{ is even}) &= P(C=4) + P(C=6) + P(c=8) \\\\
&= \\var{p4} + \\var{p6} + \\var{p8} \\\\
&= \\var{even}.
\\end{align}

\n

c) If we know the clutch size is even we immediately know that the probability that the nests contain an odd number of eggs will be 0. Hence, 

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Clutch Size$3$$4$$5$$6$$7$$8$$9$
$P(C=c|C\\text{ is even})$$0$$0$$0$$0$
\n

Now, using the formula for conditional probability, 

\n

\\begin{align}
P(C=c|C\\text{ is even}) &= \\frac{P(C=c\\text{ and }C\\text{ is even})}{P(C\\text{ is even})}.
\\end{align}

\n

So, for $c=4$,

\n

\\begin{align}
P(C=4|C\\text{ is even}) &= \\frac{P(C=4)}{P(C\\text{ is even})} \\\\
&= \\frac{\\var{p4}}{\\var{even}} \\\\
&= \\var{p4e2}, \\text{ to two decimal places}.
\\end{align}

\n

We use the same formula for $c=6$ and $c=8$, 

\n

\\begin{align}
P(C=6|C\\text{ is even}) &= \\frac{P(C=6)}{P(C\\text{ is even})} \\\\
&= \\frac{\\var{p6}}{\\var{even}} \\\\
&= \\var{p6e2}, \\text{ to two decimal places} \\\\
& \\text{and} \\\\
P(C=8|C\\text{ is even}) &= \\frac{P(C=8)}{P(C\\text{ is even})} \\\\
&= \\frac{\\var{p8}}{\\var{even}} \\\\
&= \\var{p8e2}, \\text{ to two decimal places}.
\\end{align}

\n

So our completed probability distribution is:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Clutch Size$3$$4$$5$$6$$7$$8$$9$
$P(C=c|C\\text{ is even})$$0${p4e2}$0${p6e2}$0${p8e2}$0$
\n

d) We calculate the Shannon entropy utilising the same formula from part b,

\n

\\begin{align}
H(x) &= -\\left(\\var{p4e2}\\cdot ln(\\var{p4e2}) + \\var{p6e2}\\cdot ln(\\var{p6e2}) + \\var{p8e2}\\cdot ln(\\var{p8e2}) \\right) \\\\
&= \\var{even_shanent}.
\\end{align}

\n

Hence, $H(x) = \\var{roundeven_shanent}$, rounded to two decimal places.

\n

e) Since the entropy decreases when we learn that the clutch size is even, we can say that we are more certan about the outcome.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"p3": {"name": "p3", "group": "Ungrouped variables", "definition": "if(randnum=1,0.01,if(randnum=2,0.02,if(randnum=3,0.02,0)))", "description": "

probability of the nest having 3 eggs

", "templateType": "anything", "can_override": false}, "p4": {"name": "p4", "group": "Ungrouped variables", "definition": "if(randnum=1,0.17,if(randnum=2,0.13,if(randnum=3,0.17,0)))", "description": "

probability of the nest having 4 eggs

", "templateType": "anything", "can_override": false}, "p5": {"name": "p5", "group": "Ungrouped variables", "definition": "if(randnum=1,0.35,if(randnum=2,0.4,if(randnum=3,0.34,0)))", "description": "

probability of the nest having 5 eggs

", "templateType": "anything", "can_override": false}, "p6": {"name": "p6", "group": "Ungrouped variables", "definition": "if(randnum=1,0.33,if(randnum=2,0.32,if(randnum=3,0.3,0)))", "description": "

probability of the nest having 6 eggs

", "templateType": "anything", "can_override": false}, "p7": {"name": "p7", "group": "Ungrouped variables", "definition": "if(randnum=1,0.09,if(randnum=2,0.1,if(randnum=3,0.08,0)))", "description": "

probability of the nest having 7 eggs

", "templateType": "anything", "can_override": false}, "p8": {"name": "p8", "group": "Ungrouped variables", "definition": "if(randnum=1,0.03,if(randnum=2,0.02,if(randnum=3,0.06,0)))", "description": "

probability of the nest having 8 eggs

", "templateType": "anything", "can_override": false}, "p9": {"name": "p9", "group": "Ungrouped variables", "definition": "if(randnum=1,0.02,if(randnum=2,0.01,if(randnum=3,0.03,0)))", "description": "

probability of the nest having 9 eggs

", "templateType": "anything", "can_override": false}, "randnum": {"name": "randnum", "group": "Ungrouped variables", "definition": "random(1,2,3,1,2,3)", "description": "

Random number generator to decide which set of probabilities the question will use

", "templateType": "anything", "can_override": false}, "shanent": {"name": "shanent", "group": "Ungrouped variables", "definition": "-(p3*ln(p3)+p4*ln(p4)+p5*ln(p5)+p6*ln(p6)+p7*ln(p7)+p8*ln(p8)+p9*ln(p9))", "description": "

Calculation of shannon entropy

", "templateType": "anything", "can_override": false}, "round_shanent": {"name": "round_shanent", "group": "Ungrouped variables", "definition": "precround(shanent,2)", "description": "

Shannon entropy rounded to 2 decimal places

", "templateType": "anything", "can_override": false}, "even": {"name": "even", "group": "Even Clutch Size (Part b & c)", "definition": "p4+p6+p8", "description": "

The probability that the clutch size is even

", "templateType": "anything", "can_override": false}, "p4e": {"name": "p4e", "group": "Even Clutch Size (Part b & c)", "definition": "p4/even", "description": "

probability clutch size has 4 eggs given clutch size is even

", "templateType": "anything", "can_override": false}, "p6e": {"name": "p6e", "group": "Even Clutch Size (Part b & c)", "definition": "p6/even", "description": "

probability clutch size has 6 eggs given clutch size is even

", "templateType": "anything", "can_override": false}, "p8e": {"name": "p8e", "group": "Even Clutch Size (Part b & c)", "definition": "p8/even", "description": "

probability clutch size has 8 eggs given clutch size is even

", "templateType": "anything", "can_override": false}, "p4e2": {"name": "p4e2", "group": "Even Clutch Size (Part b & c)", "definition": "precround(p4e,2)", "description": "

probability clutch size has 4 eggs given clutch size is even, rounded to 2 d.p.

", "templateType": "anything", "can_override": false}, "p6e2": {"name": "p6e2", "group": "Even Clutch Size (Part b & c)", "definition": "precround(p6e,2)", "description": "

probability clutch size has 6 eggs given clutch size is even, rounded to 2 d.p.

", "templateType": "anything", "can_override": false}, "p8e2": {"name": "p8e2", "group": "Even Clutch Size (Part b & c)", "definition": "precround(p8e,2)", "description": "

probability clutch size has 8 eggs given clutch size is even, rounded to 2 d.p.

", "templateType": "anything", "can_override": false}, "even_shanent": {"name": "even_shanent", "group": "Even Clutch Size (Part b & c)", "definition": "-(p4e*ln(p4e)+p6e*ln(p6e)+p8e*ln(p8e))", "description": "

Shannon entropy

", "templateType": "anything", "can_override": false}, "roundeven_shanent": {"name": "roundeven_shanent", "group": "Even Clutch Size (Part b & c)", "definition": "precround(even_shanent,2)", "description": "

Shannon entropy, rounded to 2 decimla places

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["p3", "p4", "p5", "p6", "p7", "p8", "p9", "randnum", "shanent", "round_shanent"], "variable_groups": [{"name": "Even Clutch Size (Part b & c)", "variables": ["even", "p4e", "p4e2", "p6e", "p6e2", "p8e", "p8e2", "even_shanent", "roundeven_shanent"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "a)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate the Shannon entropy (in nats) of the clutch size.

\n

Round your answer to two decimal places if necessary.

", "minValue": "round_shanent", "maxValue": "round_shanent", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "b)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is the probability that the clutch size is even i.e., $P(c\\text{ is even})$?

", "minValue": "even", "maxValue": "even", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "gapfill", "useCustomName": true, "customName": "c)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

If we know the clutch size is an even number, compute the new distribution $P(C=c|c\\text{ is even})$.

\n

Round your answers to two decimal places where necessary.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Clutch Size$3$$4$$5$$6$$7$$8$$9$
$P(C=c|C\\text{ is even})$[[0]][[1]][[2]][[3]][[4]][[5]][[6]]
", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "3", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "0", "maxValue": "0", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "4", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "p4e2", "maxValue": "p4e2", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "5", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "0", "maxValue": "0", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "6", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "p6e2", "maxValue": "p6e2", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "7", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "0", "maxValue": "0", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "8", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "p8e2", "maxValue": "p8e2", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "9", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "0", "maxValue": "0", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "numberentry", "useCustomName": true, "customName": "d)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Recalculate the Shannon Entropy using the distribution you found in part c.

\n

Round your answer to 2 decimal places.

", "minValue": "roundeven_shanent", "maxValue": "roundeven_shanent", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "1_n_2", "useCustomName": true, "customName": "e)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Comparing your Shannon entropy with the one you calculated in part b, which statement in true about our sysem?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["We are more certain about the outcome i.e., the number of eggs in a nest.", "We are less certain about the outcome i.e., the number of eggs in a nest."], "matrix": ["1", 0], "distractors": ["", ""]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LD01 Commutativity, Associativity and Distributive", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Poppy Jeffries", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21275/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "", "advice": "

Commutative

\n

The definition of commutativity can be written in the following way:

\n

$$
a \\times b = b \\times a.
$$

\n

There are varying degress of technical detail that can be included in this definition depending on what area you are studying. The key idea is that an operation is said to be commutative if the order in which you write the two elements being operated on does not matter. Multiplication of real numbers is commutative because as we know $2 \\times 3 = 3 \\times 2 = 6$ for example. The most common example of something being non-commutative is multiplication for matrices. In general for two matrices $A$ and $B$, $AB \\neq BA$ (in fact sometimes one of these things can be calculated and the other does not even exist).

\n

Assosciative

\n

The definition of associativity can be written in the following way:

\n

$$
(ab)c = a(bc).
$$

\n

In other words it doesn't matter if you first work out $a$ times $b$ and then take the result and times it by $c$, or if you first work out $b$ times $c$ and then pre-multiply the result by $a$.

\n

Distributive

\n

The definition of distributive can be written in the following way:

\n

$$
a \\times (b + c) = a \\times b + a \\times c.
$$

\n

As with the others there are increasing levels of detail that can be put into this definition (such as including ideas such as right-distributive and left-distributive) but the key idea is that you can \"expand brackets\" as you can in elementary algebra, if an operator is distributive.

\n

For more reading on this try (for example) this link.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "m_n_x", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Match the word to its correct definition

", "minMarks": 0, "maxMarks": "3", "minAnswers": 0, "maxAnswers": "3", "shuffleChoices": true, "shuffleAnswers": false, "displayType": "checkbox", "warningType": "warn", "showCellAnswerState": true, "markingMethod": "sum ticked cells", "choices": ["$a,b \\in S \\Rightarrow ab = ba$", "$a,b,c \\in S \\Rightarrow (ab)c = a(bc)$", "$a,b,c \\in S \\Rightarrow a(b+c)=ab+ac$", "If $a,b \\in S$, and $ab = ba = I$ then $b = a^{-1}$ ", "$a,b,c \\in S$ and $a+b = b+c \\Rightarrow a = c$"], "matrix": [["1", "0", "0"], ["0", "1", 0], ["0", "0", "1"], [0, 0, 0], [0, 0, 0]], "layout": {"type": "all", "expression": ""}, "answers": ["Commutative", "Associative", "Distributive"]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LM01 Matrices dimensions", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

The following questions are designed to explore the dimensions of matrices and what you can and can't do with matrices of differing dimensions.

", "advice": "

Rows and Columns

\n

The convention in Matrix notation is to give the dimensions of a matrix in the order \"rows\" by \"columns\".

\n

For $\\var{Dimensions}$ there are $\\var{rows[0]}$ rows and $\\var{columns[0]}$ columns. We write this as \"this is a $\\var{rows[0]}$X$\\var{columns[0]}$ matrix\".

\n

When can you add and subtract matrices?

\n

Two Matrices can be added or subtracted if they have the exact same dimensions as each other. For example $\\var{canadd1}$ and $\\var{canadd2}$ are both $\\var{rows[1]}$X$\\var{columns[1]}$ matrices and therefore can be added (or subtracted). However, $\\var{cantaddsub1}$ is a $\\var{rows[3]}$X$\\var{columns[3]}$ matrix and $\\var{cantaddsub2}$ is a $\\var{rows[3]}$X$\\var{columns[3]+1}$ matrix. Since these dimensions are different these matrices cannot be added or subtracted.

\n

Multiplying Dimensions

\n

When you multiply two matrices together the number of columns in the first matrix must match the number of rows in the second matrix. For example in the calculation $\\var{Mult3}$X$\\var{Mult4}$ the first matrix has $3$ columns and the second matrix has $3$ rows so they can be multiplied. In addition to this when multiplying two matrices (that can be multiplied) the result will be a single matrix that has the number of rows of the first matrix and the number of columns of the second matrix. In this example the first matrix has $\\var{rows[0]}$ rows and the second matrix has $\\var{columns[1]}$ columns, so the result of multiplying the two matrices will be a $\\var{rows[0]}$X$\\var{columns[1]}$ matrix.

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"rows": {"name": "rows", "group": "Ungrouped variables", "definition": "repeat(random(1..4),6)", "description": "", "templateType": "anything", "can_override": false}, "columns": {"name": "columns", "group": "Ungrouped variables", "definition": "repeat(random(1..4),6)", "description": "", "templateType": "anything", "can_override": false}, "dimensions": {"name": "dimensions", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),columns[0]),rows[0]))", "description": "", "templateType": "anything", "can_override": false}, "canadd1": {"name": "canadd1", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),columns[1]),rows[1]))", "description": "", "templateType": "anything", "can_override": false}, "canadd2": {"name": "canadd2", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),columns[1]),rows[1]))", "description": "", "templateType": "anything", "can_override": false}, "cansub1": {"name": "cansub1", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),columns[2]),rows[2]))", "description": "", "templateType": "anything", "can_override": false}, "cansub2": {"name": "cansub2", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),columns[2]),rows[2]))", "description": "", "templateType": "anything", "can_override": false}, "cantaddsub1": {"name": "cantaddsub1", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),columns[3]),rows[3]))", "description": "", "templateType": "anything", "can_override": false}, "cantaddsub2": {"name": "cantaddsub2", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),columns[3]+1),rows[3]))", "description": "", "templateType": "anything", "can_override": false}, "cantaddsub3": {"name": "cantaddsub3", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),rows[3]),columns[3]))", "description": "", "templateType": "anything", "can_override": false}, "Mult1": {"name": "Mult1", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),columns[4]),rows[4]))", "description": "", "templateType": "anything", "can_override": false}, "Mult2": {"name": "Mult2", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),columns[5]),rows[5]))", "description": "", "templateType": "anything", "can_override": false}, "correctanswertomult": {"name": "correctanswertomult", "group": "Ungrouped variables", "definition": "IF(columns[4]=rows[5],\"yes\",\"no\")", "description": "", "templateType": "anything", "can_override": false}, "incorrectanswertomult": {"name": "incorrectanswertomult", "group": "Ungrouped variables", "definition": "IF(columns[4]=rows[5],\"no\",\"yes\")", "description": "", "templateType": "anything", "can_override": false}, "Mult3": {"name": "Mult3", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),3),rows[0]))", "description": "", "templateType": "anything", "can_override": false}, "Mult4": {"name": "Mult4", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),columns[1]),3))", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "(rows[0]>1 OR columns[0]>1) AND (rows[3]<>columns[3])", "maxRuns": 100}, "ungrouped_variables": ["rows", "columns", "dimensions", "canadd1", "canadd2", "cansub1", "cansub2", "cantaddsub1", "cantaddsub2", "cantaddsub3", "Mult1", "Mult2", "correctanswertomult", "incorrectanswertomult", "Mult3", "Mult4"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Rows and Columns", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What are the dimensions of the following matrix?

\n

$\\var{dimensions}$

\n

[[0]]X[[1]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Rows", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{rows[0]}", "maxValue": "{rows[0]}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Columns", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{columns[0]}", "maxValue": "{columns[0]}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "m_n_2", "useCustomName": true, "customName": "When can you add and subtract matrices?", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Which of the following calculations are defined?

\n

(Indicate ALL possible answers by ticking the corresponding box(es))

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "checkbox", "displayColumns": "0", "minAnswers": 0, "maxAnswers": "2", "warningType": "warn", "showCellAnswerState": true, "markingMethod": "score per matched cell", "choices": ["$\\var{canadd1}+\\var{canadd2}\\\\$", "$\\var{cansub1}-\\var{cansub2}\\\\$", "$\\var{cantaddsub1}-\\var{cantaddsub2}\\\\$", "$\\var{cantaddsub1}+\\var{cantaddsub3}\\\\$"], "matrix": ["1", "1", "0", "0"], "distractors": ["", "", "", ""]}, {"type": "gapfill", "useCustomName": true, "customName": "When can you multiply two matrices?", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Is this calculation defined?

\n

$\\var{Mult1}$X$\\var{Mult2}$

\n

[[0]]

", "gaps": [{"type": "1_n_2", "useCustomName": true, "customName": "Yesno", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["{correctanswertomult}", "{incorrectanswertomult}"], "matrix": ["1", 0], "distractors": ["", ""]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": true, "customName": "Dimensions of multiplication answer", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What will be the dimensions of the matrix you get when you multiply these two matrices?

\n

$\\var{Mult3}$X$\\var{Mult4}$.

\n

\n

[[0]]X[[1]]

\n

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Rows", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "rows[0]", "maxValue": "rows[0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Cols", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "columns[1]", "maxValue": "columns[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LM02 Adding matrices", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "

Generates two sets of matrices that can be added and asks the student to add them. Will ensure that the dimensions in part a) are different to the dimensions in part b) to offer some variety.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Adding Matrices

\n

Calculate the following:

", "advice": "

Matrix addition is fairly straightforward in that each entry is calculated by adding the corresponding entries. For example the top left entry of the answer to part a) can be calculated as $\\var{A[0][0]} + \\var{Apair[0][0]} = \\var{A[0][0] + Apair[0][0]}$. So for this question:

\n

a) $\\var{A}+\\var{Apair} = \\var{A+Apair}$

\n

b) $\\var{B}+\\var{Bpair} = \\var{B+Bpair}$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"A": {"name": "A", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[0]),row[0]))", "description": "", "templateType": "anything", "can_override": false}, "col": {"name": "col", "group": "Ungrouped variables", "definition": "repeat(random(2..3),3)", "description": "", "templateType": "anything", "can_override": false}, "row": {"name": "row", "group": "Ungrouped variables", "definition": "repeat(random(2..3),3)", "description": "", "templateType": "anything", "can_override": false}, "B": {"name": "B", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[1]),row[1]))", "description": "", "templateType": "anything", "can_override": false}, "C": {"name": "C", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[2]),row[2]))", "description": "", "templateType": "anything", "can_override": false}, "Apair": {"name": "Apair", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[0]),row[0]))", "description": "", "templateType": "anything", "can_override": false}, "Bpair": {"name": "Bpair", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[1]),row[1]))", "description": "", "templateType": "anything", "can_override": false}, "Cpair": {"name": "Cpair", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[2]),row[2]))", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "col[0]<>row[0] AND col[0]<>col[1]", "maxRuns": 100}, "ungrouped_variables": ["col", "row", "A", "Apair", "B", "Bpair", "C", "Cpair"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "matrix", "useCustomName": true, "customName": "a)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{A} + \\var{Apair}=$

", "correctAnswer": "{A}+{Apair}", "correctAnswerFractions": false, "numRows": "{row[0]}", "numColumns": "{col[0]}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": true, "customName": "b)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{B} +\\var{Bpair}$

", "correctAnswer": "{B}+{Bpair}", "correctAnswerFractions": false, "numRows": "{row[1]}", "numColumns": "{col[1]}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LM03 Subtracting matrices", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "

Generates two sets of matrices that can be added and asks the student to add them. Will ensure that the dimensions in part a) are different to the dimensions in part b) to offer some variety.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Subtracting Matrices

\n

Calculate the following:

", "advice": "

Matrix subtraction is fairly straightforward in that each entry is calculated by subtracting the corresponding entries. For example the top left entry of the answer to part a) can be calculated as $\\var{A[0][0]} - \\var{Apair[0][0]} = \\var{A[0][0] - Apair[0][0]}$. So for this question:

\n

a) $\\var{A}-\\var{Apair} = \\var{A-Apair}$

\n

b) $\\var{B}-\\var{Bpair} = \\var{B-Bpair}$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"A": {"name": "A", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[0]),row[0]))", "description": "", "templateType": "anything", "can_override": false}, "col": {"name": "col", "group": "Ungrouped variables", "definition": "repeat(random(2..3),3)", "description": "", "templateType": "anything", "can_override": false}, "row": {"name": "row", "group": "Ungrouped variables", "definition": "repeat(random(2..3),3)", "description": "", "templateType": "anything", "can_override": false}, "B": {"name": "B", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[1]),row[1]))", "description": "", "templateType": "anything", "can_override": false}, "C": {"name": "C", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[2]),row[2]))", "description": "", "templateType": "anything", "can_override": false}, "Apair": {"name": "Apair", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[0]),row[0]))", "description": "", "templateType": "anything", "can_override": false}, "Bpair": {"name": "Bpair", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[1]),row[1]))", "description": "", "templateType": "anything", "can_override": false}, "Cpair": {"name": "Cpair", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[2]),row[2]))", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "col[0]<>row[0] AND col[0]<>col[1]", "maxRuns": 100}, "ungrouped_variables": ["col", "row", "A", "Apair", "B", "Bpair", "C", "Cpair"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "matrix", "useCustomName": true, "customName": "a)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{A} - \\var{Apair}=$

", "correctAnswer": "{A}-{Apair}", "correctAnswerFractions": false, "numRows": "{row[0]}", "numColumns": "{col[0]}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": true, "customName": "b)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{B} -\\var{Bpair}$

", "correctAnswer": "{B}-{Bpair}", "correctAnswerFractions": false, "numRows": "{row[1]}", "numColumns": "{col[1]}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LM04 Multiplying matrices", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Multiplying Matrices

\n

Calculate the following:

", "advice": "

When you are multiplying two matrices together you need to know what elements of each matrix multiply with each other to produce the answer. In order to look at this let's define the two matrices:

\n

$A=\\var{MatrixA1}$

\n

and

\n

$B=\\var{MatrixA2}.$

\n

These two matrices match the dimensions of the two given in is part a) of this question. When they are multiplied together as we have seen the answer will be a $\\var{row[0]}$ by $\\var{col[0]}$ matrix. So we can denote this matrix in the following way:

\n

$\\var{MatrixA1}$X$\\var{MatrixA2}=\\var{Answermatrixa}$

\n

The way in which this is calculated is as follows in terms of a formula:

\n

$\\var{Answermatrixa}=\\var{matrixmultcalc}$

\n

If you are trying to calculate $c_{11}$ for example one way to think of this is to imagine picking up the first column of the second matrix and tipping it on its side and laying it on top of the top row of the first matrix so, for example, $a_{11}$ gets paired with $b_{11}$ and $a_{12}$ gets paired with $b_{21}$ etc. As we can see in the above formula.

\n

\n

a) $\\var{A}$X$\\var{Apair} = \\var{A*Apair}$

\n

b) $\\var{B}$X$\\var{Bpair} = \\var{B*Bpair}$

\n

b) $\\var{C}$X$\\var{Cpair} = \\var{C*Cpair}$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"A": {"name": "A", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),match[0]),row[0]))", "description": "", "templateType": "anything", "can_override": false}, "col": {"name": "col", "group": "Ungrouped variables", "definition": "repeat(random(1..3),3)", "description": "", "templateType": "anything", "can_override": false}, "B": {"name": "B", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),match[1]),row[1]))", "description": "", "templateType": "anything", "can_override": false}, "C": {"name": "C", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),match[2]),row[2]))", "description": "", "templateType": "anything", "can_override": false}, "Apair": {"name": "Apair", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[0]),match[0]))", "description": "", "templateType": "anything", "can_override": false}, "Bpair": {"name": "Bpair", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[1]),match[1]))", "description": "", "templateType": "anything", "can_override": false}, "Cpair": {"name": "Cpair", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-9..9),col[2]),match[2]))", "description": "", "templateType": "anything", "can_override": false}, "match": {"name": "match", "group": "Ungrouped variables", "definition": "repeat(random(2..4),3)", "description": "", "templateType": "anything", "can_override": false}, "Rawanswermatrixa": {"name": "Rawanswermatrixa", "group": "Advice", "definition": "map('c_{'+'{j}'+'{l}}'+latexcodebits(row[0],col[0])[j-1][l-1],[j,l],product(1..row[0],1..col[0]))", "description": "

\"Latexcodebits\" is a JME function written in the Extensions and scripts section. It is a useful function for creating a list of symbols such as \"a_11\" to populate a matrix for the explanation section.

", "templateType": "anything", "can_override": false}, "row": {"name": "row", "group": "Ungrouped variables", "definition": "repeat(random(2..4),3)", "description": "", "templateType": "anything", "can_override": false}, "answermatrixa": {"name": "answermatrixa", "group": "Advice", "definition": "latex('\\\\begin{pmatrix}'+ stringify(rawanswermatrixa) + '\\\\end{'+'pmatrix}')", "description": "

\"stringify\" is a javascript written in the Extensions and scripts section - this converts a list of things into a string suitable for latex to read as a matrix.

", "templateType": "anything", "can_override": false}, "RawmatrixA1": {"name": "RawmatrixA1", "group": "Advice", "definition": "map('a_{'+'{j}'+'{l}}'+latexcodebits(row[0],match[0])[j-1][l-1],[j,l],product(1..row[0],1..match[0]))", "description": "", "templateType": "anything", "can_override": false}, "RawmatrixA2": {"name": "RawmatrixA2", "group": "Advice", "definition": "map('b_{'+'{j}'+'{l}}'+Latexcodebits(match[0],col[0])[j-1][l-1],[j,l],product(1..match[0],1..col[0]))", "description": "", "templateType": "anything", "can_override": false}, "matrixA1": {"name": "matrixA1", "group": "Advice", "definition": "latex('\\\\begin{pmatrix}'+ stringify(RawmatrixA1) + '\\\\end{'+'pmatrix}')", "description": "", "templateType": "anything", "can_override": false}, "matrixA2": {"name": "matrixA2", "group": "Advice", "definition": "latex('\\\\begin{pmatrix}'+ stringify(RawmatrixA2) + '\\\\end{'+'pmatrix}')", "description": "", "templateType": "anything", "can_override": false}, "Rawmatrixmultcalc": {"name": "Rawmatrixmultcalc", "group": "Advice", "definition": "map('a_\\{{r+1}{t+1}\\}'+'\\\\cdot'+' b_\\{{t+1}{s+1}\\}'+latexcodebitsproductcalc(row[0],match[0],col[0])[r][s][t],[r,s,t],product(0..(row[0]-1),0..(col[0]-1),0..(match[0]-1)))", "description": "", "templateType": "anything", "can_override": false}, "matrixmultcalc": {"name": "matrixmultcalc", "group": "Advice", "definition": "latex('\\\\begin{pmatrix}'+ stringify(rawmatrixmultcalc) +'\\\\end{'+'pmatrix}')", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["col", "row", "match", "A", "Apair", "B", "Bpair", "C", "Cpair"], "variable_groups": [{"name": "matrix notation", "variables": []}, {"name": "Advice", "variables": ["RawmatrixA1", "matrixA1", "RawmatrixA2", "matrixA2", "Rawanswermatrixa", "answermatrixa", "Rawmatrixmultcalc", "matrixmultcalc"]}], "functions": {"Latexcodebits": {"parameters": [["m", "number"], ["n", "number"]], "type": "list", "language": "jme", "definition": "repeat(repeat('&',n-1)+['\\\\\\\\'],m-1)+[repeat('&',n-1)+['']]"}, "stringify": {"parameters": [["input", "list"]], "type": "string", "language": "javascript", "definition": "var output = '';\nvar i;\nfor (i = 0; i < input.length; i++) {\n output += input[i];\n} \nreturn output;"}, "Latexcodebitsproductcalc": {"parameters": [["m", "number"], ["k", "number"], ["n", "number"]], "type": "anything", "language": "jme", "definition": "repeat(repeat(repeat('+',k-1)+['&'],n-1)+[repeat('+',k-1)+['\\\\\\\\']],m-1)+[repeat(repeat('+',k-1)+['&'],n-1)+[repeat('+',k-1)+['']]]"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "matrix", "useCustomName": true, "customName": "a)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{A}$X$\\var{Apair}=$

", "correctAnswer": "{A}*{Apair}", "correctAnswerFractions": false, "numRows": "{row[0]}", "numColumns": "{col[0]}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": true, "customName": "b)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{B}$X$\\var{Bpair}$

", "correctAnswer": "{B}*{Bpair}", "correctAnswerFractions": false, "numRows": "{row[1]}", "numColumns": "{col[1]}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": true, "customName": "c)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{C}$X$\\var{Cpair}$

", "correctAnswer": "{C}*{Cpair}", "correctAnswerFractions": false, "numRows": "{row[2]}", "numColumns": "{col[2]}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LM05 Determinant of a 2x2 matrix", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

The determinant of a 2x2 matrix:

\n

Calculate the determinant of the following 2X2 matrices.

", "advice": "

Determinant

\n

The detrminant of a 2x2 matrix can be calculated using the following process:

\n

$$
\\begin{vmatrix}
a & b \\\\
c & d \\\\
\\end{vmatrix} = ad-bc.
$$

\n

Example

\n

For $A = \\var{nonzerodet2},$

\n

we have that,

\n

$$
\\begin{vmatrix}
\\var{nonzerodet2[0][0]} & \\var{nonzerodet2[0][1]}\\\\
\\var{nonzerodet2[1][0]} & \\var{nonzerodet2[1][1]}\\\\
\\end{vmatrix}=(\\var{nonzerodet2[0][0]})(\\var{nonzerodet2[1][1]}) - (\\var{nonzerodet2[0][1]})(\\var{nonzerodet2[1][0]}) =\\var{detnonzerodet2} 
$$ 

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"nonzerodet1": {"name": "nonzerodet1", "group": "Ungrouped variables", "definition": "matrix([a[0],a[1]],[a[2],ceil(a[1]*a[2]/a[0]+random(1..4))])", "description": "", "templateType": "anything", "can_override": false}, "nonzerodet2": {"name": "nonzerodet2", "group": "Ungrouped variables", "definition": "matrix([b[0],b[1]],[b[2],ceil(b[1]*b[2]/b[0]+random(1..4))])", "description": "", "templateType": "anything", "can_override": false}, "zerodet1": {"name": "zerodet1", "group": "Ungrouped variables", "definition": "matrix([c[0],c[1]],[3*c[0],3*c[1]])", "description": "", "templateType": "anything", "can_override": false}, "zerodet2": {"name": "zerodet2", "group": "Ungrouped variables", "definition": "Matrix([2*c[0],5*c[0]],[2*c[1],5*c[1]])", "description": "", "templateType": "anything", "can_override": false}, "detnonzerodet2": {"name": "detnonzerodet2", "group": "Ungrouped variables", "definition": "det(nonzerodet2)", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "repeat(random(-9..9 except 0),3)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "repeat(random(-9..9 except 0),3)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "repeat(random(-9..9 except 0),2)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "nonzerodet1", "b", "nonzerodet2", "c", "zerodet1", "zerodet2", "detnonzerodet2"], "variable_groups": [{"name": "matrix notation", "variables": []}], "functions": {"Latexcodebits": {"parameters": [["m", "number"], ["n", "number"]], "type": "list", "language": "jme", "definition": "repeat(repeat('&',n-1)+['\\\\\\\\'],m-1)+[repeat('&',n-1)+['']]"}, "stringify": {"parameters": [["input", "list"]], "type": "string", "language": "javascript", "definition": "var output = '';\nvar i;\nfor (i = 0; i < input.length; i++) {\n output += input[i];\n} \nreturn output;"}, "Latexcodebitsproductcalc": {"parameters": [["m", "number"], ["k", "number"], ["n", "number"]], "type": "anything", "language": "jme", "definition": "repeat(repeat(repeat('+',k-1)+['&'],n-1)+[repeat('+',k-1)+['\\\\\\\\']],m-1)+[repeat(repeat('+',k-1)+['&'],n-1)+[repeat('+',k-1)+['']]]"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "a)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$$
A=\\var{nonzerodet2}
$$

\n

\n

$
\\text{What is the value of}\\begin{vmatrix}
A
\\end{vmatrix}?
$

\n

answer:[[0]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "nonzerodet2", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{detnonzerodet2}", "maxValue": "{detnonzerodet2}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": true, "customName": "b)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$$
m=\\var{zerodet1}
$$

\n

\n

$
\\text{What is the value of}\\begin{vmatrix}
M
\\end{vmatrix}?
$

answer:[[0]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "zerodet1", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "0", "maxValue": "0", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LM06 Inverse of a 2x2 matrix", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Poppy Jeffries", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21275/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

The inverse of a 2x2 matrix

", "advice": "

Can the inverse of a 2X2 Matrix be found?

\n

The inverse of a matrix can be found if the matrix is a square matrix and has a non-zero determinant. In the first part of this question all the matruces are 2X2 square matrices. The detrminant can be calculated by doing:

\n

$$
\\begin{vmatrix}
a & b \\\\
c & d \\\\
\\end{vmatrix} = ad-bc
$$

\n

If this comes out to be non-zero then the determinant can be found.

\n

Finding the Inverse of a 2x2 Matrix

\n

If there are two 2x2 matrices $A$ and $B$ such that:

\n

$$
AB=BA=
\\left( \\begin{matrix}
1 & 0 \\\\
0 & 1 \\\\
\\end{matrix}\\right)
$$

\n

then we can say that $A$ and $B$ are inverses of each other. The notation for this is that the inverse of a matrix $C$ is written as $C^{-1}$.

\n

If,

\n

$$
C=
\\left(\\begin{matrix}
a & b \\\\
c & d \\\\
\\end{matrix}\\right),
$$

\n

then, the inverse of $C$ is given by the formula:

\n

$$
C^{-1}=\\frac{1}{ad-bc}
\\left(\\begin{matrix}
d & -b \\\\
-c & a \\\\
\\end{matrix}\\right),
$$

\n

So for part 2) of this question let's call the given matrix $D$:

\n

$D=\\var{nonzerodet1}.$

\n

The inverse of $D$ is calculated as follows:

\n

$$
D^{-1} = \\frac{1}{(\\var{nonzerodet1[0][0]})(\\var{nonzerodet1[1][1]})-(\\var{nonzerodet1[1][0]})(\\var{nonzerodet1[0][1]})}\\left(\\begin{matrix}
\\var{nonzerodet1[1][1]} & \\var{-nonzerodet1[0][1]} \\\\
\\var{-nonzerodet1[1][0]} & \\var{nonzerodet1[0][0]} \\\\
\\end{matrix}\\right)
= \\var{inversenonzerodet1}
$$

\n

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"nonzerodet1": {"name": "nonzerodet1", "group": "Ungrouped variables", "definition": "matrix([a[0],a[1]],[a[2],ceil(a[1]*a[2]/a[0]+random(1..4))])", "description": "", "templateType": "anything", "can_override": false}, "nonzerodet2": {"name": "nonzerodet2", "group": "Ungrouped variables", "definition": "matrix([b[0],b[1]],[b[2],ceil(b[1]*b[2]/b[0]+random(1..4))])", "description": "", "templateType": "anything", "can_override": false}, "zerodet1": {"name": "zerodet1", "group": "Ungrouped variables", "definition": "matrix([c[0],c[1]],[3*c[0],3*c[1]])", "description": "", "templateType": "anything", "can_override": false}, "zerodet2": {"name": "zerodet2", "group": "Ungrouped variables", "definition": "Matrix([2*c[0],5*c[0]],[2*c[1],5*c[1]])", "description": "", "templateType": "anything", "can_override": false}, "inversenonzerodet1": {"name": "inversenonzerodet1", "group": "Ungrouped variables", "definition": "inverse(nonzerodet1)", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "repeat(random(-9..9 except 0),3)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "repeat(random(-9..9 except 0),3)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "repeat(random(-9..9 except 0),2)", "description": "", "templateType": "anything", "can_override": false}, "precision": {"name": "precision", "group": "Ungrouped variables", "definition": "max(max(abs(inversenonzerodet1[0][0]-siground(inversenonzerodet1[0][0],3)),abs(inversenonzerodet1[0][1]-siground(inversenonzerodet1[0][1],3))),max(abs(inversenonzerodet1[1][0]-siground(inversenonzerodet1[1][0],3)),abs(inversenonzerodet1[1][1]-siground(inversenonzerodet1[1][1],3))))", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "nonzerodet1", "b", "nonzerodet2", "c", "zerodet1", "zerodet2", "inversenonzerodet1", "precision"], "variable_groups": [{"name": "matrix notation", "variables": []}], "functions": {"Latexcodebits": {"parameters": [["m", "number"], ["n", "number"]], "type": "list", "language": "jme", "definition": "repeat(repeat('&',n-1)+['\\\\\\\\'],m-1)+[repeat('&',n-1)+['']]"}, "stringify": {"parameters": [["input", "list"]], "type": "string", "language": "javascript", "definition": "var output = '';\nvar i;\nfor (i = 0; i < input.length; i++) {\n output += input[i];\n} \nreturn output;"}, "Latexcodebitsproductcalc": {"parameters": [["m", "number"], ["k", "number"], ["n", "number"]], "type": "anything", "language": "jme", "definition": "repeat(repeat(repeat('+',k-1)+['&'],n-1)+[repeat('+',k-1)+['\\\\\\\\']],m-1)+[repeat(repeat('+',k-1)+['&'],n-1)+[repeat('+',k-1)+['']]]"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "m_n_2", "useCustomName": true, "customName": "1)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

For which of the following matrices can the inverse be calculated?

", "minMarks": 0, "maxMarks": "2", "shuffleChoices": true, "displayType": "checkbox", "displayColumns": 0, "minAnswers": 0, "maxAnswers": "2", "warningType": "none", "showCellAnswerState": true, "markingMethod": "sum ticked cells", "choices": ["$\\var{nonzerodet1}$", "$\\var{nonzerodet2}$", "$\\var{zerodet1}$", "$\\var{zerodet2}$"], "matrix": ["1", "1", 0, 0], "distractors": ["", "", "", ""]}, {"type": "matrix", "useCustomName": true, "customName": "2)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is the inverses of the following matrix?

\n

(Enter your answers as fractions or decimals to 3 significant figures).

\n

\n

$\\var{nonzerodet1}$

", "correctAnswer": "{inversenonzerodet1}", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": false, "tolerance": "{precision}", "markPerCell": false, "allowFractions": true, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LM07 Transpose of a matrix", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Find the transpose of the following matrices:

", "advice": "

Transposing a matrix

\n

To transpose a matrix you have to swap over the rows and columns. So for example a 3 by 2 matrix will have a transpose that is a 2 by 3 matrix. The elements of the transpose of a matrix also swap places following the same rule.

\n

Example: 

\n

From part b) of the question you have the matrix $M$ given by:

\n

$M=\\var{Transpose1}.$

\n

Swapping the rows with the columns (for example meaning the first row becomes the first column in the transpose), gives the answer:

\n

$M^{T}=\\var{answer}.$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"matrixdim": {"name": "matrixdim", "group": "matrix notation", "definition": "repeat(random(1..4),2)", "description": "", "templateType": "anything", "can_override": false}, "transpose1": {"name": "transpose1", "group": "matrix notation", "definition": "matrix(repeat(repeat(random(-9..9),matrixdim[1]),matrixdim[0]))", "description": "", "templateType": "anything", "can_override": false}, "squarematrixdim": {"name": "squarematrixdim", "group": "matrix notation", "definition": "random(2..4)", "description": "", "templateType": "anything", "can_override": false}, "squaretranspose": {"name": "squaretranspose", "group": "matrix notation", "definition": "matrix(repeat(repeat(random(-9..9),squarematrixdim),squarematrixdim))", "description": "", "templateType": "anything", "can_override": false}, "answer": {"name": "answer", "group": "matrix notation", "definition": "transpose(transpose1)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "matrixdim[0]<>matrixdim[1]", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "matrix notation", "variables": ["matrixdim", "transpose1", "squarematrixdim", "squaretranspose", "answer"]}], "functions": {"Latexcodebits": {"parameters": [["m", "number"], ["n", "number"]], "type": "list", "language": "jme", "definition": "repeat(repeat('&',n-1)+['\\\\\\\\'],m-1)+[repeat('&',n-1)+['']]"}, "stringify": {"parameters": [["input", "list"]], "type": "string", "language": "javascript", "definition": "var output = '';\nvar i;\nfor (i = 0; i < input.length; i++) {\n output += input[i];\n} \nreturn output;"}, "Latexcodebitsproductcalc": {"parameters": [["m", "number"], ["k", "number"], ["n", "number"]], "type": "anything", "language": "jme", "definition": "repeat(repeat(repeat('+',k-1)+['&'],n-1)+[repeat('+',k-1)+['\\\\\\\\']],m-1)+[repeat(repeat('+',k-1)+['&'],n-1)+[repeat('+',k-1)+['']]]"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "matrix", "useCustomName": true, "customName": "a)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{squaretranspose}$

", "correctAnswer": "transpose(squaretranspose)", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": "6", "minRows": 1, "maxRows": "6", "prefilledCells": ""}, {"type": "matrix", "useCustomName": true, "customName": "b)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{Transpose1}$

", "correctAnswer": "transpose(transpose1)", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": "6", "minRows": 1, "maxRows": "6", "prefilledCells": ""}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LM08 Determinant of a 3x3 matrix", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Violeta CIT", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1030/"}, {"name": "Marie Nicholson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1799/"}, {"name": "Timur Zaripov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3272/"}, {"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Tamsin Smith", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14108/"}, {"name": "Lauren Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21504/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}, {"name": "Fraser Buxton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/24224/"}], "tags": [], "metadata": {"description": "

Cofactors Determinant and inverse of a 3x3 matrix.

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

The Determinant of a 3x3 matrix

", "advice": "

Determinant of a 3X3 matrix

\n

Minors

\n

In order to understand the process of finding a determinant for a 3x3 (or larger square) matrix we introduce the idea of a minor.

\n

For example we will look at the matrix, $M$, defined as

\n

$$
M = \\var{Example}.
$$

\n

Each element of $M$ has an associated minor. The minor is formed from finding the detrminant of the remaining matrix after you have removed the row and column containg that element. For example, consider the minor for element $m_{12} = 2$. We remove the row and column containg $m_{12}$ (the top row and the second column) leaving:

\n

$$
\\begin{vmatrix}
4 & 6\\\\
7 & 9
\\end{vmatrix} = 4*9-6*7 = -6
$$

\n

Cofactors

\n

The next important concept is a cofactor (you don't need to calculate ALL of the cofactors for finding a determinant but you will need them to go on and find the inverse of a 3x3 matrix). A cofactor is the a minor with a sign attached. The appropriate sign comes from the pattern of alternating signs:

\n

\n

$$
\\begin{array}{ccc}
+ & - & +\\\\
- & + & - \\\\
+ & - & +\\\\
\\end{array}
$$

\n

So to continue the example above we would say the cofactor for entry $m_{12} = -(-6) = 6$.

\n

The determinant is then calculated by choosing a row or column and taking the sum of the entries multiplied by their cofactors.

\n

Putting it all together

\n

For simplicity we will choose the top row for this example.

\n

$$
\\begin{aligned}
\\det{M} &= 1*\\begin{vmatrix}
5 & 6 \\\\
8 & 9 \\\\
\\end{vmatrix} - 2* \\begin{vmatrix}
4 & 6 \\\\
7 & 9 \\\\
\\end{vmatrix} + 3* \\begin{vmatrix}
4 & 5 \\\\
7 & 8 \\\\
\\end{vmatrix} \\\\
&= 1 \\times -3 - \\left(2 \\times -6 \\right) + 3 \\times -3 \\\\
&= 0
\\end{aligned}
$$

\n

Worked solution

\n

For the question given the same calculation can be carried out as follows:

\n

$$
\\begin{aligned}
\\det{A}
&= \\var{matrixA[0][0]}
\\begin{vmatrix}
\\var{matrixA[1][1]} & \\var{matrixA[1][2]} \\\\
\\var{matrixA[2][1]} & \\var{matrixA[2][2]} \\\\
\\end{vmatrix} - \\var{matrixA[0][1]} \\begin{vmatrix}
\\var{matrixA[1][0]} & \\var{matrixA[1][2]} \\\\
\\var{matrixA[2][0]} & \\var{matrixA[2][2]} \\\\
\\end{vmatrix} + \\var{matrixA[0][2]} \\begin{vmatrix}
\\var{matrixA[1][0]} & \\var{matrixA[1][1]} \\\\
\\var{matrixA[2][0]} & \\var{matrixA[2][1]} \\\\
\\end{vmatrix} \\\\
&= \\var{matrixA[0][0]} \\times \\var{min11} - \\left(\\var{matrixA[0][1]} \\times \\var{min12}\\right) + \\var{matrixA[0][2]} \\times \\var{min13} \\\\
&= \\var{answer}
\\end{aligned}
$$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"min11": {"name": "min11", "group": "Ungrouped variables", "definition": "matrixa[1][1]*matrixa[2][2]- matrixA[2][1]*matrixa[1][2]", "description": "", "templateType": "anything", "can_override": false}, "min12": {"name": "min12", "group": "Ungrouped variables", "definition": "matrixa[1][0]*matrixa[2][2]- matrixA[2][0]*matrixa[1][2]", "description": "", "templateType": "anything", "can_override": false}, "min13": {"name": "min13", "group": "Ungrouped variables", "definition": "matrixa[1][0]*matrixa[2][1]- matrixA[2][0]*matrixa[1][1]", "description": "", "templateType": "anything", "can_override": false}, "matrixa": {"name": "matrixa", "group": "Unnamed group", "definition": "matrix(repeat(repeat(random(-10..10),3),3))", "description": "", "templateType": "anything", "can_override": false}, "answer": {"name": "answer", "group": "Unnamed group", "definition": "det(matrixa)", "description": "", "templateType": "anything", "can_override": false}, "deta": {"name": "deta", "group": "Ungrouped variables", "definition": "matrixa[0][0]*min11-matrixa[0][1]*min12+matrixa[0][2]*min13", "description": "", "templateType": "anything", "can_override": false}, "Example": {"name": "Example", "group": "Unnamed group", "definition": "matrix([1,2,3],[4,5,6],[7,8,9])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["min11", "min12", "min13", "deta"], "variable_groups": [{"name": "cofactors", "variables": []}, {"name": "Unnamed group", "variables": ["matrixa", "answer", "Example"]}], "functions": {"Latezcodebits": {"parameters": [["m", "number"], ["n", "number"]], "type": "list", "language": "jme", "definition": "repeat(repeat('&',n-1)+['\\\\\\\\'],m-1)+[repeat('&',n-1)+['']]"}, "stringify": {"parameters": [["input", "list"]], "type": "string", "language": "javascript", "definition": "var output = '';\nvar i;\nfor (i = 0; i < input.length; i++) {\n output += input[i];\n} \nreturn output;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Let:

\n

$$
A=\\var{matrixA}
$$

\n

Find the determinant of $A$

\n

$\\det A =$ [[0]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "det a", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "numberentry", "useCustomName": true, "customName": "decimal", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": false, "minValue": "answer", "maxValue": "answer", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "sigfig", "precision": "3", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "minValue": "answer", "maxValue": "answer", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LM09 Inverse of a 3x3 matrix", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Violeta CIT", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1030/"}, {"name": "Marie Nicholson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1799/"}, {"name": "Timur Zaripov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3272/"}, {"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Tamsin Smith", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14108/"}, {"name": "Poppy Jeffries", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21275/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}, {"name": "Fraser Buxton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/24224/"}], "tags": [], "metadata": {"description": "

Cofactors Determinant and inverse of a 3x3 matrix.

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

Finding the Inverse of a 3x3 Matrix

\n

Follow the steps in the questions to find the inverse of a $3 \\times 3$ matrix

", "advice": "

a)

\n

For simplicity, we will use the expansion of the first row to find the determinant

\n

$$
\\begin{aligned}
\\det{A} &= a_1A_1 + b_1B_1+ c_1C_1 \\\\
&= \\var{matrixA[0][0]}
\\begin{vmatrix}
\\var{matrixA[1][1]} & \\var{matrixA[1][2]} \\\\
\\var{matrixA[2][1]} & \\var{matrixA[2][2]} \\\\
\\end{vmatrix} - \\var{matrixA[0][1]} \\begin{vmatrix}
\\var{matrixA[1][0]} & \\var{matrixA[1][2]} \\\\
\\var{matrixA[2][0]} & \\var{matrixA[2][2]} \\\\
\\end{vmatrix} + \\var{matrixA[0][2]} \\begin{vmatrix}
\\var{matrixA[1][0]} & \\var{matrixA[1][1]} \\\\
\\var{matrixA[2][0]} & \\var{matrixA[2][1]} \\\\
\\end{vmatrix} \\\\
&= \\var{matrixA[0][0]} \\times \\var{cof11} - \\left(\\var{matrixA[0][1]} \\times \\var{cof12}\\right) + \\var{matrixA[0][2]} \\times \\var{cof13} \\\\
&= \\var{deta}
\\end{aligned}
$$

\n

b)

\n

Given arbitrary matrix

\n

$$
A = \\begin{pmatrix}
a & b & c \\\\
d & e & f \\\\
g & h & j \\\\
\\end{pmatrix}
$$

\n

It's cofactors are given by

\n

$$
\\begin{aligned}
A_{11} &=  +\\begin{vmatrix}
e & f \\\\
h & j \\\\
\\end{vmatrix} \\\\
&= +\\begin{vmatrix}
\\var{a22} & \\var{a23} \\\\
\\var{a32} & \\var{a33} \\\\
\\end{vmatrix} \\\\
&= \\var{cof11}
\\end{aligned}
$$

\n

$$
\\begin{aligned}
A_{12} &=  -\\begin{vmatrix}
d & f \\\\
g & j \\\\
\\end{vmatrix} \\\\
&= -\\begin{vmatrix}
\\var{a21} & \\var{a23} \\\\
\\var{a31} & \\var{a33} \\\\
\\end{vmatrix} \\\\
&= \\var{cof12}
\\end{aligned}
$$

\n

$$
\\begin{aligned}
A_{13} &=  +\\begin{vmatrix}
d & e \\\\
g & h \\\\
\\end{vmatrix} \\\\
&= +\\begin{vmatrix}
\\var{a21} & \\var{a22} \\\\
\\var{a31} & \\var{a32} \\\\
\\end{vmatrix} \\\\
&= \\var{cof13}
\\end{aligned}
$$

\n

$$
\\begin{aligned}
A_{21} &=  -\\begin{vmatrix}
b & c \\\\
h & j \\\\
\\end{vmatrix} \\\\
&= -\\begin{vmatrix}
\\var{a12} & \\var{a13} \\\\
\\var{a32} & \\var{a33} \\\\
\\end{vmatrix} \\\\
&= \\var{cof21}
\\end{aligned}
$$

\n

$$
\\begin{aligned}
A_{22} &=  +\\begin{vmatrix}
a & c \\\\
g & j \\\\
\\end{vmatrix} \\\\
&= +\\begin{vmatrix}
\\var{a11} & \\var{a13} \\\\
\\var{a31} & \\var{a33} \\\\
\\end{vmatrix} \\\\
&= \\var{cof22}
\\end{aligned}
$$

\n

$$
\\begin{aligned}
A_{23} &=  -\\begin{vmatrix}
a & b \\\\
g & h \\\\
\\end{vmatrix} \\\\
&= -\\begin{vmatrix}
\\var{a11} & \\var{a12} \\\\
\\var{a31} & \\var{a32} \\\\
\\end{vmatrix} \\\\
&= \\var{cof23}
\\end{aligned}
$$

\n

$$
\\begin{aligned}
A_{31} &=  +\\begin{vmatrix}
b & c \\\\
e & f \\\\
\\end{vmatrix} \\\\
&= +\\begin{vmatrix}
\\var{a12} & \\var{a13} \\\\
\\var{a22} & \\var{a23} \\\\
\\end{vmatrix} \\\\
&= \\var{cof31}
\\end{aligned}
$$

\n

$$
\\begin{aligned}
A_{32} &=  -\\begin{vmatrix}
a & c \\\\
d & f \\\\
\\end{vmatrix} \\\\
&= -\\begin{vmatrix}
\\var{a11} & \\var{a13} \\\\
\\var{a21} & \\var{a23} \\\\
\\end{vmatrix} \\\\
&= \\var{cof32}
\\end{aligned}
$$

\n

$$
\\begin{aligned}
A_{33} &=  +\\begin{vmatrix}
a & b \\\\
d & e \\\\
\\end{vmatrix} \\\\
&= +\\begin{vmatrix}
\\var{a11} & \\var{a12} \\\\
\\var{a21} & \\var{a22} \\\\
\\end{vmatrix} \\\\
&= \\var{cof33}
\\end{aligned}
$$

\n

c)

\n

Using our answer from the previous question, we simply write the cofactors in the form

\n

$$
\\begin{pmatrix}
A_{11} & A_{12} & A_{13} \\\\
A_{21} & A_{22} & A_{23} \\\\
A_{31} & A_{32} & A_{33} \\\\
\\end{pmatrix}
$$

\n

Giving us our matrix of cofactors

\n

$$
\\begin{pmatrix}
\\var{cof11} & \\var{cof12} & \\var{cof13} \\\\
\\var{cof21} & \\var{cof22} & \\var{cof23} \\\\
\\var{cof31} & \\var{cof32} & \\var{cof33} \\\\
\\end{pmatrix}
$$

\n

d)

\n

The transposition process turns rows into columns and columns into rows

\n

Carrying out this process on our matrix of cofactors gives us the adjugate

\n

$$
\\begin{pmatrix}
\\var{cof11} & \\var{cof21} & \\var{cof31} \\\\
\\var{cof12} & \\var{cof22} & \\var{cof32} \\\\
\\var{cof13} & \\var{cof23} & \\var{cof33} \\\\
\\end{pmatrix}
$$

\n

e)

\n

We can find the inverse of $A$ using our determinant and adjugate, using the formula

\n

$$
A^{-1} = \\frac{1}{\\det A}(adj \\; A)
$$

\n

Therefore, we can calculate $A^{-1}$ by

\n

$$
\\begin{aligned}
A^{-1} &= \\frac{1}{\\var{deta}} \\begin{pmatrix}
\\var{cof11} & \\var{cof21} & \\var{cof31} \\\\
\\var{cof12} & \\var{cof22} & \\var{cof32} \\\\
\\var{cof13} & \\var{cof23} & \\var{cof33} \\\\
\\end{pmatrix} \\\\
&= \\var{inverseA}
\\end{aligned}
$$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"inverseA": {"name": "inverseA", "group": "Ungrouped variables", "definition": "precround(matrix([cof11,cof21,cof31],[cof12,cof22,cof32],[cof13,cof23,cof33])/detA,2)", "description": "", "templateType": "anything", "can_override": false}, "cof22": {"name": "cof22", "group": "cofactors", "definition": "a11*a33-a31*a13", "description": "", "templateType": "anything", "can_override": false}, "a12": {"name": "a12", "group": "Ungrouped variables", "definition": "random(0..10)", "description": "", "templateType": "anything", "can_override": false}, "cof11": {"name": "cof11", "group": "cofactors", "definition": "a22*a33-a32*a23", "description": "", "templateType": "anything", "can_override": false}, "a32": {"name": "a32", "group": "Ungrouped variables", "definition": "random(0..10)", "description": "", "templateType": "anything", "can_override": false}, "cof23": {"name": "cof23", "group": "cofactors", "definition": "a12*a31-a11*a32", "description": "

cof23

", "templateType": "anything", "can_override": false}, "a22": {"name": "a22", "group": "Ungrouped variables", "definition": "random(0..5 except(a21*a12/a11))", "description": "", "templateType": "anything", "can_override": false}, "cof32": {"name": "cof32", "group": "cofactors", "definition": "a13*a21-a11*a23", "description": "", "templateType": "anything", "can_override": false}, "a21": {"name": "a21", "group": "Ungrouped variables", "definition": "random(0..10)", "description": "", "templateType": "anything", "can_override": false}, "cof13": {"name": "cof13", "group": "cofactors", "definition": "a21*a32-a31*a22", "description": "", "templateType": "anything", "can_override": false}, "matrixA": {"name": "matrixA", "group": "Ungrouped variables", "definition": "matrix([a11,a12,a13],[a21,a22,a23],[a31,a32,a33])", "description": "", "templateType": "anything", "can_override": false}, "a31": {"name": "a31", "group": "Ungrouped variables", "definition": "random(0..10)", "description": "", "templateType": "anything", "can_override": false}, "cof21": {"name": "cof21", "group": "cofactors", "definition": "a32*a13-a12*a33", "description": "", "templateType": "anything", "can_override": false}, "a13": {"name": "a13", "group": "Ungrouped variables", "definition": "random(-5..10)", "description": "", "templateType": "anything", "can_override": false}, "cof12": {"name": "cof12", "group": "cofactors", "definition": "a23*a31-a21*a33", "description": "", "templateType": "anything", "can_override": false}, "cof33": {"name": "cof33", "group": "cofactors", "definition": "a11*a22-a12*a21", "description": "", "templateType": "anything", "can_override": false}, "cof31": {"name": "cof31", "group": "cofactors", "definition": "a12*a23-a22*a13", "description": "", "templateType": "anything", "can_override": false}, "detA": {"name": "detA", "group": "Ungrouped variables", "definition": "a11*cof11+a12*cof12+a13*cof13", "description": "", "templateType": "anything", "can_override": false}, "a23": {"name": "a23", "group": "Ungrouped variables", "definition": "random(-4..4)", "description": "", "templateType": "anything", "can_override": false}, "a33": {"name": "a33", "group": "Ungrouped variables", "definition": "random(0..20)", "description": "", "templateType": "anything", "can_override": false}, "a11": {"name": "a11", "group": "Ungrouped variables", "definition": "random(-3..3)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "deta <> 0", "maxRuns": 100}, "ungrouped_variables": ["matrixA", "a11", "a12", "a21", "a22", "a13", "a23", "a31", "a32", "a33", "inverseA", "detA"], "variable_groups": [{"name": "cofactors", "variables": ["cof11", "cof12", "cof13", "cof21", "cof22", "cof23", "cof31", "cof32", "cof33"]}, {"name": "Unnamed group", "variables": []}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Let:

\n

$$
A=\\var{matrixA}
$$

\n

Find the determinant of $A$

\n

$\\det A =$ [[0]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "det a", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "det(matrixA)", "maxValue": "det(matrixA)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate the nine cofactors of $A$

\n

The cofactor $A_{ij}$ denotes the cofactor in row $i$ and column $j$

\n

$A _{11}=$ [[0]]

\n

$A_{12}=$ [[1]]

\n

$A_{13}=$ [[2]]

\n

$A_{21}=$ [[3]]

\n

$A_{22}=$ [[4]]

\n

$A_{23}=$ [[5]]

\n

$A_{31}=$ [[6]]

\n

$A_{32}=$ [[7]]

\n

$A_{33}=$ [[8]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{cof11}", "maxValue": "{cof11}", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{cof12}", "maxValue": "{cof12}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{cof13}", "maxValue": "{cof13}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{cof21}", "maxValue": "{cof21}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{cof22}", "maxValue": "{cof22}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{cof23}", "maxValue": "{cof23}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{cof31}", "maxValue": "{cof31}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{cof32}", "maxValue": "{cof32}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{cof33}", "maxValue": "{cof33}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Using your answer to part $b)$, state the matrix of cofactors

\n

[[0]]

", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "matrix([cof11,cof12,cof13],[cof21,cof22,cof23],[cof31,cof32,cof33])", "correctAnswerFractions": false, "numRows": "3", "numColumns": "3", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the transpose of your matrix from part $c)$, giving us the adjugate 

\n

[[0]]

", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "matrix([cof11,cof21,cof31],[cof12,cof22,cof32],[cof13,cof23,cof33])", "correctAnswerFractions": false, "numRows": "3", "numColumns": "3", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Using your answers from all the previous parts, find the inverse of $A$

\n

Elements will be accepted as fractions or correct to 2 decimal places

\n

$A^{-1}=$ [[0]]

", "gaps": [{"type": "matrix", "useCustomName": true, "customName": "inv a", "marks": "4", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "cof11", "part": "p1g0", "must_go_first": true}, {"variable": "cof12", "part": "p1g1", "must_go_first": true}, {"variable": "cof13", "part": "p1g2", "must_go_first": true}, {"variable": "cof21", "part": "p1g3", "must_go_first": true}, {"variable": "cof22", "part": "p1g4", "must_go_first": true}, {"variable": "cof23", "part": "p1g5", "must_go_first": true}, {"variable": "cof31", "part": "p1g6", "must_go_first": true}, {"variable": "cof32", "part": "p1g7", "must_go_first": true}, {"variable": "cof33", "part": "p1g8", "must_go_first": true}, {"variable": "detA", "part": "p0g0", "must_go_first": true}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "matrix([cof11,cof21,cof31],[cof12,cof22,cof32],[cof13,cof23,cof33])/det(matrixA)", "correctAnswerFractions": false, "numRows": "3", "numColumns": "3", "allowResize": false, "tolerance": "0.005", "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LN01 The L0 Norm", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

What is the $L^{0}$ norm of the following vectors

", "advice": "

The L-zero \"norm\"

\n

The $L^{0}$ norm of a vector is not actually a norm (by the formal definition). However, it is a useful tool with practical usage in computing. It simply counts the number of non-zero elements of a vector. So for example you can set up code that returns \"true\" (=0) and \"false\" (=1) to check if a username and password combination are correct. If they are both correct then the vector would be $(0,0)$ in which case the $L^{0}$ norm would return the value $0$ and the log in would be successful. In all other cases (such as correct username but incorrect password) the $L^{0}$ norm would return a non-zero value and you could use this to ensure the login is unsuccessful.

\n

For more information on norms read (for example) this.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"vector1": {"name": "vector1", "group": "Ungrouped variables", "definition": "vector(repeat(random(-2,-1,0,0,0,1,2,3),rowsa))", "description": "", "templateType": "anything", "can_override": false}, "vector2": {"name": "vector2", "group": "Ungrouped variables", "definition": "vector(repeat(random(-2,0,0,0,3),rowsb))", "description": "", "templateType": "anything", "can_override": false}, "answera": {"name": "answera", "group": "Ungrouped variables", "definition": "countnonzero(vector1)", "description": "", "templateType": "anything", "can_override": false}, "answerb": {"name": "answerb", "group": "Ungrouped variables", "definition": "countnonzero(vector2)", "description": "", "templateType": "anything", "can_override": false}, "answerc": {"name": "answerc", "group": "Ungrouped variables", "definition": "answera", "description": "", "templateType": "anything", "can_override": false}, "rowsa": {"name": "rowsa", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "templateType": "anything", "can_override": false}, "rowsb": {"name": "rowsb", "group": "Ungrouped variables", "definition": "random(2,3,4)", "description": "", "templateType": "anything", "can_override": false}, "number": {"name": "number", "group": "Ungrouped variables", "definition": "random(-4,5,-6,3,-2,7)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["vector1", "vector2", "answera", "answerb", "answerc", "rowsa", "rowsb", "number"], "variable_groups": [], "functions": {"countnonzero": {"parameters": [["vector", "vector"]], "type": "number", "language": "javascript", "definition": "var output = 0;\nvar i;\n let count = 0;\n for (let i = 0; i < vector.length; i++) {\n if (vector[i] !== 0) {\n output++;\n }\n }\n return output;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{vector1}$

", "minValue": "answera", "maxValue": "answera", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{vector2}$

", "minValue": "answerb", "maxValue": "answerb", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{number} \\times \\var{vector1}$

", "minValue": "answerc", "maxValue": "answerc", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LN02 The L1 Norm", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

What is the $L^{1}$ norm of the following vectors

", "advice": "

The L-one norm

\n

The $L^{1}$ norm of a vector is found by adding up the absolute value of all of the elements of the vector.

\n

So, introducing the $\\left| \\bf{v} \\right|_1$ notation for the $L^{1}$ norm, gives the definition:

\n

$$
\\begin{vmatrix}
\\left(
\\begin{array}{l}
x\\\\
y\\\\
z\\\\
\\end{array}
\\right)
\\end{vmatrix}_1 =\\left|x\\right| + \\left| y \\right| + \\left| z \\right|
$$

\n

Therefore, for example, a) has the answer:

\n

$$
\\begin{vmatrix}
\\var{vector1}
\\end{vmatrix}_1 = \\var{advice} = \\var{answera}
$$

\n

For more information on norms read (for example) this.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"vector1": {"name": "vector1", "group": "Ungrouped variables", "definition": "vector(repeat(random(-4..4),rowsa))", "description": "", "templateType": "anything", "can_override": false}, "vector2": {"name": "vector2", "group": "Ungrouped variables", "definition": "vector(repeat(random(-6..2),rowsb))", "description": "", "templateType": "anything", "can_override": false}, "answera": {"name": "answera", "group": "Ungrouped variables", "definition": "sumabsval(vector1)", "description": "", "templateType": "anything", "can_override": false}, "answerb": {"name": "answerb", "group": "Ungrouped variables", "definition": "sumabsval(vector2)", "description": "", "templateType": "anything", "can_override": false}, "answerc": {"name": "answerc", "group": "Ungrouped variables", "definition": "abs(number)*answera", "description": "", "templateType": "anything", "can_override": false}, "rowsa": {"name": "rowsa", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "templateType": "anything", "can_override": false}, "rowsb": {"name": "rowsb", "group": "Ungrouped variables", "definition": "random(2,3,4)", "description": "", "templateType": "anything", "can_override": false}, "number": {"name": "number", "group": "Ungrouped variables", "definition": "random(-4,5,-6,3,-2,7)", "description": "", "templateType": "anything", "can_override": false}, "rawadviceabs": {"name": "rawadviceabs", "group": "Ungrouped variables", "definition": "map('|\\\\' + 'var{'+'vector1[{i-1}]'+'}|'+ latexcodebits(rowsa)[i-1],[dummy,i],product(1..1,1..rowsa))", "description": "", "templateType": "anything", "can_override": false}, "advice": {"name": "advice", "group": "Ungrouped variables", "definition": "latex(stringify(rawadviceabs))", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["vector1", "vector2", "answera", "answerb", "answerc", "rowsa", "rowsb", "number", "rawadviceabs", "advice"], "variable_groups": [], "functions": {"sumabsval": {"parameters": [["vector", "vector"]], "type": "number", "language": "javascript", "definition": "var output = 0;\nvar i;\n let count = 0;\n for (let i = 0; i < vector.length; i++) {\n if (vector[i] !== 0) {\n output = output + Math.abs(vector[i]);\n }\n }\n return output;"}, "Latexcodebits": {"parameters": [["n", "number"]], "type": "anything", "language": "jme", "definition": "repeat('+',n-1)+['']"}, "Stringify": {"parameters": [["input", "list"]], "type": "string", "language": "javascript", "definition": "var output = '';\nvar i;\nfor (i = 0; i < input.length; i++) {\n output += input[i];\n} \nreturn output;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{vector1}$

", "minValue": "answera", "maxValue": "answera", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{vector2}$

", "minValue": "answerb", "maxValue": "answerb", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{number} \\times \\var{vector1}$

", "minValue": "answerc", "maxValue": "answerc", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LN03 The L2 Norm", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

What is the $L^{2}$ norm of the following vectors

", "advice": "

The L-two norm

\n

The $L^{2}$ norm of a vector is found by doing pythagoras' theorem and is our usual definition of \"length\".

\n

So, introducing the $\\left| \\bf{v} \\right|_2$ notation for the $L^{2}$ norm, gives the definition (for a vector with 3 elements):

\n

$$
\\begin{vmatrix}
\\left(
\\begin{array}{l}
x\\\\
y\\\\
z\\\\
\\end{array}
\\right)
\\end{vmatrix}_2 =\\sqrt{x^2 + y^2 + z ^2}
$$

\n

Therefore, for example, a) has the answer:

\n

$$
\\begin{vmatrix}
\\var{vector1}
\\end{vmatrix}_2 = \\sqrt{\\var{advice}} = \\var{answera} = \\var{roundeda}
$$

\n

For more information on norms read (for example) this.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"vector1": {"name": "vector1", "group": "Ungrouped variables", "definition": "vector(repeat(random(-4..4),rowsa))", "description": "", "templateType": "anything", "can_override": false}, "vector2": {"name": "vector2", "group": "Ungrouped variables", "definition": "vector(repeat(random(-6..2),rowsb))", "description": "", "templateType": "anything", "can_override": false}, "answera": {"name": "answera", "group": "Ungrouped variables", "definition": "L2norm(vector1)", "description": "", "templateType": "anything", "can_override": false}, "answerb": {"name": "answerb", "group": "Ungrouped variables", "definition": "L2norm(vector2)", "description": "", "templateType": "anything", "can_override": false}, "answerc": {"name": "answerc", "group": "Ungrouped variables", "definition": "abs(number)*answera", "description": "", "templateType": "anything", "can_override": false}, "rowsa": {"name": "rowsa", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "templateType": "anything", "can_override": false}, "rowsb": {"name": "rowsb", "group": "Ungrouped variables", "definition": "random(2,3,4)", "description": "", "templateType": "anything", "can_override": false}, "number": {"name": "number", "group": "Ungrouped variables", "definition": "random(-4,5,-6,3,-2,7)", "description": "", "templateType": "anything", "can_override": false}, "rawadviceabs": {"name": "rawadviceabs", "group": "Ungrouped variables", "definition": "map('\\\\' + 'var{'+'vector1[{i-1}]^2'+'}'+ latexcodebits(rowsa)[i-1],[dummy,i],product(1..1,1..rowsa))", "description": "", "templateType": "anything", "can_override": false}, "advice": {"name": "advice", "group": "Ungrouped variables", "definition": "latex(stringify(rawadviceabs))", "description": "", "templateType": "anything", "can_override": false}, "roundeda": {"name": "roundeda", "group": "Ungrouped variables", "definition": "siground(answera,2)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["vector1", "vector2", "answera", "answerb", "answerc", "rowsa", "rowsb", "number", "rawadviceabs", "advice", "roundeda"], "variable_groups": [], "functions": {"L2norm": {"parameters": [["vector", "vector"]], "type": "number", "language": "javascript", "definition": "var output = 0;\nvar i;\n let count = 0;\n for (let i = 0; i < vector.length; i++) {\n if (vector[i] !== 0) {\n output = output + vector[i]*vector[i];\n }\n }\noutput = Math.sqrt(output)\n return output;"}, "Latexcodebits": {"parameters": [["n", "number"]], "type": "anything", "language": "jme", "definition": "repeat('+',n-1)+['']"}, "Stringify": {"parameters": [["input", "list"]], "type": "string", "language": "javascript", "definition": "var output = '';\nvar i;\nfor (i = 0; i < input.length; i++) {\n output += input[i];\n} \nreturn output;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{vector1}$

", "minValue": "answera", "maxValue": "answera", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "sigfig", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{vector2}$

", "minValue": "answerb", "maxValue": "answerb", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "sigfig", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{number} \\times \\var{vector1}$

", "minValue": "answerc", "maxValue": "answerc", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "sigfig", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LN04 The LInfinity Norm", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

What is the $L^{\\infty}$ norm of the following vectors

", "advice": "

The L-two norm

\n

The $L^{\\infty}$ norm of a vector is found by picking the maximum of the absolute value of the elements of the vector.

\n

So, introducing the $\\left| \\bf{v} \\right|_\\infty$ notation for the $L^{\\infty}$ norm, gives the definition (for a vector with 3 elements):

\n

$$
\\begin{vmatrix}
\\left(
\\begin{array}{l}
x\\\\
y\\\\
z\\\\
\\end{array}
\\right)
\\end{vmatrix}_\\infty =\\max(\\left|x\\right|,\\left|y\\right|,\\left|z\\right|)
$$

\n

Therefore, for example, a) has the answer:

\n

$$
\\begin{vmatrix}
\\var{vector1}
\\end{vmatrix}_\\infty = \\max(\\var{advice})=\\var{answera}
$$

\n

For more information on norms read (for example) this.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"vector1": {"name": "vector1", "group": "Ungrouped variables", "definition": "vector(repeat(random(-4..4),rowsa))", "description": "", "templateType": "anything", "can_override": false}, "vector2": {"name": "vector2", "group": "Ungrouped variables", "definition": "vector(repeat(random(-9..7),rowsb))", "description": "", "templateType": "anything", "can_override": false}, "answera": {"name": "answera", "group": "Ungrouped variables", "definition": "Linfnorm(vector1)", "description": "", "templateType": "anything", "can_override": false}, "answerb": {"name": "answerb", "group": "Ungrouped variables", "definition": "Linfnorm(vector2)", "description": "", "templateType": "anything", "can_override": false}, "answerc": {"name": "answerc", "group": "Ungrouped variables", "definition": "abs(number)*answera", "description": "", "templateType": "anything", "can_override": false}, "rowsa": {"name": "rowsa", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "templateType": "anything", "can_override": false}, "rowsb": {"name": "rowsb", "group": "Ungrouped variables", "definition": "random(2,3,4)", "description": "", "templateType": "anything", "can_override": false}, "number": {"name": "number", "group": "Ungrouped variables", "definition": "random(-4,5,-6,3,-2,7)", "description": "", "templateType": "anything", "can_override": false}, "rawadviceabs": {"name": "rawadviceabs", "group": "Ungrouped variables", "definition": "map('|\\\\' + 'var{'+'vector1[{i-1}]'+'}|'+ latexcodebits(rowsa)[i-1],[dummy,i],product(1..1,1..rowsa))", "description": "", "templateType": "anything", "can_override": false}, "advice": {"name": "advice", "group": "Ungrouped variables", "definition": "latex(stringify(rawadviceabs))", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["vector1", "vector2", "answera", "answerb", "answerc", "rowsa", "rowsb", "number", "rawadviceabs", "advice"], "variable_groups": [], "functions": {"Linfnorm": {"parameters": [["vector", "vector"]], "type": "number", "language": "javascript", "definition": "var output = 0;\nvar i;\n let count = 0;\n for (let i = 0; i < vector.length; i++) {\n if (Math.abs(vector[i]) > output) {\n output = Math.abs(vector[i]);\n }\n }\n return output;"}, "Latexcodebits": {"parameters": [["n", "number"]], "type": "anything", "language": "jme", "definition": "repeat(',',n-1)+['']"}, "Stringify": {"parameters": [["input", "list"]], "type": "string", "language": "javascript", "definition": "var output = '';\nvar i;\nfor (i = 0; i < input.length; i++) {\n output += input[i];\n} \nreturn output;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{vector1}$

", "minValue": "answera", "maxValue": "answera", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{vector2}$

", "minValue": "answerb", "maxValue": "answerb", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{number} \\times \\var{vector1}$

", "minValue": "answerc", "maxValue": "answerc", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LV01 Adding and subtracting vectors", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Vector Arithmetic

\n

Work through the following questions to ensure you know how to add and subtract vectors in 2D.

\n

For the whole of this question:

\n

$\\bf{a} = \\var{a}$ and $\\bf{b}=\\var{b}$.

", "advice": "

The vectors in this question have two dimensions but the idea of addition and subtraction of vectors works in any number of dimensions (as long as all the vectors being added or subtracted have the same dimensions as each other).

\n

To add two vectors you simply add their corresponding elements. In general:

\n

$$
\\left(\\begin{array}{c}
a \\\\
b \\\\
\\end{array}\\right) +
\\left(\\begin{array}{c}
c \\\\
d \\\\
\\end{array}\\right) =
\\left(\\begin{array}{c}
a+c \\\\
b+d \\\\
\\end{array}\\right).
$$

\n

Subtraction works in the same way so we have:

\n

1)

\n

$$
\\var{a} + \\var{b} = \\var{a+b}.
$$

\n

2)

\n

$$
\\var{a} - \\var{b} = \\var{a-b}.
$$

\n

In order to undertstand the third part of the question you need to know what a \"position vector\" and \"direction vector\" are.

\n

A position vector is defined as a vector that symbolises the location of any given point with respect to the origin. It can be thought of as a coordinate point, but written as a column vector - top entry is the \"x-coordinate\" and the bottome entry is the \"y-coordinate\".

\n

A direction vector is defined as a vector that symbolises a direction and a distance in that direction but with no specified \"starting point\". In 2D it can be summarized as an instruction to go the top element number of units left or right based on the sign of the element and the bottom element number of units up or down based on the sign of the element.

\n

So the direction vector from $A$ to $B$ can be worked out by looking at a route from $A$ to $B$ that travels along the position vectors given. Starting at $A$ we have to go backwards down $\\bf{a}$ to the origin and then forwards along $\\bf{b}$. This corresponds to doing \"minus\" $\\bf{a}$ and \"positive\" $\\bf{b}$:

\n

3)

\n

$$
\\vec{AB} = (-)\\bf{a} + \\bf{b} = \\bf{b}-\\bf{a} = \\var{b}-\\var{a} = \\var{b-a}.
$$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "vector(repeat(random(-4..4),2))", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "vector(repeat(random(-4..4),2))", "description": "", "templateType": "anything", "can_override": false}, "answeradd": {"name": "answeradd", "group": "Ungrouped variables", "definition": "a+b", "description": "", "templateType": "anything", "can_override": false}, "answersub": {"name": "answersub", "group": "Ungrouped variables", "definition": "a-b", "description": "", "templateType": "anything", "can_override": false}, "answerAB": {"name": "answerAB", "group": "Ungrouped variables", "definition": "b-a", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "answeradd", "answersub", "answerAB"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "matrix", "useCustomName": true, "customName": "1)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate $\\bf{a}+\\bf{b}$.

", "correctAnswer": "answeradd", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": true, "customName": "2)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate $\\bf{a} - \\bf{b}$.

", "correctAnswer": "answersub", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": true, "customName": "3)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Let $\\bf{a}$ be the position vector of point $A$ and $\\bf{b}$ be the position vector of point $B$. Find the direction vector $\\vec{AB}$.

", "correctAnswer": "answerab", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LV02 Scalar multiplication of vectors", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Vector Arithmetic

\n

Work through the following questions exploring how to multiply a vector by a scalar.

\n

For the whole of this question:

\n

$\\bf{a} = \\var{a}$ and $\\bf{b}=\\var{b}$.

", "advice": "

The vectors in this question have two dimensions but the ideas herein work in any number of dimensions.

\n

To multiply a vector by a scalar (number) you just multiply each element by that scalar:

\n

$$
k\\left(\\begin{array}{c}
a \\\\
b \\\\
\\end{array}\\right) =
\\left(\\begin{array}{c}
ak \\\\
bk \\\\
\\end{array}\\right).
$$

\n

So we have:

\n

1)

\n

$$
\\var{m}\\var{a} = \\var{m*a}.
$$

\n

The second and third part of this question just combine this idea of multiplying a vector by a scalar and the idea that addition and subtraction work by just calculating element by element (as long as all the vectors involved have the same dimensions).  

\n

2)

\n

$$
\\var{p}\\var{a} + \\var{q}\\var{b} =
\\left(\\begin{array}{c}
\\var{p} \\times \\var{a[0]} + \\var{q} \\times \\var{b[0]} \\\\
\\var{p}\\times \\var{a[1]} + \\var{q} \\times \\var{b[1]}\\\\
\\end{array}\\right) = \\var{p*a+q*b}.
$$

\n

3)

\n

$$
\\var{r}\\var{a} - \\var{s}\\var{b} =
\\left(\\begin{array}{c}
\\var{r} \\times \\var{a[0]} - \\var{s} \\times \\var{b[0]} \\\\
\\var{s}\\times \\var{a[1]} - \\var{s} \\times \\var{b[1]}\\\\
\\end{array}\\right) = \\var{r*a-s*b}.
$$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "vector(repeat(random(-4..4),2))", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "vector(repeat(random(-4..4),2))", "description": "", "templateType": "anything", "can_override": false}, "answeradd": {"name": "answeradd", "group": "Ungrouped variables", "definition": "p*a+q*b", "description": "", "templateType": "anything", "can_override": false}, "answersub": {"name": "answersub", "group": "Ungrouped variables", "definition": "r*a-s*b", "description": "", "templateType": "anything", "can_override": false}, "p": {"name": "p", "group": "Ungrouped variables", "definition": "random(-9..9 except [-1,0,1,m])", "description": "", "templateType": "anything", "can_override": false}, "q": {"name": "q", "group": "Ungrouped variables", "definition": "random(-9..9 except [-1,0,1,p,m])", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "random(-9..9 except [-1,0,1])", "description": "", "templateType": "anything", "can_override": false}, "answerma": {"name": "answerma", "group": "Ungrouped variables", "definition": "m*a", "description": "", "templateType": "anything", "can_override": false}, "r": {"name": "r", "group": "Ungrouped variables", "definition": "random(2..9 except [p,m,q])", "description": "", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "random(2..9 except [p,m,q,r])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "m", "p", "q", "r", "s", "answerma", "answeradd", "answersub"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "matrix", "useCustomName": true, "customName": "1)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate $\\var{m}\\bf{a}$.

", "correctAnswer": "answerma", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": true, "customName": "2)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate $\\var{p}\\bf{a}+\\var{q}\\bf{b}$.

", "correctAnswer": "answeradd", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": true, "customName": "3)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate $\\var{r}\\bf{a} - \\var{s}\\bf{b}$.

", "correctAnswer": "answersub", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LV03 Vectors and geometry", "extensions": ["geogebra"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

This question is about understanding the use of vectors to prove that a shape is a trapezium.

\n

The quadrilateral ABCD is shown below.

\n

$$
A = (\\var{a[0]},\\var{a[1]})\\\\
B = (\\var{b[0]},\\var{b[1]})\\\\
C = (\\var{c[0]},\\var{c[1]})\\\\
D = (\\var{d[0]},\\var{d[1]})
$$

\n

{geogebra_applet('https://www.geogebra.org/m/xb9bvcaa',defs)}

", "advice": "

Vectors between points

\n

In order to undertstand how to find the vector between two points it is helpful to know what a \"position vector\" and \"direction vector\" are. This advice should cover parts a), b), e) and f) of this question.

\n

A position vector is defined as a vector that symbolises the location of any given point with respect to the origin. It can be thought of as a coordinate point, but written as a column vector - top entry is the \"x-coordinate\" and the bottome entry is the \"y-coordinate\". For example:

\n

The point $B$ has coordinates $(\\var{B[0]},\\var{B[1]})$ and it has position vector, denoted $\\bf{b}$, given as $\\bf{b} = \\var{b}$.

\n

A direction vector is defined as a vector that symbolises a direction and a distance in that direction but with no specified \"starting point\". In 2D it can be summarized as an instruction to go the top element number of units left or right based on the sign of the element and the bottom element number of units up or down based on the sign of the element.

\n

So the direction vector from $B$ to $C$ can be worked out by looking at a route from $B$ to $C$ that travels along the position vectors given. Starting at $B$ we have to go backwards down $\\bf{b}$ to the origin and then forwards along $\\bf{c}$. This corresponds to doing \"minus\" $\\bf{b}$ and \"positive\" $\\bf{c}$:

\n

$$
\\vec{BC} = (-)\\bf{b} + \\bf{c} = \\bf{c}-\\bf{b} = \\var{c}-\\var{b} = \\var{c-b}.
$$

\n

Parallel vectors

\n

If one vector is a multiple of another then they are vectors that point in the same direction. This means they are parallel. You just need to check what the multplier is between corresponding elements in each vector. If it is the same for both pairs of elements then the vectors are parallel (and if not then they are not).

\n

For example, $\\vec{BC} = \\var{bc}$ and $\\vec{AD} = \\var{k*BC}.$ Since $\\frac{\\var{k*BC[0]}}{\\var{BC[0]}} = \\var{k}$ which gives the same multiplier as $\\frac{\\var{k*BC[1]}}{\\var{BC[1]}} = \\var{k}$ then $\\vec{BC}$ and $\\vec{AD}$ are parallel.

\n

Conclusions about shapes

\n

This question is looking at a trapezium specifically. The key properties of a trapezium are that it is a quadrilateral and there is one pair of parallel sides. This question goes through establishing that one pair of sides are parallel and then does the calculations to show that the other pair is not parallel. At this point we can conclude that $ABCD$ is a trapezium.

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"A": {"name": "A", "group": "Ungrouped variables", "definition": "vector(0,0)", "description": "", "templateType": "anything", "can_override": false}, "AB": {"name": "AB", "group": "Ungrouped variables", "definition": "vector(0,random(2..7))", "description": "", "templateType": "anything", "can_override": false}, "B": {"name": "B", "group": "Ungrouped variables", "definition": "A+ab", "description": "", "templateType": "anything", "can_override": false}, "BC": {"name": "BC", "group": "Ungrouped variables", "definition": "vector(repeat(random(2..5),2))", "description": "", "templateType": "anything", "can_override": false}, "C": {"name": "C", "group": "Ungrouped variables", "definition": "B+bc", "description": "", "templateType": "anything", "can_override": false}, "D": {"name": "D", "group": "Ungrouped variables", "definition": "A+k*bc", "description": "", "templateType": "anything", "can_override": false}, "defs": {"name": "defs", "group": "Ungrouped variables", "definition": "[\n ['A',A],\n ['B',B],\n ['C',C],\n ['D',D]\n]", "description": "", "templateType": "anything", "can_override": false}, "k": {"name": "k", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["A", "AB", "B", "BC", "C", "D", "defs", "k"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "matrix", "useCustomName": true, "customName": "a)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the vector $\\vec{BC}$.

", "correctAnswer": "-b+c", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": true, "customName": "b)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the vector $\\vec{AD}$.

", "correctAnswer": "-a+d", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "numberentry", "useCustomName": true, "customName": "c)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Hence, it is possible to write $\\vec{AD} = k \\times \\vec{BC}$. Find the value of $k$.

", "minValue": "k", "maxValue": "k", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "1_n_2", "useCustomName": true, "customName": "d)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The fact that $\\vec{AD}$ can be written as a multiplier times by $\\vec{BC}$ means: 

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["The sides $BC$ and $AD$ are parallel.", "The sides $BC$ and $AD$ are perpendicular.", "The points $A$, $B$, $C$, and $D$ are colinear.", "Shape $ABCD$ is a trapezium."], "matrix": ["1", 0, 0, 0], "distractors": ["", "", "", ""]}, {"type": "matrix", "useCustomName": true, "customName": "e)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the vector $\\vec{AB}$.

", "correctAnswer": "ab", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": true, "customName": "f)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the vector $\\vec{CD}$.

", "correctAnswer": "-c+d", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "m_n_2", "useCustomName": true, "customName": "g)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Up to this point in the question we have now shown which of the following:

", "minMarks": 0, "maxMarks": "1", "shuffleChoices": true, "displayType": "checkbox", "displayColumns": 0, "minAnswers": "0", "maxAnswers": "0", "warningType": "none", "showCellAnswerState": true, "markingMethod": "all-or-nothing", "choices": ["Sides $BC$ and $AD$ are parallel.", "Sides $AB$ and $CD$ are not parallel.", "The shape $ABCD$ is a trapezium."], "matrix": ["1", "1", "1"], "distractors": ["", "", ""]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LV04 Scalar product of 2D vectors", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

It is given $\\bf{a} = \\var{a}$ and $\\bf{b} = \\var{b}$.

\n

Find the scalar (or dot) product of $\\bf{a}$ and $\\bf{b}$.

", "advice": "

It is important to note that for vectors there is more than one type of multiplication. This question is specifically about the scalar (or dot) product.

\n

For the vectors $ \\mathbf v = \\pmatrix{v_1 \\\\ v_2},\\, \\mathbf w = \\pmatrix{w_1 \\\\ w_2},$ the scalar (or dot) product is defined as

\n

$$
\\mathbf{v \\cdot w} = v_1 \\times w_1 + v_2 \\times w_2.
$$

\n

So for this question:

\n

$$
\\bf{a} = \\var{a} \\qquad \\text{and} \\qquad \\bf{b} = \\var{b}\\\\
\\bf{a} \\cdot \\bf{b} = \\var{a[0]}\\times\\var{b[0]} + \\var{a[1]}\\times\\var{b[1]} = \\var{adotb}.
$$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "vector(repeat(random(-9..9 except 0),2))", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "vector(repeat(random(-9..9 except 0),2))", "description": "", "templateType": "anything", "can_override": false}, "adotb": {"name": "adotb", "group": "Ungrouped variables", "definition": "dot(a,b)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "adotb"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Scalar product", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\bf{a} \\cdot \\bf{b} =$ [[0]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "scalar product", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "adotb", "maxValue": "adotb", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LV05 Scalar product of 3D vectors", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

It is given $\\bf{a} = \\var{a}$ and $\\bf{b} = \\var{b}$.

\n

Find the scalar (or dot) product of $\\bf{a}$ and $\\bf{b}$.

", "advice": "

It is important to note that for vectors there is more than one type of multiplication. This question is specifically about the scalar (or dot) product.

\n

For the vectors $ \\mathbf v = \\pmatrix{v_1 \\\\ v_2 \\\\ v_3},\\, \\mathbf w = \\pmatrix{w_1 \\\\ w_2 \\\\ w_3},$ the scalar (or dot) product is defined as

\n

$$
\\mathbf{v \\cdot w} = v_1 \\times w_1 + v_2 \\times w_2 + v_3 \\times w_3.
$$

\n

So for this question:

\n

$$
\\bf{a} = \\var{a} \\qquad \\text{and} \\qquad \\bf{b} = \\var{b}\\\\
\\bf{a} \\cdot \\bf{b} = \\var{a[0]}\\times\\var{b[0]} + \\var{a[1]}\\times\\var{b[1]} + \\var{a[2]}\\times\\var{b[2]} = \\var{adotb}.
$$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "vector(repeat(random(-9..9 except 0),3))", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "vector(repeat(random(-9..9 except 0),3))", "description": "", "templateType": "anything", "can_override": false}, "adotb": {"name": "adotb", "group": "Ungrouped variables", "definition": "dot(a,b)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "adotb"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Scalar product", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\bf{a} \\cdot \\bf{b} =$ [[0]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "scalar product", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "adotb", "maxValue": "adotb", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LV06 Scalar product to find angles between vectors", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Poppy Jeffries", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21275/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

It is given $\\bf{a} = \\var{a}$ and $\\bf{b} = \\var{b}$.

\n

Find the angle between $\\bf{a}$ and $\\bf{b}$.

", "advice": "

To answer these questions, we want to use the equations for the scalar product. Recall:

\n

For the vectors $ \\mathbf v = \\pmatrix{v_1 \\\\ v_2},\\, \\mathbf w = \\pmatrix{w_1 \\\\ w_2},$

\n

\\[ \\begin{split} \\mathbf{v \\cdot w} &\\,= v_1 \\times w_1 + v_2 \\times w_2 \\\\\\\\ \\mathbf{v \\cdot w} &\\,= |\\mathbf v| |\\mathbf w | \\cos(\\theta), \\end{split} \\]

\n

where $|\\mathbf v|$ and $|\\mathbf w|$ are the magnitudes of the vectors, and $\\theta$ is the angle between the vectors.

\n

For

\n

$$
\\bf{a} = \\var{a} \\qquad \\text{and} \\qquad \\bf{b} = \\var{b},
$$

\n

we have

\n

$$
\\bf{a} \\cdot \\bf{b} = \\var{adotb},
$$

\n

$$
|\\bf{a}| = \\sqrt{\\var{a[0]^2 +a[1]^2}} \\approx \\var{precround(asize,2)},\\\\
|\\bf{b}| = \\sqrt{\\var{b[0]^2 +b[1]^2}} \\approx \\var{precround(bsize,2)}.
$$

\n

So we have:
$$
\\theta = \\cos^{-1}\\left(\\frac{\\var{adotb}}{\\sqrt{\\var{a[0]^2 +a[1]^2}}\\times\\sqrt{\\var{b[0]^2 +b[1]^2}}}\\right) = \\var{precround(angle,1)}.
$$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "vector(repeat(random(-9..9 except 0),2))", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "vector(repeat(random(-9..9 except 0),2))", "description": "", "templateType": "anything", "can_override": false}, "adotb": {"name": "adotb", "group": "Ungrouped variables", "definition": "dot(a,b)", "description": "", "templateType": "anything", "can_override": false}, "angle": {"name": "angle", "group": "Ungrouped variables", "definition": "degrees(arccos(adotb/(asize*bsize)))", "description": "", "templateType": "anything", "can_override": false}, "asize": {"name": "asize", "group": "Ungrouped variables", "definition": "sqrt(a[0]^2+a[1]^2)", "description": "", "templateType": "anything", "can_override": false}, "bsize": {"name": "bsize", "group": "Ungrouped variables", "definition": "sqrt(b[0]^2 + b[1]^2)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "adotb<>0", "maxRuns": 100}, "ungrouped_variables": ["a", "asize", "b", "bsize", "adotb", "angle"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Angle", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The angle between $\\bf{a}$ and $\\bf{b}$ is [[0]] degrees.

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Angle", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": false, "minValue": "180 - angle", "maxValue": "180 - angle", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "1", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "minValue": "angle", "maxValue": "angle", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "1", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LV07 Scalar product to find angles between vectors 3D", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Poppy Jeffries", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21275/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

It is given $\\bf{a} = \\var{a}$ and $\\bf{b} = \\var{b}$.

\n

Find the angle between $\\bf{a}$ and $\\bf{b}$.

", "advice": "

To answer these questions, we want to use the equations for the scalar product. Recall:

\n

For the vectors $ \\mathbf v = \\pmatrix{v_1 \\\\ v_2 \\\\ v_3},\\, \\mathbf w = \\pmatrix{w_1 \\\\ w_2 \\\\ w_3},$

\n

\\[ \\begin{split} \\mathbf{v \\cdot w} &\\,= v_1 \\times w_1 + v_2 \\times w_2 + v_3 \\times w_3 \\\\\\\\ \\mathbf{v \\cdot w} &\\,= |\\mathbf v| |\\mathbf w | \\cos(\\theta), \\end{split} \\]

\n

where $|\\mathbf v|$ and $|\\mathbf w|$ are the magnitudes of the vectors, and $\\theta$ is the angle between the vectors.

\n

For

\n

$$
\\bf{a} = \\var{a} \\qquad \\text{and} \\qquad \\bf{b} = \\var{b},
$$

\n

we have

\n

$$
\\bf{a} \\cdot \\bf{b} = \\var{adotb},
$$

\n

and

\n

$$
|\\bf{a}| = \\sqrt{\\var{a[0]^2 +a[1]^2 +a[2]^2}} \\approx \\var{precround(asize,2)},\\\\
|\\bf{b}| = \\sqrt{\\var{b[0]^2 +b[1]^2 +b[2]^2}}\\approx \\var{precround(bsize,2)}.
$$

\n

So we have:
$$
\\theta = \\cos^{-1}\\left(\\frac{\\var{adotb}}{\\sqrt{\\var{a[0]^2 +a[1]^2 +a[2]^2}}\\times\\sqrt{\\var{b[0]^2 +b[1]^2 +b[2]^2}}}\\right) = \\var{precround(angle,1)}.
$$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "vector(repeat(random(-9..9 except 0),3))", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "vector(repeat(random(-9..9 except 0),3))", "description": "", "templateType": "anything", "can_override": false}, "adotb": {"name": "adotb", "group": "Ungrouped variables", "definition": "dot(a,b)", "description": "", "templateType": "anything", "can_override": false}, "angle": {"name": "angle", "group": "Ungrouped variables", "definition": "degrees(arccos(adotb/(asize*bsize)))", "description": "", "templateType": "anything", "can_override": false}, "asize": {"name": "asize", "group": "Ungrouped variables", "definition": "sqrt(a[0]^2+a[1]^2+a[2]^2)", "description": "", "templateType": "anything", "can_override": false}, "bsize": {"name": "bsize", "group": "Ungrouped variables", "definition": "sqrt(b[0]^2 + b[1]^2+b[2]^2)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "adotb<>0", "maxRuns": 100}, "ungrouped_variables": ["a", "asize", "b", "bsize", "adotb", "angle"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Angle", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The angle between $\\bf{a}$ and $\\bf{b}$ is [[0]] degrees.

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Angle", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": false, "minValue": "180 - angle", "maxValue": "180 - angle", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "1", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "minValue": "angle", "maxValue": "angle", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "1", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LV08 Scalar product to find perpendicular vectors", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

It is given $\\bf{a} = \\var{a}$ and $\\bf{b} = \\pmatrix{\\var{b1} \\\\ k}$ and that the two vectors are perpendicular.

\n

Find the value of $k$.

", "advice": "

The key thing to understand for this question is that for perpendicular vectors the scalar (or dot) product will give a result of zero.

\n

In this question we have,

\n

\\begin{alignat}{2}
&\\quad
&\\var{a}\\cdot\\pmatrix{\\var{b1} \\\\ k}
& = 0 \\\\
&\\Rightarrow\\quad
&\\var{a[0]}\\times\\var{b1} + \\var{a[1]} \\times k & = 0 \\\\
&\\Rightarrow\\quad
&\\var{a[0]*b1} + \\var{a[1]}k & = 0.
\\end{alignat}

\n

Solving this then gives,

\n

$$
k = \\var{k}.
$$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "vector(repeat(random(-9..9 except 0),2))", "description": "", "templateType": "anything", "can_override": false}, "asize": {"name": "asize", "group": "Ungrouped variables", "definition": "sqrt(a[0]^2+a[1]^2+a[2]^2)", "description": "", "templateType": "anything", "can_override": false}, "k": {"name": "k", "group": "Ungrouped variables", "definition": "-a[0]*b1/a[1]", "description": "", "templateType": "anything", "can_override": false}, "b1": {"name": "b1", "group": "Ungrouped variables", "definition": "random(-5..5)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "asize", "b1", "k"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "numberentry", "useCustomName": true, "customName": "dec", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": false, "minValue": "k", "maxValue": "k", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "sigfig", "precision": "3", "precisionPartialCredit": "100", "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "minValue": "k", "maxValue": "k", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LV09 Scalar product to find perpendicular vectors 3D", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

It is given $\\bf{a} = \\var{a}$ and $\\bf{b} = \\pmatrix{\\var{b1} \\\\ k \\\\ \\var{b3}}$ and that the two vectors are perpendicular.

\n

Find the value of $k$.

", "advice": "

The key thing to understand for this question is that for perpendicular vectors the scalar (or dot) product will give a result of zero.

\n

In this question we have,

\n

\\begin{alignat}{2}
&\\quad
&\\var{a}\\cdot\\pmatrix{\\var{b1} \\\\ k \\\\ \\var{b3}}
& = 0 \\\\
&\\Rightarrow\\quad
&\\var{a[0]}\\times\\var{b1} + \\var{a[1]} \\times k + \\var{a[2]} \\times \\var{b3} & = 0 \\\\
&\\Rightarrow\\quad
&\\var{a[0]*b1 + a[2]*b3} + \\var{a[1]}k & = 0.
\\end{alignat}

\n

Solving this then gives,

\n

$$
k = \\var{k}.
$$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "vector(repeat(random(-9..9 except 0),3))", "description": "", "templateType": "anything", "can_override": false}, "asize": {"name": "asize", "group": "Ungrouped variables", "definition": "sqrt(a[0]^2+a[1]^2+a[2]^2)", "description": "", "templateType": "anything", "can_override": false}, "k": {"name": "k", "group": "Ungrouped variables", "definition": "(-a[0]*b1 - a[2]*b3)/a[1]", "description": "", "templateType": "anything", "can_override": false}, "b1": {"name": "b1", "group": "Ungrouped variables", "definition": "random(-5..5)", "description": "", "templateType": "anything", "can_override": false}, "b3": {"name": "b3", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "asize", "b1", "b3", "k"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "numberentry", "useCustomName": true, "customName": "dec", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": false, "minValue": "k", "maxValue": "k", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "sigfig", "precision": "3", "precisionPartialCredit": "100", "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "minValue": "k", "maxValue": "k", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "LV10 Cross or vector product of two vectors", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

The vectors $\\bf a$ and $\\bf b$ are defined as follows,
$$
{\\bf a} = \\var{a} \\qquad \\text{and} \\qquad \\bf b = \\var{b}.
$$

", "advice": "

The vector product (also referred to as the cross product) of two vectors can be calculated as follows:

\n

$$
\\pmatrix{a_1 \\\\ a_2 \\\\ a_3} \\times \\pmatrix{b_1 \\\\ b_2 \\\\ b_3} = \\pmatrix{a_2b_3-a_3b_2 \\\\ -(a_1b_3-a_3b_1) \\\\ a_1b_2-a_2b_1}.
$$

\n

A way to think of this is as the following determinant:

\n

$$
\\begin{vmatrix}
\\bf i & \\bf j & \\bf k\\\\
a_1 & a_2 & a_3 \\\\
b_1 & b_2 & b_3
\\end{vmatrix},
$$

\n

where $\\bf i$, $\\bf j $, and $\\bf k$ are the standard unit basis vectors.

\n

In this question we therefore have:

\n

$$
\\begin{align*}
\\var{a} \\times \\var{b} & = \\pmatrix{\\var{a[1]} \\times \\var{b[2]} - \\var{a[2]} \\times \\var{b[1]} \\\\ -(\\var{a[0]} \\times \\var{b[2]} - \\var{a[2]} \\times \\var{b[0]}) \\\\ \\var{a[0]} \\times \\var{b[1]} - \\var{a[1]} \\times \\var{b[0]}}\\\\
& = \\var{answer}.
\\end{align*}
$$

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "vector(repeat(random(-9..9),3))", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "vector(repeat(random(-9..9),3))", "description": "", "templateType": "anything", "can_override": false}, "answer": {"name": "answer", "group": "Ungrouped variables", "definition": "cross(a,b)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "answer"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find $\\bf a \\times \\bf b$.

", "correctAnswer": "answer", "correctAnswerFractions": false, "numRows": "3", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "CD09 Chain Rule", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}], "tags": [], "metadata": {"description": "

Calculating the derivative of a function of the form $\\sin(ax^m+bx^n)$ using the chain rule.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Calculate the derivative of $y=\\simplify[all]{sin({a}*x^{n}+{b}*x^{m})}$.

", "advice": "

If we have a function of the form $y=f(g(x))$, sometimes described as a function of a function, to calculate its derivative we need to use the chain rule:

\n

\\[ \\frac{dy}{dx} = \\frac{du}{dx} \\times \\frac{dy}{du}.\\]

\n

\n

This can be split up into steps:

\n\n

\n

Following this process, we must first identify $g(x)$. Since the function is of the form $y=f(g(x))$, we are looking for the 'inner' function.

\n

So, for $y=\\simplify[all,fractionNumbers]{sin({a}*x^{n}+{b}*x^{m})}$, \\[g(x)=\\simplify[all, fractionNumbers, unitFactor]{{a}*x^{n}+{b}*x^{m}}.\\]

\n

If we now set $u=g(x)$, we can rewrite $y$ in terms of $u$ such that $y=f(u)$:

\n

\\[y=\\simplify[all, fractionNumbers,unitFactor]{sin(u)}.\\]

\n

Next, we calculate the two derivatives $\\frac{du}{dx}$ and $\\frac{dy}{du}$:

\n

\\[\\frac{du}{dx}=\\simplify[all,fractionNumbers]{{a*n}x^{n-1}+{b*m}x^{m-1}}, \\quad \\frac{dy}{du}=\\simplify[all, fractionNumbers, unitFactor]{cos(u)}.\\]

\n

Plugging these into the chain rule:

\n

\\[ \\begin{split} \\frac{dy}{dx} &= \\frac{du}{dx} \\times \\frac{dy}{du}, \\\\&=(\\simplify[all,fractionNumbers]{{a*n}x^{n-1}+{b*m}x^{m-1}}) \\times\\simplify[all, fractionNumbers, unitFactor]{cos(u)}. \\end{split} \\]

\n

Finally, we need to express $\\frac{dy}{dx}$ only in terms of $x$, so we must replace the $u$ term using the initial substitution $u=\\simplify[all, fractionNumbers, unitFactor]{{a}*x^{n}+{b}*x^{m}}$:

\n

\\[ \\frac{dy}{dx} =(\\simplify[all,fractionNumbers]{{a*n}x^{n-1}+{b*m}x^{m-1}})\\simplify[all, fractionNumbers, unitFactor]{cos({a}*x^{n}+{b}*x^{m})}.\\]

\n

\n

Use this link to find some resources which will help you revise this topic.

\n

\n

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(1..10)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-10..10 except 0)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "n>m", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "n", "m"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\frac{dy}{dx}=$[[0]]

", "gaps": [{"type": "jme", "useCustomName": true, "customName": "Gap 0", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "({a*n}*x^{n-1}+{b*m}*x^{m-1})*cos({a}x^{n}+{b}x^{m})", "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": [{"name": "x", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "CD10 Product Rule", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}], "tags": [], "metadata": {"description": "

Calculating the derivative a function of the form $ax^n \\sin(bx)$ using the product rule.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Find the derivative of \\[ \\simplify{y={a}x^{n} sin({b}x)}. \\]

", "advice": "

If we have a function of the form $y=u(x)v(x)$, to calculate its derivative we need to use the product rule:

\n

\\[ \\dfrac{dy}{dx} = u(x) \\times \\dfrac{dv}{dx} + v(x) \\times\\dfrac{du}{dx}.\\]

\n

This can be split up into steps:

\n
    \n
  1. Identify the functions $u(x)$ and $v(x)$;
  2. \n
  3. Calculate their derivatives $\\tfrac{du}{dx}$ and $\\tfrac{dv}{dx}$;
  4. \n
  5. Substitute these into the formula for the product rule to obtain an expression for $\\tfrac{dy}{dx}$;
  6. \n
  7. Simplify $\\tfrac{dy}{dx}$ where possible.
  8. \n
\n

Following this process, we must first identify $u(x)$ and $v(x)$.

\n

As \\[ \\simplify{y={a}x^{n} sin({b}x)}, \\]

\n

let \\[ u(x) = \\simplify{{a}x^{n}} \\quad \\text{and} \\quad v(x)=\\simplify{sin({b}x)}.\\]

\n

Next, we need to find the derivatives, $\\tfrac{du}{dx}$ and $\\tfrac{dv}{dx}$:

\n

\\[ \\dfrac{du}{dx} = \\simplify{{a*n}x^{n-1}}\\quad \\text{and} \\quad\\dfrac{dv}{dx}=\\simplify{{b}cos({b}x)}.\\]

\n

Substituting these results into the product rule formula we can obtain an expression for $\\tfrac{dy}{dx}$:

\n

\\[ \\begin{split} \\dfrac{dy}{dx} &\\,= \\dfrac{du}{dx}\\times v(x) + u(x) \\times\\dfrac{dv}{dx} \\\\ &\\,=\\simplify{{a*n}x^{n-1}} \\times\\simplify{sin({b}x)} +\\simplify{{a}x^{n}} \\times \\simplify{{b}cos({b}x)}.  \\end{split}\\]

\n

Simplifying,

\n

\\[\\dfrac{dy}{dx} = \\simplify{{n*a}x^{n-1}sin({b}x) + {a*b}x^{n}cos({b}x)}. \\]

\n

\n

Use this link to find some resources which will help you revise this topic

\n

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(1..10)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(1..10)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "n"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\dfrac{dy}{dx}=$[[0]] 

", "gaps": [{"type": "jme", "useCustomName": true, "customName": "Gap 0", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{n*a}x^{n-1}sin({b}x) + {a*b}x^{n}cos({b}x)", "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": [{"name": "x", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "CD11 Quotient Rule", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}, {"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}], "tags": [], "metadata": {"description": "

Calculating the derivative of a function of the form $\\frac{ax^n}{bx+c}$ using the quotient rule.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Find the derivative of \\[ \\simplify{y={a}x^{n}/({b}x+{c})}. \\]

", "advice": "

If we have a function of the form $y=\\tfrac{u(x)}{v(x)}$, to calculate its derivative we need to use the quotient rule:

\n

\\[ \\dfrac{dy}{dx} = \\dfrac{v(x) \\times \\frac{du}{dx} - u(x) \\times\\frac{dv}{dx}}{[v(x)]^2}\\,.\\]

\n

This can be split up into steps:

\n
    \n
  1. Identify the functions $u(x)$ and $v(x)$;
  2. \n
  3. Calculate their derivatives $\\tfrac{du}{dx}$ and $\\tfrac{dv}{dx}$;
  4. \n
  5. Substitute these into the formula for the quotient rule to obtain an expression for $\\tfrac{dy}{dx}$;
  6. \n
  7. Simplify $\\tfrac{dy}{dx}$ where possible.
  8. \n
\n

\n

Following this process, we must first identify $u(x)$ and $v(x)$.

\n

As \\[ \\simplify{y={a}x^{n}/({b}x+{c})}, \\]

\n

let \\[ u(x) = \\simplify{{a}x^{n}} \\quad \\text{and} \\quad v(x)=\\simplify{{b}x+{c}}.\\]

\n

Next, we need to find the derivatives, $\\tfrac{du}{dx}$ and $\\tfrac{dv}{dx}$:

\n

\\[ \\dfrac{du}{dx} = \\simplify{{a*n}x^{n-1}}\\quad \\text{and} \\quad\\dfrac{dv}{dx}=\\simplify{{b}}.\\]

\n

Substituting these results into the quotient rule formula we can obtain an expression for $\\tfrac{dy}{dx}$:

\n

\\[ \\begin{split} \\dfrac{dy}{dx} &\\,= \\dfrac{v(x) \\times \\frac{du}{dx} - u(x) \\times\\frac{dv}{dx}}{[v(x)]^2} \\\\ \\\\&\\,=\\dfrac{(\\simplify{{b}x+{c}}) \\times\\simplify{{a*n}x^{n-1}} - \\simplify{{a}x^{n}} \\times \\simplify{{b}}}{\\simplify{({b}x+{c})^2}}.  \\end{split}\\]

\n

Simplifying,

\n

\\[ \\begin{split} \\dfrac{dy}{dx} &\\,=\\dfrac{(\\simplify{{b}x+{c}})\\simplify{{a*n}x^{n-1}} - \\simplify{{b*a}x^{n}}}{\\simplify{({b}x+{c})^2}} \\\\ \\\\&\\,=\\dfrac{\\simplify[all,!cancelTerms]{{b*a*n}x^{n}+{c*a*n}x^{n-1} - {b*a}x^{n}}}{\\simplify{({b}x+{c})^2}}\\\\ \\\\ &\\,=\\dfrac{\\simplify{{b*a*n}x^{n}+{c*a*n}x^{n-1} - {b*a}x^{n}}}{\\simplify{({b}x+{c})^2}} \\\\ \\\\ &\\,=\\dfrac{\\simplify{{simp}x^{n-1}({(b*a*n-b*a)/simp}x+{c*a*n/simp})}}{\\simplify{({b}x+{c})^2}} \\end{split} \\]

\n

\n

Use this link to find some resources which will help you revise this topic.

\n

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(1..6)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(-6..6 except [0,b])", "description": "", "templateType": "anything", "can_override": false}, "simp": {"name": "simp", "group": "Ungrouped variables", "definition": "gcd(b*a*n-b*a,c*a*n)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "simp>1", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "c", "n", "simp"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\dfrac{dy}{dx}=$[[0]] 

", "gaps": [{"type": "jme", "useCustomName": true, "customName": "Gap 0", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "({simp}x^{n-1}({(b*a*n-a*b)/simp}x+{c*a*n/simp}))/({b}x+{c})^2", "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": [{"name": "x", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "CI01 Indefinite integration - polynomials", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}, {"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}, {"name": "Andrew Neate", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21832/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "

Calculating the integral of a function of the form $a_1x^{b_1}+a_2x^{b_2}+a_3x^{b_3}$ using a table of integrals. 

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Find the integral of $f(x)=\\simplify[unitFactor, unitPower, fractionNumbers]{{a_1}*x^{b_1}+{a_2}*x^{b_2}+{a_3}*x^{b_3}+{a_4}}$.

\n

\n

", "advice": "

From the Table of Integrals we see that a function of the form \\[ f(x)=x^n \\] has the integral \\[ \\int x^n dx  =  \\frac{x^{n+1}}{n+1}+ c,\\]

\n

and \\[\\int kf(x) dx = k \\int f(x) dx.\\]

\n

Additionally, the integral of the sum or difference of two or more functions is equal to the sum or difference of the integrals of each function: \\[ \\int(f(x)\\pm g(x))\\, dx = \\int f(x)\\, dx  \\pm \\int g(x) \\, dx.\\]

\n

So, for the function

\n

\\[f(x)=\\simplify[unitFactor,unitPower]{{a_1}*x^{b_1}+{a_2}*x^{b_2}+{a_3}*x^{b_3}+{a_4}},\\]

\n

the integral  is

\n

\\[ \\begin{split}\\simplify[unitFactor,unitPower]{int({a_1}*x^{b_1}+{a_2}*x^{b_2}+{a_3}*x^{b_3}+{a_4},x)} &\\,= \\simplify{{a_1}int(x^{b_1},x)+{a_2}int(x^{b_2},x)+{a_3}int(x^{b_3},x)+int({a_4},x)} \\\\&\\,= \\simplify[all,fractionNumbers]{({a_1}*x^{b_1+1})/{b_1+1}+({a_2}*x^{b_2+1})/{b_2+1}+({a_3}*x^{b_3+1})/{b_3+1}+{a_4}x}+c.\\end{split} \\]

\n

\n

Note: You only need to put one $c$ term here, you do not need to put a separate constant term for each calculation.

\n

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a_1": {"name": "a_1", "group": "Ungrouped variables", "definition": "random(1..10)", "description": "", "templateType": "anything", "can_override": false}, "b_1": {"name": "b_1", "group": "Ungrouped variables", "definition": "3", "description": "", "templateType": "anything", "can_override": false}, "a_2": {"name": "a_2", "group": "Ungrouped variables", "definition": "random(-10..10 except 0)", "description": "", "templateType": "anything", "can_override": false}, "b_2": {"name": "b_2", "group": "Ungrouped variables", "definition": "2", "description": "", "templateType": "anything", "can_override": false}, "b_3": {"name": "b_3", "group": "Ungrouped variables", "definition": "1", "description": "", "templateType": "anything", "can_override": false}, "a_3": {"name": "a_3", "group": "Ungrouped variables", "definition": "random(-10..10 except 0)", "description": "", "templateType": "anything", "can_override": false}, "advice": {"name": "advice", "group": "Ungrouped variables", "definition": "if(a_2>0 and a_3>0,'{solutiona}',{advice2})", "description": "", "templateType": "anything", "can_override": false}, "solutiona": {"name": "solutiona", "group": "Ungrouped variables", "definition": "\"

So, for the function \\\\[y=\\\\simplify[all, fractionNumbers]{{a_1}x^{b_1}+{a_2}x^{b_2}+{a_3}x^{b_3}} \\\\] the derivative  is \\\\begin{split}\\\\frac{dy}{dx} &= (\\\\var[fractionNumbers]{a_1}\\\\times\\\\var[fractionNumbers]{b_1})x^{\\\\var[fractionNumbers]{b_1}-1} +(\\\\var[fractionNumbers]{a_2}\\\\times\\\\var[fractionNumbers]{b_2})x^{\\\\var[fractionNumbers]{b_2}-1} +(\\\\var[fractionNumbers]{a_3}\\\\times\\\\var[fractionNumbers]{b_3})x^{\\\\var[fractionNumbers]{b_3}-1},\\\\\\\\ \\\\\\\\&= \\\\simplify[all, fractionNumbers]{{a_1*b_1}x^{b_1-1} +{a_2*b_2}x^{b_2-1} +{a_3*b_3}x^{b_3-1}}.\\\\end{split}

\"", "description": "", "templateType": "long string", "can_override": false}, "solutionb": {"name": "solutionb", "group": "Ungrouped variables", "definition": "\"

So, for the function \\\\[y=\\\\simplify[all, fractionNumbers]{{a_1}x^{b_1}+{a_2}x^{b_2}+{a_3}x^{b_3}} \\\\] the derivative  is \\\\begin{split}\\\\frac{dy}{dx} &= (\\\\var[fractionNumbers]{a_1}\\\\times\\\\var[fractionNumbers]{b_1})x^{\\\\var[fractionNumbers]{b_1}-1} -(\\\\var[fractionNumbers]{abs(a_2)}\\\\times\\\\var[fractionNumbers]{b_2})x^{\\\\var[fractionNumbers]{b_2}-1} +(\\\\var[fractionNumbers]{a_3}\\\\times\\\\var[fractionNumbers]{b_3})x^{\\\\var[fractionNumbers]{b_3}-1},\\\\\\\\ \\\\\\\\&= \\\\simplify[all, fractionNumbers]{{a_1*b_1}x^{b_1-1} +{a_2*b_2}x^{b_2-1} +{a_3*b_3}x^{b_3-1}}.\\\\end{split}

\"", "description": "", "templateType": "long string", "can_override": false}, "solutionc": {"name": "solutionc", "group": "Ungrouped variables", "definition": "\"

So, for the function \\\\[y=\\\\simplify[all, fractionNumbers]{{a_1}x^{b_1}+{a_2}x^{b_2}+{a_3}x^{b_3}} \\\\] the derivative  is \\\\begin{split}\\\\frac{dy}{dx} &= (\\\\var[fractionNumbers]{a_1}\\\\times\\\\var[fractionNumbers]{b_1})x^{\\\\var[fractionNumbers]{b_1}-1} +(\\\\var[fractionNumbers]{a_2}\\\\times\\\\var[fractionNumbers]{b_2})x^{\\\\var[fractionNumbers]{b_2}-1} -(\\\\var[fractionNumbers]{abs(a_3)}\\\\times\\\\var[fractionNumbers]{b_3})x^{\\\\var[fractionNumbers]{b_3}-1},\\\\\\\\ \\\\\\\\&= \\\\simplify[all, fractionNumbers]{{a_1*b_1}x^{b_1-1} +{a_2*b_2}x^{b_2-1} +{a_3*b_3}x^{b_3-1}}.\\\\end{split}

\"", "description": "", "templateType": "long string", "can_override": false}, "solutiond": {"name": "solutiond", "group": "Ungrouped variables", "definition": "\"

So, for the function \\\\[y=\\\\simplify[all, fractionNumbers]{{a_1}x^{b_1}+{a_2}x^{b_2}+{a_3}x^{b_3}} \\\\] the derivative  is \\\\begin{split}\\\\frac{dy}{dx} &= (\\\\var[fractionNumbers]{a_1}\\\\times\\\\var[fractionNumbers]{b_1})x^{\\\\var[fractionNumbers]{b_1}-1} -(\\\\var[fractionNumbers]{abs(a_2)}\\\\times\\\\var[fractionNumbers]{b_2})x^{\\\\var[fractionNumbers]{b_2}-1} -(\\\\var[fractionNumbers]{abs(a_3)}\\\\times\\\\var[fractionNumbers]{b_3})x^{\\\\var[fractionNumbers]{b_3}-1},\\\\\\\\ \\\\\\\\&= \\\\simplify[all, fractionNumbers]{{a_1*b_1}x^{b_1-1} +{a_2*b_2}x^{b_2-1} +{a_3*b_3}x^{b_3-1}}.\\\\end{split}

\"", "description": "", "templateType": "long string", "can_override": false}, "advice2": {"name": "advice2", "group": "Ungrouped variables", "definition": "if(a_2<0 and a_3>0,'{solutionb}',{advice3})", "description": "", "templateType": "anything", "can_override": false}, "advice3": {"name": "advice3", "group": "Ungrouped variables", "definition": "if(a_2>0 and a_3<0,'{solutionc}','{solutiond}')", "description": "", "templateType": "anything", "can_override": false}, "a_4": {"name": "a_4", "group": "Ungrouped variables", "definition": "random(-10..10 except 0)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "b_1>b_2 and b_2>b_3", "maxRuns": "100"}, "ungrouped_variables": ["a_1", "a_2", "a_3", "b_1", "b_2", "b_3", "advice", "advice2", "advice3", "solutiona", "solutionb", "solutionc", "solutiond", "a_4"], "variable_groups": [{"name": "Unnamed group", "variables": []}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

[[0]]

", "gaps": [{"type": "jme", "useCustomName": true, "customName": "Gap 0", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "jme", "useCustomName": true, "customName": "Alternative using \"+k\"", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": false, "answer": "{a_1}x^{{b_1}+1}/{b_1+1}+{a_2}x^{{b_2}+1}/{b_2+1}+{a_3}x^{{b_3}+1}/{b_3+1}+{a_4}x+x", "answerSimplification": "all, fractionNumbers", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": "0.01", "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": true, "customName": "Forgotten constant", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

It looks like you forgot to include the integration constant. You should always remember the \"+C\" when doing an indefinite integral.

", "useAlternativeFeedback": false, "answer": "{a_1}x^{{b_1}+1}/{b_1+1}+{a_2}x^{{b_2}+1}/{b_2+1}+{a_3}x^{{b_3}+1}/{b_3+1}+{a_4}x", "answerSimplification": "all, fractionNumbers", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": "0.01", "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x", "value": ""}]}], "answer": "{a_1}x^{{b_1}+1}/{b_1+1}+{a_2}x^{{b_2}+1}/{b_2+1}+{a_3}x^{{b_3}+1}/{b_3+1}+{a_4}x+c", "answerSimplification": "all, fractionNumbers", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": "0.01", "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "c", "value": ""}, {"name": "x", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "CI02 Definite integration", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}, {"name": "Andrew Neate", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21832/"}], "tags": [], "metadata": {"description": "

Calculating the definite integral $\\int_{n_1}^{n_2}a_1x^{b_1}+a_2x^{b_2}+a_3x^{b_3} dx$.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Evaluate \\[ \\int_{\\var{n_1}}^{\\var{n_2}}\\simplify[unitFactor, unitPower, fractionNumbers]{{a_1}*x^{b_1}+{a_2}*x^{b_2}+{a_3}*x^{b_3}} \\,dx.\\]

\n

", "advice": "

Integrating a function of the form  \\[ f(x)=x^n \\] has the integral \\[ \\int_a^b x^n dx  =  \\left[\\frac{x^{n+1}}{n+1}\\right]_a^b,\\]

\n

and \\[\\int_a^b kf(x) dx = k \\int_a^b f(x) dx.\\]

\n

Additionally, the integral of the sum or difference of two or more functions is equal to the sum or difference of the integrals of each function: \\[ \\int(f(x)\\pm g(x))\\, dx = \\int f(x)\\, dx  \\pm \\int g(x) \\, dx.\\]

\n

\n

Therefore,

\n

\\[ \\begin{split}\\simplify[unitFactor,unitPower]{defint({a_1}*x^{b_1}+{a_2}*x^{b_2}+{a_3}*x^{b_3},x,{n_1},{n_2})} &\\,= \\simplify{{a_1}defint(x^{b_1},x,{n_1},{n_2})+{a_2}defint(x^{b_2},x,{n_1},{n_2})+{a_3}defint(x^{b_3},x,{n_1},{n_2})} \\\\ &\\,= \\left[\\simplify[all,fractionNumbers]{{a_1}x^{b_1+1}/{b_1+1}+{a_2}x^{b_2+1}/{b_2+1}+{a_3}x^{b_3+1}/{b_3+1}}\\right]_\\var{n_1}^\\var{n_2} \\\\ &\\,= \\left[\\simplify[all,fractionNumbers,!collectNumbers]{{a_1*n_2^(b_1+1)}/{b_1+1}+{a_2*n_2^(b_2+1)}/{b_2+1}+{a_3*n_2^(b_3+1)}/{b_3+1}}\\right] -\\left[\\simplify[all,fractionNumbers,!collectNumbers]{{a_1*n_1^(b_1+1)}/{b_1+1}+{a_2*n_1^(b_2+1)}/{b_2+1}+{a_3*n_1^(b_3+1)}/{b_3+1}}\\right] \\\\ &\\,= \\simplify[!collectNumbers]{{eval2a}-{eval1a}} \\\\ &\\,=\\var{sol1} \\end{split} \\]

\n

Use this link to find some resources on areas under curves which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a_1": {"name": "a_1", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "templateType": "anything", "can_override": false}, "b_1": {"name": "b_1", "group": "Ungrouped variables", "definition": "3", "description": "", "templateType": "anything", "can_override": false}, "a_2": {"name": "a_2", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "templateType": "anything", "can_override": false}, "b_2": {"name": "b_2", "group": "Ungrouped variables", "definition": "2", "description": "", "templateType": "anything", "can_override": false}, "b_3": {"name": "b_3", "group": "Ungrouped variables", "definition": "1", "description": "", "templateType": "anything", "can_override": false}, "a_3": {"name": "a_3", "group": "Ungrouped variables", "definition": "random(-6..6 except 0)", "description": "", "templateType": "anything", "can_override": false}, "n_1": {"name": "n_1", "group": "Ungrouped variables", "definition": "random(0..2)", "description": "", "templateType": "anything", "can_override": false}, "n_2": {"name": "n_2", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "templateType": "anything", "can_override": false}, "eval2": {"name": "eval2", "group": "Ungrouped variables", "definition": "a_1*n_2^(b_1+1)/(b_1+1)+a_2*n_2^(b_2+1)/(b_2+1)+a_3*n_2^(b_3+1)/(b_3+1)", "description": "", "templateType": "anything", "can_override": false}, "eval1": {"name": "eval1", "group": "Ungrouped variables", "definition": "a_1*n_1^(b_1+1)/(b_1+1)+a_2*n_1^(b_2+1)/(b_2+1)+a_3*n_1^(b_3+1)/(b_3+1)", "description": "", "templateType": "anything", "can_override": false}, "eval2a": {"name": "eval2a", "group": "Ungrouped variables", "definition": "precround(eval2,3)", "description": "", "templateType": "anything", "can_override": false}, "eval1a": {"name": "eval1a", "group": "Ungrouped variables", "definition": "precround(eval1,3)", "description": "", "templateType": "anything", "can_override": false}, "sol": {"name": "sol", "group": "Ungrouped variables", "definition": "eval2-eval1", "description": "", "templateType": "anything", "can_override": false}, "sol1": {"name": "sol1", "group": "Ungrouped variables", "definition": "precround(sol,2)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "b_1>b_2 and b_2>b_3 and n_2>n_1", "maxRuns": "100"}, "ungrouped_variables": ["a_1", "a_2", "a_3", "b_1", "b_2", "b_3", "n_1", "n_2", "eval2", "eval1", "eval2a", "eval1a", "sol", "sol1"], "variable_groups": [{"name": "Unnamed group", "variables": []}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

[[0]] (Give answers to 2 decimal places where necessary)

", "gaps": [{"type": "jme", "useCustomName": true, "customName": "Gap 0", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{sol1}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": "0.01", "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": "CI03 Integration - Partial Fractions", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}, {"name": "Andrew Neate", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21832/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "

Calculating the integral of a function of the form $\\frac{c}{(x+a)(x+b)}$ using partial fractions.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Calculate the integral

\n

\\[  \\simplify{int({c}/((x^2+{aPlusb}x+{ab})),x)} .\\]

", "advice": "

In order to integrate the function \\[  \\simplify{int({c}/((x^2+{aPlusb}x+{ab})),x)}, \\] we want to rewrite it in terms of its partial fractions.

\n

First we need to factorise the denominator so we have

\n

\\[ \\simplify{{c}/((x+{a})(x+{b}))}. \\]

\n

Now to write this as a partial fraction, we want to set the function equal to the sum of 2 fractions with denominators $\\simplify{x+{a}}$ and $\\simplify{x+{b}}$. Since these are both distinct linear factors, this tells us that the numerators will be constants, which we will call $A$ and $B$:

\n

\\[ \\simplify{{c}/((x+{a})(x+{b}))} = \\simplify{A/(x+{a}) + B/(x+{b})}.\\]

\n

To find the values of $A$ and $B$, we want to multiply this equation by the denominator of the left-hand side. This gives

\n

\\[ \\simplify{{c}=A(x+{b})+B(x+{a})}.\\]

\n

\n

To find $A$, we can eliminate $B$ by setting $\\simplify{x={-a}}$:

\n

\\[ \\simplify{{c}=A{b-a}} \\implies \\simplify[fractionNumbers]{A={c/(b-a)}}.\\]

\n

Similarly, to find B, we can eliminate $A$ by setting $\\simplify{x={-b}}$:

\n

\\[ \\simplify{{c}=B{a-b}} \\implies \\simplify[fractionNumbers]{B={c/(a-b)}}.\\]

\n

Therefore, 

\n

{check1}

\n

and

\n

{check2}

\n

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"Asol": {"name": "Asol", "group": "Ungrouped variables", "definition": "c/(b-a)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-9..9 except a)", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-9..9)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "templateType": "anything", "can_override": false}, "Bsol": {"name": "Bsol", "group": "Ungrouped variables", "definition": "c/(a-b)", "description": "", "templateType": "anything", "can_override": false}, "check1": {"name": "check1", "group": "Ungrouped variables", "definition": "if(Asol=round(Asol),'{Sol1}','{Sol2}')", "description": "", "templateType": "anything", "can_override": false}, "Sol1": {"name": "Sol1", "group": "Ungrouped variables", "definition": "\"

\\\\[ \\\\simplify{{c}/((x+{a})(x+{b}))} = \\\\simplify[all,fractionNumbers]{{Asol}/(x+{a})+{Bsol}/(x+{b})},\\\\]

\"", "description": "", "templateType": "long string", "can_override": false}, "Sol2": {"name": "Sol2", "group": "Ungrouped variables", "definition": "\"

\\\\[ \\\\simplify{{c}/((x+{a})(x+{b}))} = \\\\simplify[all,fractionNumbers]{{c}/(({b-a})(x+{a}))+{c}/(({a-b})(x+{b}))},\\\\]

\"", "description": "", "templateType": "long string", "can_override": false}, "int1": {"name": "int1", "group": "Ungrouped variables", "definition": "\"

\\\\[ \\\\begin{split} \\\\simplify{int({c}/((x+{a})(x+{b})),x)} &\\\\,=  \\\\simplify[all,fractionNumbers]{int({Asol}/(x+{a})+{Bsol}/(x+{b}),x)}\\\\\\\\\\\\\\\\ &\\\\,=\\\\simplify[all,fractionNumbers]{{Asol} int(1/(x+{a}),x)+{Bsol} int(1/(x+{b}),x)}   \\\\\\\\\\\\\\\\ &\\\\,=\\\\simplify[all,fractionNumbers]{{Asol} ln (abs(x+{a}))+{Bsol} ln (abs(x+{b})) + C}. \\\\end{split}\\\\]

\"", "description": "", "templateType": "long string", "can_override": false}, "int2": {"name": "int2", "group": "Ungrouped variables", "definition": "\"

\\\\[ \\\\begin{split} \\\\simplify{int({c}/((x+{a})(x+{b})),x)} &\\\\,= \\\\simplify[all,fractionNumbers]{int({c}/(({b-a})(x+{a}))+{c}/(({a-b})(x+{b})),x)} \\\\\\\\\\\\\\\\ &\\\\,=\\\\simplify[basic,fractionNumbers,zeroFactor,noLeadingMinus]{{Asol} int(1/(x+{a}),x)+{Bsol} int(1/(x+{b}),x)}   \\\\\\\\ \\\\\\\\ &\\\\,=\\\\simplify[basic,fractionNumbers,zeroFactor,noLeadingMinus]{{Asol} ln (abs(x+{a}))+{Bsol} ln (abs(x+{b})) + C}. \\\\end{split}\\\\]

\"", "description": "", "templateType": "long string", "can_override": false}, "check2": {"name": "check2", "group": "Ungrouped variables", "definition": "if(Asol=round(Asol),'{int1}','{int2}')", "description": "", "templateType": "anything", "can_override": false}, "ab": {"name": "ab", "group": "Ungrouped variables", "definition": "a*b", "description": "", "templateType": "anything", "can_override": false}, "aPlusb": {"name": "aPlusb", "group": "Ungrouped variables", "definition": "a+b", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": "100"}, "ungrouped_variables": ["b", "a", "c", "Bsol", "Asol", "check1", "Sol1", "Sol2", "check2", "int1", "int2", "ab", "aPlusb"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "\n

[[0]]

", "gaps": [{"type": "jme", "useCustomName": true, "customName": "Correct answer", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "jme", "useCustomName": true, "customName": "brackets", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

Technically we should use the absolute value symbols for the logs. This can be done in NUMBAS by using \"abs(*function*)\".

", "useAlternativeFeedback": true, "answer": "{Asol} ln (x+{a})+{Bsol} ln (x+{b}) + c", "answerSimplification": "all,!collectLikeFractions,fractionNumbers", "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": [{"name": "c", "value": ""}, {"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": true, "customName": "Alt constant \"+k\"", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": true, "answer": "{Asol} ln (abs(x+{a}))+{Bsol} ln (abs(x+{b})) + k", "answerSimplification": "all,!collectLikeFractions,fractionNumbers", "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": [{"name": "k", "value": ""}, {"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": true, "customName": "Alt constant \"+k\" brackets", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

Technically we should use the absolute value symbols for the logs. This can be done in NUMBAS by using \"abs(*function*)\".

", "useAlternativeFeedback": true, "answer": "{Asol} ln (x+{a})+{Bsol} ln (x+{b}) + k", "answerSimplification": "all,!collectLikeFractions,fractionNumbers", "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": [{"name": "k", "value": ""}, {"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": true, "customName": "Forgotten constant", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

It looks like you forgot to include the integration constant. You should always remember the \"+C\" when doing an indefinite integral.

", "useAlternativeFeedback": false, "answer": "{Asol} ln (abs(x+{a}))+{Bsol} ln (abs(x+{b}))", "answerSimplification": "all,!collectLikeFractions,fractionNumbers", "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": [{"name": "x", "value": ""}]}], "answer": "{Asol} ln (abs(x+{a}))+{Bsol} ln (abs(x+{b})) + c", "answerSimplification": "all,!collectLikeFractions,fractionNumbers", "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": [{"name": "c", "value": ""}, {"name": "x", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "CI04 Integration - trig identities", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Andrew Neate", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21832/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "

Using the various versions of $\\cos{2x}$ identity to integrate $\\sin^2{x}$ and $\\cos^2{x}$.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Integrate $f(x)=\\var{Func}$.

", "advice": "
\n

We can't integrate $\\var{Coeff}\\sin^2(x)$ directly so first we have to use the double angle formula $\\cos(2x)=1-2\\sin^2(x)$. We re-arrange using the double angle formula to give us,

\n

\\[\\var{Coeff}\\sin^2(x)=\\frac{\\var{Coeff}}2-\\frac{\\var{Coeff}}2\\cos(2x).\\]

\n

From the Table of Integrals we see that a function of the form \\[ f(x)= \\cos(nx) \\] has the integral \\[ \\int \\cos(nx) dx  = \\frac{1}{n}\\sin(nx)+c\\]

\n

\n

So, for the function

\n

\\[f(x)=\\simplify[unitFactor,fractionNumbers]{{-Coeff/2}cos(2x)},\\]

\n

the integral is

\n

\\[ \\begin{split} \\int\\simplify[unitFactor,fractionNumbers]{{-Coeff/2}cos(2x)} dx \\,= \\simplify[unitFactor,fractionNumbers]{{-Coeff/2}int(cos(2x),x)} &\\,=\\simplify[unitFactor,fractionNumbers]{{-Coeff/2}(1/2 sin({2}x))} +c, \\\\ &\\,=\\simplify[unitFactor,fractionNumbers]{{-Coeff/4} sin(2x)+c}. \\end{split}  \\]

\n

The integral of $\\frac{\\var{Coeff}}2$ is

\n

\\[\\int\\frac{\\var{Coeff}}2dx=\\frac{\\var{Coeff}}2x+c,\\]

\n

so combining these our final answer is

\n

\\[\\int\\frac{\\var{Coeff}}2-\\frac{\\var{Coeff}}2\\cos(2x)dx=\\simplify[unitFactor,fractionNumbers]{{Coeff/2}x-{Coeff/4} sin(2x)+c}\\]

\n
\n

We can't integrate $\\var{Coeff}\\cos^2(x)$ directly so first we have to use the double angle formula $\\cos(2x)=2\\cos^2(x)-1$. We re-arrange using the double angle formula to give us,

\n

\\[\\var{Coeff}\\cos^2(x)=\\frac{\\var{Coeff}}2+\\frac{\\var{Coeff}}2\\cos(2x).\\]

\n

From the Table of Integrals we see that a function of the form \\[ f(x)= \\cos(nx) \\] has the integral \\[ \\int \\cos(nx) dx  = \\frac{1}{n}\\sin(nx)+c\\]

\n

So, for the function

\n

\\[f(x)=\\simplify[unitFactor,fractionNumbers]{{Coeff/2}cos(2x)},\\]

\n

the integral is

\n

\\[ \\begin{split} \\int\\simplify[unitFactor,fractionNumbers]{{Coeff/2}cos(2x)} dx \\,= \\simplify[unitFactor,fractionNumbers]{{Coeff/2}int(cos(2x),x)} &\\,=\\simplify[unitFactor,fractionNumbers]{{Coeff/2}(1/2 sin({2}x))} +c, \\\\ &\\,=\\simplify[unitFactor,fractionNumbers]{{Coeff/4} sin(2x)+c}. \\end{split}  \\]

\n

The integral of $\\frac{\\var{Coeff}}2$ is

\n

\\[\\int\\frac{\\var{Coeff}}2dx=\\frac{\\var{Coeff}}2x+c,\\]

\n

so combining these our final answer is

\n

\\[\\int\\frac{\\var{Coeff}}2+\\frac{\\var{Coeff}}2\\cos(2x)dx=\\simplify[unitFactor,fractionNumbers]{{Coeff/2}x+{Coeff/4} sin(2x)+c}\\]


Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"SorC": {"name": "SorC", "group": "Ungrouped variables", "definition": "random('sin(x)^2','cos(x)^2')", "description": "", "templateType": "anything", "can_override": false}, "Coeff": {"name": "Coeff", "group": "Ungrouped variables", "definition": "random(1..9)", "description": "", "templateType": "anything", "can_override": false}, "Func": {"name": "Func", "group": "Ungrouped variables", "definition": "simplify((expression(Coeff+\"*\"+SorC)),[\"unitFactor\",\"trig\"])", "description": "", "templateType": "anything", "can_override": false}, "OneIfCosMinusOneIfSine": {"name": "OneIfCosMinusOneIfSine", "group": "Ungrouped variables", "definition": "1 if(SorC='sin(x)^2',-1,1)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["SorC", "Coeff", "Func", "OneIfCosMinusOneIfSine"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "jme", "useCustomName": true, "customName": "+k instead of +c", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": false, "answer": "1/2{Coeff}*(x+{OneIfCosMinusOneIfSine}/2*sin(2x))+k", "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": [{"name": "k", "value": ""}, {"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": true, "customName": "Forgotten constant", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

It looks like you forgot to include the integration constant. You should always remember the \"+C\" when doing an indefinite integral.

", "useAlternativeFeedback": false, "answer": "1/2{Coeff}*(x+{OneIfCosMinusOneIfSine}/2*sin(2x))", "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": [{"name": "x", "value": ""}]}], "answer": "1/2{Coeff}*(x+{OneIfCosMinusOneIfSine}/2*sin(2x))+c", "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": [{"name": "c", "value": ""}, {"name": "x", "value": ""}]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "CI05 Integration - Substitution", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}, {"name": "Andrew Neate", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21832/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "

Calculating the integral of a function of the form $\\frac{nx^{n-1}}{x^n+a}$ using integration by substitution.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Calculate \\[ \\simplify[all]{int(({n}x^{n-1})/(x^{n}+{a}),x)}\\]

\n

by using the substitution \\[ \\simplify[all]{u=x^{n}+{a}}.\\]

", "advice": "

Since this integral is of the form \\[ \\int g'(x)f(g(x))\\,dx,\\] we can use the method of substitution to calculate the solution. 

\n

Firstly, we must make a change of variables from $x$ to $u$, where $u$ is equal to the 'inner' function $g(x)$.

\n

So, for \\[\\simplify[fractionNumbers]{int(({n}x^{n-1})/((x^{n}+{a})),x)}\\]

\n

let $\\color{red}{u=\\simplify[fractionNumbers]{x^{n}+{a}}}.$

\n

Now, we need to calculate the differential, $du$, where \\[ du = \\left(\\frac{du}{dx}\\right)dx. \\]

\n

Differentiating $u$ with respect to $x$:

\n

\\[ \\frac{du}{dx}= \\simplify[fractionNumbers]{{n}x^{n-1}}.\\]

\n

Therefore, \\[ \\color{blue}{du = \\simplify[fractionNumbers]{{n}x^{n-1}}\\, dx}.\\]

\n

We can now rewrite the original integral in terms of $u$:

\n

\\[ \\int \\frac{\\color{blue}{\\simplify{{n}x^{n-1}}}}{\\color{red}{\\simplify{x^{n}+{a}}}}\\color{blue}{\\text{d}x} = \\int \\frac{1}{\\color{red}{u}}\\color{blue}{\\text{d}u}.\\]

\n

(Note: It is important to see that both the function we are integrating, and the variable we are integrating with respect to, has changed.)

\n

\\[ \\simplify[fractionNumbers]{int(1/u,u) = ln(abs(u)) + c}.\\]

\n

Finally, we must rewrite our solution back in terms of the original variable $x$:

\n

\\[ \\simplify[fractionNumbers]{ln(abs(u)) + c = ln(abs(x^{n}+{a})) + c}.\\]

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(2..6)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": "100"}, "ungrouped_variables": ["a", "n"], "variable_groups": [{"name": "Unnamed group", "variables": []}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

[[0]]

", "gaps": [{"type": "jme", "useCustomName": true, "customName": "Correct answer", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "jme", "useCustomName": true, "customName": "Alternative using brackets", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

Technically we should use the absolute value symbols for the logs. This can be done in NUMBAS by using \"abs(*function*)\".

", "useAlternativeFeedback": false, "answer": "ln(x^{n}+{a})+c", "answerSimplification": "all,!collectLikeFractions,fractionNumbers", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": "0.01", "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "c", "value": ""}, {"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": true, "customName": "Alternative using \"+k\"", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": false, "answer": "ln(abs(x^{n}+{a})) + k", "answerSimplification": "all,!collectLikeFractions,fractionNumbers", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": "0.01", "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "k", "value": ""}, {"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": true, "customName": "Alternative using brackets and \"+k\"", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

Technically we should use the absolute value symbols for the logs. This can be done in NUMBAS by using \"abs(*function*)\".

", "useAlternativeFeedback": false, "answer": "ln(x^{n}+{a})+k", "answerSimplification": "all,!collectLikeFractions,fractionNumbers", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": "0.01", "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "k", "value": ""}, {"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": true, "customName": "Forgotten constant", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

It looks like you forgot to include the integration constant. You should always remember the \"+C\" when doing an indefinite integral.

", "useAlternativeFeedback": false, "answer": "ln(abs(x^{n}+{a}))", "answerSimplification": "all,!collectLikeFractions,fractionNumbers", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": "0.01", "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x", "value": ""}]}], "answer": "ln(abs(x^{n}+{a}))+c", "answerSimplification": "all,!collectLikeFractions,fractionNumbers", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": "0.01", "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "c", "value": ""}, {"name": "x", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "CI06 Integration - Parts", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}, {"name": "Andrew Neate", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21832/"}, {"name": "Will Morgan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21933/"}], "tags": [], "metadata": {"description": "

Calculating the integral of a function of the form $ax^2 \\cos(bx)$ using integration by parts.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Calculate the integral \\[ \\simplify{int({a}x^2 cos({b}x),x)}\\]

", "advice": "

If we have a function of $x$ which is the product of two functions of $x$, to integrate such a function it is often necessary to use Integration by Parts. The formula for Integration by Parts is:

\n

\\[ \\int u(x) \\frac{dv}{dx} dx = u(x)v(x) - \\int v(x) \\frac{du}{dx} dx.\\]

\n

Using this method can be broken down into steps:

\n
    \n
  1. Identify $u(x)$ and $\\tfrac{dv}{dx}$ (The function you pick for each is important, in general you want $u(x)$ to become simpler when differentiating it, and you must be able to integrate $\\tfrac{dv}{dx}$ to find $v(x)$);
  2. \n
  3. Calculate $\\tfrac{du}{dx}$ and $v(x)$;
  4. \n
  5. Put the functions $u(x)$, $v(x)$, and their derivatives into the Integration by Parts formula;
  6. \n
  7. Calculate the integral $\\int v(x) \\tfrac{du}{dx} dx$ (This may require you to use Integration by Parts again, this is OK!);
  8. \n
  9. Simplify your answer where possible and don't forget to add the constant of integration.
  10. \n
\n

\n

For the integral

\n

\\[ \\simplify{int({a}x^2 cos({b}x),x)},\\]

\n

we must first identify $u(x)$ and $\\tfrac{dv}{dx}$. In this case, let \\[ u(x)=\\simplify{{a}x^2},\\quad \\frac{dv}{dx}= \\simplify{cos({b}x)}. \\]

\n

Next, we need to calculate $\\tfrac{du}{dx}$ and $v(x)$:

\n

\\[ \\begin{split} u(x) = \\var{a}x^2 \\quad &\\implies \\frac{du}{dx} = \\simplify{{2a}x}; \\\\ \\frac{dv}{dx} = \\cos(\\var{b}x) &\\implies v(x) = \\simplify[fractionNumbers]{1/{b} sin({b}x)}. \\end{split} \\]

\n

Plugging these 4 terms into the integration by parts formula:

\n

\\[  \\begin{split} \\simplify{int({a}x^2 cos({b}x),x)} &\\,= \\simplify[fractionNumbers]{{a/b}x^2 sin({b}x) - int({2a/b}x sin({b}x),x)},  \\\\ \\\\ &\\,= \\simplify[fractionNumbers]{{a/b}x^2 sin({b}x) -{2a/b}int(x sin({b}x),x)}.\\end{split} \\]

\n

Since the integral on the right-hand side is still the product of two functions of $x$, we need to use integration by parts again. 

\n

So, for 

\n

\\[ \\simplify{int(x sin({b}x),x)}, \\]

\n

 Let $u=x$ and $\\tfrac{dv}{dx} = \\sin(\\var{b}x)$. Therefore, $\\tfrac{du}{dx}=1$ and $v(x)=\\simplify{-1/{b} cos({b}x)}$.

\n

Hence,

\n

\\[ \\begin{split} \\simplify{int(x sin({b}x),x)} &\\,= \\simplify{-1/{b}x cos({b}x)- int(-1/{b} cos({b}x),x)} \\\\ \\\\ &\\,= \\simplify{-1/{b}x cos({b}x)+1/{b^2}sin({b}x)}. \\end{split}\\]

\n

Plugging this back into the original calculation:

\n

\\[  \\begin{split} \\simplify{int({a}x^2 cos({b}x),x)} &\\,= \\simplify[fractionNumbers]{{a/b}x^2 sin({b}x) -{2a/b}int(x cos({b}x),x)} \\\\ \\\\ &\\,= \\simplify[fractionNumbers]{{a/b}x^2 sin({b}x) -{2a/b}[-1/{b}x cos({b}x)+1/{b^2}sin({b}x)]} \\\\ \\\\ &\\,=\\simplify[fractionNumbers]{{a/b}x^2 sin({b}x) +{2a/b^2}x cos({b}x)-{2a/b^3}sin({b}x)} + c.\\end{split} \\]

\n

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(2..7)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(3..5)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "gcd(a,b)=1 and b>a", "maxRuns": 100}, "ungrouped_variables": ["a", "b"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

[[0]]

", "gaps": [{"type": "jme", "useCustomName": true, "customName": "Correct Answer", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "jme", "useCustomName": true, "customName": "Alt constant +k", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": false, "answer": "{a/b}x^2 sin({b}x)+{2a/b^2}x cos({b}x)-{2a/b^3}sin({b}x)+k", "answerSimplification": "all,!collectLikeFractions,fractionNumbers", "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": [{"name": "k", "value": ""}, {"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": true, "customName": "Forgotten constant", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

It looks like you forgot to include the integration constant. You should always remember the \"+C\" when doing an indefinite integral.

", "useAlternativeFeedback": false, "answer": "{a/b}x^2 sin({b}x)+{2a/b^2}x cos({b}x)-{2a/b^3}sin({b}x)", "answerSimplification": "all,!collectLikeFractions,fractionNumbers", "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": [{"name": "x", "value": ""}]}], "answer": "{a/b}x^2 sin({b}x)+{2a/b^2}x cos({b}x)-{2a/b^3}sin({b}x)+c", "answerSimplification": "fractionNumbers, basic", "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": [{"name": "c", "value": ""}, {"name": "x", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}]}], "allowPrinting": true, "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": true, "navigatemode": "sequence", "onleave": {"action": "none", "message": ""}, "preventleave": true, "typeendtoleave": false, "startpassword": "", "autoSubmit": true, "allowAttemptDownload": false, "downloadEncryptionKey": "", "showresultspage": "oncompletion"}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"enterreviewmodeimmediately": true, "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showpartfeedbackmessageswhen": "always", "showexpectedanswerswhen": "inreview", "showadvicewhen": "inreview", "allowrevealanswer": true, "intro": "", "end_message": "

\n
\n
\n
\n
\n

Thank you for completing the Skills Audit for Maths and Stats. Hopefully it has been useful in directing you to resources and services that can support your studies. The Skills Audit for Maths and Stats will remain open to you throughout the academic year and you can always revisit it again later.

\n

For any further information or questions please contact mash@sheffield.ac.uk

\n
\n
\n
\n
", "results_options": {"printquestions": true, "printadvice": true}, "feedbackmessages": [], "reviewshowexpectedanswer": true, "showanswerstate": true, "reviewshowfeedback": true, "showactualmark": true, "showtotalmark": true, "reviewshowscore": true, "reviewshowadvice": true}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}], "extensions": ["geogebra"], "custom_part_types": [], "resources": []}