Decision Tables - a brief overview

Index
 Definition
 Structure  Steps to build a decision table  Example  Solution to the example  Exercises

catalyst.com/products/logicgem/overview. using flowcharts and traditional narratives. and the United States Air Force worked on a complex file maintenance project. It was not until 1958. they spend six labor-years of effort but failed to define the problem. successfully defined the problem in less than four weeks 1. _____________________________________ 1Taken from “A History of Decision Tables” located at http://www.html .Decision Tables In the 50's General Electric. when four analysts using decision tables. the Sutherland Corporation.

To understand complex logic expressed in traditional narrative form.Definition Tables represent an easy way for humans to read. . etc. . . understand and execute complex procedures. A decision table is a useful tool that allows us: .To check for inconsistencies verifying that every possibility was considered in the solution.To present decision procedures in a clear tabular form. particular policies.

etc. results.Structure A decision table is typically divided in four areas: Condition Alternatives Action Entries Conditions Actions The conditions are decisions that depending on their values. . Actions (effects. define different states of affairs in the problem.) are operations or values that will be determined by particular circumstances.

All possible combinations <cond-1> <cond-2> F F F T F F F T F T T F F F T … F F F F X X X X … X X X F X X X F F X X X F … T X X T F T F T T T T T … … … T T T Conditions <cond-3> … <cond-n> <action-1> <action-2> Actions <action-3> … <action-m> Actions per combination (each column represents a different state of affairs) .

