Skip to content

feat: Add Georgia Tech Problems #1250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 148 additions & 0 deletions Contrib/GeorgiaTech/LengthsAndDotProducts.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
##DESCRIPTION
## Orthogonal sets, matrices, and projections
##ENDDESCRIPTION


## DBsubject(Linear algebra)
## DBchapter(Vector geometry)
## DBsection(Dot product, length, and unit vectors)
## Date(11/25/2024)
## Institution(Georgia Institute of Technology)
## Author(Seth Brunner)
## Level(2)

DOCUMENT();
loadMacros(
"PGstandard.pl",
"PGgraders.pl",
"MathObjects.pl",
"PGchoicemacros.pl",
"matrixExtensions.pl",
"unionLists.pl",
"unionTables.pl",
"Alfredmacros.pl",
"parserPopUp.pl",
"PGcourse.pl",
);


TEXT(beginproblem());

Context("Numeric");

$dropdown_a = PopUp(["?", "A", "B", "C", "D","More than one of the given sets","None of the given sets"], "B");
$dropdown_b = PopUp(["?", "A", "B", "C", "D","More than one of the given sets","None of the given sets"], "D");
$dropdown_c = PopUp(["?", "A", "B", "C", "D","More than one of the given sets","None of the given sets"], "C");
$dropdown_d = PopUp(["?", "A", "B", "C", "D","More than one of the given sets","None of the given sets"], "A");

$normu=random(1,5,1);
$udotu=Compute("$normu**2");
$normv=random(1,6,1);
$vdotv=Compute("$normv**2");
$ssl=Compute("$normu**2+$normv**2");
while($normu==$normv)
{
$normv=random(1,6,1);
}
$dotP=0;

Context()->texStrings;

$mc1 = new_checkbox_multiple_choice();
$mc1 -> qa (
"Which of the following sets contain only unit vectors? $BITALIC Select all that apply$EITALIC.",

"\(\left\lbrace\frac1{$normu}\vec u,\frac1{$normv}\vec v\right\rbrace\)",

"\(\left\lbrace\frac{$normv}{$udotu\sqrt{$ssl}}\vec u+\frac{$normu}{$vdotv\sqrt{$ssl}}\vec v,\frac{$normu}{$udotu\sqrt{$ssl}}\vec u+\frac{$normv}{$vdotv\sqrt{$ssl}}\vec v\right\rbrace\)",
);
$mc1 -> extra(
"\(\left\lbrace\vec u+\vec v,\vec u-\vec v\right\rbrace\)",

"\(\left\lbrace\frac1{$normu}\vec u+\frac1{$normv}\vec v,\frac1{$normu}\vec u-\frac1{$normv}\vec v\right\rbrace\)",
);
$mc1 -> makeLast("None of the above");

$mc2 = new_checkbox_multiple_choice();
$mc2 -> qa (
"Which of the following sets are orthogonal? $BITALIC Select all that apply$EITALIC.",

"\(\left\lbrace\frac1{$normu}\vec u,\frac1{$normv}\vec v\right\rbrace\)",

"\(\left\lbrace\frac1{$normu}\vec u+\frac1{$normv}\vec v,\frac1{$normu}\vec u-\frac1{$normv}\vec v\right\rbrace\)",
);
$mc2 -> extra(
"\(\left\lbrace\vec u+\vec v,\vec u-\vec v\right\rbrace\)",

"\(\left\lbrace\frac{$normv}{$udotu\sqrt{$ssl}}\vec u+\frac{$normu}{$vdotv\sqrt{$ssl}}\vec v,\frac{$normu}{$udotu\sqrt{$ssl}}\vec u+\frac{$normv}{$vdotv\sqrt{$ssl}}\vec v\right\rbrace\)",
);
$mc2 -> makeLast("None of the above");


$mc3 = new_checkbox_multiple_choice();
$mc3 -> qa (
"Based on the previous two questions, which of the following sets are orthonormal? $BITALIC Select all that apply$EITALIC.",

"\(\left\lbrace\frac1{$normu}\vec u,\frac1{$normv}\vec v\right\rbrace\)",
);
$mc3 -> extra(
"\(\left\lbrace\vec u+\vec v,\vec u-\vec v\right\rbrace\)",

"\(\left\lbrace\frac{$normv}{$udotu\sqrt{$ssl}}\vec u+\frac{$normu}{$vdotv\sqrt{$ssl}}\vec v,\frac{$normu}{$udotu\sqrt{$ssl}}\vec u+\frac{$normv}{$vdotv\sqrt{$ssl}}\vec v\right\rbrace\)",

"\(\left\lbrace\frac1{$normu}\vec u+\frac1{$normv}\vec v,\frac1{$normu}\vec u-\frac1{$normv}\vec v\right\rbrace\)",
);
$mc3 -> makeLast("None of the above");

BEGIN_TEXT
<p>
Suppose \(\vec u\) and \(\vec v\) are vectors with \(\left\|\vec u\right\|=$normu\), \(\left\|\vec v\right\|=$normv\), and \(\vec u\cdot\vec v=$dotP\).
</p>

$BR

\{ $mc1 -> print_q() \}

$BR

\{ $mc1 -> print_a() \}

$BR
$BR

\{ $mc2 -> print_q() \}

$BR

\{ $mc2 -> print_a() \}

$BR
$BR

\{ $mc3 -> print_q() \}

$BR

\{ $mc3 -> print_a() \}



END_TEXT
Context()->normalStrings;

##################################################
# Answers

$showPartialCorrectAnswers = 0;

install_problem_grader(~~&std_problem_grader);

$showPartialCorrectAnswers = 0;

