Skip to content

Commit e8685fa

Browse files
authored
Merge pull request #1234 from gajennings/main
Fix bug 4860, update to PGML, add solution.
2 parents 3784412 + 1c4a32b commit e8685fa

File tree

1 file changed

+102
-23
lines changed
  • OpenProblemLibrary/TCNJ/TCNJ_MatrixEquations

1 file changed

+102
-23
lines changed

OpenProblemLibrary/TCNJ/TCNJ_MatrixEquations/problem7.pg

Lines changed: 102 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,47 +16,126 @@ loadMacros(
1616
"PGstandard.pl",
1717
"MathObjects.pl",
1818
"PGML.pl",
19-
"parserCheckboxList.pl",
19+
"parserPopUp.pl",
2020
"PGcourse.pl"
2121
);
2222

2323
TEXT(beginproblem());
2424
$showPartialCorrectAnswers = 1;
2525
Context("Numeric");
2626

27-
@yes = ( 'A vector \( b \) is a linear combination of the columns of a matrix \( A \) if and only if the equation \( Ax = b \) has at least one solution. ',
28-
'The first entry in the product \( Ax \) is a sum of products of real numbers. ' ,
29-
'If the columns of \( A \) span \( {\mathbb R}^m\), then the equation \( Ax = b \) is consistent for each \( b \) in \( {\mathbb R}^m\). ' ,
30-
'If the equation \( Ax = b \) is inconsistent for some \( b \) in \( {\mathbb R}^m\), then \( A \) cannot have a pivot position in every row. ' ,
31-
'Every matrix equation \( Ax = b \) corresponds to a vector equation with the same solution set. ' ,
32-
'Any linear combination of vectors in \(\mathbb{R}^m\) can always be written in the form \( Ax \) for a suitable matrix \( A \) and vector \( x \). ' ,
33-
'The solution set of a linear system whose augmented matrix is \( [ a_1a_2 \cdots a_n \vert b ] \) is the same as the solution set of \( Ax = b \), if \( A = [ a_1 a_2 \cdots a_n ] \). ' ,
34-
'If the equation \( Ax = b \) is inconsistent, then \( b \) is not in the set spanned by the columns of \( A \). ' ,
35-
'If the columns of \( A \) do not span \( {\mathbb R}^m\), then the equation \( Ax = b \) is inconsistent for some \( b \) in \( {\mathbb R}^m\). '
36-
);
27+
@yes = (); @yesTF=(); @yesSol=();
28+
29+
push @yes, 'The vector \( b \) is a linear combination of the columns of the matrix \( A \) if and only if the equation \( Ax = b \) has at least one solution. ';
30+
push @yesTF, DropDownTF("True");
31+
push @yesSol, 'True. \(b\) is a linear combination of the columns of \(A\) if and only if there are real numbers \(x_1,\ldots,x_n\) such that \(\sum_{j=1}^n A_{i,j}x_j = b_i\) for every \(i=1,\ldots,m\), if and only if the column vector \(x=(x_1,\ldots,x_n)\) is a solution to the equation \(Ax=b\).';
3732

