Teaching others to use AI effectively in AI for Everyone - Time & Space Complexity
When teaching others to use AI effectively, it helps to understand how the effort grows as more people learn or more tasks are involved.
We want to see how the time needed changes when the number of learners or AI tasks increases.
Analyze the time complexity of the following teaching process.
function teachAI(users) {
for (let user of users) {
explainBasics(user);
answerQuestions(user);
}
}
function explainBasics(user) {
// Basic AI concepts explained once per user
}
function answerQuestions(user) {
// Answer multiple questions from each user
for (let question of user.questions) {
respondTo(question);
}
}
This code shows teaching AI basics and answering questions for each user in a group.
Look at what repeats as the number of users and questions grow.
- Primary operation: Looping through each user and then through each question they ask.
- How many times: Once per user, and once per question per user.
As more users join, the time grows because each user needs teaching and answers.
| Input Size (users) | Approx. Operations (questions per user = 5) |
|---|---|
| 10 | 10 users x 5 questions = 50 operations |
| 100 | 100 users x 5 questions = 500 operations |
| 1000 | 1000 users x 5 questions = 5000 operations |
Pattern observation: The total work grows directly with the number of users and their questions.
Time Complexity: O(n * m)
This means the time grows with both the number of users (n) and the number of questions per user (m).
[X] Wrong: "Teaching more users only takes a little more time because explanations are quick."
[OK] Correct: Each user needs individual attention and questions answered, so time adds up with every new user and their questions.
Understanding how teaching time grows helps you explain how to manage resources and plan learning sessions effectively.
"What if each user asked twice as many questions? How would the time complexity change?"