I would say that, while it does count, it only counts in certain circumstances, as trying to use trial and error with already predetermined data as its objective to output isn't AI, as it already has data that is fine as-is. For example:
Say your AI is trying to point at a precise location but is only given the current accuracy of its positioning. It could check every location and find the best of all of them, or, it could do this:
- Correct the up/down(vertical) positioning:
- Start moving up.
- If the accuracy gets better:
- Keep moving up.
- Else move down.
- Continue until the accuracy starts to get weaker.
- Move back just a tiny bit to increase again.
- Correct the left/right(horizontal) positioning:
- Start moving right.
- If the accuracy gets better:
- Keep moving right.
- Else move left.
- Continue until the accuracy starts to get weaker
- Move back just a tiny bit to increase again.
- You're done!
This is AI, as it learns what to and what not to do, and figures out a location based off of the accuracy of its positioning alone. So while the "trial and error" method is AI, it only counts when it has no predetermined calculation to figure out the result without said trial and error. Trying to find numbers of Pi, for example, while it is technically trial and error, it uses math functions and requires multiple inputs to calculate its output, and, in the end, it only partly uses trial and error, therefore, it is not AI in the end.