Вы находитесь на странице: 1из 15

Decision Tables

A Decision table is a table of rows and columns, separated into four quadrants and is designed to illustrate complex decision rules
Done by: mahmoud abu dagga

Condition Stub upper left quadrant Rules Stub upper right quadrant Action Stub bottom left quadrant Entries Stub - bottom right quadrant

Decisionfor presentingLayout Table decision tables. Standard format used


Done by: mahmoud abu dagga

Decision Stub Action Stub

Rules Stub Entries Stub

Decision Table Example

Like Boss? 20% Pay Raise? Stay Another Year Quit after 2 Months Quit next Week

Done by: mahmoud abu dagga

1 Y Y X

2 3 4 Y N N N Y N X X X

Done by: mahmoud abu dagga

Process requires the determination of the number of conditions (inputs) that affect the decision. The set of possible actions (outputs) must likewise be determined The number of rules is computed Each rule must specify one or more actions

Developing Decision Tables

Number of Rules

Each condition generally has two possible alternatives (outcomes): Yes or No


Done by: mahmoud abu dagga

In more advanced tables, multiple outcomes for each condition are permitted

The total number of rules is equal to 2 no. of conditions Thus, if there are four conditions, there will be sixteen possible rules

Building the Table


For each rule, select the appropriate action and indicate with an X Identify rules that produce the same actions and attempt to combine those rules; for example:
Done by: mahmoud abu dagga

Condition 1 Condition 2 Action 1

Y Y Y N

Condition 1 Y Condition 2 X X Action 1 X

Cleaning Things Up
Check the table for any impossible situations, contradictions, and redundancies and eliminate such rules Rewrite the decision table with the most reduced set of rules; rearranging the rule order is permissible if it improves user understanding

Done by: mahmoud abu dagga

Decision Table example: combine and reduce


Conditions and Actions Order from Fall Catalog Order from Christmas Catalog Order from Special Catalog Mail Christmas Catalog Mail Special Catalog Mail Both Catalogs 1 Y Y Y 2 Y Y N X 3 Y N Y X X X 4 Y N N X 5 N Y Y 6 N Y N X 7 N N Y X 8 N N N X

The four gray columns can be combined into a single rule. Note that four each, there was NO order placed from the Special Catalog.

In addition, Rules 1&5 and Rules 3&7 can be combined. Each pair produces the same action and each pair shares two common conditions.

Done by: mahmoud abu dagga

Decision Table example ~ Final Version


Conditions and Actions Order from Fall Catalog Order from Christmas Catalog Order from Special Catalog Mail Christmas Catalog Mail Special Catalog Mail Both Catalogs 1 2 3
Done by: mahmoud abu dagga

-- -- -Y -- N Y N Y X X X

Eliminates the need to check for every possible case.

Decision Table example:


checking for completeness and accuracy
Conditions and Actions Salary > $50,000 per year Salary < $2,000 per month Award Double Bonus Award Regular Bonus Award no Bonus 1 Y Y 2 Y N X 3 N Y X X 4 N N

Although the Y-N Combinations suggest a rule, in this case, it is impossible for conditions 1 & 2 to exist simultaneously. They are in complete contradiction with each other. In the final version of the table, Rule 1 will disappear and Rules -4 will become Rules 1-3.

Done by: mahmoud abu dagga

Decision Tables and Membership Tables


Conditions and Actions
Condition 1 Condition 2 Condition 3 Action 1 Action 2 Action 3

Rules
12345678

Y Y Y Y N N NN Y Y N N Y Y NN Y N Y N Y N YN
X X X XX X XX

Sets A B Y Y Y N N Y N N

Operations AB AB Y Y Y N Y N N N

Done by: mahmoud abu dagga

Importance of Decision Tables


Aids in the analysis of structured decisions Ensures completeness Checks for possible errors (impossible situations, contradictions, and redundancies, etc.) Reduces the amount of condition testing that must be done

Done by: mahmoud abu dagga

Decision Trees
Decision trees are useful when multiple branching occurs in a structured decision process, although they can be quite effective when only two decision paths are called for. They are helpful when necessary to maintain a certain order for a series of decisions.

Done by: mahmoud abu dagga

Drawing Decision Trees


Drawn horizontally Root of tree is to the left side Square Nodes indicate actions Circle Nodes represent possible conditions Circle is analogous to the condition part of an IF statement Square is analogous to the consequent of an IF statement (the THEN part) IF Circle THEN Square

Done by: mahmoud abu dagga

Decision Tree Example


4
2
denotes end of action
Done by: mahmoud abu dagga

Ring up sale

Look up card in book

1 6 3 7

Call supervisor for approval

Call bank for approval

Вам также может понравиться