Sie sind auf Seite 1von 48

DECISION TABLES

A Decision Table format

Condition Stub Condition Entry

Action Stub Action Entry


Decision Table types

Based on Entries ::
Extended Entry
Limited Entry
Mixed Entry

Based on Tables ::
Go To Table
Else Table
1. Extended Entry

R1 R2 R3 R4 R5 R6

Product Code : C1 1 1 1 1 1 2

Customer Code : C2 A B A B C -

<= <= > >


Order Amount : C3 - -
500 500 500 500

Discount (in %) 5 7.5 7.5 10 6 5


2. Limited Entry

R1 R2 R3 R4 R5 R6

Product Code = 1 : C1 Y Y Y Y Y N

Customer Code =A : C2 Y - Y - - -

Customer Code =B : C3 - Y - Y - -

Customer Code =C : C4 - - - - Y -

Order Amount <=500 : C5 Y Y N N - -

Discount 5% :A1 X X

Discount 6% :A2 X

Discount 7.5% :A3 X X

Discount 10% :A4 X


3. Mixed Entry

R1 R2 R3 R4 R5 R6

Product Code = 1 : C1 Y Y Y Y Y N

Customer Code : C2 A B A B C -

Order Amount <=500 : C5 Y Y N N - -

Discount in % 5 7.5 7.5 10 6 5


Go To Decision Table ---- Else Decision Table

Condition Stub Condition Entry

ELSE
Action Stub Action Entry

GO TO Table 3.2
CASE

The discounts offered by a bookseller

a. to a library
greater than 30 books :: discount =20%
less than or equal to 30 books ::discount =15%

b. to an individual
greater than 15 books :: discount =15%
above 10 and less than or equal to 15 books ::dis =10%
less than or equal to 10 books ::discount =5%
R1 R2 R3 R4 R5

Library : C1 Y Y N N N

Books >30 : C2 Y N

Books >15 : C3 Y N

10< Books<=15 : C4 Y N

Discount 20% :A1 X

Discount 15% :A2 X X

Discount 10% :A3 X

Discount 5% :A4 X
Decision Table

3 THINGS TO BE CHECKED WHILE FRAMING A


DECISION TABLE

THUMB RULES

1. Completeness

2. Ambiguity Multiplicity of specification

3. Logically Possible / Impossible


Decision Table

1. Completeness

n
A Decision Table is complete when it has (2 )
number of rules R i.e. R1, R2 . .
where n= no of conditions
Decision Table

2. Ambiguity Multiplicity of specification

For the same set of rules ..

When same actions are stated ..


Then it is said to have multiplicity of
specifications.. One rule to be removed

When two different actions are stated ..


Then it is said to be ambiguous ..
Interact with client and sort it out
Decision Table

3. Logically Possible / Impossible


A simple case

In a stock issue problem

When x > 60 take action A1


When x < 40 take action A2

Prepare a Limited Entry Decision Table


A case

R1 R2

X > 60 Y -

X < 40 - Y

A1 X -

A2 - X

Is the Decision Table Complete ?


When are replaced by YES & NO

We get EXPANDED DECISION TABLE


Expanded Decision Table

R1 R2 R3 R4

X > 60 Y Y Y N

X < 40 Y N Y Y

A1 X X - -

A2 - - A2 A2
Expanded Decision Table

R1 R2 R3 R4

X > 60 : C1 Y Y Y N

X < 40 : C2 Y N Y Y

A1 X X - -

A2 - - X X

Now check for the three Thumb Rules


Expanded Decision Table

n
1. Completeness (2 ) =
for 2 conditions : C1, C2
2
2 = 4 Rules .. So the DT Complete

R1 R2 R3 R4

X > 60 : C1 Y Y Y N

X < 40 : C2 Y N Y Y

A1 A1 A1 - -

A2 - - A2 A2
Expanded Decision Table

2. Ambiguity Multiplicity of specification


R1 and R3 same rules..
but the action to be taken is different ?

R1 R2 R3 R4

