// 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": [{"variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "statement": "
Consider the following set of $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}$
", "functions": {}, "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", "variable_groups": [], "rulesets": {}, "parts": [{"variableReplacements": [], "marks": 0, "type": "gapfill", "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", "gaps": [{"warningType": "none", "marks": 0, "type": "m_n_x", "minAnswers": 0, "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "variableReplacements": [], "minMarks": 0, "answers": ["Yes", "No"], "choices": ["$\\textbf{v}_1$", "$\\textbf{v}_2$", "$\\textbf{v}_3$", "$\\textbf{v}_4$", "$\\textbf{v}_5$", "$\\textbf{v}_6$"], "shuffleChoices": false, "maxAnswers": 0, "matrix": "mm", "shuffleAnswers": false, "layout": {"expression": "", "type": "all"}, "scripts": {}, "showFeedbackIcon": true, "maxMarks": 0, "showCorrectAnswer": true}], "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true}], "tags": [], "extensions": [], "variables": {"mm6": {"definition": "if(u=3 or u=6 or u=8 or u=9,[0,1], [1,0])", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "mm6"}, "u": {"definition": "random(1..9)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "u"}, "al1": {"definition": "random(1,-1)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "al1"}, "z": {"definition": "[-b-c,a+c,-a+b-c,a-b]", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "z"}, "ont3": {"definition": "if(mm3[1]=1,\"\", \"not\")", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ont3"}, "nt2": {"definition": "if(mm2[0]=0.5,\"\", \"not\")", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "nt2"}, "mm3": {"definition": "if(u=4 or u=5 or u=6,[0,1], [1,0])", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "mm3"}, "c5": {"definition": "random(-3..3 except 0)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "c5"}, "nt5": {"definition": "if(mm5[0]=1,\"\", \"not\")", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "nt5"}, "ga": {"definition": "if(al*be=0, random(1,-1),0)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ga"}, "v": {"definition": "[-b+c,a-c,-a+b,a-b+c] ", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "v"}, "tmm": {"definition": "list(transpose(matrix(mm)))", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "tmm"}, "ont2": {"definition": "if(mm2[1]=0.5,\"\", \"not\")", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ont2"}, "a": {"definition": "random(-3..3 except 0)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "a"}, "p1": {"definition": "if(u<4,list(al*vector(x)),if(u<7,q,if(u<9,r,t)))", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "p1"}, "v3": {"definition": "if(u>6,z,if(u>3,p1,y))", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "v3"}, "p2": {"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": "", "group": "Ungrouped variables", "templateType": "anything", "name": "p2"}, "v5": {"definition": "if(u=1 or u=4,z,if(u =2 or u=5 or u=7,p2, if(u=9,p1,v)))", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "v5"}, "v2": {"definition": "if(u>3,y,p1)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "v2"}, "ont5": {"definition": "if(mm5[1]=1,\"\", \"not\")", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ont5"}, "mm5": {"definition": "if(u=2 or u=5 or u=7 or u=9,[0,1], [1,0])", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "mm5"}, "mm": {"definition": "[[0.5,0],mm2,mm3,mm4,mm5,mm6]", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "mm"}, "c": {"definition": "if(c5+a+b=0, if(c5+1=0,c5+2,c5+1),c5)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "c"}, "ont6": {"definition": "if(mm6[1]=1,\"\", \"not\")", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ont6"}, "message5": {"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": "", "group": "Ungrouped variables", "templateType": "anything", "name": "message5"}, "mm2": {"definition": "switch(u>3,[0.5,0],[0,0.5])", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "mm2"}, "v4": {"definition": "if(u=7 or u=8,p1,if(u=9,v,if(u=4 or u=1,p2,z)))", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "v4"}, "ont4": {"definition": "if(mm4[1]=1,\"\", \"not\")", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ont4"}, "v6": {"definition": "if(u>7 or u=3 or u=6, p2, v)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "v6"}, "b": {"definition": "random(-3..3 except 0)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "b"}, "r": {"definition": "list(al*vector(x)+be*vector(y)+ga*vector(z))", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "r"}, "mm4": {"definition": "if(u=2 or u=3 or u=5 or u=6 or u=9,[1,0], [0,1])", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "mm4"}, "v1": {"definition": "x", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "v1"}, "nt3": {"definition": "if(mm3[0]=1,\"\", \"not\")", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "nt3"}, "be": {"definition": "random(0,1,-1)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "be"}, "y": {"definition": "[b-c,a-b+c,-a-c,a+b]", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "y"}, "q": {"definition": "list(al*vector(x)+be*vector(y))", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "q"}, "t": {"definition": "list(ep*vector(v))", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "t"}, "message4": {"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": "", "group": "Ungrouped variables", "templateType": "anything", "name": "message4"}, "nt4": {"definition": "if(mm4[0]=1,\"\", \"not\")", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "nt4"}, "al": {"definition": "random(1,-1)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "al"}, "nt6": {"definition": "if(mm6[0]=1,\"\", \"not\")", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "nt6"}, "x": {"definition": "[-a+b-c,-b+c,a-c,-a+b]", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "x"}, "ga1": {"definition": "if(al1*be1=0,random(1,-1),0)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ga1"}, "ep": {"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": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ep"}, "be1": {"definition": "random(0,1,-1)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "be1"}}, "name": "Find a basis given a spanning set of vectors", "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.
"}, "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"], "type": "question", "contributors": [{"name": "Mohamed Mehbali", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1764/"}]}]}], "contributors": [{"name": "Mohamed Mehbali", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1764/"}]}