Skip to main content

Writing rules and facts, certainty factors and decision trees for an expert system: HSC Enterprise Computing Intelligent Systems

Syllabus dot point

“Develop a set of rules and facts that could be used within an expert system to draw conclusions; apply certainty factors to construct a decision tree for a proposed expert system; use a flowchart to develop a knowledge base of IF-THEN rules to be used by an expert system; explain how expert systems contribute to the efficiency of intelligent systems, including supercomputers, digital assistants, autonomous vehicles and streaming services”

HSCEnterprise ComputingIntelligent Systems9 min read

Quick answer

Build an expert system by writing facts and IF-THEN rules, turning each flowchart path into a rule, and drawing a decision tree with certainty factors at its leaves. Multiply rule and evidence certainties, use the lowest for AND conditions, and combine supporting rules with a+b(1−a)a + b(1 - a). Expert systems make supercomputers, digital assistants, autonomous vehicles and streaming services more efficient by automating well-defined decisions.

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Practice questions

What this dot point is asking

These are practical skills. You need to write facts and rules, turn a flowchart into IF-THEN rules, attach certainty factors to a decision tree, and explain how expert systems make well-known intelligent systems more efficient.

The answer

Facts and rules

  • Facts describe the current case: "Temperature = 38.5", "Rash = yes".
  • Rules (production rules) encode expert knowledge: IF condition(s) THEN conclusion. Conditions can be combined with AND, OR and NOT.
  • Rules should be specific, consistent (no two rules contradicting for the same facts) and complete enough to cover likely cases, with a default conclusion when nothing matches.

From flowchart to knowledge base

  1. Draw a flowchart of the expert's decision process (decisions as diamonds, conclusions as terminals).
  2. Trace every path from the start to each conclusion.
  3. Write one IF-THEN rule per path: the decisions on the path become the IF conditions joined by AND; the terminal becomes the THEN conclusion.
  4. Check for gaps and contradictions, and test the rules against real cases.

Certainty factors and decision trees

Experts are rarely 100% sure. A certainty factor (CF) expresses confidence in a conclusion, commonly on a scale from 0 (no confidence) to 1 (certain), or as a percentage. Some systems use -1 to +1 to allow evidence against a conclusion.

A decision tree lays out the questions (nodes), answers (branches) and conclusions (leaves), with a CF at each leaf. It is easy to read, easy to convert into rules, and shows where more evidence would raise confidence.

CF(conclusion)=CF(rule)×CF(evidence)\text{CF(conclusion)} = \text{CF(rule)} \times \text{CF(evidence)}

A simple approach used in many expert systems (based on the MYCIN system):

  • If the evidence is uncertain, multiply the rule's CF by the evidence CF.
  • If the IF part has AND conditions, use the lowest evidence CF; for OR conditions, use the highest.
  • If two rules support the same conclusion with positive CFs aa and bb, combine them as a+b(1−a)a + b(1 - a).
Worked example

A lawn care expert system. Rule R1: IF brown patches AND grubs found THEN beetle larvae damage (CF 0.9). The user is sure about brown patches (CF 1.0) but only fairly sure grubs were found (CF 0.6).

  1. AND conditions: take the lower evidence CF, 0.6.
  2. Conclusion CF = 0.9 times 0.6 = 0.54.
  3. A second rule R2: IF birds digging in lawn THEN beetle larvae damage (CF 0.5), and the user is certain birds are digging (CF 1.0), giving 0.5.
  4. Combine: 0.54+0.5×(1−0.54)=0.54+0.23=0.770.54 + 0.5 \times (1 - 0.54) = 0.54 + 0.23 = 0.77.
  5. Output: "Beetle larvae damage is likely (certainty 0.77). Check under the turf to confirm."

How expert systems contribute to efficiency

  • Supercomputers: rule-based schedulers allocate jobs, processors and cooling to maximise use and minimise energy.
  • Digital assistants: map recognised requests to actions, ask for missing information and apply user preferences, completing tasks in seconds.
  • Autonomous vehicles: encoded road rules and safety constraints guide split-second decisions alongside machine learning perception.
  • Streaming services: rules and learned preferences drive recommendations and adaptive streaming quality, reducing search time and buffering.
Common traps
Writing rules without clear conditions
"IF it looks bad THEN problem" cannot be tested.
Adding CFs together
Use the combination formula, or the result could exceed 1.
Leaving CFs off decision tree leaves
The question asks you to apply them.

Practice questions

Original practice questions graded from foundation to exam level, each with a full worked solution. Try them before revealing the solution.

foundation3 marks
Write two facts and two IF-THEN rules for an expert system that advises whether a student needs a jacket.
Show worked solution →

Facts: the temperature is 12 degrees; rain is forecast.

Rules:

  • R1: IF temperature is below 15 degrees THEN wear a warm jacket.
  • R2: IF rain is forecast THEN take a waterproof jacket.

From these facts, both rules fire: advise a warm, waterproof jacket.

Marking guide: 1 mark for two valid facts, 1 mark per valid rule (2 marks).

core5 marks
A bike shop expert system diagnoses a flat tyre. Construct a decision tree with certainty factors using these expert estimates: if the tyre deflates overnight, a slow puncture is the cause with certainty 0.7, otherwise a valve fault with certainty 0.3. If the tyre deflates within minutes, a large puncture is the cause with certainty 0.9. If there is visible damage on the tyre with a slow deflation, the certainty of a slow puncture rises to 0.95.
Show worked solution →

Decision tree.

  • Node 1: How fast does the tyre deflate?
    • Within minutes: Large puncture (CF 0.9)
    • Overnight: Node 2: Is there visible damage on the tyre?
      • Yes: Slow puncture (CF 0.95)
      • No: Slow puncture (CF 0.7) or Valve fault (CF 0.3), so the system suggests checking the tyre in water first, then the valve.

Knowledge base rules.

  • R1: IF deflation = minutes THEN large puncture (CF 0.9)
  • R2: IF deflation = overnight AND damage = yes THEN slow puncture (CF 0.95)
  • R3: IF deflation = overnight AND damage = no THEN slow puncture (CF 0.7)
  • R4: IF deflation = overnight AND damage = no THEN valve fault (CF 0.3)

Marking guide: 2 marks for a correct tree structure, 2 marks for correct certainty factors at leaves, 1 mark for matching rules.

exam6 marks
Explain how expert systems contribute to the efficiency of two of the following: supercomputers, digital assistants, autonomous vehicles, streaming services.
Show worked solution →

Autonomous vehicles. Rule-based layers encode road rules and safety constraints (IF pedestrian detected in path THEN brake), working alongside machine learning perception. Encoded rules let the vehicle make safe, predictable decisions in milliseconds without human input, improving traffic flow and reducing accidents caused by human reaction time. Rules also make behaviour easier to verify and explain.

Digital assistants. Expert-system logic maps recognised intents to actions (IF intent = set reminder AND time given THEN create reminder), asks follow-up questions when facts are missing (similar to backward chaining) and uses stored user preferences. This completes tasks in seconds that would otherwise take several manual steps, and handles millions of users without human operators.

(Supercomputers: expert systems schedule jobs and allocate processors and energy efficiently. Streaming services: rules and learned preferences choose recommendations and adapt video quality to bandwidth.)

Marking guide: 3 marks per system: how expert-system reasoning is used (2 marks) and the efficiency gained (1 mark).

Practise this

Sources & how we know this

ExamExplained