// Numbas version: finer_feedback_settings {"name": "Michael's copy of Find a basis given a spanning set of vectors", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "tags": [], "preamble": {"css": "", "js": ""}, "variable_groups": [], "variables": {"ep": {"description": "", "definition": "if(al=0 and be=0,random(1,-1),if(al=0 and ga=0,random(1,-1), if(be=0 and ga=0,random(1,-1),0)))", "templateType": "anything", "group": "Ungrouped variables", "name": "ep"}, "mm3": {"description": "", "definition": "if(u=4 or u=5 or u=6,[0,1], [1,0])", "templateType": "anything", "group": "Ungrouped variables", "name": "mm3"}, "z": {"description": "", "definition": "[-b-c,a+c,-a+b-c,a-b]", "templateType": "anything", "group": "Ungrouped variables", "name": "z"}, "al": {"description": "", "definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "al"}, "message5": {"description": "", "definition": "if(u=2 or u=5 or u=7, \"There are three linearly independent vectors at this stage and you know that the set is spanning, so the 6th vector must be in the basis.\",if(u=3 or u=6 or u=8, \"There are now 4 linearly independent vectors, so the 6th vector is not in the basis.\",\" \"))", "templateType": "anything", "group": "Ungrouped variables", "name": "message5"}, "p1": {"description": "", "definition": "if(u<4,list(al*vector(x)),if(u<7,q,if(u<9,r,t)))", "templateType": "anything", "group": "Ungrouped variables", "name": "p1"}, "nt6": {"description": "", "definition": "if(mm6[0]=1,\"\", \"not\")", "templateType": "anything", "group": "Ungrouped variables", "name": "nt6"}, "y": {"description": "", "definition": "[b-c,a-b+c,-a-c,a+b]", "templateType": "anything", "group": "Ungrouped variables", "name": "y"}, "v2": {"description": "", "definition": "if(u>3,y,p1)", "templateType": "anything", "group": "Ungrouped variables", "name": "v2"}, "tmm": {"description": "", "definition": "list(transpose(matrix(mm)))", "templateType": "anything", "group": "Ungrouped variables", "name": "tmm"}, "v5": {"description": "", "definition": "if(u=1 or u=4,z,if(u =2 or u=5 or u=7,p2, if(u=9,p1,v)))", "templateType": "anything", "group": "Ungrouped variables", "name": "v5"}, "ga": {"description": "", "definition": "if(al*be=0, random(1,-1),0)", "templateType": "anything", "group": "Ungrouped variables", "name": "ga"}, "t": {"description": "", "definition": "list(ep*vector(v))", "templateType": "anything", "group": "Ungrouped variables", "name": "t"}, "mm2": {"description": "", "definition": "switch(u>3,[0.5,0],[0,0.5])", "templateType": "anything", "group": "Ungrouped variables", "name": "mm2"}, "ont5": {"description": "", "definition": "if(mm5[1]=1,\"\", \"not\")", "templateType": "anything", "group": "Ungrouped variables", "name": "ont5"}, "v": {"description": "", "definition": "[-b+c,a-c,-a+b,a-b+c] ", "templateType": "anything", "group": "Ungrouped variables", "name": "v"}, "nt4": {"description": "", "definition": "if(mm4[0]=1,\"\", \"not\")", "templateType": "anything", "group": "Ungrouped variables", "name": "nt4"}, "ont6": {"description": "", "definition": "if(mm6[1]=1,\"\", \"not\")", "templateType": "anything", "group": "Ungrouped variables", "name": "ont6"}, "q": {"description": "", "definition": "list(al*vector(x)+be*vector(y))", "templateType": "anything", "group": "Ungrouped variables", "name": "q"}, "c": {"description": "", "definition": "if(c5+a+b=0, if(c5+1=0,c5+2,c5+1),c5)", "templateType": "anything", "group": "Ungrouped variables", "name": "c"}, "be1": {"description": "", "definition": "random(0,1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "be1"}, "al1": {"description": "", "definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "al1"}, "v3": {"description": "", "definition": "if(u>6,z,if(u>3,p1,y))", "templateType": "anything", "group": "Ungrouped variables", "name": "v3"}, "a": {"description": "", "definition": "random(-3..3 except 0)", "templateType": "anything", "group": "Ungrouped variables", "name": "a"}, "message4": {"description": "", "definition": "if(u=1 or u=4, \"Since at this stage there are only 2 linearly independent vectors and you know that the set is spanning, you can immediately say yes to the next two as they must be in the basis.\",if(u=9,\"There are now 4 linearly independent vectors and so you can answer no to the next two.\",\" \"))", "templateType": "anything", "group": "Ungrouped variables", "name": "message4"}, "v6": {"description": "", "definition": "if(u>7 or u=3 or u=6, p2, v)", "templateType": "anything", "group": "Ungrouped variables", "name": "v6"}, "nt3": {"description": "", "definition": "if(mm3[0]=1,\"\", \"not\")", "templateType": "anything", "group": "Ungrouped variables", "name": "nt3"}, "ont3": {"description": "", "definition": "if(mm3[1]=1,\"\", \"not\")", "templateType": "anything", "group": "Ungrouped variables", "name": "ont3"}, "ga1": {"description": "", "definition": "if(al1*be1=0,random(1,-1),0)", "templateType": "anything", "group": "Ungrouped variables", "name": "ga1"}, "mm6": {"description": "", "definition": "if(u=3 or u=6 or u=8 or u=9,[0,1], [1,0])", "templateType": "anything", "group": "Ungrouped variables", "name": "mm6"}, "nt2": {"description": "", "definition": "if(mm2[0]=0.5,\"\", \"not\")", "templateType": "anything", "group": "Ungrouped variables", "name": "nt2"}, "c5": {"description": "", "definition": "random(-3..3 except 0)", "templateType": "anything", "group": "Ungrouped variables", "name": "c5"}, "mm4": {"description": "", "definition": "if(u=2 or u=3 or u=5 or u=6 or u=9,[1,0], [0,1])", "templateType": "anything", "group": "Ungrouped variables", "name": "mm4"}, "v1": {"description": "", "definition": "x", "templateType": "anything", "group": "Ungrouped variables", "name": "v1"}, "be": {"description": "", "definition": "random(0,1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "be"}, "nt5": {"description": "", "definition": "if(mm5[0]=1,\"\", \"not\")", "templateType": "anything", "group": "Ungrouped variables", "name": "nt5"}, "u": {"description": "", "definition": "random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "u"}, "p2": {"description": "", "definition": "\n if(u=1 or u=4,list(al1*vector(x)+be1*vector(y)),\n if(u=2 or u=5 or u=7,list(al1*vector(x)+be1*vector(y)+ga1*vector(z)),\n [random(0..2),random(-1,3),random(0..2),random(0..2)]))\n ", "templateType": "anything", "group": "Ungrouped variables", "name": "p2"}, "ont2": {"description": "", "definition": "if(mm2[1]=0.5,\"\", \"not\")", "templateType": "anything", "group": "Ungrouped variables", "name": "ont2"}, "r": {"description": "", "definition": "list(al*vector(x)+be*vector(y)+ga*vector(z))", "templateType": "anything", "group": "Ungrouped variables", "name": "r"}, "b": {"description": "", "definition": "random(-3..3 except 0)", "templateType": "anything", "group": "Ungrouped variables", "name": "b"}, "mm": {"description": "", "definition": "[[0.5,0],mm2,mm3,mm4,mm5,mm6]", "templateType": "anything", "group": "Ungrouped variables", "name": "mm"}, "v4": {"description": "", "definition": "if(u=7 or u=8,p1,if(u=9,v,if(u=4 or u=1,p2,z)))", "templateType": "anything", "group": "Ungrouped variables", "name": "v4"}, "ont4": {"description": "", "definition": "if(mm4[1]=1,\"\", \"not\")", "templateType": "anything", "group": "Ungrouped variables", "name": "ont4"}, "x": {"description": "", "definition": "[-a+b-c,-b+c,a-c,-a+b]", "templateType": "anything", "group": "Ungrouped variables", "name": "x"}, "mm5": {"description": "", "definition": "if(u=2 or u=5 or u=7 or u=9,[0,1], [1,0])", "templateType": "anything", "group": "Ungrouped variables", "name": "mm5"}}, "functions": {}, "extensions": [], "advice": "

