#4D4D4D

$\text{Check}$

$\text{NEW PROBLEM}$

Fix position and allow selection for all text objects

Empty all input boxes

$b=$

Reset app

\text{This is the error specific hint}

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

#eeeeee

#2E006758

#2EB00020

$a=\vphantom{b}$

\text{Describe the applet here}

$\text{Some string input}$

(Element 1, element 2) = pixel location of text, element 3: text direction for x: 1=right of point, -1=left of point, 0=centered. element 4: text direction for y (-1,0,1)

$\mathsf{%v}$

$\mathsf{%v}$

\textsf{Base}

x\vphantom{Base}

$\mathsf{%v}$

\textsf{Trees}

\textsf{Simplify your answer}

allRandomSeeds = RandomUniform(0, 0.99, 200)
inputSaved: {NaN}
inputA = NaN
inputB = NaN
numRandoms: 2
countQuestion = 0
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
randomBase: 2 + floor((currentRandomSeeds(1) * 2))
onboarding = false
randomX: 1 + floor((currentRandomSeeds(1) * 4))
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
randomMult: 1 + floor((currentRandomSeeds(1) * 2))
f(x) = (randomMult * randomBase^(x))
text1 = ReplaceAll(Text[f], "x", Text[randomX])
expected: f(randomX)
textSolution: "\textsf{\bold{Possible Solution}}\\
\textsf{The exponential function }
\\f(x)=" + (LaTeX[f]) + "\textsf{ models the total}\\
\textsf{number of branches at the top of}\\
\textsf{" + (LaTeX[If[randomMult ≟ 1, "a", ("" * randomMult)]]) + " tree" + (LaTeX[If[randomMult ≟ 1, "", "s"]]) + ", assuming each branch}\\
\textsf{splits into " + (LaTeX[randomBase]) + " branches }x\textsf{ times.}\\\textsf{If }x=" + (LaTeX[randomX]) + "\textsf{, the number of branches }\\
\textsf{at the top level is:}\\
f(" + (LaTeX[randomX]) + ")=" + (LaTeX[If[randomMult ≟ 1, "", (randomMult * "\cdot")]]) + "" + (LaTeX[randomBase]) + "^" + (LaTeX[randomX]) + "=" + (LaTeX[expected]) + ""
InputBoxB = Textfield(inputB)
correct2: inputB ≟ randomX
tempA = NaN
correct1: tempA ≟ expected
correct: correct1
isTypicalError: inputB ≟ inputA + 1
showbuttons = true
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
helpTextHint: "\textsf{The function }f(x)=" + (LaTeX[f]) + "\textsf{ models the}\\
\textsf{total number of branches at the top}\\\textsf{of " + (LaTeX[Element[{"a", "two", "three"}, randomMult]]) + " tree" + (LaTeX[Element[{"", "s", "s"}, randomMult]]) + " assuming each\\
branch splits into " + (LaTeX[If[randomBase ≟ 2, "two", "three"]]) + " at each level.}\\
\textsf{Use the model to visualize the}\\\textsf{function.}"
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16
pixelsTop: 24
xMax = 6.614626666666667
xMin = -11.849195555555557
yMax = 4.120977777777778
yMin = -7.436177777777778
textHint: "\textsf{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + ""
layoutY = 140
layoutX: 16
layoutAppSize = Corner(5)
tempB = NaN
inputDefined: Sum[Zip[A ≠ "?" ∧ ReplaceAll[A, " ", ""] ≠ "", A, {("" * tempA)}]] ≟ 1
inputCurrent: {tempA}
pulsingSpeed: 8
pulsing = 0.5 (slider from 0 to 1, step 0.1)
onboardingCase = 4 (slider from 1 to 4, step 1)
onboardingX: 337
onboardingY: 300
solutionView: showanswer ∨ showsolution
InputBoxA = Textfield(inputA)
altFeedback: "\text{" + (LaTeX[If[correct, (("Your answer is correct. Total number correct: " * countCorrect) * ". "), ("Your answer is not correct. " * If[tries < 3, "Try again. ", "Maybe next time. "])]]) + "}" + (LaTeX[If[showsolution, ("\\" * textSolution), If[showhint ∨ showhinttypicalerror, textHint, ""]]]) + ""
InputBoxC = Textfield(inputC)
textQuestion: "\textsf{Evaluate the function }f(x) = " + (LaTeX[f]) + "\textsf{ at }x=" + (LaTeX[randomX]) + "
 "