X > 60 : C1 Y Y Y N

X < 40 : C2 Y N Y Y

A1 X A1 - -

A2 - - X A2
Expanded Decision Table

2. Ambiguity Multiplicity of specification


Hence after interaction with clients,
one rule is removed..
In this case.. R3 is removed

R1 R2 R3 R4

X > 60 : C1 Y Y N

X < 40 : C2 Y N Y

A1 X X -

A2 - - X

Now we find the DT has again become incomplete


Expanded Decision Table

R1 R2 R3 R4

X > 60 : C1 Y Y N

X < 40 : C2 Y N Y

A1 X X -

A2 - - X

Hence the missing rule is

N N
Expanded Decision Table

R1 R2 R3 R4

X > 60 : C1 Y Y N N

X < 40 : C2 Y N N Y

A1 X X - -

A2 - - X X

Let us assume the action taken is A2


Expanded Decision Table

3. Logically Possible / Impossible

R1 R2 R3 R4

X > 60 : C1 Y Y N N

X < 40 : C2 Y N N Y

A1 X X - -

A2 - - X X

Check for Logic


It is found that one rule is logically impossible
It is Rule 1 R1 .. i.e. at the same time
X >60 and X < 40 is logically not possible..
Hence R1 is removed from further analysis
Final Decision Table

R1 R2 R3 R4

X > 60 : C1 Y N N

X < 40 : C2 N N Y

A1 X - -

A2 - X X

The final DT is
Complete
Non Ambiguous
Logically possible

Can proceed for further analysis


Decision Table: Installment payment Case

R1 R2 R3 R4 R5 R6

C1: Payment in Current month > Y N N - - -


minimum specified payment
C2 : Payment in Current month > 0 - Y Y - N N

C3 : Any payment in last 3 months - - - N Y Y

C4 : Actual Arrears > 3 (Minimum - Y N Y N Y


Specified payment per month)
A1 : Send Letter A X - - - - -

A2 : Send Letter B - X - - - -

A3 : Send Letter C - - X - - -

A4 : Send Letter D - - - X - X

A5 : Send Letter E - - - - X -
To check for the thumb rules and to arrive at a minimum
number of rule based Decision Table..
We use the process called

KARNAUGH MAPPING
Now check for thumb Rules

1. Completeness :: If all cells are filled.. Then completeness is


established So the empty cell has to be filled after interacting
and identifying a decision from the client.. In this case, we
assume presently it is Action A4

C1C2 NN NY YY YN

C3C4

NN A3 A1 A1

NY A4 A2 A4 A1 A4 A1 A4

YY A4 A2 A1 A1 A4

YN A5 A3 A1 A1 A5
Now check for thumb Rules

1. Complete

C1C2 NN NY YY YN

C3C4

NN A4 A3 A1 A1

NY A4 A2 A4 A1 A4 A1 A4

YY A4 A2 A1 A1 A4

YN A5 A3 A1 A1 A5
Now check for thumb Rules

2. Ambiguity :: Several cells have multiple actions for the same


Rules.. Again interact with client and decide on one Action

C1C2 NN NY YY YN

C3C4

NN A4 A3 A1 A1

NY A4 A2 A4 A1 A4 A1 A4

YY A4 A2 A1 A1 A4

YN A5 A3 A1 A1 A5
Now check for thumb Rules

2. Ambiguity

C1C2 NN NY YY YN

C3C4

NN A4 A3 A1 A1

NY A4 A4 A4 A4

YY A4 A2 A1 A4

YN A5 A3 A1 A5
Now check for thumb Rules

3. Logically Possible / Impossible :: ?

C1=Y; C2=N Logically impossible

C1C2 NN NY YY YN

C3C4

NN A4 A3 A1 A1

NY A4 A4 A4 A4

YY A4 A2 A1 A4

YN A5 A3 A1 A5
Now check for thumb Rules

3. Logically Possible / Impossible :: ?

C1=Y; C2=N Logically impossible

C1C2 NN NY YY YN

C3C4

