# Aggregate function to collect guesses for solutions to an inequality

I am trying to use “aggregate” so that Desmos collects all the guesses from a class for a linear inequality and graphs all of them. Any ideas? i know I can collect answers but how do i graph them as points?

You can only aggregate numbers. So, if it’s a point, you need a separate list for each coordinate.
If entered as a coordinate pair, in your graph CL:

``````numberList(`X`): aggregate(numericValue("\${parseOrderedPair(input.latex).x}"))
numberList(`Y`): aggregate(numericValue("\${parseOrderedPair(input.latex).y}"))
``````

Then, to graph all the points, in the graph itself:
`(X,Y)`

First, thanks so much for your reply. It makes some logical sense but I guess I am really reaching with my skills. I have never used a Computation Layer but feel pretty computer literate. I also have minimal coding knowledge.

The problem the students are given is:
Give at least 3 solutions to each inequality. In other words, give at least 3 combinations that make sense.
You receive an \$80 gift card to the bookstore. Hardback books cost \$8 and paperback books cost \$4. How many books of each type can you buy? (You do not need to spend all of your money)

My original idea was to have them enter their guesses in a table on the first screen. They could do it many ways though like plotting points in a sketch or entering values in a math input box with x and y separate inputs. Whatever is easier to make this idea work.
Then on the second screen the entire class’ guesses would be graphed.

In the example you sent me, what input were you thinking they would enter their guesses? What is the variable in the “code”? is it “Input”?

“input” would need to be whatever you name a math input where students enter a coordinate pair. You’ll need two lists for each coordinate pair entered, and then use join in the graph to combine them.

Based on what you described, I think this should give you enough of a start. Cool idea.

Since you envisioned a table, that’s what I went with. I aggregated a list from each cell position since that’s how you have to generate the class results. I also aggregated an individual student’s columns to plot the 3 points the student created so that they can see their own entries. Not sure if that’s what you want to do or not.

All of the aggregation CL is on screen 2, and the graph itself has the lists as placeholders (they all get overwritten by student interaction).

If you make a copy and “save a draft” you can run a “Sample Class” … open up a few tabs and enter in data to see how students would see it and how you see it on the dashboard.

1 Like