Clearly $\\textbf{v}_1$ is always in the required basis as it is non-zero.

\n

$\\textbf{v}_2$ is {nt2} in the required basis as it is {ont2} a multiple of $\\textbf{v}_1$.

\n

$\\textbf{v}_3$ is {nt3} in the required basis as it is {ont3} a linear  combination of $\\textbf{v}_1$ and $\\textbf{v}_2$.

\n

$\\textbf{v}_4$ is {nt4} in the required basis as it is {ont4} a linear  combination of previous vectors.

\n

{message4}

\n

$\\textbf{v}_5$ is {nt5} in the required basis as it is {ont5} a linear  combination of previous vectors.

\n

{message5}

\n

$\\textbf{v}_6$ is {nt6} in the required basis as it is {ont6} a linear  combination of previous vectors.

\n

 

", "variablesTest": {"condition": "", "maxRuns": 100}, "metadata": {"description": "

Given $6$ vectors in $\\mathbb{R^4}$ and given that they span $\\mathbb{R^4}$ find a  basis.

", "licence": "Creative Commons Attribution 4.0 International"}, "name": "Michael's copy of Find a basis given a spanning set of vectors", "ungrouped_variables": ["mm5", "mm4", "nt3", "mm6", "nt5", "al", "ga1", "mm2", "ga", "ep", "ont3", "ont2", "ont6", "ont5", "ont4", "message5", "message4", "be1", "tmm", "be", "nt2", "nt4", "v1", "v2", "v3", "v4", "mm3", "v6", "nt6", "b", "c5", "al1", "a", "c", "p1", "mm", "q", "p2", "r", "u", "t", "v", "y", "x", "z", "v5"], "statement": "

