SlideShare a Scribd company logo
Major Topics

   Structured English
   Flowcharts
   Decision Tables
   Decision Trees
   Decision Criteria
Structured English
   Structured English is a technique
    used to describe algorithmic procedures
    and is sometimes considered an
    alternative to flowcharts.
Example

IF Hours is greater than
  40
                                 Y                  N
THEN                                  Hours > 40

   Compute Overtime Pay
ELSE                       Compute                 Compute
   Compute Regular Pay     Overtime                Regular
ENDIF
What are Flowcharts?
   They describe a procedure or program by
    specifying the sequence diagrammatically in
    which individual steps must be executed.
   An ideal means for documenting complex
    algorithms so that users can refer to them as
    procedural guides.
Flowchart Symbols
 Terminal       Input/
(Start/Stop)    Output


 Process       Decision
               or Test


Flow Line      Connector
Simple Example

     Start
                 A


 Print
Headings              Print
                     Number,
             EOF?    Square


             N
Read a
Number
             Stop
                     Procedure reads numbers from a
                     file and produces a Table of the
                        numbers and their squares.
 A
Decision Tables

   A Decision table is a table of rows
    and columns, separated into four
    quadrants and is designed to illustrate
    complex decision rules
       Condition Stub – upper left quadrant
       Rules Stub – upper right quadrant
       Action Stub – bottom left quadrant
       Entries Stub - bottom right quadrant
Decision Table Layout
   Standard format used for presenting
    decision tables.

         Decision      Rules
          Stub         Stub

          Action       Entries
           Stub         Stub
Decision Table Example

                      1   2 3 4
    Like Boss?        Y   Y N N
 20% Pay Raise?       Y   N Y N
Stay Another Year     X   X
Quit after 2 Months         X
 Quit next Week               X
Developing Decision
            Tables
   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
Number of Rules
       Each condition generally has two possible
        alternatives (outcomes): Yes or No
         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:
         Condition 1   Y Y      Condition 1
          Y
          Condition 2   Y N      Condition 2
           -

          Action 1      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
Decision Table example:
        combine and reduce
          Conditions and Actions       1   2   3   4   5   6   7   8
       
Order from Fall Catalog                Y   Y   Y   Y   N   N   N   N
Order from Christmas Catalog           Y   Y   N   N   Y   Y   N   N
Order from Special Catalog             Y   N   Y   N   Y   N   Y   N
Mail Christmas Catalog                     X       X       X       X
Mail Special Catalog                           X               X
Mail Both Catalogs                     X               X

The four gray columns can             In addition, Rules 1&5 and
be combined into a single           Rules 3&7 can be combined.
 rule. Note that four each,         Each pair produces the same
there was NO order placed          action and each pair shares two
 from the Special Catalog.                common conditions.
Decision Table example ~
       Final Version
         Conditions and Actions           1   2   3

 Order from Fall Catalog                  -- -- --
 Order from Christmas Catalog             Y -- N
 Order from Special Catalog               Y N Y
 Mail Christmas Catalog                      X
 Mail Special Catalog                           X
 Mail Both Catalogs                       X

Eliminates the need to check for every possible case.
Decision Table example:
         checking for completeness and
                    accuracy
          Conditions and Actions         1   2   3   4
      
  Salary > $50,000 per year             Y    Y   N   N
  Salary < $2,000 per month             Y    N   Y   N
  Award Double Bonus                         X
  Award Regular Bonus                            X
  Award no Bonus                                     X
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.
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
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.
Drawing Decision Trees
   Drawn horizontally          Circle is analogous
   Root of tree is to the       to the condition part
    left side                    of an IF statement
   Square Nodes                Square is analogous
    indicate actions             to the consequent of
   Circle Nodes                 an IF statement (the
    represent possible           ‘THEN’ part)
    conditions                  “IF Circle THEN
                                 Square”
Decision Trees
Assume the following discount policy:
         “ Bookstores get a trade discount of 25%;
  for orders from libraries and individuals, 5%
  allowed on orders of 6-19 copies per book title;
  10% on orders for 20-49 copies per book
  title;15% on orders for 50 copies or more per
  book title.”
         Using the Decision Table describe the
  above mentioned discount policy.
