Wednesday, April 15, 2009

Decision Table

A major drawback of a decision tree is the lack of information in its format to tell us what other combinations of conditions to test. This is where the decision table is useful. A decision table is a table of contingencies for defining a problem and the actions to be taken. It is a single representation of the relationships between conditions and actions.1i

A decision tabl2 consists of two parts stub and entry. The stub part is
COMPUTE- DISCOUNT

Add up the number of copies per book title IF order is from bookstore
ELSE , (ORDER-SIZE is MINIMUM)

SO: no discount is allowed

ELSE (order is from libraries or individual customers

ORDER-SIZE is LARGE discount is 15%

ELSE IF ORDER-SIZE is MEDIUM discount is 10%

ELSE IF ORDER-SIZE is SMALL discount is 5%

ELSE SO:

10RDER-SIZE is MINIMUM) no discount is allowed
divided into an upper quadrant called the condition stub and a lower'­ quadrant called the action stub, The entry part is also divided into an upper quadrant called the condition entry and a lower quadrant called the action entry, The four elements and their definitions are summarized in
Customer' is bookstore? Y Y N N N N
Order-size 6 copies or more? Y N N N N N
IF Customer librarian or individual? Y Y Y Y
(condition) Order-size 50 copies or more'? Y N N N
Order-size 20-49 copies? Y N N
Order-size 6-19 copies? 'y N
,
Allow 25% discount X
THEN Allow 15% discount X
(action) Allow 10% discount X


Allow 5% discount X
No discount allowed. X X

Sets forth in -question form the condition that may exist

Indicates the appropriate action resulting from the answers to the conditions in the condition entry quadrant

an N to signify no, or a blank to show that the condition involved has not been tested. In the action entry quadrant, an X (or a check mark will do) indicates the response to the answer(s) entered in the condition entry quadrant. Furthermore, each column represents a decision or a rule. For example, rule 1 states:

IF customer is a bookstore and order size is 6 copies or more THEN allow 25% discount

So, according to the decision table, we have six decisions and therefore six rules A look at the table provides each decision (answer) immediately The following rules should be followed in constructing decision tables:

1. A decision should be given a name. shown in the top left of the table.
2. The logic of the decision table is independent of the sequence in which the condition rules are written, but the action takes place in the order in which the events occur.
3. Standardized language must be used consistently.
4. Duplication of terms 01" meanings should be eliminated, where possible.

No comments:

Post a Comment