-
-
Notifications
You must be signed in to change notification settings - Fork 418
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 using MathObjects and PGML #1178
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
621db75
Rewrite using MathObjects and PGML
lahvak 750254d
Change a to the as suggested by @dlglin
lahvak 1765ca6
Change wording as suggested by @dlglin
lahvak a5685a3
Use the Interval context for domain
lahvak 86ac60e
Fix solution after switching to Interval context
lahvak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,35 +20,39 @@ DOCUMENT(); # This should be the first executable line in the problem. | |
|
||
loadMacros( | ||
"PGstandard.pl", | ||
"PGchoicemacros.pl", | ||
"PGML.pl", | ||
"MathObjects.pl", | ||
"PGcourse.pl" | ||
); | ||
|
||
TEXT(beginproblem()); | ||
$showPartialCorrectAnswers = 1; | ||
|
||
Context("Numeric"); | ||
|
||
$a = random(2,9,1); | ||
$ans3 = Formula("sqrt(x)-$a"); | ||
|
||
Context("Interval"); | ||
|
||
$ansInt = Compute("[-$a, infinity)"); | ||
|
||
BEGIN_PGML | ||
The function [`f(x)=(x+[$a])^2`] is not one-to-one. Choose the largest possible | ||
domain containing the number 100 so that the function restricted to the domain is one-to-one. | ||
|
||
The largest possible domain is [_________________]{$ansInt} (use interval notation). | ||
|
||
If [`f`] is restricted to the above domain, then the inverse function is [`g(x)=`][_______________]{$ans3}. | ||
END_PGML | ||
|
||
BEGIN_PGML_SOLUTION | ||
The function [`f(x)=(x+[$a])^2`] is one-to-one on the intervals [`(-\infty, -[$a]]`] and [`[-[$a], \infty)`]. | ||
The second one contains the number 100. | ||
|
||
TEXT(EV2(<<EOT)); | ||
The function \(f(x)=(x+$a)^2\) is not one-to-one. Choose a largest possible | ||
domain containing the number 100 so that | ||
the function restricted to the domain is one-to-one. | ||
$BR | ||
The largest possible domain is [\{ ans_rule(10) \},\{ ans_rule(10) \}); | ||
$BR | ||
the inverse function is \(g(x)=\) \{ ans_rule(15) \} | ||
$BR | ||
$BBOLD | ||
If your answer is \(\infty\), enter infinity. | ||
$EBOLD | ||
EOT | ||
|
||
$ans1 = -$a; | ||
$ans2 = "infinity"; | ||
$ans3 = "sqrt(x)-$a"; | ||
ANS(num_cmp($ans1)); | ||
ANS(str_cmp($ans2)); | ||
ANS(fun_cmp($ans3)); | ||
Solving the equation [`y=(x+[$a])^2`] for [`x`] will give us two solutions: [`x = \pm\sqrt{y} - [$a]`]. | ||
According to our domain choice, [`x \ge [$ans1]`], which means we have to choose the solution with [`+`]. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. line 53: replace $ans1 with $a
gajennings marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Exchanging the [`x`] and [`y`] variables will give us the answer [`g(x) = [$ans3]`]. | ||
END_PGML_SOLUTION | ||
|
||
ENDDOCUMENT(); # This should be the last executable line in the problem. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 43: replace "interval notation" with [@ helpLink("interval","interval notation") @]*
(including the star at the end!) This will create a link that points to instructions for entering intervals into webwork.