In computer science, a problem is a challenge or situation that needs to be overcome using some action. In computer science, a computing problem is a problem that is solved step-by-step using computation. It can include any type of calculation such as arithmetical or logical. These problems usually have a well-defined input and some desired properties that output must be satisfied.
A decision problem occurs when a given input requires a binary response, either Yes or No. Responses may take various forms, such as true or false. Figure 2.1 visually illustrates a simple decision problem. In complex cases, answers extend beyond a straightforward Yes-or-No, involving multiple decision factors and criteria.
In science and engineering, many problems are solved using search. In such types of problems, we have a set of objects among which we search for the solution. For example, finding a path between two cities. Search problems are often represented using graphs, where we have nodes and each link connects two nodes. A node can be connected to multiple nodes.
To solve such problems, we have three things:
These problems work on the principle that if an event/decision has A number of choices and another decision/event has B number of choices then the total number of possible unique combinations would be AxB.
Let's solve counting problems.
One event is numbers of shirts, and another event is number of pants you own then how many pairs of shirts and pants you can make from it.
Solution:
Total possible casual dresses = (number of shirts) x (number of pants).
Total casual dresses = 5 x 3 = 15
The counting problems are normally seen as an easy task that can immediately be done. As we go deeper, the counting problems can get complicated very quickly if we want to list out all of the possibilities.
Fig. 2.6: Counting Problem Example 2
You visit a computer shop to buy a computer system for you. The vender asks you to choose one of 4 monitors, one of 2 keyboards, one of 4 computers and one of 3 printers. How many numbers of possible systems you can choose from?
You must choose 1 monitor, 1 keyboard, 1 computer and 1 printer. The below given diagram shows each component of the computer system with the number of choices you have.
For the computer system elements, we have 4 monitors, 2 keyboard, 4 computers and 3 printers. Using the counting principle, the number of all possible computer systems that you can buy is given by:
N = 4 x 2 x 4 x 3 = 96
Problem solving defines the process of analyzing some situation and accordingly behaving to generate some response. For simple problems the following 4 steps are used:
However, for complex problems, the 6 step problem solving process could be used:
Before jumping into an action for a problem, it must be thoroughly investigated capture all the relevant aspects of the problem. For this purpose, we properly define ar analyze a problem. In defining a problem, there must be clarity and the objectives of the problem must be specified.