Skip to content

Commit e8ae253

Browse files
committed
Replaced accidentally deleted files
1 parent 7bf0cb4 commit e8ae253

File tree

9 files changed

+457
-130
lines changed

9 files changed

+457
-130
lines changed

Contrib/METU-NCC/Linear_Algebra/3x3-2d_eig.pg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ loadMacros(
2323
"MathObjects.pl",
2424
"parserMultiAnswer.pl",
2525
"PGmatrixmacros.pl",
26-
"PGcoures.pl"
26+
"PGcourse.pl"
2727
);
2828

2929

Contrib/METU-NCC/Linear_Algebra/3x3-gen_eig.pg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
DOCUMENT();
1919

2020
loadMacros(
21+
"PGstandard.pl",
2122
"MatrixUnits.pl", # Needed for GL3Z()
2223
"MathObjects.pl",
2324
"parserMultiAnswer.pl",
2425
"PGmatrixmacros.pl",
25-
"PGstandard.pl",
2626
"PGcourse.pl"
2727
);
2828

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
## BEGIN_DESCRIPTION
2+
## Convert from degrees to radians (5 conversions)
3+
## END_DESCRIPTION
4+
##
5+
##############################################
6+
## DBsubject(Trigonometry)
7+
## DBchapter(Geometric and algebraic foundations for trigonometry)
8+
## DBsection(Radians, converting radians & degrees)
9+
## Institution(METU-NCC)
10+
## Author(Benjamin Walter)
11+
## MO(1)
12+
## Static(0)
13+
## Level(2)
14+
## Language(en)
15+
###############################################
16+
17+
DOCUMENT(); # This should be the first executable line in the problem.
18+
19+
loadMacros(
20+
"PGstandard.pl",
21+
"PGchoicemacros.pl",
22+
"PGasu.pl",
23+
"PGcourse.pl",
24+
"MathObjects.pl",
25+
"contextFraction.pl"
26+
);
27+
28+
sub pick {
29+
my ($k, @in) = @_;
30+
my @out = ();
31+
while (@out < $k) { push( @out, splice(@in, random(0,$#in), 1) ); }
32+
@out;
33+
}
34+
35+
TEXT(beginproblem());
36+
$showPartialCorrectAnswers = 1;
37+
Context("Fraction-NoDecimals");
38+
39+
my @c = (
40+
(-11,-7,-5,5,7,11)[random(0,5)],
41+
(-7, -5,-3,3,5, 7)[random(0,5)],
42+
(-8,-7,-5,-4,-2,2,4,5,7,8)[random(0,9)],
43+
(-7,-5,-3,3,5,7)[random(0,5)],
44+
(-5,-4,-3,3,4,5)[random(0,5)],
45+
);
46+
47+
@r = (
48+
Compute(($c[0]%12)."*pi/6")->reduce,
49+
Compute(($c[1]%8)."*pi/4")->reduce,
50+
Compute(($c[2]%6)."*pi/3")->reduce,
51+
Compute(($c[3]%4)."*pi/2")->reduce,
52+
Compute(($c[4]%2)."*pi/1")->reduce
53+
);
54+
55+
@d = (
56+
Compute("30*$c[0]"),
57+
Compute("45*$c[1]"),
58+
Compute("60*$c[2]"),
59+
Compute("90*$c[3]"),
60+
Compute("180*$c[4]")
61+
);
62+
63+
foreach (0..$#c) { $s[$_] = ($c[$_] < 0) ? "" : "\phantom{-}"; }
64+
65+
@i = pick(5,(0..4));
66+
67+
Context()->texStrings;
68+
BEGIN_TEXT
69+
70+
Convert the following $BBOLD degree $EBOLD measures to $BBOLD radians. $EBOLD$BR
71+
(Write your answers as angles \(0 \le \theta < 2\pi \). Write as a fraction
72+
using \(\fbox{pi}\) for \(\pi\).)
73+
74+
END_TEXT
75+
for ($j=0; $j <= $#d; $j++) {
76+
BEGIN_TEXT
77+
78+
$PAR $SPACE $SPACE
79+
\($s[$i[$j]]$d[$i[$j]]\ \text{degrees}\ = \ \)
80+
\{ ans_rule(10) \} \(\text{radians}\)
81+
82+
END_TEXT
83+
}
84+
85+
Context()->normalStrings;
86+
87+
for ($j=0; $j <= $#r; $j++) {
88+
ANS( $r[$i[$j]]->cmp() );
89+
}
90+
91+
ENDDOCUMENT(); # This should be the last executable line in the problem.
92+
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
## BEGIN_DESCRIPTION
2+
## Convert from radians to degrees (5 conversions)
3+
## END_DESCRIPTION
4+
##
5+
##############################################
6+
## DBsubject(Trigonometry)
7+
## DBchapter(Geometric and algebraic foundations for trigonometry)
8+
## DBsection(Radians, converting radians & degrees)
9+
## Institution(METU-NCC)
10+
## Author(Benjamin Walter)
11+
## MO(1)
12+
## Static(0)
13+
## Level(2)
14+
## Language(en)
15+
###############################################
16+
17+
DOCUMENT(); # This should be the first executable line in the problem.
18+
19+
loadMacros(
20+
"PGstandard.pl",
21+
"PGchoicemacros.pl",
22+
"PGasu.pl",
23+
"PGcourse.pl",
24+
"MathObjects.pl",
25+
"contextFraction.pl"
26+
);
27+
28+
sub pick {
29+
my ($k, @in) = @_;
30+
my @out = ();
31+
while (@out < $k) { push( @out, splice(@in, random(0,$#in), 1) ); }
32+
@out;
33+
}
34+
35+
TEXT(beginproblem());
36+
$showPartialCorrectAnswers = 1;
37+
Context("Fraction-NoDecimals");
38+
39+
my @c = (
40+
(-11,-7,-5,5,7,11)[random(0,5)],
41+
(-7, -5,-3,3,5, 7)[random(0,5)],
42+
(-8,-7,-5,-4,-2,2,4,5,7,8)[random(0,9)],
43+
(-7,-5,-3,3,5,7)[random(0,5)],
44+
(-5,-4,-3,3,4,5)[random(0,5)],
45+
);
46+
47+
@r = (
48+
"\frac{$c[0]\pi}{6}",
49+
"\frac{$c[1]\pi}{4}",
50+
"\frac{$c[2]\pi}{3}",
51+
"\frac{$c[3]\pi}{2}",
52+
"$c[4]\pi"
53+
);
54+
55+
@d = (
56+
Compute((30*$c[0])%360),
57+
Compute((45*$c[1])%360),
58+
Compute((60*$c[2])%360),
59+
Compute((90*$c[3])%360),
60+
Compute((180*$c[4])%360)
61+
);
62+
63+
foreach (0..$#c) { $s[$_] = ($c[$_] < 0) ? "" : "\phantom{x}"; }
64+
65+
@i = pick(5,(0..4));
66+
67+
Context()->texStrings;
68+
BEGIN_TEXT
69+
70+
Convert the following $BBOLD radian $EBOLD measures to $BBOLD degrees. $EBOLD$BR
71+
(Write your answers as angles \(0^\circ \le \theta < 360^\circ \).)
72+
73+
END_TEXT
74+
for ($j=0; $j <= $#r; $j++) {
75+
BEGIN_TEXT
76+
77+
$PAR $SPACE $SPACE
78+
\($s[$i[$j]]$r[$i[$j]]\ \text{radians}\ = \ \)
79+
\{ ans_rule(10) \} \(\text{degrees}\)
80+
81+
END_TEXT
82+
}
83+
84+
Context()->normalStrings;
85+
86+
for ($j=0; $j <= $#d; $j++) {
87+
ANS( $d[$i[$j]]->cmp() );
88+
}
89+
90+
ENDDOCUMENT(); # This should be the last executable line in the problem.
91+
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
## BEGIN_DESCRIPTION
2+
## Solve trigonometric equation using trig identities
3+
## END_DESCRIPTION
4+
##
5+
##############################################
6+
## DBsubject(Trigonometry)
7+
## DBchapter(Analytic trigonometry)
8+
## DBsection(Solving trigonometric equations exactly)
9+
## Institution(METU-NCC)
10+
## Author(Benjamin Walter)
11+
## MO(1)
12+
## Static(0)
13+
## Level(2)
14+
## Language(en)
15+
###############################################
16+
17+
18+
DOCUMENT();
19+
20+
loadMacros(
21+
"PGstandard.pl",
22+
"MathObjects.pl",
23+
"AnswerFormatHelp.pl",
24+
"PGcourse.pl"
25+
);
26+
27+
TEXT(beginproblem());
28+
29+
COMMENT("Randomly choose one of eight problems$BR (all use double angle for cos)");
30+
31+
###################################
32+
# Setup
33+
34+
Context("Numeric");
35+
Context()->functions->disable("Trig");
36+
37+
@expression = (
38+
" \cos(x) + \cos(2x) = 0", #1. (2cos(x)-1)(cos(x)+1) = 0
39+
"3\cos(x) + \cos(2x) = -2", #2. (2cos(x)+1)(cos(x)+1) = 0
40+
"\cos(2x) + 2 = 3\cos(x)", #3. (2cos(x)-1)(cos(x)-1) = 0
41+
"\cos(2x) = \cos(x)", #4. (2cos(x)+1)(cos(x)-1) = 0
42+
"\cos(2x) + 3 = 5\cos(x)", #5. (2cos(x)-1)(cos(x)-2) = 0
43+
"\cos(2x) = 1 + 3\cos(x)", #6. (2cos(x)+1)(cos(x)-2) = 0
44+
"5\cos(x) + cos(2x) = -3", #7. (2cos(x)+1)(cos(x)+2) = 0
45+
"3\cos(x) + cos(2x) = 1", #8. (2cos(x)-1)(cos(x)+2) = 0
46+
);
47+
48+
49+
@answer = (
50+
List(Compute("pi"),Compute("pi/3"),Compute("5 pi/3")), #1
51+
List(Compute("pi"),Compute("2 pi/3"),Compute("4 pi/3")), #2
52+
List(Compute("0"), Compute("pi/3"), Compute("5 pi/3")), #3
53+
List(Compute("0"), Compute("2 pi/3"),Compute("4 pi/3")), #4
54+
List(Compute("pi/3"),Compute("5 pi/3")), #5
55+
List(Compute("2 pi/3"),Compute("4 pi/3")), #6
56+
List(Compute("2 pi/3"),Compute("4 pi/3")), #7
57+
List(Compute("pi/3"),Compute("5 pi/3")), #8
58+
);
59+
60+
$i = random(0,7);
61+
62+
63+
###################################
64+
# Main text
65+
66+
Context()->texStrings;
67+
BEGIN_TEXT
68+
Use trigonometric identities to find all solutions to
69+
\[ $expression[$i] \]
70+
for \( 0 \leq x < 2\pi \).
71+
$PAR
72+
\( x =\) \{ ans_rule(30) \}
73+
$PAR
74+
$SPACE $SPACE Write
75+
solutions separated by commas.
76+
$BR
77+
$SPACE $SPACE Write angles in radians, using "${BTT}pi${ETT}" for \(\pi\).
78+
$BR
79+
$SPACE $SPACE
80+
For example
81+
"${BTT}2pi / 3, 5pi / 4${ETT}"
82+
END_TEXT
83+
Context()->normalStrings;
84+
85+
86+
##################################
87+
# Answer evaluation
88+
89+
$showPartialCorrectAnswers = 1;
90+
91+
ANS($answer[$i]->cmp(
92+
showHints=>0,
93+
showLengthHints=>0,
94+
partialCredit=>1,
95+
ordered=>0,
96+
removeParens=>1,
97+
requireParenMatch=>0,
98+
implicitList=>1,
99+
) );
100+
101+
Context()->texStrings;
102+
103+
104+
;
105+
ENDDOCUMENT();
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
## BEGIN_DESCRIPTION
2+
## Find complex roots to equation
3+
## END_DESCRIPTION
4+
##
5+
##############################################
6+
## DBsubject(Algebra)
7+
## DBchapter(Quadratic equations and functions)
8+
## DBsection(Complex roots)
9+
## Institution(METU-NCC)
10+
## Author(Benjamin Walter)
11+
## MO(1)
12+
## Static(0)
13+
## Level(2)
14+
## Language(en)
15+
###############################################
16+
17+
DOCUMENT(); # This should be the first executable line in the problem.
18+
19+
loadMacros(
20+
"PGstandard.pl",
21+
"PGchoicemacros.pl",
22+
"MathObjects.pl",
23+
"PGcourse.pl"
24+
);
25+
26+
TEXT(beginproblem());
27+
28+
Context("Complex");
29+
Context()->variables->are(z=>'Real');
30+
31+
$showPartialCorrectAnswers = 0;
32+
33+
$a = random(2,4,1) * random(-1,1,2);
34+
do { $b = random(2,4,1); } until (abs($b)!=abs($a));
35+
my $c = $a**2 + $b**2;
36+
37+
$f = Formula("z^2 - 2*$a z + $c")->reduce;
38+
39+
Context("LimitedComplex");
40+
Context()->operators->undefine("^","**","sqrt");
41+
42+
$roots = List(Complex("$a+$b i"),Complex("$a-$b i"));
43+
44+
Context()->texStrings;
45+
TEXT(EV2(<<EOT));
46+
Find all complex solutions to the following equation.
47+
\[ $f = 0\]
48+
Answer: \(z= \)\{ans_rule(40) \}
49+
$PAR $SPACE $SPACE
50+
Write your answer as a list of complex numbers without using powers or roots,
51+
e.g. "3-4i, 5+i".
52+
EOT
53+
Context()->normalStrings;
54+
55+
ANS( $roots->cmp(partialCredit=>1) );
56+
57+
ENDDOCUMENT(); # This should be the last executable line in the problem.
58+

0 commit comments

Comments
 (0)