Decision Table Examples

To differentiate between conditions and actions, I have put the conditions in regular font and the actions in italics.

Example #1: Assume that we are processing the harvest of corn. If the corn is ripe and contains no bugs at the top then the corn is sold individually. If the corn is ripe and contains bugs at the top, then the bugs are cut off and the corn is put in a bag to sell. If the corn is not ripe it is boxed for cattle.

 

 

 

Corn processing

1

2

3

4

1

Ripe

Y

Y

N

N

2

Bugs at top

Y

N

Y

N

1

Sold individually

 

X

   

2

Bagged

X

     

3

Boxed for cattle

   

X

X

 

 

Corn processing

1

2

3 - 4

1

Ripe

Y

Y

N

2

Bugs at top

Y

N

0

1

Sold individually

 

X

 

2

Bagged

X

   

3

Boxed for cattle

   

X

 

Example #2: Passengers who have average more than 100,000 miles per year and have been customer for over 5 years and pay cash for their tickets are entitled to receive a free ticket to Europe or South America. Passengers who average more than 100,000 miles and have been customers for over 5 years but do not pay cash get a free ticket to anywhere in the US. Passengers who fly 100,000 miles or under and have been customers for over 5 years get a $200 coupon.

 

 

Flying

1

2

3

4

5

6

7

8

1

> 5 yrs

Y

Y

Y

Y

N

N

N

N

2

> 100000

Y

Y

N

N

Y

Y

N

N

3

Pay cash

Y

N

Y

N

Y

N

Y

N

1

Ticket Eur or SoAmer

X

2

Ticket US

 

X

           

3

$200 coupon

   

X

X

       

4

No bonus

       

X

X

X

X

I can now consolidate rule 3 and rule 4 since they have a different condition 3 but the same actions. I can also consolidate 5 and 6 because they have the same condition for the first 2 but a different answer for condition 3 but result in the same action. The same applies to 7 and 8.

 

 

Flying

1

2

3-4

5-6

7-8

1

> 5 yrs

Y

Y

Y

N

N

2

> 100000

Y

Y

N

Y

N

3

Pay Cash

Y

N

-

-

-

1

Ticket Eur or SoAmer

X

       

2

Ticket US

 

X

     

3

200 coupon

   

X

   

4

No bonus

     

X

X

I can now consolidate 5-6 and 7-8 because they have the same answer to the first condition, different answers to the second condition. The third condition is now null so it does not count and the results are the same. That means that condition two does not matter.

 

Flying

1

2

3-4

5-8

1

> 5yrs

Y

Y

Y

N

2

> 100000

Y

Y

N

-

3

Pay Cash

Y

N

-

-

1

Ticket Eur or SoAmer

X

     

2

Ticket US

 

X

   

3

200 coupon

   

X

 

4

No bonus

     

X

In this example I have now combined 5-8 which says if not over 5 years there is no bonus. In other words if not over 5 yrs, I do not care about the miles or how you pay.

Example #3: Students attended the college are either degree candidates, certificate candidates or non degree students. If a student is a degree candidate they must take two semesters of English during their first year, two semesters of history during their first year, and during their second year they must take a semester of science, a semester of math, a semester of economics and a semester of speech. If a student is a certificate candidate they must take a semester of English during their first year and a semester of computer literacy during their second year. Non-degree/non-certificate candidates may register in any courses they want to.

In analyzing this problem, it is clear that there are too many conditions to put all in one decision table. Therefore, I am going to have an original table that asks what type of student the person is and deals with the non-degree/non-certificate candidates. Then I am going to send the degree candidates to one table and the certificate candidates to another table.

Note that with these three categories, a student has to be in one of the categories. That means I only have two ask two questions. I am going to ask the degree question and the certificate question. If the student is not a degree student and not a certificate student than they may register as they want to.

 

College

1

2

3

4

1

Degree candidate

Y

Y

N

N

2

Certificate candidate

Y

N

Y

N

1

Go to table degree

 

X

   

2

Go to table certificate

   

X

 

3

Free to register any way

     

X

Note that in this situation, rule 1 has the person both a degree and a certificate candidate. If we assume this is impossible than we can eliminate rule 1 from the final table and just show rule 2, 3, and 4 or we can leave no activity. If we assume that they can be both a degree candidate and a certificate candidate we have to decide on the rules for that and send them to an appropriate table. In the degree and certificate tables I am only dealing with first and second year students. If all students do not fall into one of those categories the table would have to be done differently.

 

Degree table

1

2

1

First year

Y

N

1

English (2 sem)

X

 

2

History (2 sem)

X

 

3

Science

 

X

4

Math

 

X

5

Economics

 

X

6

Speech

 

X

 

Certificate table

1

2

1

First year

Y

N

1

English

X

 

2

Computer literacy

 

X