Computational Thinking & AI
Computational Thinking & AI
Artificial intelligence
Grade 9
P (60-65)
Python
Python is a versatile, high-level programming language known for its
simple syntax, making it easy to learn and use. It is widely used for
web development, data analysis, artificial intelligence, automation,
and more.
for i in range(5):
print(i)
# Output: 0, 1, 2, 3, 4
2- while Loop (Repeats as long as a condition is True).
x = 0 while x < 5:
print(x)
x += 1
# Output: 0, 1, 2, 3, 4
3- Nested Loops (You can place a loop inside another loop).
for i in range(3):
for j in range(2):
print(f"i={i}, j={j}")
4- Additional Features:
for i in range(10):
if i == 5:
break
print(i)
# Output: 0, 1, 2, 3, 4
for i in range(5):
if i == 2:
continue
print(i)
# Output: 0, 1, 3, 4
for i in range(5):
print(i)
else: print("Loop completed!")
# Output: 0, 1, 2, 3, 4, Loop completed!
Artificial intelligence:
- Or AI means building computers that can solve problems using human-like judgement.
Methods:
Heuristics
Expert systems
Decision trees
Machine learning
Computational thinking:
Artificial intelligence
Unit 1: Heuristics
Grade 9
P (66-69)
Heuristics
A heuristic is a rule that helps you make a quick decision. It’s like a guess or a rough
estimate. But it is a guess based on careful thinking about the problem.
Heuristics are not always completely accurate. But they provide a quick way to simplify
difficult problems.
- People judge the likelihood of an event based on how easily examples come to mind.
Example: After hearing about a plane crash on the news, you might overestimate the risk of
flying, even though statistically, it's much safer than driving.
- Decisions are made based on how similar something is to a prototype in a person’s mind.
Example: Assuming someone wearing a lab coat is a doctor because they fit the stereotype,
even if they are actually a scientist.
- People rely heavily on the first piece of information they encounter when making decisions.
Example: A salesperson starts with a high price and offers a discount; customers might feel
they’re getting a deal, even if the final price is still expensive.
The heuristic we will use:
- Signals with fewer than three characters are bad.
- None of the good signals are this short.
- They will be excluded from the list.
- Many of the bad signals have been removed from the list.
- All the good Signals are still on the list.
- Some bad signals are still on the list. The heuristic did not find them.
8)What will happen if you try to access numbers[3] when numbers = [0 , 1]?
Answer: It will give an error