Decision Tables - Furman University



Decision Tables *Example scenario: “A marketing company wishes to construct a decision table to decide how to treat clients according to three characteristics: Gender, City Dweller, and age group: A (under 30), B (between 30 and 60), C (over 60). The company has four products (W, X, Y and Z) to test market. Product W will appeal to female city dwellers. Product X will appeal to young females. Product Y will appeal to Male middle aged shoppers who do not live in cities. Product Z will appeal to all but older females.”Decision tables are used to model complicated programming logic. They can make it easy to see that all possible combinations of conditions have been considered; when conditions are missed, it is easy to see this. The tables are composed of 4 parts: conditions, actions, condition alternatives (each column is a rule), and actions for the rules.The process used to create a decision table is the following:Identify conditions and their alternative values. There are 3 conditions: gender, city dweller, and age group. Put these into table as 3 rows in upper left side.Gender’s alternative values are: F and M.City dweller’s alternative values are: Y and NAge group’s alternative values are: A, B, and CCompute max. number of rules.Determine the product of number of alternative values for each condition.2 x 2 x 3 = 12.Fill table on upper right side with one column for each unique combination of these alternative values. Label each column using increasing numbers 1-12 corresponding to the 12 rules. For example, the first column (rule 1) corresponds to F, Y, and A. Rule 2 corresponds to M, Y, and A. Rule 3 corresponds to F, N, and A. Rule 4 corresponds to M, N, and A. Rule 5 corresponds to F, Y, and B. Rule 6 corresponds to M, Y, and B and so on.Identify possible actionsMarket product W, X, Y, or Z. Put these into table as 4 rows in lower left side.Define each of the actions to take given each rule.For example, for rule 1 where it is F, Y, and A; we see from the above example scenario that products W, X, and Z will appeal. Therefore, we put an ‘X’ into the table’s intersection of column 1 and the rows that correspond to the actions: market product W, market product X, and market product Z.123456789101112GenderFMFMFMFMFMFMCityYYNNYYNNYYNNAgeAAAABBBBCCCCMarketW XXXMarketXXXMarketYXMarketZXXXXXXXXXXVerify that the actions given to each rule are correct. Simplify the table. Determine if there are rules (columns) that represent impossible situations. If so, remove those columns. There are no impossible situations in this example.Determine if there are rules (columns) that have the same actions. If so, determine if these are rules that are identical except for one condition and for that one condition, all possible values of this condition are present in the rules in these columns. In the example scenario, columns 2, 4, 6, 7, 10, and 12 have the same action. Of these columns: 2, 6, and 10 are identical except for one condition: age group. The gender is M and they are city dwellers. The age group is A for rule 2, B for rule 6, and C for rule 10. Therefore, all possible values of condition ‘age group’ are present. For rules 2, 6, and 10; the age group is a “don’t care”. These 3 columns can be collapsed into one column and a hyphen is put into the age group location to signify that we don’t care what the value of the age group is, we will treat all male city dwellers the same: market product Z.12345678910GenderFMFMFMFMFMCityYYNNYNNYNNAgeAAABBBCCCMarketWXXXMarketXXXMarketYXMarketZXXXXXXXX* Example and material taken from saintmarys.edu/~psmith/417lab3b.htmlDecision Table - ExampleSave Supermarket has a policy for cashing customers checks. If the check is a personal check for $75.00 or less the check can be cashed. If the check is the customers pay check, it can be cashed for over $75.00 providing it is a company accredited by the supermarket.Step 1 - Name the conditions and the values for each condition -Type of check - personal (PE), payroll (PA) Amount of check - equal to or less than $75.00 (=<$75), greater than $75.00 (>$75) Accredited company - Yes (Y), No (N) Step 2 - name all possible actionsCash the check Don't cash the check Step 3 - list all possible rules2 x 2 x 2 = 8 rules?RulesConditions12345678Type of checkPEPEPEPEPAPAPAPAAmount of check=<$75=<$75>$75>$75=<$75=<$75>$75>$75Accredited CompanyYNYNYNYN?Step 4 - Define the Actions for each rule?RulesConditions12345678Type of checkPEPEPEPEPAPAPAPAAmount of check=<$75=<$75>$75>$75=<$75=<$75>$75>$75Accredited CompanyYNYNYNYN?ActionsCash the checkXX--X-X-Don't cash the check--XX-X-XStep 5 - Simplify the Decision Table?RulesConditions12345678Type of checkPEPEPEPEPAPAPAPAAmount of check=<$75=<$75>$75>$75----Accredited Company----YNYN?ActionsCash the checkXX--X-X-Don't cash the check--XX-X-XRemove indifferent conditions. Combine rules 1 and 2, 3 and 4, 5 and 7, and 6 and 8Simplified Decision Table?RulesConditions1234Type of checkPEPEPAPAAmount of check=<$75>$75--Accredited Company--YN????Actions???Cash the checkX-X-Don't cash the check-X-X(adapted from Whitten JL, Bentley LD and Dittman KC, 2001, Systems Analysis and Design Methods 5th Edn, McGraw-Hill, New York) Additional ScenarioFollowing the steps outlined above create a Decision Table for the following scenario. The local video store is planning a promotional giveaway for it?s long-standing customers. If the customer has been a member for 12 months or more they will receive a coupon booklet allowing them to hire 5 movies for free. If during that same 12 months they have hired at least 10 videos, they will receive an additional 5 free movie hire vouchers. If the customer?s membership is less than 12 months and they have hired at least 10 videos then they will receive 3 free movie hire vouchers. All members will receive a Thank You letter.Decision TablesA decision table is a table composed of rows and columns, separated into four separate quadrants.?ConditionsCondition AlternativesActionsAction EntriesThe upper left quadrant contains the conditions. The upper right quadrant contains the condition rules ofr alternatives. The lower left quadrant contains the actions to be taken and the lower right quadrant contains the action rules.Developing Decision TablesIn order to build decision tables, you need to determine the maximum size of the table, eliminate any impossible situations, inconsistencies, or redundancies, and simplify the table as much as possible. The following steps provide offer some guidelines to developing decision tables:1. Determine the number of conditions that may affect the decision. Combine rows that overlap, for example, conditions that are mutually exclusive. The number of conditions becomes the number of rows in the top half of the decision table.2. Determine the number of possible actions that can be taken. This becomes the number of rows in the lower half of the decision table.3. Determine the number of condition alternatives for each condition. In the simplest form of decision table, there would be two alternatives (Y or N) for each condition. In an extended-entry table, there may be many alternatives for each condition.4. Calculate the maximum number of columns in the decision table by multiplying the number of alternatives for each condition. If there were four conditions and two alternatives (Y or N) for each of the conditions, there would be sixteen possibilities as follows:Condition 1:x2 alternativesCondition 2:x2 alternativesCondition 3:x2 alternativesCondition 4:x2 alternatives16 possibilities5. Fill in the condition alternatives. Start with the first condition and divide the number of columns by the number of alternatives for that condition. In the foregoing example, there are sixteen columns and two alternatives (Y and N), so sixteen divided by two is eight. Then choose one of the alternatives and write Y in all of the eight columns. Finish by writing N in the remaining eight columns as follows:Condition 1 YYYYYYYYNNNNNNNNRepeat this for each condition using a subset of the table:?YYYYYYYYNNNNNNNN?YYYY?NNNN?????????YYNN?????????????Y?N??????????????and continue the pattern for each condition:?Condition 1?YYYYYYYYNNNNNNNN?Condition 2?YYYYNNNN?YYYYNNNN?Condition 3?YYNN?YYNNYYNNYYNN?Condition 4?YN?plete the table by inserting an X where rules suggest certain actions.bine rules where it is apparent that an alternative does not make a difference in the outcome; for example:Condition 1Y YCondition 2Y NAction 1X Xcan be expressed as:Condition 1YCondition 2--Action 1XThe dash (-) signifies that condition 2 can be either Y or N and action will still be taken.8.Check the table for any impossible situations, contradictions, redundancies.9. Rearrange the conditions and actions (or even rules) to make the decision table more understandable.An ExampleA store wishes to program a decision on non-cash receipts for goods into their intelligent tills.The conditions to check are agreed as:1. Transaction under ?502. Pays by check with check card (guarantee ?50)3. Pays by credit cardThe possible actions that a cashier could take are agreed as:1. Ring up sale2. Check credit card from local database3. Call a supervisor4. Automatic check of credit card company databaseUsing the rules above construct a decision table showing all possible combinations of alternatives.The condition rules are yes or no, therefore the number of possible condition rules are 2 alternatives for condition 1 x 2 alternatives for condition 2 x 2 alternatives for condition 3 or 2 3 = 8?Under ?50?YYYYNNNNPays by check?YYNNYYNNPays by credit card??YNYNYNYN?????????Ring up sale??????????Check from local database?????????Call Supervisor?????????Check credit card database????????We can see that some of the condition rules are invalid, the customer cannot pay by check AND pay by credit card or not pay by either method. We have decided that these combinations are mutually exclusive. This decision table can be reduced to 4 condition rules.?Under ?50YYNNPays by checkYNYNPays by credit card?NYNY?????Ring up sale??????Check from local database?????Call Supervisor?????Check credit card database????Indicate the actions.?Under ?50YYNNPays by checkYNYNPays by credit card?NYNY?????Ring up sale??X????Check from local database??X???Call Supervisor???X??Check credit card database????XCheck for completeness.What if the customer has not shopped their before? Missing some as obvious as this means reconstructing the table!The conditions are now:1. Transaction under ?502. Pays by check with check card (guarantee ?50)3. Pays by credit card4. Unknown customerThe actions remain the same but the number of condition rules increases by a multiple of 2.?Under ?50?YYYYNNNNPays by check?YYNNYYNNPays by credit card??NNYYNNYY?Unknown customer?YNYNYNYN?????????Ring up sale??????????Check from local database?????????Call Supervisor?????????Check credit card database????????The dash in the Pays by credit row indicates that it does not matter about the condition rule since if a customer pays by check they will not pay by credit card and vice versa ( mutually exclusive ).?Under ?50?-Y-Y-N-NPays by check?YYNNYYNNPays by credit card??--------?Unknown customer?YNYNYNYN?????????Ring up sale???X???????Check from local database????X?????Call Supervisor?X????X?X???Check credit card database???X????X?XLook for redundancies, contradictions and impossible situations.?Under ?50?-Y-Y-N-NPays by check?YYNNYYNNPays by credit card??--------?Unknown customer?YNYNYNYN?????????Ring up sale???X???????Check from local database????X?????Call Supervisor?X????X?X???Check credit card database???X????X?XThe red and cyan columns are repeats and one is therefore redundant.?Under ?50?-Y-YNNPays by check?YYNNYNPays by credit card??------?Unknown customer?YNYNNN???????Ring up sale???X?????Check from local database????X???Call Supervisor?X????X??Check credit card database???X???XSome condition rules can be combined by examing the action stub for identical actions and the pay by credit row in the condition stub can be removed since it can create an impossible situation.?Under ?50?-Y-YNNPays by check?YYNNYNPays by credit card??------?Unknown customer?YNYNNN???????Ring up sale???X?????Check from local database????X???Call Supervisor?X????X??Check credit card database???X???XFinal version of the decision table.?Under ?50YYNNPays by checkYNYN?Unknown customerNN--?????Ring up sale??X????Check from local database??X???Call Supervisor???X??Check credit card database????X? ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download