AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Term 3 round-up

Week 30 · Review: Term 3 · 3 lessons
1

Review: AI and bits

Computing 7: Units 7.5–7.6, pp. 150–224
GoalExplain how an AI learns and can be unfair, and work out picture sizes, binary numbers and letter codes.
New words
bias · unfairness in an AI’s results, often caused by training data that leaves some groups outcolour depth · the number of bits stored for each pixel; depth 2 allows 4 coloursvector graphic · a picture stored as a list of shapes, not as pixelsplace value · the value of a position in a binary number: 128, 64, 32, 16, 8, 4, 2 and 1
Explanation

An AI learns patterns from training data, and then it makes guesses about new data. If the training data leaves some things out, the AI is biased and makes more mistakes for them, so a person must check what it decides. An AI system has inputs from sensors, cameras or microphones, a process and an output, and it can predict the future from past data, for example with a mean. Never give personal information to an AI chatbot. A bitmap picture is made of pixels, and its size in bits is the number of pixels across × the number of pixels down × the colour depth. A colour depth of 2 allows four colours and a depth of 3 allows eight. In a binary number each place has a value, and you add the values where there is a 1. Sound is measured by an analogue to digital converter, and each letter is stored as one byte.

Kind of dataHow the computer stores it
picturepixels, each with a binary colour code
soundreadings from an analogue to digital converter, stored as binary numbers
textone byte (8 bits) for every character
whole numberbinary place values 128, 64, 32, 16, 8, 4, 2, 1
Worked examples
GroupTraining photosTest photosCorrectPercent correct
dogs9010990%
cats1010440%
A team trains an AI to tell dogs from cats. The training set has 90 dog photos and only 10 cat photos. In the test the AI gets 9 of 10 dogs right but only 4 of 10 cats. The cats were left out of the training data, so the AI is biased. The fix is to add many more varied cat photos and test again.
This hot-air balloon is 9 pixels across and 6 down, with four colours: 00 = blue, 01 = red, 10 = yellow and 11 = brown. The colour depth is 2, so the file needs 9 × 6 × 2 = 108 bits. Eight colours would need a depth of 3, and the same picture would need 9 × 6 × 3 = 162 bits.
1286432168421
00101101
To read a binary number, add the place values that have a 1. Here 32 + 8 + 4 + 1 = 45. In a character chart each letter has an 8-bit code, and the codes go up by one for each letter. If P is 01010000, which is 64 + 16 = 80, then the code 01010011 is 64 + 16 + 2 + 1 = 83, which is three letters later: S.
Class activity

Bias test with cards (no computer): draw 12 small training cards for a pretend AI that tells dogs from cats: 10 dogs and 2 cats. Draw 6 test cards, 3 dogs and 3 cats. A partner studies only the 12 training cards and then guesses the label of each test card. Count the correct guesses for dogs and for cats and write the percentages. Why are they different? Add 8 more cat cards to the training set, swap partners and test again. Then, on squared paper, colour a 6 × 6 picture with two colours and work out its size in bits.

Practice
1
A smart plant pot has a soil moisture sensor, a pump and a light. Say whether each part is an input, a process or an output.
Part of a smart plant potINPUT, PROCESS or OUTPUT?
soil moisture sensor?
compare the reading with the best level?
pump starts?
a light that shows the water tank is empty?
2
A bus company counted the riders on four Mondays. An AI predicts the next Monday from the mean of the past numbers. What does it predict? Give one reason why the real number might be different.
MondayRiders
148
252
345
451
next?
3
The code of row 3 is hidden. Write it. How many bits does the whole picture need? How many would it need with a colour depth of 2?
0001100000111100????????000110000001100000011000
4
(a) Use the chart to decode the message 01010100 01001111 01010000. (b) Change 00110010 into an ordinary number.
LetterCode
M01001101
N01001110
O01001111
P01010000
Q01010001
R01010010
S01010011
T01010100