Skip to content
Classroom

N-Tuple Question Type

Students enter an ordered pair, triple, or n-tuple of values.

Basic Syntax

[ntuple]
answer = (3, 5);

Options

answer (required)

The correct n-tuple in parentheses.

[ntuple]
answer = (2, -1, 4);  // Triple

tolerance

Acceptable error for each component (default: no tolerance).

[ntuple]
answer = (1.5, 2.7, 3.1);
tolerance = 0.1;

type

  • ordered (default) — Order matters: (1, 2)(2, 1)
  • unordered — Order doesn't matter: (1, 2) = (2, 1)
[ntuple]
answer = (2, 3);
type = unordered;

Examples

Ordered Pair (Point on Plane)

Find the point of intersection of `y = 2x + 1` and `y = -x + 4`.

[ntuple]
answer = (1, 3);
tolerance = 0.01;

Solution to System (Unordered)

Find all solutions to the system (order doesn't matter):
`x + y = 5`
`2x - y = 1`

[ntuple]
answer = (2, 3);
type = unordered;
tolerance = 0.01;

3D Point

Find the corner of the box where `x = 2`, `y = -1`, `z = 4`.

[ntuple]
answer = (2, -1, 4);
type = ordered;

Coordinates from Graph

Read the coordinates of the intersection point from the graph.

[ntuple]
answer = (4, 6);
tolerance = 0.5;

Grading

  • If type = ordered: Position matters → (1, 2) ≠ (2, 1)
  • If type = unordered: Order doesn't matter → (1, 2) = (2, 1)
  • Each component is checked against tolerance if set

Tips

  • Use for coordinates: Points, intersections, solutions
  • Set tolerance for real-world data: Measurements have inherent error
  • Unordered for sets: Use when order is irrelevant (roots of equation, prime factors, etc.)

See Also