# Brute Force

## What is a Brute Force Algorithm?:gorilla:

A **Brute Force** Algorithm tries every possible combination in a problem for a solution.

![](/files/-MMb3u2m_3pV1d8Wr0Lm)

## What's your pin number? :credit\_card: :shopping\_bags: :shopping\_cart:&#x20;

A **Brute Force** algorithm tries every possible combination to guess a correct pin number

```
Brute Force a Pin Number
Assumptions: 
  Pin = Numbers = #
  Pin = 4 Digits = ____

Start with 0000
Add 1 & Try Pin 
Repeat 

0000 -> 0001 -> 0002...9998 -> 9999
10,000 possible pin numbers
```

:hammer:In Computer Science a **Brute Force** solution is normally not the best solution but is a good starting point to get a deeper understanding of the problem.:hammer:&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ksmcclay.gitbook.io/no-code-computer-science/algorithms/brute-force.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