Decision Tree Example
                                                                  50       25% Discount
                                     O    size
                                               >=                      4
                                 2        Osi
                                                       ze<
                       re                                         50       Nil Discount
              s   to                                                   5
           ok
      bo


1
    lib
     ra
      ri




                                                                             5% Discount
                                                                       6
          es




                                                              9
              &




                                                          1
                                                       6-
                   in




                                                   :
                                              ze
                        di




                                         si
                            vi




                                     O
                            du




                                                                           10% Discount
                             al




                                     Osize:2 0-49
                                                                       7
                                 s




                                 3            Osi
                                                        ze>
                                                                  50
                                                                           15 % Discount
                                                                       8

More Related Content

What's hot

System development life cycle
System development life cycleSystem development life cycle
System development life cycle
Yaswanth Babu Gummadivelli
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering conceptsKomal Singh
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
Ravinder Kamboj
 
System Analysis and Design
System Analysis and DesignSystem Analysis and Design
System Analysis and Design
Yohan Gunathilaka
 
Data warehousing and data mart
Data warehousing and data martData warehousing and data mart
Data warehousing and data mart
Amit Sarkar
 
Software Engineering concept
Software Engineering concept Software Engineering concept
Software Engineering concept
Atamjitsingh92
 
System Analysis and Design
System Analysis and DesignSystem Analysis and Design
System Analysis and Design
Dr. C.V. Suresh Babu
 
COCOMO Model By Dr. B. J. Mohite
COCOMO Model By Dr. B. J. MohiteCOCOMO Model By Dr. B. J. Mohite
COCOMO Model By Dr. B. J. Mohite
Zeal Education Society, Pune
 
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddelCHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
mohamed khalaf alla mohamedain
 
multi dimensional data model
multi dimensional data modelmulti dimensional data model
multi dimensional data model
moni sindhu
 
Functional and non functional
Functional and non functionalFunctional and non functional
Functional and non functional
Dikshyanta Dhungana
 
Data Flow Diagram
Data Flow DiagramData Flow Diagram
Data Flow Diagram
nethisip13
 
Data dictionary
Data dictionaryData dictionary
Data dictionary
Surbhi Panhalkar
 
System development methodologies
System development methodologiesSystem development methodologies
System development methodologies
Kashif Khan (کاشف خان)
 
Database System Architecture
Database System ArchitectureDatabase System Architecture
Database System Architecture
University of Potsdam
 
Distributed operating system(os)
Distributed operating system(os)Distributed operating system(os)
Distributed operating system(os)
Dinesh Modak
 
Software requirements
Software requirementsSoftware requirements
Software requirements
Dr. Loganathan R
 
Information System Development
Information System DevelopmentInformation System Development
Information System DevelopmentIamPe Khamkhum
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
Kumar
 

What's hot (20)

System development life cycle
System development life cycleSystem development life cycle
System development life cycle
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering concepts
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
 
System Analysis and Design
System Analysis and DesignSystem Analysis and Design
System Analysis and Design
 
Data warehousing and data mart
Data warehousing and data martData warehousing and data mart
Data warehousing and data mart
 
Software Engineering concept
Software Engineering concept Software Engineering concept
Software Engineering concept
 
System Analysis and Design
System Analysis and DesignSystem Analysis and Design
System Analysis and Design
 
COCOMO Model By Dr. B. J. Mohite
COCOMO Model By Dr. B. J. MohiteCOCOMO Model By Dr. B. J. Mohite
COCOMO Model By Dr. B. J. Mohite
 
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddelCHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
 
multi dimensional data model
multi dimensional data modelmulti dimensional data model
multi dimensional data model
 
Functional and non functional
Functional and non functionalFunctional and non functional
Functional and non functional
 
Data Flow Diagram
Data Flow DiagramData Flow Diagram
Data Flow Diagram
 
Data dictionary
Data dictionaryData dictionary
Data dictionary
 
System development methodologies
System development methodologiesSystem development methodologies
System development methodologies
 
Database System Architecture
Database System ArchitectureDatabase System Architecture
Database System Architecture
 
Distributed operating system(os)
Distributed operating system(os)Distributed operating system(os)
Distributed operating system(os)
 
Software requirements
Software requirementsSoftware requirements
Software requirements
 
Software Metrics
Software MetricsSoftware Metrics
Software Metrics
 
