Artificial intelligence can develop complex software, summarize scientific texts, and answer difficult questions. But does Oman count as a country without an A in its name? Sometimes that’s a challenge. Why the seemingly innocent party game ‘Categories’ (‘Stadt-Land-Fluss’) exposes the weaknesses of language models actually has a surprisingly technical background.
Categories – That can’t be so hard, can it?
Imagine you’re playing an advanced round of Categories (Stadt-Land-Fluss) with friends. You don’t just play with initial letters, but with extra rules too. You’re looking for terms that begin with O and contain no A.
You think about it: which country starts with O but doesn’t have an A…
Oman is eliminated.
After the game, you ask your favorite AI for suitable countries. And suddenly it claims Oman meets the requirements.

Wait a minute. An AI that can program entire applications misses a letter in a word with just four characters?
It sounds absurd, but it’s a great example that AIs (the so-called ‘large language models’ / LLMs) work very differently than most of us assume.
And it explains why I wouldn’t necessarily trust an AI as referee for a Categories game.
Why Categories is harder for AI than it looks
Categories isn’t really that complicated.
You have to find terms in various categories that start with a particular letter. Maybe you add extra rules, such as that a certain letter may not appear in the word.
For a human, that’s usually not a big challenge. We can instantly spot the letters in a word, and often know whether something is a city, country, or river.
A language model, however, has several tasks to solve at once:
- It has to find a suitable term.
- It has to recognize if it fits the required category.
- It has to check if the word starts with the right letter.
- It needs to consider any additional rules.
- It shouldn’t invent places that don’t actually exist.
Checking individual letters, in particular, can be surprisingly error-prone.
That’s because language models don’t read words the same way we do.
The problem is tokens
When you read “Oman,” you see four letters:
O – m – a – n
You can look at them individually, count them, and compare them.
A language model, by contrast, first processes text as so-called tokens.
Before the text even reaches the AI’s neural network, a so-called tokenizer splits it into smaller units. These tokens might be whole words, word fragments, individual characters, or punctuation marks.
A long word might be split into several parts, while a common short word might just need a single token.
The precise splitting depends on the tokenizer used – so it varies from AI to AI and model to model.
Afterwards, tokens are represented by numbers (specifically numeric IDs).
The crucial point:
A token does not necessarily correspond to a single letter.
If a word is processed as a single token, the language model often doesn’t “see” the individual letters at all. What appears to us as a word is just a number to artificial intelligence.
That doesn’t mean the AI can’t know how the word is made up.
During training, it can of course learn how a word is spelled. It can spell out words and even carry out complex character analyses.
But this knowledge isn’t always as reliable as with an algorithm that inspects a character string directly.
The AI knows where Oman is, but not necessarily what letters are in the name
This is the really curious thing.
Ask an AI about Oman, and it can probably tell you quite a lot.
It knows the country is on the Arabian Peninsula, its capital is Muscat, it borders the Arabian Sea, and so on…
It might even put together a travel itinerary or tell you about the country’s history.
But when it comes to whether the name contains the letter A, it may get it wrong.
How does that add up?
A “large language model” is trained to learn patterns and relationships from massive volumes of text. It thereby acquires enormous knowledge about countries, cities, and rivers.
But that doesn’t mean it has an exactly retrievable list of the letters in every known word.
You could say: The AI knows a lot about Oman, but answering questions about the individual letters in its name requires a completely different skill.
And that skill isn’t always reliable.
Why a simple algorithm is sometimes better than artificial intelligence
As a software developer, I find it especially interesting just how easily some of these tasks can be solved with classic programming.
Take our extra rule from the game:
Find countries that start with O without containing an A.
If we already have a list of country names, this task can be solved in a few lines of PHP:
$countries = [
'Oman',
'Österreich',
'Osttimor'
];
$result = array_filter(
$countries,
fn($country) =>
str_starts_with($country, 'O')
&& stripos($country, 'a') === false
);
print_r($result);
The result is clear: The only correct answer is “Osttimor”. (Even if under certain circumstances “Ö” may be treated like “O” (for example in a lexicon), in software development Ö and O are two completely different characters.)
And that’s exactly why it’s important to actually check results, rather than rely on a plausible-sounding explanation.
A properly executed algorithm finds Osttimor reliably and without ambiguity, whereas a large language model is unreliable at this task.
Once these requirements are clear, a fixed algorithm gives a reproducible result.
But an AI can program itself!
Correct. And that makes things even more interesting.
You could easily ask an AI to code a Categories game.
It would create a user interface, could program the rules as a fixed algorithm, and thereby implement a neat, correct version of Categories.
But trying to enforce the rules without a strictly programmed algorithm can be a problem.
There’s a big difference between describing or producing an algorithm and actually executing one.
A language model generates responses based on learned patterns and information in the current context.
In doing so, it has developed remarkable abilities, including logical reasoning and solving complex problems.
But it doesn’t automatically run an exact string check just because the question demands it.
If, on the other hand, it writes a program and that program is actually executed, the program code takes care of the precise checking.
That’s the essential difference.
Are tokens really (only) to blame?
Tokenization is an important part of the explanation. But it’s not the only factor.
It would be wrong to claim that AI basically can’t recognize letters, just because it only sees tokens.
Modern language models can learn to work with individual characters. Some are already quite good at it (for example, I couldn’t provoke the error in Claude Opus 5.5).
How reliably an AI can solve such tasks depends on several factors:
Tokenization: Depending on how a word is split, analyzing its individual letters may be easier or harder.
Training: Language models mainly learn from linguistic contexts. Exact character operations are not necessarily among the abilities that are learned with high reliability. A person who can speak does not automatically know how the words he or she says are written.
How the question is phrased: Sometimes it helps to prompt the AI to first spell out the word, then check the criteria.
The model in use: Not all language models have the same capabilities. What one model answers incorrectly, another may solve easily.
The available tools: If a model can run Python code or query a database, many tasks can be solved much more reliably.
The right prompt makes the difference
This is the heart of it all: If you work with AI, you need to learn how to prompt.
Just because AI understands natural language doesn’t mean it will always return the result you wanted — even if you think you were perfectly clear.
Especially if you plan to publish the AI’s results, or want staff or customers to rely on its output, the prompts must be carefully crafted, tested, and verified.
For our Categories example: Don’t just use “country with O but no A”, but experiment with more detailed prompts.
Experiment Prompt Improvement A:
If you ask Google AI Search, for example, “country with o but no a, spell the country’s name to know for sure whether the criteria are met”, the answer is still wrong.
This might give you some idea of how the tokenizer works. Maybe spelling “Oman” wrong has other causes, too.

