Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2024-06-06 20:31:46

Jai Ganesh
Administrator
Registered: 2005-06-28
Posts: 48,141

Brute Force

Brute Force

Gist

The brute force approach is a guaranteed way to find the correct solution by listing all the possible candidate solutions for the problem. It is a generic method and not limited to any specific domain of problems. The brute force method is ideal for solving small and simpler problems.

Summary:

Algorithm

A brute force algorithm is a simple, comprehensive search strategy that systematically explores every option until a problem’s answer is discovered. It’s a generic approach to problem-solving that’s employed when the issue is small enough to make an in-depth investigation possible. However, because of their high temporal complexity, brute force techniques are inefficient for large-scale issues.

Key takeaways:

Methodical Listing: Brute force algorithms investigate every potential solution to an issue, usually in an organized and detailed way. This involves attempting each option in a specified order.

Relevance: When the issue space is small and easily explorable in a fair length of time, brute force is the most appropriate method. The temporal complexity of the algorithm becomes unfeasible for larger issue situations.

Not using optimization or heuristics: Brute force algorithms don’t use optimization or heuristic approaches. They depend on testing every potential outcome without ruling out any using clever pruning or heuristics.

Features of the brute force algorithm

* It is an intuitive, direct, and straightforward technique of problem-solving in which all the possible ways or all the possible solutions to a given problem are enumerated.
* Many problems are solved in day-to-day life using the brute force strategy, for example, exploring all the paths to a nearby market to find the minimum shortest path.
* Arranging the books in a rack using all the possibilities to optimize the rack spaces, etc.
* Daily life activities use a brute force nature, even though optimal algorithms are also possible.

PROS AND CONS OF BRUTE FORCE ALGORITHM:

Pros:
* The brute force approach is a guaranteed way to find the correct solution by listing all the possible candidate solutions for the problem.
* It is a generic method and not limited to any specific domain of problems.
* The brute force method is ideal for solving small and simpler problems.
* It is known for its simplicity and can serve as a comparison benchmark.

Cons:
* The brute force approach is inefficient. For real-time problems, algorithm analysis often goes above the O(N!) order of growth.
* This method relies more on compromising the power of a computer system for solving a problem than on a good algorithm design.
* Brute force algorithms are slow.
* Brute force algorithms are not constructive or creative compared to algorithms that are constructed using some other design paradigms.

Conclusion

Brute force algorithm is a technique that guarantees solutions for problems of any domain helps in solving the simpler problems and also provides a solution that can serve as a benchmark for evaluating other design techniques, but takes a lot of run time and inefficient.

Details

Proof of exhaustion

Proof by exhaustion, also known as proof by cases, proof by case analysis, complete induction or the brute force method, is a method of mathematical proof in which the statement to be proved is split into a finite number of cases or sets of equivalent cases, and where each type of case is checked to see if the proposition in question holds. This is a method of direct proof. A proof by exhaustion typically contains two stages:

* A proof that the set of cases is exhaustive; i.e., that each instance of the statement to be proved matches the conditions of (at least) one of the cases.
* A proof of each of the cases.

The prevalence of digital computers has greatly increased the convenience of using the method of exhaustion (e.g., the first computer-assisted proof of four color theorem in 1976), though such approaches can also be challenged on the basis of mathematical elegance. Expert systems can be used to arrive at answers to many of the questions posed to them. In theory, the proof by exhaustion method can be used whenever the number of cases is finite. However, because most mathematical sets are infinite, this method is rarely used to derive general mathematical results.

In the Curry–Howard isomorphism, proof by exhaustion and case analysis are related to ML-style pattern matching.

Example

Proof by exhaustion can be used to prove that if an integer is a perfect cube, then it must be either a multiple of 9, 1 more than a multiple of 9, or 1 less than a multiple of 9.

Proof:

Each perfect cube is the cube of some integer n, where n is either a multiple of 3, 1 more than a multiple of 3, or 1 less than a multiple of 3. So these three cases are exhaustive:

Case 1: If n = 3p, then

, which is a multiple of 9.
Case 2: If
, then
, which is 1 more than a multiple of 9. For instance, if n = 4 then
.
Case 3: If
, then
, which is 1 less than a multiple of 9. For instance, if n = 5 then
. Q.E.D.

Elegance

Mathematicians prefer to avoid proofs by exhaustion with large numbers of cases, which are viewed as inelegant. An illustration as to how such proofs might be inelegant is to look at the following proofs that all modern Summer Olympic Games are held in years which are divisible by 4:

Proof: The first modern Summer Olympics were held in 1896, and then every 4 years thereafter (neglecting exceptions such as when the games were not held due to World War I and World War II along with the 2020 Tokyo Olympics being postponed to 2021 due to the COVID-19 pandemic.). Since 1896 = 474 × 4 is divisible by 4, the next Olympics would be in year

, which is also divisible by four, and so on (this is a proof by mathematical induction). Therefore, the statement is proved.

The statement can also be proved by exhaustion by listing out every year in which the Summer Olympics were held, and checking that every one of them can be divided by four. With 28 total Summer Olympics as of 2016, this is a proof by exhaustion with 28 cases.

In addition to being less elegant, the proof by exhaustion will also require an extra case each time a new Summer Olympics is held. This is to be contrasted with the proof by mathematical induction, which proves the statement indefinitely into the future.

Number of cases

There is no upper limit to the number of cases allowed in a proof by exhaustion. Sometimes there are only two or three cases. Sometimes there may be thousands or even millions. For example, rigorously solving a chess endgame puzzle might involve considering a very large number of possible positions in the game tree of that problem.

The first proof of the four colour theorem was a proof by exhaustion with 1834 cases.[4] This proof was controversial because the majority of the cases were checked by a computer program, not by hand. The shortest known proof of the four colour theorem today still has over 600 cases.

In general the probability of an error in the whole proof increases with the number of cases. A proof with a large number of cases leaves an impression that the theorem is only true by coincidence, and not because of some underlying principle or connection. Other types of proofs—such as proof by induction (mathematical induction)—are considered more elegant. However, there are some important theorems for which no other method of proof has been found, such as

* The proof that there is no finite projective plane of order 10.
* The classification of finite simple groups.
* The Kepler conjecture.
* The Boolean Pythagorean triples problem.


It appears to me that if one wants to make progress in mathematics, one should study the masters and not the pupils. - Niels Henrik Abel.

Nothing is better than reading and gaining more and more knowledge - Stephen William Hawking.

Offline

Board footer

Powered by FluxBB