Computer Science
Decision Tables

Decision tables are used to model logic by observing all of the possible conditions and outcomes that can occur.

Imagine that we want to model a person's entitlement to benefits during a period of unemployment. If the person is not 18 or over, they get no entitlement, if they are, they get benefits if they have savings of less than £10000.

We can write this logic out as follows,

If Age >= 18 And Savings < £10000
   Then Output "Entitled"
   Else Output "Not Entitled"

The corresponding decision table for this scenario is as follows,

ConditionsAge >= 18YYNN
Savings < £10000YNYN
ActionsOutput "Entitled"x
Output "Not Entitled"xxx

Y & N are used to indicate the possible outcomes of the conditions. An X indicates the action that results from each combination of outcomes.

The pattern of Ys & Ns in the table is predictable. Look at what happens if we add a third condition to the table.

If Age >= 18 And Savings < £10000 And Out_Of_Work = True
   Then Output "Entitled"
   Else Output "Not Entitled"
ConditionsAge >= 18YYYYNNNN
Savings < £10000YYNNYYNN
Out_Of_Work = trueYNYNYNYN
ActionsOutput "Entitled"X
Output "Not Entitled"XXXXXXX