Binary Search Method
Updated: April 9, 2025
A common and proven matching strategy for any GuessAndMatch game is based on binary search method. Each iteration of binary search method reduces the final search list by half.
Binary Search is a highly efficient algorithm used to find the match within a sorted list of names. It works by repeatedly dividing the search interval in half until the match is found or the interval is empty. This method leverages the sorted nature of the list to reduce the time taken to find the match.
Guess The Country
Lets use the binary search method to guess the randomly picked country.
- Starting with a alphabetcally sorted list of about 200 countries, make your first guess for any country that starts with letter M, which is about mid point of A to Z. for example Morocco.
-
You'll see the first letter of your guess highlighted either
Green,
Blue or
Red.
Green first letter means the actual name starts with the same first letter. You just lucked out (A lucky guess is never merely luck. There is always some talent in it). Use the other clues to narrow it down to the final matching name. - Blue first letter means the actual name starts with a letter that is alphabetically higher than the blue letter. You have successfully narrowed down the final countries list in half. The actual name is now somewhere in this half list that goes from Letter N up to Z. Your next guess could start from letter T, about mid point of N to Z - for example Turkey.
- Red first letter means the actual name starts with a letter that is alphabetically lower than the red letter. You have successfully narrowed down the final countries list in half. The actual name is now somewhere in this half list that goes from Letter A up to L. Your next guess could start from letter F, about mid point of A to L - for example France.
- Repeat steps 2, 3 and 4 in similar manner until you find the match. Each time your guessed first letter is red, keep guessing alphabetically lower names starting with the highest previous blue letter to lowest red letter. This way you'll keep dividing your list in half. You don't have to pick exactly the alphabetically middle letter but somewhat close to it. Other match clues will help you eliminate many possible names and you'll soon find the matching name in fewer tries.
In this example, we started with letter M (Morocco). Since M is highlighted blue, we went higher to T (Tunisia). T is highlighted red, so we went lower to P (Panama). P is highlighted blue, so we went higher to R (Republic of the Congo) R is highlighted blue, so we went higher to S (South Africa) which was the match.
If we paid attention to the match clue about the continent, we could have avoided the above guess #3. Its because the continent clue matched for our first guess Morocco, that means the hidden country is in Africa. Hense, Panama is not a good guess because its in North America.
Using a combination of the binary search method and the eliminations and deductions based on other attribute match clues, it should easier to match in 7 or fewer guesses.