textFeedback: "\text{\vphantom{✕}" + (LaTeX[If[correct, (("\textcolor{" * colorTealSuccess) * "}{✓ Correct}"), (((("\textcolor{" * colorRedError) * "}{✕ ") * If[tries < 3, "Try again", "Maybe next time"]) * "}")]]) + "}"
canBeSimplified: true ∈ Zip[Defined[IndexOf[ss, inputAsText]], ss, {"^", "(", ")", "+", "*", "-", "/"}] ∧ correct
enableBtnValidate: inputCurrent ≠ inputSaved ∧ inputDefined ∧ (¬canBeSimplified)
maxTries: 3
labelBtnValidate: "\text{CHECK (" + (LaTeX[maxTries - tries]) + ")}"
enableInput: tries < maxTries ∧ (¬(validate ∧ correct))
onboardingPositions = Element({{onboardingX + 24, onboardingY - 12, 1, 0}, {onboardingX, onboardingY - 12, -1, 0}, {onboardingX + 18, onboardingY, 0, -1}, {onboardingX + 18, onboardingY - 36, 0, 0}}, onboardingCase)
OnboardingTextPoint = PixelsToPoint((xMin, yMin), (xMax, yMax), (800, 500), (onboardingPositions(1), onboardingPositions(2)))
onboardingDisplayText = Text("\text{Drag to start}", OnboardingTextPoint, true, true, onboardingPositions(3), onboardingPositions(4))
slideBase_{1} = 3 (slider from 2 to 3, step 1)
slidePower_{1} = 2 (slider from 0 to 7, step 1)
powerFunc_{1}(x) = slideBase_{1}^(x)
Cor1 = (-3.1399, -5.18344)
Cor3 = (6.76893, 1.01885)
Cor2_{1}: (x(Cor3), y(Cor1))
trans_{1}: 0.25
numTrees = 2 (slider from 1 to 3, step 1)
q1 = Polygon({(-6, -5), (6.5, -5), (6.5, 3), (-6, 3)})
showtrees: showhint ∨ showsolution ∨ validate ∧ correct
pic4 = Translate(Element[{pic0, pic31, pic32, pic33, pic34, pic35, pic36, pic37}, slidePower_{1} + 1], Vector[(4, 1.5)])
pic3 = Translate(Element[{pic0, pic31, pic32, pic33, pic34, pic35, pic36, pic37}, slidePower_{1} + 1], Vector[(-3.5, 2.5)])
pic1 = Translate(Element[{pic0, pic21, pic22, pic23, pic24, pic25, pic26, pic27}, slidePower_{1} + 1], Vector[(4, 1.5)])
pic2 = Translate(Element[{pic0, pic21, pic22, pic23, pic24, pic25, pic26, pic27}, slidePower_{1} + 1], Vector[(-3.5, 2.5)])
tabOrder: {textQuestion, InputBoxA, btnValidate, textHint, slideBase_{1}, slidePower_{1}, numTrees, textSolution, btnNew}
lblInputBox: "f(" + (LaTeX[randomX]) + ")="
A = (3.600465244444445, -4.2001742222222225)
g: y = y(A)
eq1: x = x(A)
eq1' = Translate(eq1, Vector[(Vector[Corner[1], Corner[2]] / 800 * 36)])

Tool: PixelsToPoint
PixelsToPoint(Corner1,Corner3,Corner5,PixelCoords)
Input: Corner1, Corner3, Corner5, InputPixels
Output: OutputPoint

InputPixels: (100, 200)
xRight: x(Corner3)
xLeft: x(Corner1)
yTop: y(Corner3)
yBottom: y(Corner1)
yCoord: yTop - (y(InputPixels) / y(Corner5) * (yTop - yBottom))
xCoord: (x(InputPixels) / x(Corner5) * (xRight - xLeft)) + xLeft
OutputPoint: (xCoord, yCoord)