Information System Development
Information System DevelopmentInformation System Development
Information System Development
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 

Viewers also liked

Software Engineering- ERD DFD Decision Tree and Table
Software Engineering- ERD DFD Decision Tree and TableSoftware Engineering- ERD DFD Decision Tree and Table
Software Engineering- ERD DFD Decision Tree and Table
Nishu Rastogi
 
Structured analysis and structured design
Structured analysis  and structured designStructured analysis  and structured design
Structured analysis and structured design
Sudeep Singh
 
Data Flow Diagram
Data Flow DiagramData Flow Diagram
Data Flow Diagram
Puneet Arora
 
Structure chart
Structure chartStructure chart
Structure chart
Roy Antony Arnold G
 
DFD, Decision Table, Decision Chart, Structure Charts
DFD, Decision Table, Decision Chart, Structure ChartsDFD, Decision Table, Decision Chart, Structure Charts
DFD, Decision Table, Decision Chart, Structure ChartsSOuvagya Kumar Jena
 
System Analysis and Design
System Analysis and DesignSystem Analysis and Design
System Analysis and Design
Aamir Abbas
 

Viewers also liked (8)

Software Engineering- ERD DFD Decision Tree and Table
Software Engineering- ERD DFD Decision Tree and TableSoftware Engineering- ERD DFD Decision Tree and Table
Software Engineering- ERD DFD Decision Tree and Table
 
Structured Analysis and Structured Design
Structured Analysis and Structured DesignStructured Analysis and Structured Design
Structured Analysis and Structured Design
 
Decision tables
Decision tablesDecision tables
Decision tables
 
Structured analysis and structured design
Structured analysis  and structured designStructured analysis  and structured design
Structured analysis and structured design
 
Data Flow Diagram
Data Flow DiagramData Flow Diagram
Data Flow Diagram
 
Structure chart
Structure chartStructure chart
Structure chart
 
DFD, Decision Table, Decision Chart, Structure Charts
DFD, Decision Table, Decision Chart, Structure ChartsDFD, Decision Table, Decision Chart, Structure Charts
DFD, Decision Table, Decision Chart, Structure Charts
 
System Analysis and Design
System Analysis and DesignSystem Analysis and Design
System Analysis and Design
 

Similar to L7 decision tree & table

Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2Tech_MX
 
Unit 3 dbms
Unit 3 dbmsUnit 3 dbms
Unit 3 dbms
Sweta Singh
 
Mona Nasr-SAD-Lecture 3.pptx
Mona Nasr-SAD-Lecture 3.pptxMona Nasr-SAD-Lecture 3.pptx
Mona Nasr-SAD-Lecture 3.pptx
OmarElKordy2
 
Statistics.pdf
Statistics.pdfStatistics.pdf
Statistics.pdf
Shruti Nigam (CWM, AFP)
 
Exploiting your Data
Exploiting your DataExploiting your Data
Exploiting your Data
BeirutQuantifiedSelf
 
Akram najjar exploiting your data (in color)
Akram najjar   exploiting your data (in color)Akram najjar   exploiting your data (in color)
Akram najjar exploiting your data (in color)
Instabeat Inc.
 
Supervised learning (2)
Supervised learning (2)Supervised learning (2)
Supervised learning (2)
AlexAman1
 
A&D - DT, DD, DFD
A&D - DT, DD, DFDA&D - DT, DD, DFD
A&D - DT, DD, DFDvinay arora
 

Similar to L7 decision tree & table (10)

Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2
 
Unit 3 dbms
Unit 3 dbmsUnit 3 dbms
Unit 3 dbms
 
Mona Nasr-SAD-Lecture 3.pptx
Mona Nasr-SAD-Lecture 3.pptxMona Nasr-SAD-Lecture 3.pptx
Mona Nasr-SAD-Lecture 3.pptx
 
Statistics.pdf
Statistics.pdfStatistics.pdf
Statistics.pdf
 
Exploiting your Data
Exploiting your DataExploiting your Data
Exploiting your Data
 
Akram najjar exploiting your data (in color)
Akram najjar   exploiting your data (in color)Akram najjar   exploiting your data (in color)
Akram najjar exploiting your data (in color)
 
Supervised learning (2)
Supervised learning (2)Supervised learning (2)
Supervised learning (2)
 
