#4D4D4D

$\text{Check}$

$\text{NEW PROBLEM}$

Fix position and allow selection for all text objects

\text{This is the answer.}

\text{\bold{Possible Solution}\
The outlier represents a value that is set apart from the rest of the points. }

Reset app

\text{There is more than one outlier.}

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

\text{Recall that an outlier represents a value that is set apart from the rest of the points.}

#eeeeee

\text{Select each point that represents an outlier.} 

#2E006758

#2EB00020

\text{Click to select}

allRandomSeeds = RandomUniform(0, 0.99, 200)
countQuestion = 0
divisorY: 11
numPoints = 19
numRandoms: (numPoints * 2) + 10
maxRandIndex: Mod[(countQuestion * numRandoms), Length[allRandomSeeds] - numRandoms + 1] + numRandoms
currentRandomSeeds = If(maxRandIndex > numRandoms, Take[allRandomSeeds, maxRandIndex - numRandoms, maxRandIndex], Take[allRandomSeeds, 1, numRandoms])
regSlope: floor(((currentRandomSeeds(3) - 0.5) * 16)) / 10
regIntercept = If(regSlope < 0, 8.5, If[regSlope > 0, 1.5, 2])
numOutliers: round(currentRandomSeeds(2) + 1)
randomListY = Insert((0.5 * 20 / divisorY), Sequence[floor(((currentRandomSeeds(numPoints - numOutliers + 1 + k) - 0.5) * 20)) / divisorY, k, 1, numPoints - 1], 10)
posY = KeepIf(x > 0, randomListY)
onboardingIndex = IndexOf((0.5 * 20 / divisorY), randomListY)
isCluster = If(currentRandomSeeds(1) > 0.5, true, false)
clusterLocation = If(isCluster, round((currentRandomSeeds(1) * 7) + 1), 5)
divisorX = If(isCluster, 11, 3)
maxX: 10
randomListX = If(isCluster, Sequence[clusterLocation + round(((currentRandomSeeds(k + 1) - 0.5) * 25)) / divisorX, k, 1, numPoints], Sequence[((k + ((-1)^(k + 1) * currentRandomSeeds(k + 1))) * (maxX - 1) / numPoints), k, 1, numPoints])
pointsList = Sequence((Element[randomListX, k], (regSlope * Element[randomListX, k]) + regIntercept + Element[randomListY, k]), k, 1, numPoints)
outlierIntercept: abs(10 - regIntercept)
outlierSlope = If(abs(abs(regSlope) - 0.5) ≤ 0.1, (regSlope * (-1 / 2)), If[regSlope ≠ 0, (regSlope * (-1)), 0.3])
outlierX = Sequence(currentRandomSeeds(k) / 2 + k, k, 1, 9)
outlierOptions = Zip((k, (outlierSlope * k) + outlierIntercept), k, outlierX)
outlierMin: 3.5
outlierPoints = KeepIf(Distance[A, ClosestPoint[pointsList, A]] > outlierMin, A, outlierOptions)
Outlier2 = Element(outlierPoints, Length[outlierPoints])
Outlier1 = Element(outlierPoints, 1)
pulsingIndexList: {2, 20, 1, 10, 19, 3, 11, 17, 4, 16, 5, 15, 6, 14, 7, 13, 8, 12, 9}
pulsingIndex = 8 (slider from 1 to numPoints, step 1)
pulsing = 0.8 (slider from 0 to 1, step 0.1)
allPoints = If(numOutliers ≟ 1, Union[{Outlier1}, pointsList], Union[{Outlier1, Outlier2}, pointsList])
pulsingPoint = Element(allPoints, pulsingIndexList(pulsingIndex))
inputCurrent: {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}
clusterBooleanList = Take(inputCurrent, 1, numPoints)
outlierBooleanList = Take(inputCurrent, numPoints + 1, numPoints + numOutliers)
maxY: 10
inputPoint = (0, 0)
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
correct: (¬Defined[IndexOf[false, outlierBooleanList]]) ∧ (¬Defined[IndexOf[true, clusterBooleanList]])
showbuttons = true
showhinttypicalerror = false
labelBtnValidate: "\text{CHECK (" + (LaTeX[3 - tries]) + ")}"
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16 + 36 + 24 + 16 + 8
pixelsTop: 24 + 16 + 8
layoutY: 320
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 16
layoutAppSize = Corner(5)
inputPointLastPos: (0, 1)
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
textHint: "\text{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + "}"
inputSaved: {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}
booleanList = Sequence(false, k, 1, numPoints + numOutliers)
enableBtnValidate: inputCurrent ≠ inputSaved
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correct}$", "$\text{✕ " + (If[tries < 3, "Try again", "Maybe next time"]) + "}$"]]) + ""
onboarding = true
pulsingSpeed: 8
haloPixels: (pulsing * 7)
pulseColor: (37 + (pulsing * 218)) / 255
viewbox = Polygon({(-0.5, -0.5), (-0.5, maxY + 0.5), (maxX + 0.5, maxY + 0.5), (maxX + 0.5, -0.5)})
onboardingCase: 4
OnBoardingTextLoc = Element(pointsList, onboardingIndex)
onboardingX: ((x(OnBoardingTextLoc) - x(Corner[1])) * x(Corner[5]) / (x(Corner[2]) - x(Corner[1]))) - 8
onboardingY: ((y(Corner[4]) - y(OnBoardingTextLoc)) * y(Corner[5]) / (y(Corner[4]) - y(Corner[1]))) - 16
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
point1 = Element(pointsList, 1)
point2 = Element(pointsList, 2)
point3 = Element(pointsList, 3)
point4 = Element(pointsList, 4)
point5 = Element(pointsList, 5)
point6 = Element(pointsList, 6)
point7 = Element(pointsList, 7)
point8 = Element(pointsList, 8)
point9 = Element(pointsList, 9)
point10 = Element(pointsList, 10)
point11 = Element(pointsList, 11)
point12 = Element(pointsList, 12)
point13 = Element(pointsList, 13)
point14 = Element(pointsList, 14)
point15 = Element(pointsList, 15)
point16 = Element(pointsList, 16)
point18 = Element(pointsList, 18)
point19 = Element(pointsList, 19)
point17 = Element(pointsList, 17)
isTypicalError: numOutliers > 1 ∧ Defined[IndexOf[false, outlierBooleanList]] ∧ Defined[IndexOf[true, outlierBooleanList]]
yAxisLine = Segment((0, 0), (0, maxY + 0.5))
SelectedColor: "" + colorPurpleDark + ""
PointColor: colorPurpleLight
SelectedSize: 9
tempNumber = 10
SelectedStyle: 4
PointStyle: 10
xAxisLine = Segment((0, 0), (maxX + 0.5, 0))
lblX = Text("x", (maxX + 0.6, 0), true, true, 1, 0)
lblY = Text("y", (0.05, maxY + 0.6), true, true, 0, 1)
pointColors = Sequence(If[clusterBooleanList(A) ∧ (¬validate), "colorPurpleDark", If[clusterBooleanList(A), "colorRedLight", "colorPurpleLight"]], A, 1, Length[clusterBooleanList])
outlierColors = Sequence(If[outlierBooleanList(A) ∧ (¬validate), "colorPurpleDark", If[outlierBooleanList(A), "colorTealLight", "colorPurpleLight"]], A, 1, Length[outlierBooleanList])
SetClusterColor = Zip((((("SetColor(point" * A) * ",") * B) * ")"), A, Sequence[1, numPoints], B, pointColors)
SetOutlierColor = Zip((((("SetColor(Outlier" * A) * ",") * B) * ")"), A, Sequence[1, numOutliers], B, outlierColors)
pointSize = Sequence(If[inputCurrent(A), SelectedSize, 7], A, 1, numPoints)
SetClusterSize = Zip((((("SetPointSize(point" * A) * ",") * B) * ")"), A, Sequence[A, A, 1, numPoints], B, pointSize)
OutlierSize = Sequence(If[outlierBooleanList(A), SelectedSize, 7], A, 1, numOutliers)
SetOutlierSize = Zip((((("SetPointSize(Outlier" * A) * ",") * B) * ")"), A, Sequence[A, A, 1, numOutliers], B, OutlierSize)
ShadedBox = Polygon({(-0.5, -0.5), (-0.5, maxY), (maxX, maxY), (maxX, -0.5)})
CorrectOutlier1: Outlier1
CorrectOutlier2: Outlier2
pulsingCircle = expandCircle(pulsingPoint, 7 + (7 * pulsing), Corner[1], Corner[3], Corner[5])

