Problems differ in the kind of answer they require. "Is this number even?" needs only yes or no. "Which route is the cheapest?" needs the best of many possible answers. Recognizing the type of a problem guides the choice of method.
Classifying by the Answer Required
Problems can be grouped by the kind of answer they ask for. The wording of the task usually gives a clue. Five common types are described below and summarized in Table 1.3.
A decision problem asks a question whose answer is yes or no. "Is 37 a prime number?" is a decision problem.
A search problem asks for an item that meets a condition. "Find the student whose roll number is 24" is a search problem. The answer is the item itself, or a report that no such item exists.
An optimization problem asks for the best answer according to some measure. "Find the least expensive route" is an optimization problem. Many routes may exist, but only the cheapest is acceptable.
A counting problem asks how many items meet a condition. "How many marks are above 80?" is a counting problem, and its answer is a whole number.
A construction problem asks for a new object that obeys stated rules. "Arrange these names in alphabetical order" is a construction problem, because the answer is a newly built list.
Table 1.3: Common types of computational problems
| Type | Answer required | Example |
|---|---|---|
| Decision | Yes or no | Is this number even? |
| Search | An item meeting a condition | Find the student with this roll number |
| Optimization | The best result by a measure | Find the least expensive route |
| Counting | How many items qualify | How many marks are above 80? |
| Construction | A new object obeying rules | Create a list in sorted order |
Definition: Classification. Grouping problems according to the kind of answer they require, so that a suitable method of solution can be chosen.
Problems That Combine Types
Many practical tasks combine more than one type. A route-planning task may first ask whether any route exists between two cities, which is a decision problem, and then ask for the shortest one, which is an optimization problem.
Why Classification Helps
Identifying the type of a problem has practical value.
- It fixes the form of the output. A decision problem must output yes or no, not a number.
- It suggests a method. Counting problems need a counter; optimization problems need a "best so far" value.
- It prevents solving the wrong problem. "Return any path to the library" and "return the shortest path" are different requirements. The first accepts any valid answer; the second accepts only the best one.
Example 1.3: Classifying tasks
Problem: Classify each task: (a) Does the word "level" read the same backwards? (b) How many students were absent today? (c) Which item in the list costs the least?
Solution:
- Task (a) asks a yes-or-no question, so it is a decision problem.
- Task (b) asks "how many", so it is a counting problem.
- Task (c) asks for the best item by the measure of cost, so it is an optimization problem.
Result: (a) Decision, (b) Counting, (c) Optimization.
Common mistakes
- Returning any acceptable answer when the task asks for the best answer.
- Giving a number as the answer to a decision problem, or yes or no to a counting problem.
- Overlooking that a task combines two types and solving only one part.
Key takeaways
- Problems are classified by the kind of answer required.
- The five common types are decision, search, optimization, counting and construction.
- The wording of the task ("is", "find", "best", "how many", "create") indicates the type.
- A single task can combine several types.
Practice questions
- What type of problem is "find the tallest student in the class"?
- What type is "is the given year a leap year"?
- Give one counting problem based on a list of ages.
Answers to the practice questions
- Optimization, because it asks for the best item by the measure of height.
- Decision, because the answer is yes or no.
- For example, "How many people are older than 18?"
Sources
- Official BCA syllabus (NEP 2025 scheme), Problem Solving Techniques, course code 25BCA401SEC01, Unit I
