An answer in Bulls and Cows (called Hit & Blow in Japan) is a row of all-different symbols chosen from 10 symbols (here, the digits 0 to 9). Let’s count how many there are.

How to count

Let’s think about 3 digits.

  • The 1st digit can be any of 0 to 9: 10 ways.
  • The 2nd digit cannot repeat the 1st, so 9 ways.
  • The 3rd digit cannot repeat the 1st or 2nd, so 8 ways.

In all, 10 × 9 × 8 = 720 ways. For each extra digit, multiply by the number of digits left (7, 6, 5, …).

Number of candidates for each length

DigitsCalculationCandidates
3 digits (★1)10×9×8720
4 digits (★2)10×9×8×75040
5 digits (★3)10×9×8×7×630240
6 digits (★4)10×9×…×5151200
7 digits (★5)10×9×…×4604800

A 7-digit answer has more than 600,000 possibilities. If you guess at random, your chance of getting it in one guess is less than 1 in 600,000.

When digits can repeat

If the rule let you use the same digit as many times as you like, every place would have 10 ways, so 3 digits would be 10 × 10 × 10 = 1000 ways and 4 digits would be 10000 ways.

DigitsNo repeatsRepeats allowed
3 digits7201000
4 digits504010000

The “all different symbols” rule of Bulls and Cows does more than cut the candidates a little. It also makes the hits and blows easier to count, because with two of the same digit it gets hard to tell which one is the blow (How Mastermind Differs).

How do clues shrink the candidates?

After one guess, only the answers that do not contradict the clue stay. If you guess “012” with 3 digits, here is how many candidates stay for each clue, counted in full.

ClueCandidates left
0 hits, 0 blows210
0 hits, 1 blow252
0 hits, 2 blows63
0 hits, 3 blows2
1 hit, 0 blows126
1 hit, 1 blow42
1 hit, 2 blows3
2 hits, 0 blows21
3 hits (solved)1

They add up to exactly 720. The most likely clue is “0 hits, 1 blow,” at 252 of the 720 (35%). Even in the worst case, 252 candidates are left after one guess.

Stack this kind of shrinking a few times, and even 720 answers can always be solved in 6 guesses or fewer if you guess well (Is There a Winning Strategy for Bulls and Cows?).

How much harder does it get with more digits?

The number of candidates grows more than 800 times from 3 digits to 7 digits. But the number of guesses to solve it does not grow that much. This is probably because the kinds of clues grow with the number of digits, so each guess tells you more. In the app “Bulls and Cows,” the target number is 6 guesses for 3 digits and 10 for 7 digits.