Linear vs. Nonlinear Relationships in Scatter Plots

Linear vs. Nonlinear Relationships in Scatter Plots
Loading the math board and drawing, please wait…
2023-04-27 21:18
This example demonstrates linear and nonlinear relationships in scatter plots to help students identify trends in data sets. Commands used include Shuffle, Element, If, Point, Append, Slope, Text, Translate, etc. Suitable for 6-8 grade students to practice identifying linear and nonlinear relationships.

GeoGebra Commands & Parameters

  1. Shuffle(Sequence[0, 1.25, 0.25]) → randomb, {0, 1.25, 0.5, 0.25, 0.75, 1}
  2. Shuffle(Flatten[Sequence[{1, 2, 3, 4}, ii, 1, 5]]) → randomList1, {1, 4, 3, 4, 1, 4, 4, 1, 3, 2, 2, 2, 2, 1, 4, 3, 3, 3, 2, 1}
  3. Element(randomList1, Mod[countQuestion, Length[randomList1]] + 1) → randomNum1
  4. Shuffle(Sequence[4] \ {randomNum1}) → RanPositionsOrder, {3, 2, 4}
  5. Shuffle(Sequence[0, 3, 0.1] \ {Element[Sequence[0, 3, 0.1], Mod[countQuestion, 5] + 1]}) → randomList2, {2.4000000000000004, 1.8000000000000007, 2.1, 0.5, 0.8999999999999999, 2, 0.7, 2.3000000000000003, 1, 0.7999999999999999, 0.1, 1.2000000000000002, 1.7000000000000006, 1.1, 1.4000000000000004, 1.6000000000000005, 1.5000000000000004, 2.5000000000000004, 1.3000000000000003, 0.4, 2.6000000000000005, 2.7000000000000006, 1.9000000000000008, 2.2, 2.8000000000000007, 3, 0.2, 0.6, 2.900000000000001, 0.30000000000000004}
  6. Shuffle(Sequence[2, 4]) → randomn, {4, 3, 2}
  7. Shuffle(Sequence[0.5, 3, 0.25]) → randomm, {0.5, 1.75, 2, 1, 1.5, 2.25, 0.75, 2.75, 1.25, 2.5, 3}
  8. Shuffle(Flatten[Sequence[Sequence[0, 0.25, 0.05], ii, 1, 5]]) → randomErrors, {0.15000000000000002, 0, 0.25, 0.2, 0, 0.05, 0.05, 0, 0.1, 0.25, 0.05, 0.2, 0, 0.15000000000000002, 0.25, 0.05, 0, 0.15000000000000002, 0.1, 0.15000000000000002, 0.1, 0.2, 0.1, 0.25, 0.2, 0.25, 0.15000000000000002, 0.2, 0.1, 0.05}
  9. If(randomNum1 ≠ 1, 3 - Element[randomb, Mod[countQuestion, Length[randomb]] + 1], Element[randomb, Mod[countQuestion, Length[randomb]] + 1]) → intercept
  10. Point(yAxis) → F
  11. Append(randomNum1, RanPositionsOrder) → RanPosOrderComplet
  12. Element(randomn, Mod[countQuestion, 3] + 1) → coeffn
  13. Slope(Line[G, H]) → slope
  14. Text((((intercept * "-") * slope) * "x")) → expressionQ11
  15. Text((((intercept * "+") * slope) * "y")) → expressionQ1
  16. Translate(Polygon[{F, F - (0, hei), F + (wid, (-hei)), F + (wid, 0)}], (0, -0.07)) → droparea
  17. TableText(Append[Flatten[Sequence[{"\hspace{-10}y", "\hspace{-10}\times"}, i, 1, coeffn - 1]], "\hspace{-10}y"]) → tableQ9
  18. Element(randomList2, Mod[countQuestion, 15] + 1) → randomNum2
  19. Textfield(input1) → InputBox1
  20. Textfield(input2) → InputBox2
  21. Corner(5) → layoutAppSize
  22. onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5]) → OnboardingTextOffset
  23. Sequence((3 + ini, 1.35 + (ii * 0.55) - hei), ii, 0, 3) → l2
  24. Sort(l2, RanPosOrderComplet) → PositionsOrder
  25. Vertex(droparea, 2) → P
  26. Zip((("\textsf{" * TT) * "}"), TT, {"POSITIVE LINEAR RELATION", "NEGATIVE LINEAR RELATION", "NONLINEAR RELATION", "NO CORRELATION"}) → Options
  27. Segment((0, 0), (3, 0)) → fakexAxis
  28. Segment((0, 0), (0, 3)) → fakeyAxis
  29. Translate(vGL, Vector[(Vector[Corner[1], Corner[2]] / 800 * 32)]) → vGL'
  30. KeepIf(0.1 ≤ y(PP) ≤ 2.9, PP, Zip[(ii, (slope * ii) + intercept + ee), ii, randomList2, ee, randomErrors]) → linCoScatter
  31. KeepIf(0.1 ≤ y(PP) ≤ 2.9, PP, Zip[(ii, f1(ii) + ee), ii, randomList2, ee, randomErrors]) → nonlinScatter
  32. Text("\bold{x}", (3.2, -0.07), true, true, 0, 1) → labelx
  33. Text("\bold{y}", (0.2, 3), true, true, 0, 0) → labely
  34. FitLineY(linCoScatter) → flin
  35. Polygon({(0.05, 0.05), (2.95, 0.05), (2.95, 2.95), (0.05, 2.95)}) → q1
  36. KeepIf(0.1 ≤ y(PP) ≤ 2.9, PP, Zip[(ii, (1.5 * sin((1000 * ii))) + 1.5 + ee), ii, randomList2, ee, randomErrors]) → noCorScatter2
  37. Mirror(noCorScatter2, y = 1.5) → noCorScatter
  38. FitSin(nonlinScatter) → fitsin
  39. FitPoly(nonlinScatter, If[nonLinop ≤ 2, 2, 3]) → fitquad
  40. Text(Element[Options, 4], (0, 0), true, true) → text4
  41. Text(Element[Options, 3], (0, 0), true, true) → text3
  42. Text(Element[Options, 2], (0, 0), true, true) → text2
  43. Text(Element[Options, 1], (0, 0), true, true) → text1
  44. Translate(p, Vector[(Vector[Corner[4], Corner[1]] / 500 * 16)]) → p'

AI Drawing Prompt Reference

Draw a coordinate-plane activity that compares scatter plots of different relationships. First show a linear positive or negative trend using one set of points scattered around a straight-line fit, with noticeable noise so the points are not perfectly aligned. Then add a clearly nonlinear scatter set in the same bounded window (roughly x,y from about 0.1 to 2.9), following a curved pattern with a smooth fitted curve (e.g., sinusoidal or quadratic). Include visible x- and y-axis labels. Add option text in a corner indicating four categories: POSITIVE LINEAR RELATION, NEGATIVE LINEAR RELATION, NONLINEAR RELATION, NO CORRELATION, so the viewer can classify each scatter plot by visual trend.
The prompt above was compiled from the original drawing commands and is for reference only.