ANS(checkbox_cmp($mc1->correct_ans()));
ANS(checkbox_cmp($mc2->correct_ans()));
ANS(checkbox_cmp($mc3->correct_ans()));



ENDDOCUMENT();
150 changes: 150 additions & 0 deletions Contrib/GeorgiaTech/Module1TrueorFalse.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
## DBsubject(Calculus - multivariable)

## DBchapter(Calculus of vector valued functions)

## DBsection(Parameterized curves)

## Institution(Georgia Institute of Technology)

## Author(Gregory Mayer, Hunter Lehman)

## Level(2)

## MO(1)

## Language(en)


DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGchoicemacros.pl",
"unionLists.pl",
"parserPopUp.pl",
"PGcourse.pl",
);

TEXT(beginproblem(), $BR,$BBOLD, "True or False Exercise", $EBOLD, $BR,$BR);
$showPartialCorrectAnswers = 0;

@questions = (
"The speed of a particle with a position function \(r(t)\) is \(\frac{r'(t)}{|r'(t)|}\).",
"If \(u\) and \(v\) are two vectors in \(\mathbb{R}^3\), then \(u \cdot v\) is a vector orthogonal to both \(u\) and \(v\).",
"The point (2, -1, 3) lies on the graph of the sphere \((x - 2)^2 + (y + 1)^2 + (z - 3)^2 = 25\).",
"\(\frac{d}{dt}[u(t) \times u(t)] = 2u'(t) \times u(t)\). ",
"Parallel planes have parallel normal vectors. ",
"The vector \(\frac{1}{\sqrt{3}} \hat i - \frac{1}{\sqrt{3}} \hat j + \frac{2}{\sqrt{3}} \hat k\) is a unit vector. ",
"The only way that \(v \cdot w\) = 0 is if \(v\) = 0 or \(w\) = 0.",
);

@corans = ('False', 'False', 'False', 'False', 'True', 'True', 'False');

# Choose Seven of the question and answer pairs at random.
@which = NchooseK(7, 7);

@squestions = @questions[@which];
@scorans = @corans[@which];

foreach my $i (0..6) {
$popup[$i] = PopUp(['Choose','True', 'False'],$scorans[$i]);
}

BEGIN_TEXT
Indicate whether the following statements are true or false.
$PAR
\{ BeginList('OL',type=>'a') \}

$ITEM
$squestions[0]
$BR
\{ $popup[0]->menu \}
$ITEMSEP

$ITEM
$squestions[1]
$BR
\{ $popup[1]->menu \}
$ITEMSEP

$ITEM
$squestions[2]
$BR
\{ $popup[2]->menu \}
$ITEMSEP

$ITEM
$squestions[3]
$BR
\{ $popup[3]->menu \}
$ITEMSEP

$ITEM
$squestions[4]
$BR
\{ $popup[4]->menu \}
$ITEMSEP

$ITEM
$squestions[5]
$BR
\{ $popup[5]->menu \}
$ITEMSEP

$ITEM
$squestions[6]
$BR
\{ $popup[6]->menu \}
$ITEMSEP

\{ EndList('OL') \}

END_TEXT

install_problem_grader(~~&std_problem_grader);

# Enter the correct answers to be checked against the answers to the students.

foreach my $i (0..6) {
ANS($popup[$i]->cmp);
}

Context()->texStrings;

@solutions = (
"$BBOLD False $EBOLD
$BR
The speed of a particle is defined as the magnitude of its velocity vector, not the normalized velocity. The correct formula for speed is \(|r'(t)|\), where \(r'(t)\) is the velocity vector. The given expression \(\frac{r'(t)}{|r'(t)|}\) would always have a magnitude of 1, representing only the direction of motion, not the speed. ",
"$BBOLD False $EBOLD
$BR
\(u \cdot v\) is a scalar (dot product), not a vector. The cross product \(u × v\) would give a vector orthogonal to both u and v, but not the dot product.",
"$BBOLD False $EBOLD
$BR
The sphere equation represents points whose distance from the center (2, -1, 3) equals the radius \(\sqrt{25} = 5\). Substituting (2, -1, 3) into the equation results in all squared terms becoming zero. Since any distance squared is non-negative, the equation reduces to \(0 = 25\), which is never true. This mathematical contradiction confirms (2, -1, 3) is not on the sphere. ",
"$BBOLD False $EBOLD
$BR
The correct differentiation of \(u(t) \times u(t)\) (cross product of a vector with itself) with respect to \(t\) is \(u'(t) \times u(t) + u(t) \times u'(t) \). Note also that the cross product of a vector with itself happens to be zero. But either way the statement is false because it does not use the correct differentiation formula.",
"$BBOLD True $EBOLD
$BR
Parallel planes have identical normal vectors or normal vectors that are scalar multiples of each other. ",
"$BBOLD True $EBOLD
$BR
Magnitude = \(\sqrt{\left(\frac{1}{\sqrt{3}}\right)^2 + \left(\frac{1}{\sqrt{3}}\right)^2 + \left(\frac{2}{\sqrt{3}}\right)^2} = 1\). A vector with magnitude 1 is a unit vector. ",
"$BBOLD False $EBOLD
$BR
Two non-zero orthogonal vectors can have a dot product of zero.",
);

$solutions = "";
foreach (@which) {
$solutions .= "$ITEM $solutions[$_]";
}

SOLUTION(EV3(<<'END_SOLUTION'));
\{ BeginList('OL',type=>'a') \}
$solutions
\{ EndList('OL') \}
END_SOLUTION
Context()->normalStrings;

ENDDOCUMENT(); # This should be the last executable line in the problem.
Loading