Specify functions
Updated 28 Aug 2023
In the Edit Algorithmic Values window, you can use functions in your constraint definitions. Functions are not available for all courses.
- In the Constraint Value column, click inside the row
where you want to insert a function, and then right-click.
A menu displays with a list of the types of available functions: Simple, Trigonometric, Logarithmic, Statistical, and Miscellaneous.
- Choose the function you want to insert in your constraints.
- Replace the variables in the function syntax with your own definitions. If you are inserting other algorithmic values in a function, precede the value name with a tilde.
Algorithmic values that you define as the Text or Symbol or Algebraic or Numeric Expression type do not perform calculations. Instead, they display the text of the expression exactly as you defined it. To use the result of a calculation in an algorithmic value, use another algorithmic value to perform the calculation and then use that value in the algorithmic value you are defining.
You also can add most functions by typing in the template syntax. See Function templates for a list of the available functions and their definitions.
- Define the integer algorithmic values ~num and ~den for the numerator and denominator, respectively, of the original fraction.
- Use a function to define an intermediate
value to calculate the simplified form of the numerator:
- Define an integer algorithmic value, ~simpnum, to calculate the simplified form of the numerator and select = as the relational operator.
- Click in the row under Constraint Value and then right-click to select
Editing Options > Simple > SIMPAB(A,B) from the list.
This function divides A by the greatest common factor of A and B.
- Replace A and B with your algorithmic values for
the numerator and denominator:
SIMPAB(~num,~den)
- Use a function to define an intermediate
value to calculate the simplified form of the denominator:
- Define an integer algorithmic value, ~simpden, to calculate the simplified form of the denominator and select = as the relational operator.
- Click in the row under Constraint Value and then right-click to select
Editing Options > Simple > SIMPBA(A,B) from the list.
This function divides B by the greatest common factor of A and B.
- Replace A and B with your algorithmic values for
the numerator and denominator:
SIMPBA(~num,~den)
- On the next line, add not-equal-to 1 as a constraint to avoid cases when the fraction simplifies to a whole number.
- Define a fifth algorithmic value,~frac, for the simplified fraction:
- Select Algebraic or Numeric Expression as the algorithmic value type.
- Select your relational operator.
- In the Constraint Value column, enter:
~simpnum / ~simpden
Your Algorithmic Values List looks like this:
- Insert ~frac in your question. The fraction displays as follows: