Introduction
In the early 1970s, the field of Artificial Intelligence was grappling with the challenge of "Computer Understanding." While early systems like STUDENT and CARPS had successfully tackled algebra and calculus word problems, probability remained a formidable frontier. Probability problems are uniquely difficult because they require more than just mapping words to variables; they necessitate a deep understanding of outcome spaces, event relationships, and combinatorial logic.
In 1971, Jack P. Gelb developed HAPPINESS (Heuristic Analysis of Probability Problems In a Natural-language Environment with Symbolic Solutions), a LISP-based system designed to bridge this gap. HAPPINESS was capable of ingesting natural English descriptions of probability scenarios and generating step-by-step symbolic and numerical solutions.
System Architecture
The HAPPINESS system was built on a modular architecture designed to separate linguistic analysis from mathematical reasoning. This modularity allowed the system to handle the "messiness" of natural language while maintaining a rigorous mathematical engine.
As shown in the architecture diagram, the system is governed by a Driver module that coordinates between the Language Analyzer and the Solution Generator. The Language Analyzer utilizes a Semantic Dictionary to interpret input, while the Solution Generator relies on a Formula Dictionary to construct mathematical proofs.
The Language Analyzer and Semantic Representation
The first major hurdle for HAPPINESS was translating English sentences into a structured internal model. This was achieved through a multi-pass pipeline:
- Standardization: The system first cleaned the text, converting number words to digits and handling basic punctuation.
- Transformational Grammar: Complex sentences were broken down into simpler, declarative statements to reduce syntactic ambiguity.
- LL(1) Parsing: Using a specialized grammar and keyword scanning, the system identified the "objects" (e.g., coins, dice) and "events" (e.g., getting a head) described in the problem.
The output of this process was a "desclist" (description list)—a hierarchical tree structure that captured the semantic essence of the problem.
The desclist (Figure 2) illustrates how the system categorized information: the type of object (COIN), the number of trials (4), and the specific events (E1 and E2) with their associated qualifiers (e.g., "at least 2"). This representation allowed the system to reason about the problem space independently of the original English phrasing.
The Solution Generator: A Didactic Approach
Once the desclist was constructed, the Solution Generator took over. Gelb designed this component to be "didactic," meaning it aimed to show the logic of the solution rather than just providing a final number. The generator operated in four distinct stages:
- Stage 1: Symbolic Expansion. The system applied fundamental rules, such as the addition rule for "OR" events.
- Stage 2: Heuristic Analysis. The system performed checks to determine if events were mutually exclusive or independent, which dictated which formulas were applicable.
- Stage 3: Combinatorial Construction. The system built explicit formulas using combinations ($nCr$), permutations ($nPr$), and fractions.
- Stage 4: Numerical Evaluation. Finally, the symbolic formulas were evaluated to produce a fraction and a decimal result.
Key Insights and Results
One of the most significant features of HAPPINESS was its ability to handle nonsense words. By focusing on syntactic roles rather than a fixed dictionary of real-world objects, the system could solve a problem about "3 brakky werfels" just as easily as one about "3 red marbles." This proved that the system was performing structural reasoning rather than simple keyword matching.
The system's performance was remarkable for its time. Running on an IBM TSS/67, HAPPINESS solved standard textbook problems—such as multi-stage coin tosses and sampling without replacement—in approximately 1.3 to 1.8 seconds.
Limitations and Legacy
Despite its success, HAPPINESS had limitations. Its LL(1) grammar was somewhat rigid, requiring manual updates to handle new sentence structures. Furthermore, while it could solve numerical problems, it lacked a general theorem-prover for theoretical probability proofs.
Nevertheless, HAPPINESS represented a significant leap in AI. It demonstrated that by combining heuristic language analysis with symbolic mathematical modeling, computers could begin to "understand" and solve complex, event-based problems that previously required human intuition.
Summary updated