There is almost always more than one solution to a problem. Logical reasoning is used to predict the outcomes of the algorithms that are designed to solve a problem, to help select the best solution.
Logical reasoning is the process of applying rules to problem solving. algorithmA sequence of logical instructions for carrying out a task. In computing, algorithms are needed to design computer programs. are designed as a set of steps to follow to solve a problem. At the same time, a set of rules is determined. For example, selectionA decision within a computer program when the program decides to move on based on the results of an event. is based on rules:
if a condition is met, do this
if not, do that
These rules govern the path that is followed through the algorithm.
Rules are built using logical reasoning to ensure that the algorithm performs correctly.
Why use logical reasoning?
Algorithms are step-by-step instructionA single action that can be performed by a computer processor. to solve a problem, created along with rules that decide which path to take when a decision is faced.
When trying to solve a problem, it may be that more than one solution is found. A different algorithm can be built from each solution. Logical reasoning determines if algorithms will work by predicting what happens when the algorithm’s steps - and the rules they consist of - are followed.
Predictions from each algorithm can be used to compare solutions and decide on the best one.