Tool: expandTriangle
expandTriangle(A,B,C,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, C, pixelGap, Corner1, Corner3, Corner5
Output: newPolygon

Corner5: (800, 500)
Corner3: (7, 6)
Corner1: (-4, -2)
distanceY: (pixelGap / y(Corner5) * (y(Corner3) - y(Corner1)))
distanceX: (pixelGap / x(Corner5) * (x(Corner3) - x(Corner1)))
pointGap: distanceX
allVerts: {A, B, C}
concaveAngles = Zip(Angle[I, J, K] > 180°, I, Append[allVerts(-1), allVerts], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
allVecs = Zip(Vector[J, K], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
pVecs = Zip(Vector[UnitOrthogonalVector[A]], Vector[A], allVecs)
xyScale: (distanceY) / (distanceX)
circTemplate = CurveCartesian((pointGap * cos(t)), ((xyScale * pointGap) * sin(t)), t, 0, (2 * pi))
scaledVecs = Zip(Vector[(x(K), (xyScale * y(K)))], Vector[K], pVecs)
vPointsPre = Zip(A - (pointGap * B), A, allVerts, B, Append[scaledVecs(-1), scaledVecs])
vPointsPost = Zip(A - (pointGap * B), A, allVerts, Vector[B], scaledVecs)
endAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPost, M, allVerts)
startAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPre, J, vPointsPost, M, allVerts)
roundedCornersConvex = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, endAngles, C, startAngles)
roundedCornersConcave = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, startAngles, C, endAngles)
cornerAngles = Zip(Angle[A, B, C], A, vPointsPre, B, allVerts, C, vPointsPost)
cornerPoints = Flatten(Zip[If[¬Concave, {Element[D, 3]}, If[A < pi / 3 ∨ (¬Concave), {Element[C, 3]}, C]], A, cornerAngles, C, roundedCornersConcave, D, roundedCornersConvex, Concave, concaveAngles])
newPolygon = Polygon(cornerPoints)

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: 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: expandCircle
expandCircle(A,pixelRadius,Corner1,Corner3,Corner5)
Input: A, pixelRadius, Corner1, Corner3, Corner5
Output: newEllipse

distanceX: (pixelRadius / x(Corner5) * (x(Corner3) - x(Corner1)))
distanceY: (pixelRadius / y(Corner5) * (y(Corner3) - y(Corner1)))
xyScale: distanceY / distanceX
pointGap: distanceX
cMinor = Min(pointGap, (pointGap * xyScale))
cMajor = Max(pointGap, (pointGap * xyScale))
f1: sqrt(cMajor^(2) - cMinor^(2))
A: (3, 4)
newEllipse = If(xyScale < 1, Ellipse[A + (f1, 0), A + ((-f1), 0), A + (cMajor, 0)], Ellipse[A + (0, f1), A + (0, (-f1)), A + (0, cMajor)])