DiscreteSolver
Type a combinatorics word problem; get the operation, the formula and the answer.
- 2026
- Collaboration · Machine learning

The problem
Combinatorics word problems are easy to misread: the difference between a permutation and a combination is often one word. DiscreteSolver classifies the question first, then shows the formula it used, so the answer can be checked.
How it works
- AskPlain-English question
- ClassifyTF-IDF + linear SVM
- Extractn and r by regex
- SolveFormula
- ShowRendered with KaTeX
A small Flask app. The operation is decided before any numbers are read: the classifier picks it from the wording, a parser then pulls out n and r, and the formula is shown next to the answer — so a misread question shows up in the working instead of hiding behind a number.
What it does
- Classify
A TF-IDF and linear support-vector classifier, trained on a labelled set of word problems, picks one of six operations.
- Extract
A regex parser pulls out n and r, including number words like “five”.
- Show the working
The result is rendered with KaTeX: operation, formula and value.
Built with
- Python
- Flask
- scikit-learn
- pytest
- KaTeX
- Docker