Fill all combinations in the table. Analyze column by column to determine which actions are appropriate for each combination. 3. Calculate the space of combinations. List all the conditions which determine which action to take.Steps to create a decision table 1. Reduce the table by eliminating redundant columns. . 5. 2. 4.

) _____________________________________ 2 Example taken form: Structured Analysis and System Specification. We charge for cocktails on all domestic flights. we serve free cocktails unless it is a domestic flight. for all the ones where we serve cocktails. 1979.. Tom de Marco. . New York. Yourdon inc. (Cocktails are only served on flights that are more than half-full. that is.Example  Policy for charging charter flight costumers for certain in-flight services:2 If the flight is more than half-full and costs more than $350 per seat.

No (N) Y. N Is it a domestic flight? Y.List all the conditions that determine which action to take. N . Conditions The flight more than halffull? Cost is more than $350? Values Yes (Y).

Calculate the space of combinations Conditions 1 2 3 Number of Combinations 2 4 8 Y N Y N Y Y Y N Y Y Y Y Possible Combinations Y N Y N Y N N N N Y Y Y N N Y N Y N N N N N … … n 2n .

g. e. 3*2*2*2=24 _____________________________________ 1 Taken from Mariel de Wilde’s Decision Table Training Session .Calculate the space of combinations1 Number of Values to the power of the number of conditions with these values  If all conditions are simply Y/N values: 2number of conditions  If 1 condition with 3 values and 3 with 2: 31 * 23 = 24  Or. use the values per condition and multiply each value down the column.

hence we have: All combinations are 23 = 8 .Calculate the space of combinations Conditions in the example are 3 and all are two-valued ones.

Fill all combinations in the table. POSSIBLE COMBINATIONS more than halffull CONDITONS more than $350 per seat domestic flight ACTIONS N N N N Y Y Y Y N N Y Y N N Y Y N Y N Y N Y N Y .

Analyze column by column to determine which actions are appropriate for each combination POSSIBLE COMBINATIONS more than halffull CONDITONS N N N N Y Y Y Y more than $350 per seat domestic flight N N Y Y N N Y Y N Y N Y N X Y X N X X Y X ACTIONS serve cocktails free .

POSSIBLE COMBINATIONS more than halffull CONDITONS N N N N Y Y Y Y Note that some columns are identical but by one condition.Reduce the table by eliminating redundant columns. more than $350 per seat domestic flight N N Y Y N N Y Y N Y N Y N X Y X N X X Y X ACTIONS serve cocktails free .

Which means that actions are independent from the value of that particular condition. more than $350 per seat domestic flight N N Y Y N N Y Y N Y N Y N X Y X N X X Y X ACTIONS serve cocktails free .Reduce the table by eliminating redundant columns. POSSIBLE COMBINATIONS more than halffull CONDITONS N N N N Y Y Y Y Note that some columns are identical but by one condition.

Reduce the table by eliminating redundant columns. POSSIBLE COMBINATIONS more than halffull CONDITONS N N N N Y Y Y Y Note that some columns are identical but by one condition. Hence. Which means that actions are independent from the value of that particular condition. the table can be simplified. more than $350 per seat domestic flight N N Y Y N N Y Y N Y N Y N X Y X N X X Y X ACTIONS serve cocktails free .

Reduce the table by eliminating redundant columns. POSSIBLE COMBINATIONS more than halffull CONDITONS N N N Y Y Y Y First we combine the yellow ones nullifying the condition. more than $350 per seat domestic flight N Y Y N N Y Y - N Y N X Y X N X X Y X ACTIONS serve cocktails free .

Then the red ones.Reduce the table by eliminating redundant columns. POSSIBLE COMBINATIONS more than halffull CONDITONS N N Y Y Y Y First we combine the yellow ones nullifying the condition. more than $350 per seat domestic flight N Y N N Y Y - - N X Y X N X X Y X ACTIONS serve cocktails free .

more than $350 per seat domestic flight N Y N N Y Y - - N X Y X N X X Y X Notice that yellow and red columns are identical but by one condition. POSSIBLE COMBINATIONS more than halffull CONDITONS N N Y Y Y Y First we combine the yellow ones nullifying the condition.Reduce the table by eliminating redundant columns. ACTIONS serve cocktails free . Then the red ones.

Then the red ones. So. we combine them. ACTIONS serve cocktails free .Reduce the table by eliminating redundant columns. more than $350 per seat domestic flight - N N Y Y - N X Y X N X X Y X Notice that yellow and red columns are identical but by one condition. POSSIBLE COMBINATIONS more than halffull CONDITONS N Y Y Y Y First we combine the yellow ones nullifying the condition.

POSSIBLE COMBINATIONS more than halffull CONDITONS more than $350 per seat domestic flight ACTIONS serve cocktails free N Y Y Y First we combine the yellow ones nullifying the condition. So. Then we combine the violet colored ones. - N Y Y - X N X X Y X Notice that yellow and red columns are identical but by one condition.Reduce the table by eliminating redundant columns. . Then the red ones. we combine them.

POSSIBLE COMBINATIONS more than halffull CONDITONS more than $350 per seat domestic flight ACTIONS serve cocktails free N Y Y Y Notice that even when we observe that the green columns seem to be identical but by one condition. - N Y Y - X N X X Y X .Reduce the table by eliminating redundant columns.

POSSIBLE COMBINATIONS more than halffull CONDITONS more than $350 per seat domestic flight ACTIONS serve cocktails free N Y Y Y Notice that even when we observe that the green columns are identical but by one condition. It is not the same a “NULIFYIED” condition than a valued one.Reduce the table by eliminating redundant columns. - N Y Y - X N X X Y X .

POSSIBLE COMBINATIONS more than halffull CONDITONS more than $350 per seat domestic flight ACTIONS serve cocktails free N Y Y Y Notice that even when we observe that the green columns are identical but by one condition.Reduce the table by eliminating redundant columns. - N Y Y - X N X X Y X . DO NOT OVERSIMPLIFY THE TABLE OR IT WILL GET REDUNDANT. BE CAREFUL. It is not the same a “NULIFYIED” condition than a valued one.

Final solution4 Combinations more than half-full CONDITONS N Y Y Y more than $350 per seat - N Y Y domestic flight ACTIONS serve cocktails free - X N X X Y X _____________________________________ 4 In previous steps. other combinations were possible that if followed would have led to different but equivalent solution tables. .

_____________________________________ 3 Example taken form: Structured Analysis and System Specification. and $50 for scouts who have been members longer than two years. and $20 if he has attained the rank of Lion – unless he does it in his first year. $15 if he has attained the rank of Bear. . in which case he receives $70. $35 for second-year members.. In addition to this base. each scout gets an extra subsidy of $10 if he has attained the rank of Wolf. New York. Tom de Marco.Exercises  Subsidy policy for the cub scout pack3: The subsidy to the cub scout pack is based on number of scouts. Yourdon inc. rank. and length of membership. 1979. The subsidy for each scout is $25 for first-year members.

_____________________________________ 1 Taken from Mariel de Wilde’s Decision Table Training Session . The content is different for different types of customers. who get a special letter. The content of the mailing is about the current level of discounting and potential levels of discounting.Exercises  Specify the following policy using a decision table: 1 A mailing is to be sent out to customers. B and C get a normal letter except Customer Type C. Any customer with 2 or more current lines or with a credit rating of ‘X’ get a special paragraph added with an offer to subscribe to another level of discounting. Customer Types A.