Skip to content

Commit

Permalink
updating precalculus problems for Tradler/Carley textbook
Browse files Browse the repository at this point in the history
  • Loading branch information
drdrew42 committed Jan 19, 2024
1 parent 040443a commit e8392e6
Show file tree
Hide file tree
Showing 263 changed files with 17,881 additions and 912 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ END_PGML_HINT

BEGIN_PGML_SOLUTION

>> [` \begin{align*}([$c1]) - ([$c2]) &= [$c1] - [$bR] - [$bI] i \\
>> [` \begin{aligned}([$c1]) - ([$c2]) &= [$c1] - [$bR] - [$bI] i \\
&= ([$aR] - [$bR]) + [$aI] i - [$bI] i \\
&= [$ansR] + ([$aI] - [$bI]) i \\
&= [$ansR] + [$ansI] i
\end{align*}
\end{aligned}
`] <<


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ loadMacros(
"MathObjects.pl",
"contextLimitedComplex.pl",
"contextFraction.pl",
"niceTables.pl",
"PGML.pl"
);

Expand Down Expand Up @@ -113,6 +114,19 @@ are conjugate pairs. This is significant because whenever you multiply conjugate

We can take advantage of this when attempting to divide Complex numbers, because it is preferable to have a denominator that is a Real number instead of Complex.

##### Example #####

[@ LayoutTable(
[
[['\( \dfrac{5+6i}{3+4i}
=\dfrac{(5+6i)\cdot (3-4i)}{(3+4i)\cdot (3-4i)}
=\dfrac{15-20i+18i-24i^2}{9-12i+12i-16i^2} \)'] ],
['\( \hspace{13mm}=\dfrac{15-2i-24\cdot (-1)}{9-16\cdot (-1)}=\dfrac{15-2i+24}{9+16}\)'],
['\( \hspace{13mm}=\dfrac{39-2i}{25}=\dfrac{39}{25}-\dfrac{2}{25}i \)'],
],
align=>'l',
allcellcss=>'padding: 1pt;'
) @]***

>> ### Practice ### <<

Expand Down Expand Up @@ -185,10 +199,10 @@ _Last_: [` [$aI] i \cdot [$bIc] i = [$aIbIc] i^2 \quad\longrightarrow\quad [$aIb

(b) Combine like terms:

>> [` \begin{eqnarray*}
\color{red}{[$aRbR] + [$aRbIc] i + [$aIbR] i - [$aIbIc]} &=& [$ansRp] + ([$aRbIc] + [$aIbR]) i \\
&=& \color{red}{[$ansRp] + [$ansIp] i}
\end{eqnarray*}
>> [` \begin{aligned}
\color{red}{[$aRbR] + [$aRbIc] i + [$aIbR] i - [$aIbIc]} &= [$ansRp] + ([$aRbIc] + [$aIbR]) i \\
&= \color{red}{[$ansRp] + [$ansIp] i}
\end{aligned}
`]<<

So our numerator reduces to [` \color{red}{[$ansRp] + [$ansIp] i}. `]
Expand All @@ -208,9 +222,9 @@ _Last_: [`[$bI] i \cdot [$bIc] i = -[$bI2] i^2 \quad\longrightarrow\quad

(b)Combine like terms:

>>[` \begin{eqnarray*}
\color{blue}{[$bR2] + [$bRbIc] i + [$bRbI] i + [$bI2]} &=& [$denom] + ([$bRbIc] + [$bRbI]) i \\
& =& [$denom] + 0\cdot i = \color{blue}{[$denom]}\end{eqnarray*} `]<<
>>[` \begin{aligned}
\color{blue}{[$bR2] + [$bRbIc] i + [$bRbI] i + [$bI2]} &= [$denom] + ([$bRbIc] + [$bRbI]) i \\
&= [$denom] + 0\cdot i = \color{blue}{[$denom]}\end{aligned} `]<<

And our denominator reduces to [`\color{blue}{[$denom]}`],

Expand All @@ -219,10 +233,10 @@ Recombine our fraction with the reduced numerator and denominator:
Divide each term by the denominator and reduce:

>>[`
\begin{align*}
\begin{aligned}
\displaystyle \frac{\color{red}{[$ansRp] + [$ansIp] i}}{\color{blue}{[$denom]}} &=& \frac{\color{red}{[$ansRp]}}{\color{blue}{[$denom]}} + \frac{\color{red}{[$ansIp]}}{\color{blue}{[$denom]}} \color{red}{i} \\
&=& \frac{[$ansRr]}{[$ansRD]} + \frac{[$ansIr]}{[$ansID]} i
\end{align*}
\end{aligned}
`]<<


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ BEGIN_TEXT
$PAR
Simplify the expression using complex numbers:
$PAR
\[ ($c1) ($c2) \]
\[ ($c1) \cdot ($c2) \]
$PAR
\{ans_rule(15)\}

Expand Down Expand Up @@ -153,10 +153,10 @@ _Last_:

* Combine like terms:

>> [`\begin{align*}
>> [`\begin{aligned}
\color{blue}{[$aRbR] + [$aRbI] i + [$aIbR] i - [$aIbI]} & = [$ansR] + ([$aRbI] + [$aIbR]) i \\
& = [$ansR] + [$ansI] i \\
\end{align*}
\end{aligned}
`]<<


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ END_PGML_HINT

BEGIN_PGML_SOLUTION

[`\begin{align*}
[`\begin{aligned}
([$c1]) + ([$c2]) &= [$c1] + [$c2] \\
&= [$aR] + [$bR] + [$aI] i + [$bI] i \\
&= [$ansR] + ([$aI] + [$bI]) i \\
&= [$ansR] + [$ansI] i \\
\end{align*}`]
\end{aligned}`]

END_PGML_SOLUTION
Context()->normalStrings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ b. We want to know the population size [`A(t)`] when [`t= [$mins]`]. So we need
c. The initial population is [`[$init]`]. The double of that is [`[@2*$init@]`]. We want to find [`t`] such that [`A(t)= [@2*$init@]`]:

>>
[`\begin{align*}
[`\begin{aligned}
[$At] & = [@2*$init@] & \qquad \text{divide both sides by } [$init] \\
e^{[$rate] t} & = 2 & \qquad \text{apply } \ln \text{to both sides}\\
\ln\left(e^{[$rate] t}\right) & = \ln 2 & \qquad \text{use the } \log \text{property for powers} \\
[$rate] t \ln e & = \ln 2 & \qquad \text{use that } \ln e = 1 \\
[$rate] t & = \ln 2 & \qquad \text{divide both sides by } [$rate] \\
t & = \dfrac{\ln 2}{[$rate]} &\\
t & \approx [$time] &
\end{align*}
\end{aligned}
`]<<

The population will double in about [`[$time]`] minutes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ Hence [` A(t) = [$init] e^{[$rate]t} `]. We want to find [`t`] such that
[`A(t) = [$double]`].

>>
[`\begin{align*}
[`\begin{aligned}
[$init] e^{[$rate]t} & = [@2*$init@] & \qquad \text{divide both sides by } [$init] \\
e^{[$rate] t} & = 2 & \qquad \text{apply } \ln \text{to both sides}\\
\ln\left(e^{[$rate] t}\right) & = \ln 2 & \qquad \text{use the } \log \text{property for powers} \\
[$rate] t \ln e & = \ln 2 & \qquad \text{use that } \ln e = 1 \\
[$rate] t & = \ln 2 & \qquad \text{divide both sides by } [$rate] \\
t & = \dfrac{\ln 2}{[$rate]} &\\
t & \approx [$time] &
\end{align*}
\end{aligned}
`]<<

It will take about [`[$time]`] years for the investment to reach $[$double].
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
##DESCRIPTION
## Algebra problem: exponential model of population growth
##ENDDESCRIPTION


########################################################################

DOCUMENT();

loadMacros(
"PGstandard.pl", # Standard macros for PG language
"MathObjects.pl",
"PGML.pl",
"contextFraction.pl"
);

# Print problem number and point value (weight) for the problem
TEXT(beginproblem());

# Show which answers are correct and which ones are incorrect
$showPartialCorrectAnswers = 1;

##############################################################
#
# Setup
#
#
Context("Numeric");

$year = random(2013,2023,1);
$initial_population = random(201000,699000,1000);
$rate = random(1.6,6.3,0.1);
$wait_time = random(17,65,1);
$laterpopulation=$initial_population*exp(-$rate*$wait_time/100);
$halftime=floor($year+100*ln(2)/$rate);

##############################################################
#
# Text
#
#

BEGIN_PGML


In [`[$year]`], the population of a city is [`[$initial_population]`], and is decreasing exponentially at [`[$rate]%`] per year.

a. What is the population size after [`[$wait_time]`] years? [_________________________]{$laterpopulation}

b. In what year will half of the population be left? [_________________________]{$halftime}



END_PGML

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


COMMENT("Funded by US DoE Title V: Opening Gateways grant.");

ENDDOCUMENT();
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
##DESCRIPTION
## Algebra problem: exponential model of population growth
##ENDDESCRIPTION


########################################################################

DOCUMENT();

loadMacros(
"PGstandard.pl", # Standard macros for PG language
"MathObjects.pl",
"PGML.pl",
"contextFraction.pl"
);

# Print problem number and point value (weight) for the problem
TEXT(beginproblem());

# Show which answers are correct and which ones are incorrect
$showPartialCorrectAnswers = 1;

##############################################################
#
# Setup
#
#
Context("Numeric");

$year = random(2013,2023,1);
$initial_population = random(501000,999000,1000);
$rate = random(1.1,3.9,0.1);
$wait_time = random(31,76,1);
$wait_time_year = $year+$wait_time;
$laterpopulation=$initial_population*exp($rate*$wait_time/100);
$doubletime=floor($year+100*ln(2)/$rate);
$tripletime=floor($year+100*ln(3)/$rate);

##############################################################
#
# Text
#
#

BEGIN_PGML


In [`[$year]`], the population of a country is [`[$initial_population]`], and is growing at [`[$rate]%`] per year.

a. What will the population be in [`[$wait_time_year]`]? [_________________________]{$laterpopulation}

b. In what year will the population be double? [_________________________]{$doubletime}

c. In what year will the population be triple? [_________________________]{$tripletime}





END_PGML

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


COMMENT("Funded by US DoE Title V: Opening Gateways grant.");

ENDDOCUMENT();
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ END_PGML

BEGIN_PGML_HINT

* Do you have an expression like `\color{blue}{a} \log(\color{red}{b})`? That is `\log(\color{red}{b}^\color{blue}{a})`.
* Do you have an expression like `\color{blue}{a} \log(\color{red}{b})`? That is `\log(\color{red}{b}^{\color{blue}{a}})`.

* Do you have a sum of logarithms? Use the fact that `\log(\color{red}{a}) + \log(\color{blue}{b}) = \log(\color{red}{a}\color{blue}{b})`.

Expand All @@ -140,10 +140,10 @@ BEGIN_PGML_SOLUTION

a.
>>
[`\begin{align*}
[`\begin{aligned}
&\color{magenta}{[$m] \log(x)}- \color{magenta}{[$p] \log(y)}+\color{magenta}{ [$n] \log(z)} & \text{three terms of the form } \color{blue}{a} \log(\color{red}{b})\\ \\
\longrightarrow\quad&\color{blue}{[$m]} \log(\color{red}{x})- \color{blue}{[$p]} \log(\color{red}{y})+ \color{blue}{[$n]} \log(\color{red}{z}) & \text{identify the} \;\color{red}{a}\text{'s and the }\;\color{blue}{b}\text{'s} \\
&&\text{ use that } \color{blue}{a}\log(\color{red}{b})= \log(\color{red}{b}^\color{blue}{a})\\ \\
&&\text{ use that } \color{blue}{a}\log(\color{red}{b})= \log(\color{red}{b}^{\color{blue}{a}})\\ \\
\longrightarrow\quad & \log(\color{red}{x}^{\color{blue}{[$m]}} )- \log(\color{red}{y}^{\color{blue}{[$p]}})+ \log(\color{red}{z}^{\color{blue}{[$n]}}) & \text{the first two terms are a } \textbf{difference} \text{ of logs}\\ \\
\longrightarrow\quad & \log(\color{red}{x^{[$m]}} )- \log(\color{blue}{y^{[$p]}})+ \log(z^{[$n]})& \text{ use that } \log (\color{red}{a}) - \log(\color{blue}{b}) = \log\left(\dfrac{\color{red}{a}}{\color{blue}{b}}\right) \\
&& \text{identify the } \color{red}{a} \text{ and the } \color{blue}{b} \\ \\
Expand All @@ -152,13 +152,13 @@ a.
&& \text{identify the } \color{red}{a} \text{ and the } \color{blue}{b} \\ \\
\longrightarrow\quad & \log\left(\color{red}{\dfrac{x^{[$m]}}{y^{[$p]}}} \cdot\color{blue}{z^[$n]}\right) &\\ \\
\longrightarrow\quad & \log\left(\dfrac{x^[$m]z^[$n]}{y^[$p]}\right) &\\
\end{align*}`]<<
\end{aligned}`]<<

b.
>>[`\begin{align*}
>>[`\begin{aligned}
&-\color{magenta}{[$m] \log(z)}+ \color{magenta}{[$p] \log(x)}-\color{magenta}{ [$n] \log(y)} & \text{three terms of the form } \color{blue}{a} \log(\color{red}{b})\\ \\
\longrightarrow\quad&-\color{blue}{[$m]} \log(\color{red}{z})+ \color{blue}{[$p]} \log(\color{red}{x})- \color{blue}{[$n]} \log(\color{red}{y}) & \text{identify the} \;\color{red}{a}\text{'s and the }\;\color{blue}{b}\text{'s} \\
&&\text{ use that } \color{blue}{a}\log(\color{red}{b})= \log(\color{red}{b}^\color{blue}{a})\\ \\
&&\text{ use that } \color{blue}{a}\log(\color{red}{b})= \log(\color{red}{b}^{\color{blue}{a}})\\ \\
\longrightarrow\quad & -\log(\color{red}{z}^{\color{blue}{[$m]}} )+ \log(\color{red}{x}^{\color{blue}{[$p]}})- \log(\color{red}{y}^{\color{blue}{[$n]}}) & \text{the last two terms are a } \textbf{difference} \text{ of logs}\\ \\
\longrightarrow\quad & -\log(z^{[$m]} )+ \log(\color{red}{x^{[$p]}})- \log(\color{blue}{y^{[$n]}})& \text{ use that } \log (\color{red}{a}) - \log(\color{blue}{b}) = \log\left(\dfrac{\color{red}{a}}{\color{blue}{b}}\right) \\
&& \text{identify the } \color{red}{a} \text{ and the } \color{blue}{b} \\ \\
Expand All @@ -170,7 +170,7 @@ b.
\longrightarrow\quad & \log\left(\dfrac{\color{red}{\dfrac{x^{[$p]}}{y^{[$n]}}}}{\color{blue}{\dfrac{z^[$m]}{1}}}\right) & \text{division of fractions}\\ \\
\longrightarrow\quad & \log\left(\dfrac{x^{[$p]}}{y^{[$n]}}\cdot\dfrac{1}{z^{[$m]}}\right) &\\ \\
\longrightarrow\quad & \log\left(\dfrac{x^[$p]}{y^[$n]z^[$m]} \right) &\\
\end{align*}`]<<
\end{aligned}`]<<



Expand Down
Loading

0 comments on commit e8392e6

Please sign in to comment.