---
title: "How we prove a Binairo has one solution | Once Books"
description: "A Binairo is two symbols and three rules. Generating one that follows them is easy; proving it is the only grid that does is the real work. Here is how."
source: "https://www.oncebooks.com/blog/how-we-prove-a-binairo-has-one-solution"
---

1. [Home](https://www.oncebooks.com/)
2. [Blog](https://www.oncebooks.com/blog)
3. How we prove a Binairo has one solution

Blog

# How we prove a Binairo has one solution

[The Once Books team](https://www.oncebooks.com/authors/team) · 21 October 2026 · 6 min read

- [binairo](https://www.oncebooks.com/blog/tag/binairo)
- [engineering](https://www.oncebooks.com/blog/tag/engineering)
- [kdp](https://www.oncebooks.com/blog/tag/kdp)

A Binairo is two symbols and three rules, which makes it sound trivial to generate. The hard part isn't making a grid that follows the rules. It's proving the grid you made is the only grid that does. That proof is the whole reason a good Binairo book is rarer than a good sudoku book, and it's the same proof we reuse for three other puzzles.

## One solver, four puzzles

Binairo, Futoshiki, Skyscrapers and Kakurasu all run on a single constraint-grid solver. It does the two things a publishable puzzle needs, find a solution and prove there's exactly one, without knowing any puzzle's rules. Each puzzle plugs in a tiny description of itself: how to narrow a cell's possibilities given the others, and how to check a finished grid. The solver owns the search; the puzzle owns the rule.

Uniqueness is one line on top of that search. Count solutions, but stop counting at two, because you never need to know a broken grid has two answers or two thousand, only that it has more than one:

```
export function hasUniqueSolution(model: GridModel): boolean {
  return countSolutions(model, 2) === 1;
}
```

For Binairo we hold a stricter bar than uniqueness. We keep a grid only if it solves by propagation alone, with no branching, which guarantees a human can reason it out with no guessing. That same propagate-only pass is also a proof of uniqueness: if logic alone fills every cell, there was never a second answer to find.

## Building the grid, then taking it apart

Generation is fill-then-dig. First we build a complete, legal grid: Binairo has few enough legal row patterns that we can enumerate them and assemble rows that don't clash. Then we remove cells in a random order, and after each removal we re-check that the grid still solves by logic alone. If a removal would make it ambiguous, the cell goes back. What's left is the sparsest grid that still has one logical solution.

## The bug that taught us something

The row-assembly search is where the larger grids nearly died. The obvious way to try row patterns in a fresh random order at each step is expensive in a way that's easy to miss: reshuffling the candidate list costs a full pass over the patterns on every node you visit, and on a 14 by 14 that cost dominates. We shuffle the candidate rows once and reuse that order at every depth instead, which turned a crawl into something fast.

Even then, a bad starting order can wander. So the search runs under a node budget of 4,000 and, if it blows that, abandons the attempt and retries from a fresh seed, up to 200 times. A bad order is far cheaper to throw away and re-roll than to backtrack out of. All of it is seeded, so the same seed rebuilds the same grid in the worker, the studio and the [free tool](https://www.oncebooks.com/tools/binairo-generator).

## The rule we don't propagate

Binairo's third rule, no two identical rows and no two identical columns, is the one we deliberately leave out of the propagation step. It can't be narrowed soundly: knowing two rows are the same so far tells you nothing about which cell must change until they're nearly complete, so trying to act on it early would risk removing a value that was actually legal. We check it only on the finished grid instead. Getting that split wrong, propagating a rule that looks local but isn't, is exactly how a generator ends up printing a puzzle with no solution.

## Where it runs

Grids have even sides, graded by size from 6 by 6 up to 14 by 14. To watch the solver work, the [free Binairo generator](https://www.oncebooks.com/tools/binairo-generator) runs it in your browser and prints the grid with its solution. For a graded book with a solutions section, the [KDP Binairo maker](https://www.oncebooks.com/kdp-binairo-maker) runs it in a worker, and [how to make and sell Binairo books on KDP](https://www.oncebooks.com/blog/how-to-make-and-sell-binairo-books-on-kdp) covers everything after the grids are built.

## Try the tool

Free, in your browser, no sign-up. Make one, then build the whole book in the studio.

[Binairo generator Generate a binary logic puzzle and print it with its answer. Free, no sign-up. Try it free](https://www.oncebooks.com/tools/binairo-generator)

## Questions parents ask

**How do you generate a Binairo with a unique solution?**

Build a full legal grid, then remove cells one at a time, and after each removal check the grid still solves by logic alone. If a removal would let it solve two ways, put the cell back. Every grid that survives has one solution.

**Is a Binairo always solvable without guessing?**

In our books, yes. We keep a grid only if constraint propagation alone fills it in, with no branching. That is stricter than uniqueness and is the quality bar we hold for Binairo and Futoshiki.

**Do Binairo, Futoshiki, Skyscrapers and Kakurasu share a solver?**

Yes. All four run on one constraint-grid core that finds a solution and proves it is the only one, without knowing any puzzle's rules. Each puzzle supplies just its own rule as a small plug-in.

## Related reading

- [How to make and sell Binairo books on Amazon KDP](https://www.oncebooks.com/blog/how-to-make-and-sell-binairo-books-on-kdp) — A guide to making Binairo (Takuzu) books for Amazon KDP: pick a grid size, generate single-solution 0-and-1 grids, get the interior right, and upload.
- [Why a picture nonogram almost never solves by pure logic](https://www.oncebooks.com/blog/why-picture-nonograms-need-a-guess) — We drew 18 recognisable nonogram pictures. Every one had a single solution, but only one solved without a guess. The code, the numbers, and why.
- [How we make sure every sudoku has one solution](https://www.oncebooks.com/blog/how-we-guarantee-one-solution-sudoku) — How our sudoku generator works: fill a grid, remove clues in pairs, and re-solve after every removal so each board has one answer. Real code and timings.

## Keep reading

- [Answers](https://www.oncebooks.com/answers) — One sharply-scoped question per page, cost, safety, timing, printing, answered in a couple of sentences before the detail.
- [Glossary](https://www.oncebooks.com/glossary) — Plain definitions of the vocabulary: the Character Sheet, the Consistency Engine, style profiles, drift.
- [Help centre](https://www.oncebooks.com/help) — Task-shaped instructions for making, printing and sharing a book once you have started one.

[← All posts](https://www.oncebooks.com/blog)

Try this tool

[Binairo generator Generate a binary logic puzzle and print it with its answer. Free, no sign-up. Try it free](https://www.oncebooks.com/tools/binairo-generator)
