Every topic starts at New. Sign in and your practice counts.
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 stepby-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. Following are some of the computing problems:
Decision Problems: 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.
Example 1:
This is a decision problem where the task is to check if a given integer is divisible only by 1 and itself. If it is, the answer is "Yes," otherwise, it's "No."
Example 2:
This is a simple decision problem where we check if a number is divisible by 2.The decision is based on whether the number gives a remainder of 0 or 1 when divided by 2 . If the remainder is 0, the number is even, and the answer is "Yes". If the remainder is 1, the number is odd, and the answer is "No".
Example 3:
The problem is asking for a yes/no answer:
If "aa" is found anywhere in X, the answer is "Yes".
If "aa" is not present in X, the answer is "No"
DO YOU KNOW
Brainstorming is where people sit together with open minds to effectively discuss all possible solutions. The idea is to critically analyze every solution and later choose the optimal one for further analysis and implementation.
Search Problems: In science and engineering, many problems are solved using the 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 where each link connects to nodes. A node can be connected to multiple nodes. To solve such problems, we have three things:
This figure is being prepared.
Decision Problem
Example: Route Finding Problem
The map shown in Fig. 2.2 corresponds to the graph, where the nodes are assumed as cities and the links between nodes represent the routes in between the cities. The problem is to find a route in the graph from city S to city T.
Example: Eight puzzle problem
A board is given that contains 8 tiles (every tile can contain one number ranging from 1 to 8) and one empty space. The goal is to place the numbers on tiles in such ordering that it matches the final configuration using the empty space. However, we also have some restrictions that we can only slide one step and only four types of slides are allowed (left, right, above, and below).
This figure is being prepared.
Eight puzzle problem
Counting Problems: 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 .
Let's solve counting problems.
Example: 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.
This figure is being prepared.
Solution
Total possible casual dresses = (number of shirts) × (numbers of pants).
Total casual dresses
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.
Example:
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?
Solution
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:
Total possible computer systems