38-
@no = ( 'The equation \( Ax = b \) is referred to as a vector equation. ' ,
39-
'The equation \( Ax = b \) is consistent if the augmented matrix \( [ A \vert b ] \) has a pivot position in every row. ',
40-
'If the augmented matrix \( [ A\vert b ] \) has a pivot position in every row, then the equation \( Ax = b \) is inconsistent. '
41-
);
33+
push @yes, 'The first component in the vector \( Ax \) is a sum of products of real numbers. ' ;
34+
push @yesTF , DropDownTF("True");
35+
push @yesSol, 'True. \((Ax)_1 = \sum_{j=1}^m A_{1,j}x_j\)';
36+
37+
push @yes, 'If the columns of \( A \) span \( {\mathbb R}^m\), then the equation \( Ax = b \) is consistent for each \( b \) in \( {\mathbb R}^m\). ' ;
38+
push @yesTF, DropDownTF("True");
39+
push @yesSol, 'True. The columns of \(A\) span \( {\mathbb R}^m\) if and only if for every \(b\in{\mathbb R}^m\) there exist real numbers \(x_1,\ldots,x_n\) such that \(b_i = \sum_{j=1}^n A_{i,j}x_j\) for every \(i=1,\ldots, m\), if and only if for every \(b\in{\mathbb R}^m\) there is a vector \(x=[x_1,\ldots,x_n]\) that is a solution to the matrix equation \(Ax=b\).
40+
An equation is consistent if and only if it has a solution.';
41+
42+
push @yes, 'If the equation \( Ax = b \) is inconsistent for some \( b \) in \( {\mathbb R}^m\), then \( A \) cannot have a pivot position in every row. ' ;
43+
push @yesTF, DropDownTF("True");
44+
push @yesSol, 'True. If the matrix \(A\) had a pivot position in every row then one could solve the equation \(Ax=b\) using row reduction and back substitution, so the equation would be consistent, not inconsistent, because it would have a solution.';
45+
46+
push @yes, 'Every matrix equation \( Ax = b \) corresponds to a vector equation with the same solution set. ' ;
47+
push @yesTF,DropDownTF("True");
48+
push @yesSol,'True. If one interprets the columns of \(A\) as column vectors then the matrix equation becomes a vector equation without changing its meaning or solution.';
49+
50+
push @yes, 'Any linear combination of vectors in \(\mathbb{R}^m\) can always be written in the form \( Ax \) for a suitable matrix \( A \) and vector \( x \). ' ;
51+
push @yesTF, DropDownTF("True");
52+
push @yesSol, 'True. A linear combination of vectors \(a_1,\ldots,a_n\) is a sum
53+
\(\sum_{j=1}^n a_jx_j\) where \(x_1,\ldots,x_n\) are real numbers. Regard \(x=[x_1,\ldots,x_n]\) as a column vector in \(\mathbb{R}^n\), and \(A\) as the matrix whose columns are \(a_1,\ldots,a_n\). Then the sum is exactly the same as the product \(Ax\).';
54+
55+
push @yes, 'If the columns of \(A\) are the m-dimensional column vectors a_1 a_2 \cdots a_n then the solution set of a linear system whose augmented matrix is \( [ a_1a_2 \cdots a_n \vert b ] \) is the same as the solution set of the matrix equation \( Ax = b \). ' ;
56+
push @yesTF, DropDownTF("True");
57+
push @yesSol, 'True. The linear system whose augmented matrix is \( [ a_1a_2 \cdots a_n \vert b ] \) means exactly the same thing as the linear system represented by the matrix equation \( Ax = b \), so both have the same solutions' ;
58+
59+
push @yes, 'If the equation \( Ax = b \) is inconsistent, then \( b \) is not in the set spanned by the columns of \( A \). ' ;
60+
push @yesTF, DropDownTF("True");
61+
push @yesSol, 'True. If the equation is inconsistent then it has no solution, which means that \(b\) is not in the span of the columns of \(A\).';
62+
63+
push @yes, 'If the columns of \( A \) do not span \( {\mathbb R}^m\), then the equation \( Ax = b \) is inconsistent for some \( b \) in \( {\mathbb R}^m\). ';
64+
push @yesTF, DropDownTF("True");
65+
push @yesSol, 'True. If the columns of \(A\) do not span \(\mathbb{R}^m\) then there is a vector \(b\in \mathbb{R}^m\) that is not in the span of the columns, so the equation \(Ax=b\) has no solution, so it is inconsistent.';
66+
67+
68+
@no=(); @noTF=(); @noSol=();
69+
70+
push @no, 'The equation \(Ax=b\) is always called a "vector equation", never a "matrix equation".';
71+
push @noTF, DropDownTF("False");
72+
push @noSol, 'False. People who regard \(Ax\) as representing a linear combination of the columns of \(A\) might call it a "vector equation". Others might describe it as a "matrix equation" if they regard \(x\) as a \(1\times n\) matrix and \(b\) as a \(1\times m\) matrix. It depends on your point of view. This is an aspect of the power of linear algebra: the same expression can represent many different things. ';
73+
74+
# the next solution works for two of the questions.
75+
76+
$notEnoughData = 'False. The hypothesis "the augmented matrix has a pivot position in every row" does not provide enough information, by itself, to determine whether the equation is consistent or inconsistent. It could go either way. Therefore the given general statement is false.
4277

