From c83cacf8399cd1918be5fc6c3ef4d0331fcedf88 Mon Sep 17 00:00:00 2001 From: Drew Lewis <30658947+siwelwerd@users.noreply.github.com> Date: Tue, 30 Jul 2024 08:23:14 -0700 Subject: [PATCH] Incorporate Tonya's feedback (#418) * Incorporate Tonya's feedback * Add activity before 1.7.7 for scaffolding * Fix graph * Try to add number line * Should work but doesn't * Add other two numberline tasks * Missing

tag * Draw number lines manually --- sage/common.sage | 75 +++++++++++++++++++++ source/01-EQ/07.ptx | 158 ++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 219 insertions(+), 14 deletions(-) create mode 100644 sage/common.sage diff --git a/sage/common.sage b/sage/common.sage new file mode 100644 index 00000000..0f24b2dd --- /dev/null +++ b/sage/common.sage @@ -0,0 +1,75 @@ +# Library of helpful functions +class TBILPrecal: + @staticmethod + def numberline_plot(center=0, radius=10): + P = arrow((center-radius,0),(center+radius,0),color="black", width=1, arrowsize=1, aspect_ratio=1,head=2) + for i in range(center-radius+1,center+radius): + P += line([(i,-0.2),(i,0.2)],color="black") + P += text(f"${i}$", (i,-0.6),color="black") + return P + + @staticmethod + def inequality_plot( + start=None, + strict_start=True, + end=None, + strict_end=True, + label_endpoints=True): + P = Graphics() + if start is None: + P += arrow((end,0),(-10,0),color="#0088ff", width=3, arrowsize=3, aspect_ratio=1) + if end is None: + P += arrow((start,0),(10,0),color="#0088ff", width=3, arrowsize=3, aspect_ratio=1) + if start is not None and end is not None: + P += line([(start,0),(end,0)],color="#0088ff", thickness=3, aspect_ratio=1) + + if start is not None: + if label_endpoints: + P += text(f"${round(start,ndigits=2)}$", (start,0.6), color="black") + if strict_start: + P += text("(", (start,0), color="#0088ff", fontsize=18) + else: + P += text("[", (start,0), color="#0088ff", fontsize=18) + + if end is not None: + if label_endpoints: + P += text(f"${round(end,ndigits=2)}$", (end,0.6), color="black") + if strict_end: + P += text(")", (end,0), color="#0088ff", fontsize=18) + else: + P += text("]", (end,0), color="#0088ff", fontsize=18) + return P + + @staticmethod + def small_rationals(numerators=range(-8,9), + denominators=[2,3,5], + dictionary=True, + length=1): + '''Generates a list or dictionary of unique rational numbers with small numerators and denominators. + For a dictionary, keys are the rationals and values are the denominators.''' + fulldict = {m/n:n for m in numerators for n in denominators if m%n !=0} + dict= { num:fulldict[num] for num in sample(list(fulldict.keys()),length)} + if dictionary: + return dict + return list(dict.keys()) + + @staticmethod + def small_irrationals(rational_part=range(-8,9), + irrational_part=[2,3,5,6,7,8], + denominators=[i for i in range(-5,6) if i != 0], + dictionary=True, + length=1): + '''Generates a list or dictionary of uniqe irrational numbers of the form (a+sqrt(b))/c. + For a dictionary, keys are tuples of rationals and their conjugate, and values are the denominators.''' + fulldict = { ((a+sqrt(b))/c,(a-sqrt(b))/c):c for a in rational_part for b in irrational_part for c in denominators} + dict= { pair:fulldict[pair] for pair in sample(list(fulldict.keys()),length)} + if dictionary: + return dict + else: + return list(dict.keys()) + + @staticmethod + def small_complex(real_part=range(-5,6), + imaginary_part=[i for i in range(-5,6) if i != 0],length=1): + '''Generates a list of unique 2-tuples of conjugate pairs of complex (not real) numbers of the form a+bi.''' + return sample([(a+b*I,a-b*I) for a in real_part for b in imaginary_part],length) \ No newline at end of file diff --git a/source/01-EQ/07.ptx b/source/01-EQ/07.ptx index 4a457ade..79cd3ea2 100644 --- a/source/01-EQ/07.ptx +++ b/source/01-EQ/07.ptx @@ -121,23 +121,53 @@ - -

Solve the quadratic inequality algebraically2x^2-28 \lt 10x. - Write your solution using interval notation.

+ +

Solve the quadratic inequality algebraically2x^2-28 \lt 10x.

+
+ + +

Write your solution using interval notation.

  1. \left(-\infty,-2\right)\cup\left(7,\infty\right)

  2. \left(-\infty,-7\right)\cup\left(2,\infty\right)

  3. \left(-7,2\right)

  4. \left(-2,7\right)

  5. -
-
-

D.

+ + +

D.

+
+ + +

Draw a number line representing your solution.

