Why AI sometimes makes confident mistakes in AI for Everyone - Performance Analysis
We want to understand how the AI's decision process grows as it handles more information.
Specifically, why does AI sometimes confidently give wrong answers?
Analyze the time complexity of this simplified AI decision process.
function aiDecision(inputData) {
let confidence = 0;
for (let i = 0; i < inputData.length; i++) {
confidence += analyzeFeature(inputData[i]);
}
return confidence > threshold ? "Confident" : "Unsure";
}
function analyzeFeature(feature) {
// returns a score based on feature
return feature.score;
}
This code sums scores from many features to decide confidence.
Look for repeated steps that take most time.
- Primary operation: Loop over each feature in inputData.
- How many times: Once for every feature, so as many times as inputData length.
As the number of features grows, the AI checks each one once.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | 10 feature checks |
| 100 | 100 feature checks |
| 1000 | 1000 feature checks |
Pattern observation: The work grows directly with the number of features.
Time Complexity: O(n)
This means the AI's confidence calculation takes longer as more features are checked, growing in a straight line with input size.
[X] Wrong: "AI is always right if it is confident."
[OK] Correct: Confidence is based on summed scores, but if features are misleading or incomplete, AI can be confidently wrong.
Understanding how AI processes information step-by-step helps you explain its strengths and limits clearly, a useful skill in many discussions.
What if the AI used nested loops to compare every feature with every other feature? How would the time complexity change?