NN A4 A3 A1 A1

NY A4 A4 A4 A4

YY A4 A2 A1 A1

YN A5 A3 A1 A1
The Decision Table will now be

having 12 Rules
CAN IT BE FURTHER REDUCED ?

C1C2 NN NY YY YN

C3C4

NN A4 A3 A1

NY A4 A4 A4

YY A4 A2 A1

YN A5 A3 A1
Karnaugh Mapping

We use Boolean algebra to check if any further reductions


in Rules are possible
The symbol . (dot) denotes a boolean AND operator, + the
OR operator, and (bar) above the variable, a NOT
operator

1 .A = A
A+A = 1
Karnaugh Mapping

Treat this table as a cylinder with edges attached to each


other and map 2 cells, 4 cells, 8 cells etc..
Let us assume we are mapping the following A1 cells

C1C2 NN NY YY YN

C3C4

NN A4 A3 A1

NY A4 A4 A4

YY A4 A2 A1

YN A5 A3 A1
Karnaugh Mapping

Treat this table as a cylinder with edges attached to each


other and map 2 cells, 4 cells, 8 cells etc..
Let us assume we are mapping the following A1 cells

C1C2 NN NY YY YN

C3C4

NN A4 A3 A1

NY A4 A4 A4

YY A4 A2 A1

YN A5 A3 A1
The Decision Table.. Inserting the first rule

R1

C1 Y

C2 -

C3 Y

C4 -

ACTION A1
Karnaugh Mapping

For ACTION A1 second loop

C1C2 NN NY YY YN

C3C4

NN A4 A3 A1

NY A4 A4 A4

YY A4 A2 A1

YN A5 A3 A1
C1C2 NN NY YY YN

C3C4

NN A4 A3 A1

NY A4 A4 A4

YY A4 A2 A1

YN A5 A3 A1
The Decision Table.. Inserting the second rule

R1 R2

C1 Y Y

C2 - -

C3 Y -

C4 - N

ACTION A1 A1
Rule 3 ::
Action A2 :: C1 =N; C2=Y; C3=Y; C4=Y
(no reduction possible)

R1 R2 R3

C1 Y Y N

C2 - - Y

C3 Y - Y

C4 - N Y

ACTION A1 A1 A2
Hence Rule 4 is C1=N; C2=Y; C4=N

C1C2 NN NY YY YN

C3C4

NN A4 A3 A1

NY A4 A4 A4

YY A4 A2 A1

YN A5 A3 A1
The Decision Table.. Inserting the FOURTH rule

R1 R2 R3 R4
C1 Y Y N N

C2 - - Y Y

C3 Y - Y -

C4 - N Y N

ACTION A1 A1 A2 A3
Mapping for Action 4

C1C2 NN NY YY YN

C3C4

NN A4 A3 A1 A4

NY A4 A4 A4 A4

YY A4 A2 A1 A4

YN A5 A3 A1 A4

A4 => Rule 5= - - NY;


Rule 6 = - NNN;
Rule 7 = - NYY;
The Decision Table..

Now filling for Action A4

R1 R2 R3 R4 R5 R6 R7
C1 Y Y N N - - -

C2 - - Y Y - N N

C3 Y - Y - N N Y

C4 - N Y N Y N Y

ACTION A1 A1 A2 A3 A4 A4 A4
Mapping for Action 4

C1C2 NN NY YY YN

C3C4

NN A4 A3 A1 A4

NY A4 A4 A4 A4

YY A4 A2 A1 A4

YN A5 A3 A1 A5

A5 => Rule 8= - NYN;


The Decision Table..

filling for Action A5.. we get

R1 R2 R3 R4 R5 R6 R7 R8
C1 Y Y N N - - - -

C2 - - Y Y - N N N

C3 Y - Y - N N Y Y

C4 - N Y N Y N Y N

ACTION A1 A1 A2 A3 A4 A4 A4 A5

We started with 16 Rules.. Now we have ended with 8 Rules


using K map

Das könnte Ihnen auch gefallen