Skip to content
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

Rewrite ordering problem to use DraggableProof #1172

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
113 changes: 39 additions & 74 deletions OpenProblemLibrary/LoyolaChicago/Precalc/Chap4Sec1/Q52.pg
Original file line number Diff line number Diff line change
Expand Up @@ -20,82 +20,47 @@

DOCUMENT();

loadMacros(
"PGstandard.pl",
"extraAnswerEvaluators.pl",
"PGgraphmacros.pl",
"MathObjects.pl",
"PGchoicemacros.pl",
"parserPopUp.pl",
"PGcourse.pl"
loadMacros("PGstandard.pl", "PGML.pl", "draggableProof.pl", "PGcourse.pl");

$showPartialCorrectAnswers = 1;

$dp = DraggableProof(
[
'\(\log{A}\)', '\(\log{A} + \log{B}\)',
'\(0\)', '\(\log{\left(B^A\right)}\)',
'\(\log{B}\)'
],
[],
SourceLabel => "Choose from these expressions",
TargetLabel =>
"Correct order (least at the top, greatest at the bottom)"
);

TEXT(beginproblem());
BEGIN_PGML
Suppose that [` \ 0 < A < AB < 1 < B \ `].

$showPartialCorrectAnswers = 1;
Rank the following five expressions from least to greatest.

[_]{$dp}
END_PGML

BEGIN_PGML_SOLUTION
Here are some observations:

[` A<1 `] means [` \log{A}<0 `].

[` B>1 `] means [` \log{B} >0 `].

Since [` AB<1 `], we know that [` \log{(AB)} <0 `], so [` \log{A}+\log{B}<0 `].

Since [` \log{B} >0 `], the sum [` \log{A}+\log{B} `] is greater than [` \log{A} `].

Since [` \log{(B^A)}=A \ \log{B} `], and since both [` A `] and [` \log{B} `] are positive, we know that [` \log{(B^A)}>0 `].

Since [` A<1 `], we know that the product [` A \ \log{B} `] is less than [` \log{B} `].

Putting this all together, we have
[`` \log{A} < \log{A}+\log{B} < 0 < \log{(B^A)} < \log{B} ``]
END_PGML_SOLUTION

@num = ("0","log(A)","log(B)","log(A)+log(B)","log(B**A)");
@ans = ("log(A)","log(A)+log(B)","0","log(B**A)","log(B)");

$popup1 = PopUp(["?", $num[0], $num[1], $num[2], $num[3], $num[4] ],$ans[0]);
$popup2 = PopUp(["?", $num[0], $num[1], $num[2], $num[3], $num[4] ],$ans[1]);
$popup3 = PopUp(["?", $num[0], $num[1], $num[2], $num[3], $num[4] ],$ans[2]);
$popup4 = PopUp(["?", $num[0], $num[1], $num[2], $num[3], $num[4] ],$ans[3]);
$popup5 = PopUp(["?", $num[0], $num[1], $num[2], $num[3], $num[4] ],$ans[4]);

BEGIN_TEXT
Suppose \( \ 0 < A < AB < 1 < B \ \). $BR
Rank the following five expressions from least to greatest by selecting the correct order of the expressions in the inequality.
$BR $SPACE $BR
(i) \( 0 \) $SPACE $SPACE $SPACE $SPACE $SPACE $SPACE $SPACE $SPACE
(ii) \( \log{A} \) $SPACE $SPACE $SPACE $SPACE $SPACE $SPACE $SPACE $SPACE
(iii) \( \log{B} \) $SPACE $SPACE $SPACE $SPACE $SPACE $SPACE $SPACE $SPACE
(iv) \( \log{A}+\log{B} \) $SPACE $SPACE $SPACE $SPACE $SPACE $SPACE $SPACE $SPACE
(v) \( \log{\left( B^A \right)} \)
$BR $SPACE $BR
$BITALIC Note: The expression in the pulldown menu $BBOLD log(B**A) $EBOLD denotes the last expression \( \log{(B^A)} \).$EITALIC
$BR $HR $BR
\{ $popup1->menu() \}
\( < \) \{ $popup2->menu() \}
\( < \) \{ $popup3->menu() \}
\( < \) \{ $popup4->menu() \}
\( < \) \{ $popup5->menu() \}

END_TEXT

ANS($popup1->cmp() );
ANS($popup2->cmp() );
ANS($popup3->cmp() );
ANS($popup4->cmp() );
ANS($popup5->cmp() );


SOLUTION(EV3(<<'END_SOLUTION'));
$BR $SPACE $BR
$BBOLD SOLUTION $EBOLD
$BR
Here are some observations: $BR
\( A<1 \) means \( \log{A}<0 \). $BR $SPACE $BR

\( B>1 \) means \( \log{B} >0 \). $BR $SPACE $BR

Since \( AB<1 \), we know that \( \log{(AB)} <0 \), so \( \log{A}+\log{B}<0 \). $BR $SPACE $BR

Since \( \log{B} >0 \), the sum \( \log{A}+\log{B} \) is greater than \( \log{A} \). $BR $SPACE $BR

Since \( \log{(B^A)}=A \ \log{B} \), and since both \( A \) and \( \log{B} \) are positive, we know that \( \log{(B^A)}>0 \). $BR $SPACE $BR

Since \( A<1 \), we know that the product \( A \ \log{B} \) is less than \( \log{B} \).
$BR
$HR
$BR
Putting this all together, we have $BR
\[ \log{A} < \log{A}+\log{B} < 0 < \log{(B^A)} < \log{B} \]
$BR
END_SOLUTION




;
ENDDOCUMENT();