Automatically Generating Algebra Problems

Rohit Singh, Sumit Gulwani, Sriram K. Rajamani

Abstract

Creating high-quality mathematics problems is a labor-intensive task for educators. This paper introduces a general-purpose framework that takes a single "seed" algebra problem and automatically generates a neighborhood of similar, mathematically valid identities. By combining symbolic abstraction with randomized polynomial identity testing (PIT), the system enables the creation of endless variations in domains such as trigonometry, calculus, and linear algebra. Evaluation on 52 benchmark problems demonstrates that the tool can efficiently explore massive search spaces to produce pedagogically useful problems with minimal manual intervention.

Introduction

While basic software can easily randomize constants in simple equations, generating "proof problems"—identities where a student must demonstrate that a left-hand side (LHS) equals a right-hand side (RHS)—remains a significant challenge. Existing solutions are typically hard-coded for narrow domains and fail to generalize. This research addresses the need for a general-purpose framework capable of handling diverse algebraic fields while ensuring generated problems are mathematically correct and pedagogically interesting.

Methodology

The proposed workflow consists of three primary phases: Query Generation, Execution, and Tuning.

Query Generation

The system abstracts a seed problem into a "Query" by replacing specific operators and constants with Choice Nodes. For instance, a trigonometric function might be replaced with a choice set of all six primary functions, and a plus sign might become a choice between addition and subtraction. This creates a structured search space of potential identities.

The formal grammar for defining problem neighborhoods using Choice nodes.

Query Execution and Identity Testing

To verify the validity of generated identities without the overhead of complex symbolic solvers, the system utilizes Polynomial Identity Testing (PIT) based on the Schwartz-Zippel lemma. By evaluating the LHS and RHS at 4–6 random points, the system can determine if an identity holds with high probabilistic certainty. To handle non-polynomial math, the authors implemented approximate numerical methods, including adaptive quadrature for integrals and finite differences for derivatives.

Query Tuning and Pruning

To ensure results are not trivial (e.g., $0=0$) or redundant, the system allows users to apply constraints. Backtracking is employed to prune the search space efficiently, avoiding the re-evaluation of sub-expressions that cannot lead to valid identities.

Evaluation and Results

The tool was evaluated against a benchmark of 52 problems sourced from classic textbooks (e.g., S.L. Loney’s Trigonometry) and online tutorials. These covered five domains: Trigonometry (T), Limits (L), Integral Calculus (I), Binomial Theorem (B), and Determinants (D).

Experimental performance metrics across 52 benchmark problems, showing search space size (||Q||) and generation time (t).

Key findings include:

  • Efficiency: Even with search spaces exceeding $10^7$ combinations, the system typically found valid problems in under 60 seconds. For example, a complex $3 \times 3$ determinant identity yielded 6 new problems in just 12 seconds.
  • Novelty: In trigonometry, the engine generated 8 similar problems from one seed; while two existed in the source textbook, six were entirely new identities that shared the same underlying proof strategy.
  • Generality: The framework proved robust across disparate mathematical fields, from the Binomial Theorem to Matrix Determinants.

Discussion and Future Work

The system's primary strength lies in using identity testing as a filter to bypass symbolic complexity. However, limitations remain. The current framework only supports equalities ($LHS = RHS$) and does not yet model human-perceived difficulty, meaning some generated problems may be mathematically similar but pedagogically much harder. Future work aims to extend the system to inequalities and develop a more sophisticated model for difficulty assessment to better serve classroom needs.

Summary updated

BibTeX
@inproceedings{singh2012automatically,
  author = {Rohit Singh and Sumit Gulwani and Sriram K. Rajamani},
  title = {{Automatically Generating Algebra Problems}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2012},
  doi = {10.1609/aaai.v26i1.8341},
}
Figure