Search, sort and learning
Answers are for parents and teachers.
1
Sort 6, 3, 9, 2 by hand: show the list after each round of comparing neighbours.
Start 6 3 9 2. After round 1: 3 6 2 9. After round 2: 3 2 6 9. After round 3: 2 3 6 9.
2
The list is [6, 2, 9]. What do the two last lines show?
Python
1numbers = [6, 2, 9] 2print(sorted(numbers)) 3print(numbers)
The first print shows [2, 6, 9] because sorted makes a new list; the second shows [6, 2, 9] because the list itself did not change.
3
Label each as fixed rule or learned from data: (a) a teacher writes if the mark is below 50, fail; (b) a model studies 1000 labelled photos of apples and oranges.
(a) fixed rule; (b) learned from data.
4
Why does a spam model usually improve when it gets more and better examples?
It sees more kinds of messages, so its pattern covers more cases and misses fewer.
5
Write one sentence that explains why the answers of a language model must be checked.
It is trained on very large amounts of text and writes answers that sound natural, but it can be wrong.