I want students to restrict the domain of a function in a graph between -2 and 4. So the correct answer would be f(x)=2x+3 {-2 ≤ x ≤ 4}. Is there a way to check this and have it display a checkmark in the dashboard?

# Correctness checking the domain

**corbin**#3

They will just be entering it in a line of the graph. Here is the activity I am working on. They are asked to restrict the function on slide 3.

I experimented on this activity but didn’t have any luck:

**corbin**#4

If needed I could use an input box that is pre-populated with the equation of the line and just have the students add the restriction. However, I do want the graph to display the restriction if I go that route.

**ASmith**#5

Cool Ideas. I’m playing with creating a similar activity. Wondering if you ever figured it out?

**ASmith**#7

I think Webinar 5 video will help with correctness. I’m watching it now. Introduction to the Computation Layer #5

I also just got info about an example for inputting any equation into graph.

Table items to Graphing Horiz/Vert Lines via CL

**PanettaMath**#8

I am sure there are various ways to check the correctness of a restricted domain. It is not something I have built myself, but depending on what exactly the purpose is but I would think you would…

- Let f be the student function and g be the desired function.
- Set your desired function with parameters (maybe a,b?) for the restricted domain.
- Create a list of inputs along the restricted domain. Something like X=[a,a+.1,…b].
- Check to see the restricted portion of the domain is the same function. (i.e. f(X)-g(X)=0; or some other tolerance level)
- Check to see that the function is undefined where it should be… For example f(a-.1) and f(b+.1) should be undefined, you might even make lists A=[a-.1,…-10] and B=[b+.1,…10]?

I know those are not the most concrete set of directions…I will try to build an example if I find the time.

**PanettaMath**#9

That wasn’t too bad…

It worked for the one function I checked… feel free to look for bugs!

**PanettaMath**#10

I think testing a single point to the left and right of the restriction (with a small epsilon) would suffice, but I built the example using a list of points. When I first built it with lists, I tried to use total(f(A)), but that would make a wide array of answers correct so I switched over to quantile(f(A),0). The tolerance is set to .1

**mxepstein**#11

Just be careful because I believe the above example only works with ≤ ≥ and not with < >, though it could be easily tweaked to do so instead.

In looking for a simpler solution I was surprised to discover that CL cannot check for equality between two lists (see attached). Though I supose CL support for numberLists is limited in general.

**ASmith**#12

Yes, that’s the type of thing that Jay’s Webinar 5 guides us through. I’m currently looking at 19 minutes. so slightly before that is were it starts.