Consider the following $6$ vectors in $\\mathbb{R^4}$ . . 

\n

\\[\\begin{align} \\textbf{v}_1&=\\var{rowvector(v1)}\\\\ \\textbf{v}_2&=\\var{rowvector(v2)}\\\\ \\textbf{v}_3&=\\var{rowvector(v3)}\\\\ \\textbf{v}_4&=\\var{rowvector(v4)}\\\\ \\textbf{v}_5&=\\var{rowvector(v5)}\\\\ \\textbf{v}_6&=\\var{rowvector(v6)}\\end{align}\\] 

\n

You are given that this set of vectors is a spanning set for  $\\mathbb{R^4}$

", "parts": [{"showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "marks": 0, "variableReplacements": [], "customMarkingAlgorithm": "", "sortAnswers": false, "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "gapfill", "gaps": [{"showCorrectAnswer": true, "answers": ["Yes", "No"], "type": "m_n_x", "unitTests": [], "scripts": {}, "matrix": "mm", "warningType": "none", "extendBaseMarkingAlgorithm": true, "shuffleAnswers": false, "marks": 0, "minAnswers": 0, "variableReplacements": [], "customMarkingAlgorithm": "", "minMarks": 0, "maxAnswers": 0, "displayType": "radiogroup", "layout": {"expression": "", "type": "all"}, "choices": ["$\\textbf{v}_1$", "$\\textbf{v}_2$", "$\\textbf{v}_3$", "$\\textbf{v}_4$", "$\\textbf{v}_5$", "$\\textbf{v}_6$"], "variableReplacementStrategy": "originalfirst", "shuffleChoices": false, "maxMarks": 0, "showFeedbackIcon": true}], "prompt": "

Your task is to find a basis for $\\mathbb{R^4}$ by finding a linearly independent subset of these vectors.

\n

Start from $\\textbf{v}_1$ and work through each vector in turn.

\n

Determine if a vector is a linear combination of the previous vectors in the list.

\n

If it is not such a linear combination then include it in the basis by choosing Yes, otherwise choose No.

\n

Note that if a vector $\\textbf{v}_i$ for $i=2,\\ldots 5$ is a linear combination of the previous vectors in the list then it will satisfy a simple relation of the form  $ \\textbf{v}_i=a\\textbf{v}_j +b\\textbf{v}_k$ where $a$ can be $0,\\;1$  or $-1$  similarly for $b$.

\n

When you get to $\\textbf{v}_6$ it will be obvious if it is in the spanning set or not. (why?)

\n

[[0]]  

\n

 

"}], "type": "question", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Michael Hoffmann", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1625/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Michael Hoffmann", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1625/"}]}