Create and edit algorithmic values
Updated 28 Aug 2023
The Edit Algorithmic Values window lets you define algorithmic values. To access the Edit Algorithmic Value window from the Custom Question Builder:
- Click Algorithmic Values > Add New Algorithmic Value.
- Click Show Algorithmic Values List and then click Add.
The Edit Algorithmic Values window has two tabs where you define constraints and options.
On the Constraints tab, you define the type of value and its behavior:
- Algorithmic Value Name - Enter a meaningful name for your algorithmic value. If you are creating a new algorithmic value, replace the default variable name, which begins with V. Algorithmic value names must begin with a letter but can include numbers. Algorithmic values names are not case-sensitive.
- Select
Type of Algorithmic Value - Choose the type of value to determine
how it is displayed and treated in calculations:
- Integer
- A positive or negative integer without decimal places.
When you select the Integer type, any decimal values you enter are rounded to the nearest integer when displayed and when used in other variables or in calculations. If your constraints include a calculation, the resulting value is simplified and rounded to the nearest integer.
- Decimal - A positive or negative decimal number rounded to the number of decimal places you specify under Format. If your constraints include a calculation, the resulting value is rounded to the specified number of decimal places.
- Text or Symbol - One or more words, math symbols, or a string of characters. Text must be enclosed in quotation marks and appears exactly as you type it, with no computational significance.
- Algebraic or Numeric Expression - An algebraic or numeric expression. When you select this type, mathematical functions and expressions are not simplified.
The type you choose affects how the Custom Question Builder automatically displays your input. For example, suppose you enter
pi
as your value. If you have defined it as an integer, the value displays as 3. If you have defined it as a decimal rounded to 4 decimal places, the value displays as 3.1415. If you have defined it as text and entered"pi"
, it displays as pi; but if do not enter the quotes, it displays as the value of pi to fourteen decimal places. If you have defined pi as an algebraic or numeric expression, you see the symbol.If you are creating a question for a textbook that uses SI notation, enter commas instead of spaces between periods in values. Your commas are automatically converted to spaces when the question is used in a textbook that uses SI notation. For more information, see Work with SI notation.
- Integer
- A positive or negative integer without decimal places.
- In the table under List
values or Set Up Constraints, select:
- Relational Operator - From the dropdown list, select an operator to define the value.
- Constraint Value - Enter the
value that applies to the operator. Constraint values may contain text,
numbers, mathematical expressions, mathematical functions, symbols, or
other algorithmic values.
To include functions, symbols and other algorithmic values, right-click in the Constraint Value column, select Editing Options from the pop-up menu, and make a selection from the list of options. You can also type functions and other algorithmic values directly into the Constraint Value column.
For example, if your algorithmic value is an integer with a range greater than or equal to 2 and less than or equal to 10, you'll choose the following:
You can include calculations in your constraints by using mathematical operators. For example:
In this example, PV, R, and N are algorithmic values. When your constraint includes other algorithmic values, you must precede the value names with a tilde (~).
To delete an answer, right-click in the row and the select Delete or Remove Row.
See Specify constraints for more information on the many ways you can enter constraints.
- Number of decimal
places - Enter the number of decimal places to display and use
in calculations. The maximum is 10 places.
If the result of a calculation exceeds the number of decimal places allowed, the value rounds to the allowed number of decimal places. If you want the value to truncate rather than round, use the TRUNC math function.
- Show trailing zeros - Select whether to display trailing zeros in the correct answer.
- Use commas or spaces between periods - Select
whether numbers above 999 displays with spaces or commas.
The following table shows the calculated and displayed value given different formatting selections:
Format
Calculated value
Displayed value
2 decimal places, do not show trailing zeros, use commas
3456.20
3,456.2
2 decimal places, do not show trailing zeros, use spaces
3456.20
3 456.2
1 decimal place, show trailing zeros, no commas
7234
7234.0
2 decimal places, do not show trailing zeros, no commas
2675.12624
2675.13
- Final value must be a prime number - Select whether the generated value of your algorithmic value is a prime number.
- Must be relatively prime to - If your value must be relatively prime to another algorithmic value, enter the name of the other value, preceded by a tilde, in the box.
On the Options tab, you set the following optional attributes of your algorithmic value:
- Link ID - Type a link number in this box when you create an
algorithmic value using a list and want to associate the value with one
or more other algorithmic values defined as lists. Link IDs should be
numeric values such as "1," "2," or "3."
Each linked algorithmic value must contain the same number of values in
its list.
When algorithmic values share the same link ID, the player selects values from the same relative position in their respective value lists. For example, suppose you link the following algorithmic values:
~A1 = 1, 3, 5
~A2 = 3, 7, 9
~A3 = 4, 10, 14When generating algorithmic values, the player uses either all the elements in the first position (1, 3, 4), all the elements in the second position (3, 7, 10), or all the elements in the third position (5, 9, 14) for the values of ~A1, ~A2, and ~A3, respectively.
- Do not display when value equals - An algorithmic value does not appear in your question when its value equals the value you enter in this box. For example, if you use an algorithmic value as the coefficient of a variable and want to hide the value when it equals 1, type 1 in this box.
- Authoring notes - Optionally, add any notes about the algorithmic value that you might need if you edit the value later. Authoring notes show only in the Edit Algorithmic Values and the Algorithmic Values List windows.