- Understand what decomposition diagrams are for Task 3
- Learn to identify main functions and sub-functions
- Master hierarchical problem breakdown
- Apply decomposition to data analysis problems
- Create exam-ready decomposition diagrams
What is Task 3?
Task 3 is the design task in your ESP exam where you create algorithm designs for a data analysis system. You'll receive:
- A CSV file with sales data (dates, car models, values, salespeople)
- User requirements (e.g., show total sales income by car model over time)
- Instructions to create decomposition diagrams and flowcharts
Your job: Design a solution that transforms raw data into meaningful information for decision-making.
Understanding Decomposition Diagrams
A decomposition diagram breaks down a complex problem into smaller, manageable parts. It shows the hierarchy of tasks from the main goal down to specific sub-tasks.
Why Decomposition Matters in Task 3
- Shows your thinking: Demonstrates you understand the problem
- Organizes your solution: Makes complex systems manageable
- Guides your flowcharts: Each box becomes a potential flowchart
- Earns marks: Examiners look for clear, logical breakdown
- Helps planning: Identifies what needs to be built
Structure of a Decomposition Diagram
Decomposition diagrams use a tree structure with levels:
Level 0: Main Problem
- The overall system or goal
- Example: "Car Sales Analysis System"
- One box at the top
Level 1: Major Functions
- Main tasks the system must perform
- Example: "Read Data", "Process Data", "Display Results"
- Typically 3-5 boxes
Level 2: Sub-Functions
- Specific tasks within each major function
- Example: Under "Process Data" → "Calculate Totals", "Group by Model", "Sort by Date"
- Break down until tasks are simple enough to code
Example: T-Learn Automotives Sales System
Let's decompose a typical Task 3 problem:
Requirements:
- Show total sales income from different car models over time
- Easy to use interface
- Display information meaningfully
- Use textual, numerical, and graphical output
Level 0: Main System
T-Learn Automotives Sales Analysis System
Level 1: Major Functions
- 1. Load Data - Get data from CSV file
- 2. Process Data - Analyze and calculate information
- 3. Display Results - Show information to user
- 4. User Interface - Handle user interactions
Level 2: Sub-Functions
1. Load Data:
- 1.1 Open CSV file
- 1.2 Read all records
- 1.3 Store in data structure
- 1.4 Handle file errors
2. Process Data:
- 2.1 Group sales by car model
- 2.2 Calculate total value per model
- 2.3 Sort by date/time period
- 2.4 Calculate monthly totals
- 2.5 Identify top-selling models
3. Display Results:
- 3.1 Show textual summary
- 3.2 Display numerical tables
- 3.3 Generate bar chart
- 3.4 Generate line graph (sales over time)
- 3.5 Format output clearly
4. User Interface:
- 4.1 Display menu options
- 4.2 Get user selection
- 4.3 Validate input
- 4.4 Loop until exit
Important Note: Shared Functions
Some functions are used by multiple branches:
- Load Data (1.1-1.4) must happen FIRST - you always need to read the CSV before doing anything else
- Every menu option will need to call "Load Data" before processing
- Example: To show sales by model, you must: Load Data → Group by Model → Display Results
- Example: To show monthly trends, you must: Load Data → Sort by Date → Calculate Monthly Totals → Display Graph
Tip: In your decomposition, you can show "Load Data" as a separate branch that feeds into all other functions, or note that it's a prerequisite step.
How to Create Your Decomposition Diagram
Step 1: Read Requirements Carefully
- Highlight key verbs (show, calculate, display, validate)
- Identify what data you have (CSV columns)
- Note what outputs are needed (textual, numerical, graphical)
- Understand user requirements (easy to use, meaningful display)
Step 2: Identify Major Functions
Ask yourself: What are the BIG things this system must do?
- Input/Loading data
- Processing/Calculating
- Output/Displaying
- User interaction
Step 3: Break Down Each Function
For each major function, ask: What specific tasks are needed?
- Be specific but not too detailed
- Each sub-function should be one clear task
- Aim for 3-6 sub-functions per major function
Step 4: Check Coverage
- Does your diagram cover ALL requirements?
- Have you included error handling?
- Have you included all output types mentioned?
- Is the user interface addressed?
Common Functions for Task 3
Most Task 3 problems will need these functions:
Data Input Functions
- Open file
- Read CSV data
- Parse records
- Store in lists/dictionaries
- Handle file not found errors
Data Processing Functions
- Filter data by criteria
- Group data by category (e.g., car model)
- Calculate totals/averages
- Sort data by date/value
- Find maximum/minimum values
- Count occurrences
Display Functions
- Format textual output
- Create tables of data
- Generate bar charts (matplotlib)
- Generate line graphs (matplotlib)
- Display summary statistics
User Interface Functions
- Display menu
- Get user choice
- Validate input
- Loop program
- Exit gracefully
Tips for High Marks
What Examiners Look For
- Complete coverage: All requirements addressed
- Logical structure: Clear hierarchy from general to specific
- Appropriate detail: Not too vague, not too detailed
- Clear labels: Each function clearly named
- Relevant to problem: Functions match the CSV data and requirements
Common Mistakes to Avoid
- Too vague ("Process data" with no sub-functions)
- Too detailed (including specific Python code)
- Missing requirements (forgetting graphical output)
- Illogical grouping (mixing input and output functions)
- No error handling functions
- Forgetting user interface
Presentation Tips
- Use boxes and lines to show hierarchy
- Keep it neat and readable
- Use consistent formatting
- Number your functions (1.1, 1.2, 2.1, 2.2)
- Save as PDF with clear filename
Exam Strategy
Working with the CSV Data
Look at the CSV file provided. Identify:
- What columns exist (Date, Car Model, Value, Salesperson)
- What calculations are needed (totals, averages, counts)
- What groupings are required (by model, by date, by salesperson)
- What outputs are specified (text, numbers, graphs)
Linking to Flowcharts
Your decomposition diagram guides your flowcharts:
- Each Level 2 sub-function could become a flowchart
- Focus on the most complex functions for detailed flowcharts
- Common flowchart topics: reading CSV, calculating totals, displaying menu