// Numbas version: finer_feedback_settings {"name": "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": [{"variable_groups": [], "variables": {"mm2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(u>3,[0.5,0],[0,0.5])", "description": "", "name": "mm2"}, "ont4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(mm4[1]=1,\"\", \"not\")", "description": "", "name": "ont4"}, "mm6": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(u=3 or u=6 or u=8 or u=9,[0,1], [1,0])", "description": "", "name": "mm6"}, "v1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "x", "description": "", "name": "v1"}, "ga": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(al*be=0, random(1,-1),0)", "description": "", "name": "ga"}, "nt6": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(mm6[0]=1,\"\", \"not\")", "description": "", "name": "nt6"}, "ont6": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(mm6[1]=1,\"\", \"not\")", "description": "", "name": "ont6"}, "ep": {"group": "Ungrouped variables", "templateType": "anything", "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)))", "description": "", "name": "ep"}, "be": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0,1,-1)", "description": "", "name": "be"}, "v": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[-b+c,a-c,-a+b,a-b+c] ", "description": "", "name": "v"}, "nt5": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(mm5[0]=1,\"\", \"not\")", "description": "", "name": "nt5"}, "nt2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(mm2[0]=0.5,\"\", \"not\")", "description": "", "name": "nt2"}, "ont2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(mm2[1]=0.5,\"\", \"not\")", "description": "", "name": "ont2"}, "b": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(-3..3 except 0)", "description": "", "name": "b"}, "message5": {"group": "Ungrouped variables", "templateType": "anything", "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.\",\" \"))", "description": "", "name": "message5"}, "be1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0,1,-1)", "description": "", "name": "be1"}, "p2": {"group": "Ungrouped variables", "templateType": "anything", "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 ", "description": "", "name": "p2"}, "r": {"group": "Ungrouped variables", "templateType": "anything", "definition": "list(al*vector(x)+be*vector(y)+ga*vector(z))", "description": "", "name": "r"}, "mm4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(u=2 or u=3 or u=5 or u=6 or u=9,[1,0], [0,1])", "description": "", "name": "mm4"}, "al1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1,-1)", "description": "", "name": "al1"}, "u": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..9)", "description": "", "name": "u"}, "v3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(u>6,z,if(u>3,p1,y))", "description": "", "name": "v3"}, "x": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[-a+b-c,-b+c,a-c,-a+b]", "description": "", "name": "x"}, "q": {"group": "Ungrouped variables", "templateType": "anything", "definition": "list(al*vector(x)+be*vector(y))", "description": "", "name": "q"}, "nt4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(mm4[0]=1,\"\", \"not\")", "description": "", "name": "nt4"}, "a": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(-3..3 except 0)", "description": "", "name": "a"}, "c": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(c5+a+b=0, if(c5+1=0,c5+2,c5+1),c5)", "description": "", "name": "c"}, "z": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[-b-c,a+c,-a+b-c,a-b]", "description": "", "name": "z"}, "ont5": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(mm5[1]=1,\"\", \"not\")", "description": "", "name": "ont5"}, "t": {"group": "Ungrouped variables", "templateType": "anything", "definition": "list(ep*vector(v))", "description": "", "name": "t"}, "ga1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(al1*be1=0,random(1,-1),0)", "description": "", "name": "ga1"}, "mm3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(u=4 or u=5 or u=6,[0,1], [1,0])", "description": "", "name": "mm3"}, "v6": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(u>7 or u=3 or u=6, p2, v)", "description": "", "name": "v6"}, "v2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(u>3,y,p1)", "description": "", "name": "v2"}, "mm5": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(u=2 or u=5 or u=7 or u=9,[0,1], [1,0])", "description": "", "name": "mm5"}, "mm": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[[0.5,0],mm2,mm3,mm4,mm5,mm6]", "description": "", "name": "mm"}, "c5": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(-3..3 except 0)", "description": "", "name": "c5"}, "nt3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(mm3[0]=1,\"\", \"not\")", "description": "", "name": "nt3"}, "al": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1,-1)", "description": "", "name": "al"}, "tmm": {"group": "Ungrouped variables", "templateType": "anything", "definition": "list(transpose(matrix(mm)))", "description": "", "name": "tmm"}, "v4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(u=7 or u=8,p1,if(u=9,v,if(u=4 or u=1,p2,z)))", "description": "", "name": "v4"}, "message4": {"group": "Ungrouped variables", "templateType": "anything", "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.\",\" \"))", "description": "", "name": "message4"}, "ont3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(mm3[1]=1,\"\", \"not\")", "description": "", "name": "ont3"}, "v5": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(u=1 or u=4,z,if(u =2 or u=5 or u=7,p2, if(u=9,p1,v)))", "description": "", "name": "v5"}, "p1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(u<4,list(al*vector(x)),if(u<7,q,if(u<9,r,t)))", "description": "", "name": "p1"}, "y": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[b-c,a-b+c,-a-c,a+b]", "description": "", "name": "y"}}, "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"], "name": "Find a basis given a spanning set of vectors", "functions": {}, "parts": [{"variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "scripts": {}, "gaps": [{"displayType": "radiogroup", "layout": {"type": "all", "expression": ""}, "marks": 0, "choices": ["$\\textbf{v}_1$", "$\\textbf{v}_2$", "$\\textbf{v}_3$", "$\\textbf{v}_4$", "$\\textbf{v}_5$", "$\\textbf{v}_6$"], "showCorrectAnswer": true, "matrix": "mm", "type": "m_n_x", "maxAnswers": 0, "shuffleChoices": false, "warningType": "none", "scripts": {}, "maxMarks": 0, "minAnswers": 0, "minMarks": 0, "shuffleAnswers": false, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "answers": ["Yes", "No"], "showFeedbackIcon": true}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "
Your task is to find a basis for $\\mathbb{R^4}$ by finding a linearly independent subset of these vectors.
\nStart from $\\textbf{v}_1$ and work through each vector in turn.
\nDetermine if a vector is a linear combination of the previous vectors in the list.
\nIf it is not such a linear combination then include it in the basis by choosing Yes, otherwise choose No.
\nNote 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$.
\nWhen you get to $\\textbf{v}_6$ it will be obvious if it is in the spanning set or not. (why?)
\n[[0]]
\n", "variableReplacements": [], "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "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}\\]
\nYou are given that this set of vectors is a spanning set for $\\mathbb{R^4}$
", "tags": ["basis", "checked2015", "euclidean space", "linear algebra", "linear combination", "linear dependence", "linear independence", "linear spaces", "linearly dependent", "span", "spanning set", "vector spaces"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Given $6$ vectors in $\\mathbb{R^4}$ and given that they span $\\mathbb{R^4}$ find a basis.
"}, "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", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}