# Understanding Biases

We'll cover the following

## Biases in an algorithm

It’s easy to say, “This algorithm has a bias” and “That algorithm has no bias,” but so far, we haven’t been very specific about what we mean by that. It’s more than simply identifying a long passage or a slantwise tendency in a maze. A visible texture or pattern in a maze—in the output of an algorithm—is only evidence of an algorithm’s bias if a significant number of mazes generated by that algorithm exhibit that same texture.

But even that definition doesn’t really cover it. Unlike Sidewinder and Binary Tree, biases may not always be blatantly obvious. They may not even produce visible artifacts at all. To understand how that can be, let’s consider an example.

Can’t mazes have biases, too?

Walter Pullen uses the term “bias” to describe a specific class of texture involving passage direction in “Maze Classification.” A maze with horizontal bias, for example, will have longer east-to-west passages. So, yes, in some contexts, the word bias may be applied to mazes, as well as algorithms.

However, to avoid confusion, in this course, bias will refer strictly to algorithms, while the more general term texture will be used to describe mazes. That is to say, a bias of the algorithm may produce a texture in the maze.

Let’s say we want to generate a perfect 2x2 maze. (Recall that “perfect” here means one with no loops in it.) The following figure shows all four possible perfect mazes that can fit in a 2x2 grid. By generating a 2x2 maze randomly, we’re effectively choosing between these four possibilities.

Get hands-on with 1200+ tech skills courses.