43-
# a random set of 4 "yes" items
78+
For example, the
79+
simple equation \(x_1=0\) has an obvious solution, so it is consistent. Its
80+
augmented matrix \([1\vert 0]\) has a pivot in every row. (Yes, there
81+
is only one row). But the equally simple equation \(0x_1 = 1\) has no solution so it is inconsistent, but its augmented matrix \([0\vert 1]\) also has a pivot in every row. ';
4482

45-
@items = random_subset(4,@yes);
83+
push @no, 'The equation \( Ax = b \) is consistent if the augmented matrix \( [ A \vert b ] \) has a pivot position in every row. ';
84+
push @noTF, DropDownTF("False");
85+
push @noSol, $notEnoughData;
4686

47-
# add a random set of 2 "no" items
87+
push @no, 'If the augmented matrix \( [ A\vert b ] \) has a pivot position in every row, then the equation \( Ax = b \) is inconsistent. ' ;
88+
push @noTF, DropDownTF("False");
89+
push @noSol, $notEnoughData;
4890

49-
push(@items, random_subset(2,@no));
91+
# select a random set of 4 "yes" items
92+
@yesSlice = random_subset(4,(0..scalar(@yes)-1));
5093

51-
# randomize the final list of 6 items
94+
#select a random set of 2 "no" items
95+
@noSlice = random_subset(2,(0..scalar(@no)-1));
5296

53-
$questions = CheckboxList([ ~~@items ], [0,1,2,3]);
97+
#concatenate these random sets
98+
99+
@question = (@yes[@yesSlice],@no[@noSlice]);
100+
@answer = (@yesTF[@yesSlice],@noTF[@noSlice]);
101+
@solution = (@yesSol[@yesSlice],@noSol[@noSlice]);
102+
103+
# randomize presentation order
104+
105+
@allslice = random_subset(6,(0..5));
106+
@question = @question[@allslice];
107+
@answer = @answer[@allslice];
108+
@solution = @solution[@allslice];
54109

55110
BEGIN_PGML
56-
Let [`A`] be an [`m\times n`] matrix of real numbers, [`x \in \mathbb{R}^n`], [`b\in \mathbb{R}^m`]. Select the _true_ statements in the list below.
111+
In the following [`A`] represents an arbitrary [`m\times n`] matrix of real numbers, and [`x \in \mathbb{R}^n`] and [`b\in \mathbb{R}^m`] represent arbitrary vectors. Select the _true_ statements in the list below. Remember that a general statement "if P then Q" is true if and only if Q is true in every case where P is true.
112+
113+
1. [_]{$answer[0]} [$question[0]]
114+
115+
2. [_]{$answer[1]} [$question[1]]
116+
117+
3. [_]{$answer[2]} [$question[2]]
118+
119+
4. [_]{$answer[3]} [$question[3]]
57120

58-
[_]{$questions}
121+
5. [_]{$answer[4]} [$question[4]]
122+
123+
6. [_]{$answer[5]} [$question[5]]
59124
END_PGML
60125

126+
BEGIN_PGML_SOLUTION
127+
1. [$solution[0]]
128+
129+
2. [$solution[1]]
130+
131+
3. [$solution[2]]
132+
133+
4. [$solution[3]]
134+
135+
5. [$solution[4]]
136+
137+
6. [$solution[5]]
138+
END_PGML_SOLUTION
139+
61140
ENDDOCUMENT(); # This should be the last executable line in the problem.
62141

0 commit comments

Comments
 (0)