Tool: expandSegment
expandSegment(A,B,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, pixelGap, Corner1, Corner3, Corner5
Output: newPoly

distanceX: (pixelGap / x(Corner5) * (x(Corner3) - x(Corner1)))
distanceY: (pixelGap / y(Corner5) * (y(Corner3) - y(Corner1)))
pointGap: distanceX
xyScale: distanceY / distanceX
A: (0, 0)
vecAB: B - A
pVec: (20 * UnitVector[(((-y(vecAB))) / xyScale, (x(vecAB) * xyScale))])
pVecAngle = Angle(xAxis, Line[(0, 0), pVec])
realAngle = If(pVecAngle ≟ pi / 2 ∨ pVecAngle ≟ (3 * pi / 2), pVecAngle, atand(tan(pVecAngle) / xyScale))
curveFunction = CurveCartesian((pointGap * cos(u)), ((pointGap * xyScale) * sin(u)), u, 0, (2 * pi))
K: curveFunction(realAngle)
vSpace = Vector(K)
allPoints: {A + vSpace, A - vSpace, B - vSpace, B + vSpace}
newPoly = Polygon(allPoints)

Tool: onboardingTextOffset
onboardingTextOffset(textCorner1,textCorner3,case,corner1,corner3,corner5)
Input: CornerText1, CornerText3, case, Corner1, Corner3, Corner5
Output: TextOffset

xPixels: ((x(CornerText3) - x(CornerText1)) * x(Corner5) / (x(Corner3) - x(Corner1)))
yPixels: ((y(CornerText3) - y(CornerText1)) * y(Corner5) / (y(Corner3) - y(Corner1)))
xOffset = Element({27, (-xPixels) + 2, 16 - xPixels / 2, 16 - xPixels / 2}, case)
yOffset = Element({-23, -23, yPixels - 27, -49}, case)
TextOffset: (xOffset, yOffset)

Tool: Grow
Grow[ parmA,parmB,parmC,parmD,parmE,angleA,angleB,angleC,angleD,angleE,ParmP1,parmP2,segStart]
Input: parameterA, parameterB, parameterC, parameterD, parameterE, angleA, angleB, angleC, angleD, angleE, parameterP1, parameterP2, segStart
Output: output

segStart = Segment((0, 0), (0, 3))
Start = Point(segStart, 0)
End = Point(segStart, 1)
P1 = Point(segStart, parameterP1)
P2 = Point(segStart, parameterP2)
A = Translate(Rotate[Point[segStart, parameterA], angleA, Start], P1 - Start)
B = Translate(Rotate[Point[segStart, parameterB], angleB, Start], P1 - Start)
C = Translate(Rotate[Point[segStart, parameterC], angleC, Start], P2 - Start)
D = Translate(Rotate[Point[segStart, parameterD], angleD, Start], P2 - Start)
E = Translate(Rotate[Point[segStart, parameterE], angleE, Start], End - Start)
output: {Segment[P1, A], Segment[P1, B], Segment[P2, C], Segment[P2, D], Segment[End, E]}

Tool: GrowFour
GrowFour[ parmA,parmB,parmC,parmD,parmE,angleA,angleB,angleC,angleD,ParmP1,segStart]
Input: parameterA, parameterB, parameterC, parameterD, angleA, angleB, angleC, angleD, parameterP1, segStart
Output: output

segStart = Segment((0, 0), (0, 3))
Start = Point(segStart, 0)
End = Point(segStart, 1)
P1 = Point(segStart, parameterP1)
A = Translate(Rotate[Point[segStart, parameterA], angleA, Start], P1 - Start)
B = Translate(Rotate[Point[segStart, parameterB], angleB, Start], P1 - Start)
C = Translate(Rotate[Point[segStart, parameterC], angleC, Start], End - Start)
D = Translate(Rotate[Point[segStart, parameterD], angleD, Start], End - Start)
output: {Segment[P1, A], Segment[P1, B], Segment[End, C], Segment[End, D]}

Tool: GrowThree
GrowThree[ parmA,parmB,parmC,angleA,angleB,angleC,ParmP1,segStart]
Input: parameterA, parameterB, parameterC, angleA, angleB, angleC, parameterP1, segStart
Output: output

segStart = Segment((0, 0), (0, 3))
Start = Point(segStart, 0)
End = Point(segStart, 1)
P1 = Point(segStart, parameterP1)
A = Translate(Rotate[Point[segStart, parameterA], angleA, Start], P1 - Start)
B = Translate(Rotate[Point[segStart, parameterB], angleB, Start], P1 - Start)
C = Translate(Rotate[Point[segStart, parameterC], angleC, Start], End - Start)
output: {Segment[P1, A], Segment[P1, B], Segment[End, C]}

Tool: GrowTwo
GrowTwo[ parmA,parmB,angleA,angleB,ParmP1,segStart]
Input: parameterA, parameterB, angleA, angleB, parameterP1, segStart
Output: output

segStart = Segment((0, 0), (0, 3))
Start = Point(segStart, 0)
P1 = Point(segStart, parameterP1)
A = Translate(Rotate[Point[segStart, parameterA], angleA, Start], P1 - Start)
B = Translate(Rotate[Point[segStart, parameterB], angleB, Start], P1 - Start)
output: {Segment[P1, A], Segment[P1, B]}