Writing reports and presentations with AI in AI for Everyone - Time & Space Complexity
When using AI to write reports and presentations, it's important to understand how the time needed grows as the amount of content increases.
We want to know how the AI's work time changes when the report or presentation gets longer or more detailed.
Analyze the time complexity of the following AI writing process.
function generateReport(sections) {
let report = "";
for (let section of sections) {
let content = aiWrite(section);
report += content;
}
return report;
}
// aiWrite creates text for each section
This code creates a report by asking the AI to write each section one by one and then combines them.
Look at what repeats as the input grows.
- Primary operation: Calling the AI to write each section.
- How many times: Once for each section in the report.
As the number of sections increases, the total time grows roughly in direct proportion.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | 10 AI writing calls |
| 100 | 100 AI writing calls |
| 1000 | 1000 AI writing calls |
Pattern observation: Doubling the number of sections doubles the work time.
Time Complexity: O(n)
This means the time to generate the report grows linearly with the number of sections.
[X] Wrong: "The AI writes the whole report instantly, so time doesn't depend on length."
[OK] Correct: Each section requires separate AI processing, so more sections mean more time.
Understanding how AI workload grows helps you explain efficiency and plan tasks well, a useful skill in many real-world projects.
"What if the AI could write multiple sections at once? How would that change the time complexity?"