Skip to content

Commit 8b8a751

Browse files
committed
Fix bug 4678
1 parent 77c3818 commit 8b8a751

File tree

1 file changed

+9
-5
lines changed
  • OpenProblemLibrary/TCNJ/TCNJ_VectorEquations

1 file changed

+9
-5
lines changed

OpenProblemLibrary/TCNJ/TCNJ_VectorEquations/problem7.pg

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Context("Numeric");
3535
$v01 = non_zero_random(-5,5,2);
3636
$v02 = random(-5,5,1);
3737
$v03 = non_zero_random(-5,5,1);
38+
$a1 = Matrix([[$v01],[$v02],[$v03]]);
3839

3940
$mult = non_zero_random(-2,2,1);
4041
$d1 = non_zero_random(-3,3,1);
@@ -43,21 +44,24 @@ $d2 = non_zero_random(-3,3,1);
4344
$v11 = $mult*$v01;
4445
$v12 = $mult*$v02+$d1;
4546
$v13 = $mult*$v03+$d2;
47+
$a2 = Matrix([[$v11],[$v12],[$v13]]);
4648

4749
$mult2 = non_zero_random(-2,2,1);
4850
$mult3 = random(-2,2,1);
4951
$d3 = non_zero_random(-5,5,1);
5052
$v21 = $mult2*$v01+$mult3*$v11;
5153
$v22 = $mult2*$v02+$mult3*$v12;
5254
$v23 = $mult2*$v03+$mult3*$v13+$d3;
55+
$a3 = Matrix([[$v21],[$v22],[$v23]]);
5356

5457
$A = Matrix([[$v01, $v11, $v21],[$v02, $v12, $v22],[$v03, $v13, $v23]]);
5558

56-
$b1 = random(-6,6,2);
57-
$b2 = random(-5,5,1);
58-
$b3 = random(-5,5,1);
59-
60-
$b = Matrix([[$b1],[$b2],[$b3]]);
59+
do {
60+
$b1 = random(-6,6,2);
61+
$b2 = random(-5,5,1);
62+
$b3 = random(-5,5,1);
63+
$b = Matrix([[$b1],[$b2],[$b3]]);
64+
} until ($b != $a1 && $b != $a2 && $b != $a3);
6165

6266
$ans1 = 3;
6367
$ans2 = -1;

0 commit comments

Comments
 (0)