ReferenceperiodicSet

<periodicSet>

A periodic set of real numbers

<periodicSet> represents an infinite set of real numbers of the form ok+np:nZ,k=1,,m\\{ o_k + n p : n \in \mathbb{Z}, \, k = 1, \ldots, m \\} — that is, a list of offsets repeated with a fixed period. The classic use case is comparing families of angles modulo π\pi or 2π2\pi in trigonometry: the set of solutions to sin(x)=12\sin(x) = \frac{1}{2}, for example, is the periodic set with offsets π/6, 5π/6\pi/6,\ 5\pi/6 and period 2π2\pi.

Two <periodicSet> values compare equal when they describe the same set of real numbers, regardless of which representative offsets are chosen. That makes it the right tool for answer-validation of trigonometric solution sets.

Attributes and Properties

Attributes for <periodicSet>

Highlighted (3)
displayDigits

integer. Default value: 3. Number of significant digits to display when rendering this number.

format

keyword. Input format.

ValueDescription
text (default)Plain-text math notation (e.g., x^2 + 1).
latexLaTeX-formatted math (e.g., x^{2} + 1).
simplify

keyword. Level of simplification applied to the expression.

ValueDescription
none (default)No simplification is applied.
fullFully simplify the expression.
numbersSimplify numeric subexpressions only, leaving symbolic structure intact.
numbersPreserveOrderLike numbers, but does not reorder commutative operands.
normalizeOrderReorder commutative operands into a canonical form without simplifying values.
Number display (5)
avoidScientificNotation

boolean. Default value: false. Whether to render numbers in full decimal form rather than scientific notation.

displayDecimals

integer. Default value: 2. Number of decimal places to display when rendering this number.

displayDigits

integer. Default value: 3. Number of significant digits to display when rendering this number.

displaySmallAsZero

number. Default value: 1e-14. Threshold below which numbers are displayed as zero.

padZeros

boolean. Default value: false. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.

Positioning (2)
anchor

point. Default value: \(\left( 0, 0 \right)\). Coordinates of the anchor point used to position this component on a graph.

positionFromAnchor

keyword. Where this component sits relative to its anchor point.

ValueDescription
upperRightPlace the component above and to the right of the anchor point.
upperLeftPlace the component above and to the left of the anchor point.
lowerRightPlace the component below and to the right of the anchor point.
lowerLeftPlace the component below and to the left of the anchor point.
topPlace the component directly above the anchor point.
bottomPlace the component directly below the anchor point.
leftPlace the component directly to the left of the anchor point.
rightPlace the component directly to the right of the anchor point.
center (default)Center the component on the anchor point.
Other (19)
assumptions

math. Default value: \(_\). Assumptions applied when simplifying or comparing.

createIntervals

boolean. Default value: false. Whether range expressions are interpreted as intervals.

createVectors

boolean. Default value: false. Whether tuple-like expressions are interpreted as vectors.

displayBlanks

boolean. Default value: true. Whether blanks (placeholders) are visibly rendered.

draggable

boolean. Default value: true. Whether the math component can be dragged on a graph.

expand

boolean. Default value: false. Whether to expand the expression.

functionSymbols

textList. Default value: ["f","g"]. Symbols treated as function names when parsing.

layer

number. Default value: 0. Z-order layer index when shown on a graph.

maxIndex

integer. Default value: Infinity. Largest period index considered when listing offsets.

integer. Default value: 1. Largest period index when rendered as a list.

minIndex

integer. Default value: -Infinity. Smallest period index considered when listing offsets.

integer. Default value: -1. Smallest period index when rendered as a list.

offsets

mathList. Offsets within one period.

parseScientificNotation

boolean. Default value: false. Whether to parse expressions like 1e3 as scientific notation.

period

math. The period of the set.

referencesAreFunctionSymbols

reference. References whose names should be treated as function symbols when parsing.

renderMode

text. Default value: inline. How the math is rendered (e.g. "inline", "display").

splitSymbols

boolean. Default value: true. Whether multi-character symbols are split into a product of variables.

unordered

boolean. Whether tuple- or list-like math expressions should be treated as unordered for comparison.

Common to all components (9)
copy

reference. Create an independent copy of another component by reference. Enter a references a $name.

disabled

boolean. Default value: false. Whether this component is disabled and cannot be interacted with.

extend

reference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.

fixed

boolean. Default value: false. Whether this component's value is fixed and cannot be modified.

fixLocation

boolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

hide

boolean. Default value: false. Whether to hide this component from the rendered output.

isResponse

boolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.

name

text. The name used to reference this component from elsewhere in the document.

styleNumber

integer. Default value: 1. The style number used to select this component's visual styling from the available style definitions.

Properties for <periodicSet name="p">

Highlighted (3)
$p.displayDigits

integer. Number of significant digits to display when rendering this number.

$p.format

text. Input format.

$p.simplify

text. Level of simplification applied to the expression.

Number display (5)
$p.avoidScientificNotation

boolean. Whether to render numbers in full decimal form rather than scientific notation.

$p.displayDecimals

integer. Number of decimal places to display when rendering this number.

$p.displayDigits