A&D - DT, DD, DFD
A&D - DT, DD, DFDA&D - DT, DD, DFD
A&D - DT, DD, DFD
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Decision theory & decisiontrees
Decision theory & decisiontreesDecision theory & decisiontrees
Decision theory & decisiontrees
 

L7 decision tree & table

  • 1. Major Topics  Structured English  Flowcharts  Decision Tables  Decision Trees  Decision Criteria
  • 2. Structured English  Structured English is a technique used to describe algorithmic procedures and is sometimes considered an alternative to flowcharts.
  • 3. Example IF Hours is greater than 40 Y N THEN Hours > 40 Compute Overtime Pay ELSE Compute Compute Compute Regular Pay Overtime Regular ENDIF
  • 4. What are Flowcharts?  They describe a procedure or program by specifying the sequence diagrammatically in which individual steps must be executed.  An ideal means for documenting complex algorithms so that users can refer to them as procedural guides.
  • 5. Flowchart Symbols Terminal Input/ (Start/Stop) Output Process Decision or Test Flow Line Connector
  • 6. Simple Example Start A Print Headings Print Number, EOF? Square N Read a Number Stop Procedure reads numbers from a file and produces a Table of the numbers and their squares. A
  • 7. Decision Tables  A Decision table is a table of rows and columns, separated into four quadrants and is designed to illustrate complex decision rules  Condition Stub – upper left quadrant  Rules Stub – upper right quadrant  Action Stub – bottom left quadrant  Entries Stub - bottom right quadrant
  • 8. Decision Table Layout  Standard format used for presenting decision tables. Decision Rules Stub Stub Action Entries Stub Stub
  • 9. Decision Table Example 1 2 3 4 Like Boss? Y Y N N 20% Pay Raise? Y N Y N Stay Another Year X X Quit after 2 Months X Quit next Week X
  • 10. Developing Decision Tables  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
  • 11. Number of Rules  Each condition generally has two possible alternatives (outcomes): Yes or No  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
  • 12. 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:  Condition 1 Y Y Condition 1 Y Condition 2 Y N Condition 2 - Action 1 X X Action 1 X
  • 13. 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
  • 14. Decision Table example: combine and reduce Conditions and Actions 1 2 3 4 5 6 7 8       Order from Fall Catalog Y Y Y Y N N N N Order from Christmas Catalog Y Y N N Y Y N N Order from Special Catalog Y N Y N Y N Y N Mail Christmas Catalog X X X X Mail Special Catalog X X Mail Both Catalogs X X The four gray columns can In addition, Rules 1&5 and be combined into a single Rules 3&7 can be combined. rule. Note that four each, Each pair produces the same there was NO order placed action and each pair shares two from the Special Catalog. common conditions.
  • 15. Decision Table example ~ Final Version Conditions and Actions 1 2 3 Order from Fall Catalog -- -- -- Order from Christmas Catalog Y -- N Order from Special Catalog Y N Y Mail Christmas Catalog X Mail Special Catalog X Mail Both Catalogs X Eliminates the need to check for every possible case.
  • 16. Decision Table example: checking for completeness and accuracy Conditions and Actions 1 2 3 4     Salary > $50,000 per year Y Y N N Salary < $2,000 per month Y N Y N Award Double Bonus X Award Regular Bonus X Award no Bonus X 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.
  • 17. 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
  • 18. 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.
  • 19. Drawing Decision Trees  Drawn horizontally  Circle is analogous  Root of tree is to the to the condition part left side of an IF statement  Square Nodes  Square is analogous indicate actions to the consequent of  Circle Nodes an IF statement (the represent possible ‘THEN’ part) conditions  “IF Circle THEN Square”
  • 20. Decision Trees Assume the following discount policy: “ Bookstores get a trade discount of 25%; for orders from libraries and individuals, 5% allowed on orders of 6-19 copies per book title; 10% on orders for 20-49 copies per book title;15% on orders for 50 copies or more per book title.” Using the Decision Table describe the above mentioned discount policy.
  • 21. Decision Tree Example 50 25% Discount O size >= 4 2 Osi ze< re 50 Nil Discount s to 5 ok bo 1 lib ra ri 5% Discount 6 es 9 & 1 6- in : ze di si vi O du 10% Discount al Osize:2 0-49 7 s 3 Osi ze> 50 15 % Discount 8