Experiment Prompt Improvement B:
Next try: If you use the prompt “country with o but no a, break the name down into its individual letters”, Google AI gives a better output. In this case, it treats ‘Ö’ as an ‘O’, which is fine here.

What UX, algorithms, and development patterns are for conventional software development — that is, what determines if a program is robust and does what it’s supposed to — the right prompt is for AI.
Try it yourself!
If you want to experiment a bit, give your favorite AI these tasks:
- Name five countries that begin with O and contain no A.
- Find a river whose name begins with X.
- Name five cities with exactly three vowels in their name.
- Which German city names begin with B and end with G?
- Name three countries whose German name contains the letter E exactly twice.
Then check the answers yourself.
Maybe the AI gets every question right. Maybe it makes a mistake. It depends on the model, and sometimes on the specific conversation, too.
It’s particularly interesting to ask the same questions to different AI models and compare the results.
Not every task needs artificial intelligence
Categories is a great example showing that a task can be child’s play for humans, but can pose unexpected challenges for a language model.
Even though many AIs can now generate excellent code, that doesn’t mean they should be used to replace classic algorithms everywhere.
If I want to know if a word contains a particular letter, I don’t need a neural network with a context window of millions of tokens.
A few lines of code are more than enough.
And if I’m developing a game like Categories, I might use AI for creative categories, exciting variants, or for explanations of unusual terms.
But the decision whether “Oman” contains an A is best left to a simple string function.
At least it doesn’t argue with me about it. 😉
Your opinion
What’s your take on using AI in software development? What does it do well; how do you combine AI with algorithms? Feel free to share your thoughts in the comments below.