Knowing when NOT to use AI in AI for Everyone - Time & Space Complexity
We want to understand how the cost of using AI changes as the problem size grows.
Specifically, when does using AI become too costly or inefficient?
Analyze the time complexity of deciding when NOT to use AI.
function shouldUseAI(task) {
if (task.isSimple) {
return false;
}
if (task.requiresHumanJudgment) {
return false;
}
if (task.dataIsInsufficient) {
return false;
}
return true;
}
This code checks simple conditions to decide if AI should be used or not.
Identify the loops, recursion, array traversals that repeat.
- Primary operation: A few simple condition checks.
- How many times: Each condition is checked once per task.
The number of checks stays the same no matter how big the task is.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | 3 checks per task x 10 = 30 checks |
| 100 | 3 checks per task x 100 = 300 checks |
| 1000 | 3 checks per task x 1000 = 3000 checks |
Pattern observation: The work grows directly with the number of tasks, but each task only needs a fixed small number of checks.
Time Complexity: O(n)
This means the time to decide grows in a straight line with the number of tasks.
[X] Wrong: "Checking if AI should be used takes a lot of time because AI itself is complex."
[OK] Correct: The decision to use AI is usually a simple check done once per task, not the AI processing itself.
Understanding when not to use AI shows you can think clearly about costs and benefits, a skill valuable in many real-world situations.
"What if the decision to use AI involved checking many complex conditions or data points? How would the time complexity change?"