Unit summary

  • A computational problem is described by its inputs, outputs and constraints; an instance supplies actual input values.
  • A special case adds restrictions to a problem, and generalization removes them.
  • Problems are classified as decision, search, optimization, counting or construction according to the answer required.
  • Problem analysis identifies inputs, outputs, rules and limits, and resolves unclear requirements before planning.
  • An algorithm is a finite sequence of definite, effective steps that takes input and produces output.
  • Correctness is judged before efficiency; efficiency is measured by how work grows with the input size n.
  • A data structure organizes data so that the operations a solution needs are convenient.
  • The problem-solving process has four steps: understand, plan, execute and review.
  • Decomposition divides a large problem into subproblems with clear inputs and results.
  • An input/output specification states the meaning, type, range and unit of each value; validation enforces it.
  • A precondition must hold before an algorithm runs, and a postcondition is guaranteed after it finishes correctly.

Glossary

Term Meaning
Algorithm A finite set of clear steps for solving a problem.
Boundary case An instance at the limit of the allowed inputs, such as the smallest or largest valid value.
Classification Grouping problems by the kind of answer they require.
Computational problem A problem that can be described in terms of inputs and required outputs.
Constraint A rule that limits valid inputs or acceptable results.
Correctness The property of producing an acceptable result for every valid input.
Data structure A way to organize data for the work a solution needs to do.
Decomposition Breaking a large problem into smaller tasks.
Efficiency How much time or memory a solution uses.
Generalization A broader form of a problem with fewer restrictions.
Input Data given to a solution.
Output The result a solution must produce.
Postcondition A condition that must be true after a solution step finishes correctly.
Precondition A condition that must be true before a solution step begins.
Problem A task with a goal that needs a solution.
Problem instance One particular set of input values for a problem.
Requirement A condition the solution must meet.
Special case A narrower form of a problem with extra restrictions.
Tracing Carrying out an algorithm by hand and recording the value of each variable.
Validation Checking that input follows the stated rules.

Question bank

Short Answer Questions (2 marks each)

  1. Define a computational problem.
  2. What is a problem instance? Give one example.
  3. Distinguish between a general problem and a special case.
  4. What is a decision problem? Give one example.
  5. Define an algorithm.
  6. List any four characteristics of an algorithm.
  7. What is meant by the correctness of an algorithm?
  8. Define a data structure.
  9. What is decomposition?
  10. Differentiate between a precondition and a postcondition.

Medium Answer Questions (5 marks each)

  1. Explain the difference between a problem and a problem instance with a suitable example.
  2. Describe the five types of computational problems with one example of each.
  3. Explain the steps involved in analysing a problem, using a billing task as an example.
  4. Write an algorithm to find the sum of three numbers and trace it for the input 4, 7, 2.
  5. Explain input validation. Describe type checks and range checks with examples.
  6. Explain how decomposition helps in solving a large problem.

Long Answer Questions (15 marks each)

  1. Explain the four-step problem-solving process in detail. Apply all four steps to the problem of finding the average of three test scores.
  2. What is an algorithm? Explain its characteristics. Discuss correctness and efficiency as measures for judging an algorithm, with an example comparing two methods.
  3. Explain generalization and special cases. Discuss the classification of computational problems with suitable examples and explain why classification is useful.
  4. Explain input/output specification, input validation, preconditions and postconditions. Illustrate each with the problem of finding the largest value in a list.

Sources

  • Official BCA syllabus (NEP 2025 scheme), Problem Solving Techniques, course code 25BCA401SEC01, Unit I