3.1 Computational problems
A **computational problem** is a challenge that can be solved by a computational process – an **algorithm** (step-by-step instructions a computer can execute).
- **Input** – data given at the start.
- **Process** – the steps (the algorithm) applied to the input.
- **Output** – the result produced.
## Classifying problems
- **Decision problems** – the answer is yes or no (Is 17 prime?).
- **Search problems** – find an item or solution that meets some criteria (Is Islamabad in this list?).
- **Optimization problems** – find the *best* solution (shortest route, lowest cost).
- **Counting problems** – count the number of ways a condition can be met.
## Well-defined and ill-defined problems
- **Well-defined:** clear goal, input, process and output. Example: is a number even? Input an integer, check divisibility by 2, output even/odd.
- **Ill-defined:** vague or ambiguous goals and requirements. Example: "How to reduce poverty in Pakistan".