integer. Number of significant digits to display when rendering this number.

$p.displaySmallAsZero

number. Threshold below which numbers are displayed as zero.

$p.padZeros

boolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.

Positioning (2)
$p.anchor

point. The coordinates where this component is anchored on the graph.

$p.positionFromAnchor

text. Where this component sits relative to its anchor point.

Other (46)
$p.asList

mathList. The periodic set rendered as a list of explicit values.

$p.assumptions

math. Assumptions applied when simplifying or comparing.

$p.backgroundColor

text. Human-readable name for this component's background color, derived from the active style and theme.

$p.columns

[ math ]. The matrix's entries grouped by column.

$p.createIntervals

boolean. Whether range expressions are interpreted as intervals.

$p.createVectors

boolean. Whether tuple-like expressions are interpreted as vectors.

$p.disabled

boolean. Whether this component is disabled and cannot be interacted with.

$p.displayBlanks

boolean. Whether blanks (placeholders) are visibly rendered.

$p.draggable

boolean. Whether the math component can be dragged on a graph.

$p.expand

boolean. Whether to expand the expression.

$p.fixed

boolean. Whether this component's value is fixed and cannot be modified.

$p.fixLocation

boolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

$p.functionSymbols

textList. Symbols treated as function names when parsing.

$p.hidden

boolean. Whether this component is hidden from the rendered output.

$p.isNumber

boolean. Whether the expression evaluates to a finite number.

$p.isNumeric

boolean. Whether the expression evaluates to any number (including infinities).

$p.latex

latex. The expression rendered as a LaTeX string.

$p.layer

number. Z-order layer index when shown on a graph.

$p.list

[ math ]. The math expression interpreted as a list (its elements).

$p.matrix

[ math ]. The math expression interpreted as a matrix (its entries by row and column).

$p.matrixSize

numberList. The size of the math expression as a matrix, as a [numRows, numColumns] list.

$p.maxIndex

integer. Largest period index considered when listing offsets.

$p.maxIndexAsList

integer. Largest period index when rendered as a list.

$p.minIndex

integer. Smallest period index considered when listing offsets.

$p.minIndexAsList

integer. Smallest period index when rendered as a list.

$p.number

number. The numeric value of the expression (NaN if not a number).

$p.numColumns

integer. The number of columns when the math expression is interpreted as a matrix.

$p.numDimensions

integer. The number of dimensions if the math expression is interpreted as a vector or matrix.

$p.numListItems

integer. The number of items when the math expression is interpreted as a list.

$p.numOffsets

integer. The number of distinct offsets within one period.

$p.numRows

integer. The number of rows when the math expression is interpreted as a matrix.

$p.offsets

mathList. Offsets within one period.

$p.parseScientificNotation

boolean. Whether to parse expressions like 1e3 as scientific notation.

$p.period

math. The period of the set.

$p.redundantOffsets

boolean. Offsets that are redundant given the period.

$p.renderMode

text. How the math is rendered (e.g. "inline", "display").

$p.rows

[ math ]. The matrix's entries grouped by row.

$p.splitSymbols

boolean. Whether multi-character symbols are split into a product of variables.

$p.text

text. The expression rendered as a plain text string.

$p.textColor

text. Human-readable name for this component's text color, derived from the active style and theme.

$p.textStyleDescription

text. Human-readable description of this component's text styling (color and any background color).

$p.value

periodicSet. The math expression value.

$p.vector

[ math ]. The math expression interpreted as a vector (its components).

$p.x

math. The first component of the math expression when interpreted as a vector.

$p.y

math. The second component of the math expression when interpreted as a vector.

$p.z

math. The third component of the math expression when interpreted as a vector.

Common to all components (4)
$p.doenetML

text. The DoenetML source code that produced this component.

$p.hide

boolean. Whether to hide this component from the rendered output.

$p.isResponse

boolean. Whether this component is treated as a response for the purposes of assessment.

$p.styleNumber

integer. The style number used to select this component's visual styling from the available style definitions.

Examples

Example: Solutions of a trigonometric equation

The learner-entered offsets and period define one <periodicSet>; the correct set is defined inline as another. The = operator compares the two sets, so equivalent representations are accepted: e.g. writing 13pi/6 in place of pi/6 (shifted by +2 pi), -7pi/6 in place of 5pi/6 (shifted by -2 pi), or listing the two offsets in either order.

Note the missing space in 5pi/6: the offsets attribute is a mathList — a space-separated list of math expressions — so an inner space would split that value into two offsets (5 and pi/6). The period attribute is a single math, so spaces inside it (2 pi) are fine.


Example: List representative values

The asList property returns a comma-separated list of representative values, with minIndexAsList and maxIndexAsList controlling how many periods are listed. numOffsets returns the number of distinct offsets within a single period.

Attribute Examples

Attribute Example: offsets and period

offsets is a space-separated list of offsets within one period; period is the spacing. Together they parametrize the entire set.


Attribute Example: minIndexAsList, maxIndexAsList

minIndexAsList and maxIndexAsList control the range of period indices included when the set is rendered as a list. Both default to ±1, so a periodic set with one offset renders as three representative values by default.