Using AI well · Write-up

Why the famous AI letter-counting fail isn't a test of intelligence, and what changes when the model can use a tool.

The famous fail

Ask a chatbot how many R's are in "strawberry," and for a long time it would confidently tell you two. The answer is three. It became the go-to example people post to prove AI is dumb.

Most chatbots get this one right now, but the lesson behind it hasn't changed, and it explains a lot of the other "AI can't even…" posts you still see.

Why it happens

A language model doesn't read letters. Before it sees your question, the text is broken into chunks called tokens, often whole words or pieces of words. "Strawberry" might arrive as something like "straw" and "berry," not as ten letters.

So asking it to count letters is like asking someone to spell a word they've only ever heard spoken. They can make a good guess, but it's still a guess.

Give it a tool

You wouldn't count letters by guessing either. You'd look. AI can look too, if it has a tool. Most AI assistants today can write a small piece of code and run it. Instead of guessing, it writes one line and lets the computer do the counting:

word = "strawberry"
print(word.count("r"))   # 3

That's Python. The answer is 3, and it's 3 every time, because the computer is counting characters, not guessing from tokens.

The same idea in other languages

Every language has a way to do this in one line.

Bash

Print the word, put each "r" on its own line, then count the lines.

echo -n "strawberry" | grep -o "r" | wc -l

PowerShell

Find every match of "r" with a regular expression and count them.

([regex]::Matches("strawberry", "r")).Count

JavaScript

Split the word into letters, keep the R's, and count what's left.

[..."strawberry"].filter(c => c === "r").length

The right tool for the job

The lesson isn't that AI is dumb. It's that the tools exist, and knowing which one to reach for is the skill.

ToolGood atExample
A chat modelLanguageReading, summarizing, drafting
CodeExact answersCounting, math, dates
A small modelNarrow questions, cheaply"Is this email a receipt?"

That last row is how I sort my own email: a small model answers a few yes/no questions about each message, and code makes every decision. The full write-up is The Home Depot Problem.

What I took away

Before deciding AI can't do something, ask whether it had the right tool. A lot of "AI fails" are really a hammer being judged on how well it turns screws.

The useful question isn't "is AI smart?" It's "which part of this job is language, which part is exact, and which tool should handle each?"