+
+ + + + + #p = TBILPrecal.numberline_plot() + #p += TBILPrecal.inequality_plot(start=-2,end=7,label_endpoints=False) + p = arrow((-10,0),(10,0),color="black", width=1, arrowsize=1, aspect_ratio=1,head=2) + for i in range(-9,10): + p += line([(i,-0.2),(i,0.2)],color="black") + p += text(f"${i}$", (i,-0.6),color="black") + p += line([(-2,0),(7,0)],color="#0088ff", thickness=3, aspect_ratio=1) + p += text("(", (-2,0), color="#0088ff", fontsize=18) + p += text(")", (7,0), color="#0088ff", fontsize=18) + p.axes(False) + p + + + +
+ +

Solve the inequality -2x^2-10x-10 \ge 6x+20.

+
+ -

Solve the inequality -2x^2-10x-10 \ge 6x+20. - Write your solution using interval notation.

+

Write your solution using interval notation.

  1. [-5,-3]

  2. (-\infty,-5]\cup[-3,\infty)

  3. @@ -146,6 +176,66 @@

A.

+
+ + +

Draw a number line representing your solution.

+
+ + + + + #p = TBILPrecal.numberline_plot() + #p += TBILPrecal.inequality_plot(start=-5,end=3,strict_start=False,strict_end=False,label_endpoints=False) + p = arrow((-10,0),(10,0),color="black", width=1, arrowsize=1, aspect_ratio=1,head=2) + for i in range(-9,10): + p += line([(i,-0.2),(i,0.2)],color="black") + p += text(f"${i}$", (i,-0.6),color="black") + p += line([(-5,0),(3,0)],color="#0088ff", thickness=3, aspect_ratio=1) + p += text("[", (-5,0), color="#0088ff", fontsize=18) + p += text("]", (3,0), color="#0088ff", fontsize=18) + p.axes(False) + p + + + +
+
+ + + +

+ Consider the rational inequality \frac{x+3}{x-2} \leq 0. +

+
+ + +

+ Use a graphing utility to graph the function f(x)=\dfrac{x+3}{x-2}. + Which part of the graph represents where \dfrac{x+3}{x-2}\leq 0? + Write your answer in interval notation. +

+
+ + + + f(x) = (x+3)/(x-2) + fill_opt = {'fillcolor': 'blue', 'thickness': 0} + p=plot(f,(x,-3,2),fill=True,**fill_opt,ymin=-15,ymax=15)+plot(f,(x,-5,5),thickness=3,detect_poles=True) + p + + +

The graph is below the x-axis on the interval [-3,2).

+
+
+ + +

How does the interval you found in part (a) relate to the numerator and the denominator + of the function f(x)=\dfrac{x+3}{x-2}? +

+
+

The places where the numerator or denominator are zero are the potential places where the sign can change.

+
@@ -166,9 +256,23 @@ -

Use a graphing utility to graph the function g(x)=\frac{4x+3}{x+2}-x. - Which part of the graph represents where \frac{4x+3}{x+2}-x\gt0?

+

+ Use a graphing utility to graph the function g(x)=\frac{4x+3}{x+2}-x. + Which part of the graph represents where \frac{4x+3}{x+2}-x\gt0? + Write your answer in interval notation. +

+ + + + f(x) = (4*x+3)/(x+2)-x + fill_opt = {'fillcolor': 'blue', 'thickness': 0} + p=plot(f,(x,-1,3),fill=True,**fill_opt)+plot(f,(x,-7,-2),fill=True,**fill_opt)+plot(f, (x, -7, 7), ymin=-15, ymax=15, color='blue', thickness=3, detect_poles=True) + p + + +

The graph is above the x-axis on the interval (-\infty, -2) \cup (-1,3).

+
@@ -184,12 +288,12 @@ -

How do these values you found in part (b) relate to the numerator and the denominator +

How does the interval you found in part (b) relate to the numerator and the denominator of the combined rational function in part (c)?

Factor the numerator.

-

The places where the numerator or denominator vanishes are the potential places where the sign can change.

+

The places where the numerator or denominator are zero are the potential places where the sign can change.

@@ -207,10 +311,10 @@

How can we express the answers to part (e) for the rational inequality using interval notation?

    -
  1. \left(-\infty,-2\right) \cup (-1,3)
  2. +
  3. \left(1,3\right)
  4. \left(-2,-1\right) \cup (3,\infty)
  5. \left(-2,-1\right)
  6. -
  7. \left(1,3\right)
  8. +
  9. \left(-\infty,-2\right) \cup (-1,3)

A.

@@ -241,6 +345,32 @@

B.

+ + +

Draw a number line representing your solution.

+
+ + + + + #p = TBILPrecal.numberline_plot() + #p += TBILPrecal.inequality_plot(end=-12,strict_end=False,label_endpoints=False) + #p += TBILPrecal.inequality_plot(start=-5,end=2,label_endpoints=False) + p = arrow((-14,0),(5,0),color="black", width=1, arrowsize=1, aspect_ratio=1,head=2) + for i in range(-14,5): + p += line([(i,-0.2),(i,0.2)],color="black") + p += text(f"${i}$", (i,-0.6),color="black") + p += arrow((-12,0),(-15,0),color="#0088ff", width=3) + p += line([(-5,0),(2,0)],color="#0088ff", thickness=3) + p += text("]", (-12,0), color="#0088ff", fontsize=18) + p += text("(", (-5,0), color="#0088ff", fontsize=18) + p += text(")", (2,0), color="#0088ff", fontsize=18) + p.axes(False) + p + + + +