REVISION SUMMARY: Introduction to Problem Solving (NCERT Class 11)
1. Chapter at a Glance
- Problem solving is the process of identifying a problem, developing an algorithm, and implementing it as a program; computers cannot solve problems without precise step-by-step instructions.
- Key steps for problem solving using computers: Analysing the problem (identify inputs/outputs), Developing an Algorithm, Coding, and Testing & Debugging (including maintenance).
- An algorithm is a finite sequence of exact steps with a definite beginning and end that solves a problem or accomplishes a task when followed correctly.
- Good algorithms must satisfy: Precision, Uniqueness, Finiteness, Input, and Output.
- Algorithms are represented using flowcharts (visual symbols) or pseudocode (non-formal language using keywords like INPUT, COMPUTE, PRINT, IF/ELSE, WHILE).
- Flow of control can be Sequence, Selection (conditionals with IF/ELSE for decisions) or Repetition (loops with WHILE for iteration).
- Algorithms must be verified via dry run on multiple inputs; multiple algorithms for the same problem can be compared on time complexity and space complexity.
- Complex problems are solved by decomposition into smaller sub-problems that are solved independently and combined.
2. Key Terms and Definitions
- Algorithm: A set of exact steps which, when followed, solve the problem or accomplish the required task; it has a definite beginning and end, consists of a finite number of steps, and leads to the desired result in finite time.
- Flowchart: A visual representation of an algorithm using standardised shapes (boxes, diamonds, parallelograms) connected by arrows; each shape represents a step and arrows show order/flow.
- Pseudocode: A non-formal language description of instructions that a computer must follow in a particular order; intended for human reading and not directly executable.
- Flow of Control: The flow of events in an algorithm — can be sequence (steps executed one after another), selection (branching based on condition), or repetition (repeating steps till a condition is met).
- Conditionals / Selection: Used to check possibilities; the program checks one or more conditions and performs operations depending on true or false (binary) value of the condition.
- Repetition / Iteration / Loop: Execution of some program statements repeatedly till a specified condition is satisfied.
- Dry Run / Verification: Taking input values and going through all steps of the algorithm manually to check if it yields the desired output for each input; helps identify incorrect or missing steps.
- Time Complexity: Amount of processing time an algorithm needs to run.
- Space Complexity: Amount of memory an algorithm needs to execute.
- Source Code: Program written in a high-level language.
- Decomposition: Breaking down a complex problem into simpler sub-problems that can be solved independently and then combined.
3. Syntax and Constructs
Pseudocode keywords and structures (as shown in NCERT examples):
INPUT num1
COMPUTE Result = num1 + num2
PRINT Result
IF condition THEN
steps
ELSE
steps
END IF
WHILE condition REPEAT
steps
IF (shape is diamond) OR (shape is club) THEN
INCREMENT Dpoint
ELSE IF (shape is heart) AND (value is number) THEN
INCREMENT Wpoint
ELSE
INCREMENT Wpoint
END IF
4. Algorithms and Worked Logic
Students must write/dry-run algorithms for:
- Finding square of a number, sum of two numbers, area & perimeter of rectangle (sequence).
- Checking even/odd, categorising by age (child/teenager/adult), card game scoring (selection with multiple conditions).
- Calculating average of 5 numbers or numbers until 0 is entered (repetition with counter or condition).
- Verifying and correcting algorithms (e.g., adding time in hours/minutes — must handle carry-over when mm_total ≥ 60).
Key steps always include: clearly identify Input → Process → Output, then write steps or draw flowchart/pseudocode.
5. Common Errors and Exam Pitfalls
- Not identifying Input/Process/Output before writing the algorithm.
- Writing algorithms that do not stop after finite steps or lack precision/uniqueness.
- Missing cases in selection (e.g., forgetting ELSE for false condition) or not handling boundary values.
- Incorrect loop conditions (wrong counter initialisation, missing increment, or infinite loop risk).
- Failing to verify algorithm on all possible inputs (e.g., time addition fails when minutes sum ≥ 60).
- Confusing flowchart symbols or omitting arrows for flow.
- Not documenting or handling multiple conditions correctly in pseudocode.
- Choosing inefficient algorithms without comparing time/space complexity.
- In exam answers, losing marks for missing END IF, wrong keywords, or not showing dry-run verification.