|
14 | 14 | ## EditionText1('1') |
15 | 15 | ## Section1('2.3') |
16 | 16 | ## Problem1('') |
17 | | -DOCUMENT(); # This should be the first executable line in the problem. |
| 17 | +DOCUMENT(); # This should be the first executable line in the problem. |
18 | 18 |
|
19 | | -loadMacros( |
20 | | - "PGstandard.pl", |
21 | | - "PGchoicemacros.pl", |
22 | | - "PGgraphmacros.pl", |
23 | | - "PGmatrixmacros.pl", |
24 | | - "PGcourse.pl" |
25 | | -); |
| 19 | +loadMacros("PGstandard.pl", "PGML.pl", "PGcourse.pl"); |
26 | 20 |
|
27 | | -TEXT(beginproblem()); |
28 | 21 | $showPartialCorrectAnswers = 1; |
29 | 22 |
|
30 | | -$a = non_zero_random(1,8,1); |
31 | | -$b = non_zero_random(1,8,1); |
32 | | -if($a<$b){ |
33 | | - $c=$b; |
34 | | - $b=$a; |
35 | | - $a=$c; |
| 23 | +$a = non_zero_random(1, 8, 1); |
| 24 | +$b = non_zero_random(1, 8, 1); |
| 25 | +if ($a < $b) { |
| 26 | + $c = $b; |
| 27 | + $b = $a; |
| 28 | + $a = $c; |
36 | 29 | } else { |
37 | | -if ($a == $b) { $a=$b+1; }} |
38 | | - |
| 30 | + if ($a == $b) { $a = $b + 1; } |
| 31 | +} |
39 | 32 |
|
40 | 33 | ## $a is now the larger value |
41 | 34 | ## $a and -$b will be the roots of the equation. |
42 | 35 |
|
43 | | -$c= $a -$b; |
44 | | -$d= $a * $b; |
| 36 | +$c = $a - $b; |
| 37 | +$d = $a * $b; |
45 | 38 |
|
| 39 | +Context("Numeric")->variables->are('k' => 'Real'); |
| 40 | +Context()->noreduce('(-x)-y'); |
| 41 | +$f = Formula("$c*k+$d")->reduce(); |
| 42 | +$g = Formula("k^2-$c*k-$d")->reduce(); |
| 43 | +$ans1 = List(-$b, $a); |
46 | 44 |
|
47 | | -if( $a == $b+1){ |
48 | | -BEGIN_TEXT |
49 | | -$BR |
| 45 | +BEGIN_PGML |
| 46 | +If [`k`] is a real number, then the vectors [`\begin{bmatrix}1\\ k\end{bmatrix},\begin{bmatrix}k\\[$f]\end{bmatrix}`] |
| 47 | +are linearly independent precisely when [`k \ne`][_]{$ans1}{5} |
50 | 48 |
|
51 | | -If \(k\) is a real number, then |
52 | | -the |
53 | | -vectors \( (1, k), (k, k+ $d) \) are linearly independent precisely when |
| 49 | +If there is more than one value, enter a list separated by commas. |
| 50 | +END_PGML |
54 | 51 |
|
55 | | -\( k \ne a, b \), $BR |
56 | | -where \(a= \)\{ans_rule(10)\}, \(b = \) \{ans_rule(10)\}, and |
57 | | -\( a<b \). |
58 | | -END_TEXT |
59 | | -}else{ |
60 | | -BEGIN_TEXT |
61 | | -$BR |
| 52 | +BEGIN_PGML_SOLUTION |
| 53 | +The vectors will be linearly independent provided that if [`a\begin{bmatrix}1\\ k\end{bmatrix}+b\begin{bmatrix}k\\[$f]\end{bmatrix}=\begin{bmatrix} 0\\0\end{bmatrix}`], then [`a=0`] and [`b=0`]. |
62 | 54 |
|
63 | | -If \(k\) is a real number, then the |
64 | | -vectors \( (1, k), (k, $c k+ $d) \) are linearly independent precisely when |
65 | | - |
66 | | -\( k \ne a, b \), $BR |
67 | | -where \(a= \)\{ans_rule(5)\}, \(b = \) \{ans_rule(5)\}, and |
68 | | -\( a<b \). |
69 | | -END_TEXT |
70 | | -} |
| 55 | +This is equivalent to checking that the system of equations given by [`\begin{bmatrix}1 & k\\k & [$f]\end{bmatrix}\begin{bmatrix}a\\ b\end{bmatrix}=\begin{bmatrix}0\\0\end{bmatrix}`] has a unique solution. |
71 | 56 |
|
| 57 | +One way to do this is to check that the determinant of the coefficient matrix is nonzero: |
72 | 58 |
|
| 59 | +[`\begin{array}{rcl}\begin{vmatrix}1 & k\\k & [$f]\end{vmatrix}\ne 0 & \Rightarrow & ([$f])-k^2\ne 0\\ |
| 60 | +& \Rightarrow & [$g]\ne 0\\ |
| 61 | +& \Rightarrow & (k+[$b])(k-[$a])\ne 0\\ |
| 62 | +& \Rightarrow & k\ne-[$b],[$a] |
| 63 | +\end{array}`] |
| 64 | +END_PGML_SOLUTION |
73 | 65 |
|
74 | | -$k=2; |
75 | | -ANS(num_cmp(-$b)); |
76 | | -ANS(num_cmp($a)); |
77 | | -ENDDOCUMENT(); # This should be the last executable line in the problem. |
| 66 | +ENDDOCUMENT(); # This should be the last executable line in the problem. |
0 commit comments