 Kau. So, the last lesson we did, we looked at how computers can detect errors and correct them. Hands up if you've ever been to the supermarket and you've scanned in your groceries and it comes up with the grocery item. So have you guys done that? Yeah, hands down. So, what happens when you've scanned it and it isn't reading properly, what does the checkout person do? What would the checkout person do? Yeah, they do scan something and sometimes they have to key in something, don't they? It just can't be read because it might be folded and so they have to do something. What do they have to do? Yeah, they do. Don't they scan that on the sheet? They do, but that still doesn't tell us what the product is. So, at the bottom of the product, you've got the barcode, right, the black and the white, but then you've got some numbers underneath. And those numbers have a thing called a check sum at the end, yeah? Yeah, yeah, absolutely. So, they have to type in the numbers because they just can't read it, right? And so that last number is called a check sum and I'm going to teach you guys today how it works. Dylan, could you just go and get something from the back of the classroom there? That's got a 13 digit barcode for us and we'll see how it works. Cool, so call out the numbers loud and proud, but I don't want to know the 13th number. I only want to know the 12 digits before that. 9, 3, 1, 0, 4, 9, 2, 0, 0, 0, 4, 5. OK, I'm just going to read that back to you. Can you double check for me? 9, 3, 1, 0, 4, 9, 2, 0, 0, 0, 4, 5. True? Cool. OK, so now we've got these numbers up on the board. What I need you guys to do is to help me add up just this top row. So 9 plus 1 is? 10. 10 plus 4 is? 14. 14 plus 2 is? 16. 16 plus 4 is? And we're only interested in the ones column. So what number in 20 is in the ones column? See? It's in the tens. Good try. Zero. So we're just going to record the zero here, because that's the only number we're interested in. Now we're going to add up the bottom column. 3 plus 0 is? 3 plus 9 is? 12 plus 0 is? 12 plus 5 is? 17, but we're only interested in the ones column? 7. 7. Now the bottom one, we're going to times by 3, but here's the trick, we're only interested in the ones column. What's 7 times 3? And what's the value in the ones column? Freddy. Cool. Is it equal to 1? What's 0 plus 1? Now, if I had to make 0, which is really 10, right? Because we're only interested in the ones column. If I had to make 0, what would be that missing number in there? Yeah? 1 plus what makes 10? 9. The check sum is 9. True or false? So that's the mathematical equation that's underneath every single barcode, right? OK. So let's have a look at what happens if I heard something wrong. Let's say that I heard the 4 as a 5. So the first thing that would change is this. Would this be a 0 still? What would that become? OK. Which then changes 1 plus 1 isn't 1 anymore. What is it? 2. That becomes 2. So does 2 plus what makes 10, is it 9? It becomes 8. So because I typed in 1 number wrong, the check sum is incorrect and it beeps back at you to say, it's not right. And so you have to type the number in again. And because we're people, what do you think the most common mistake is when we're typing in numbers? What's the thing we would get wrong the most, Robert? Yeah, the number. What would we do with the numbers? That would make it different. Yeah. Would I read the number wrong? What would I do? My part, instead of the 1, instead of being 9, it might be 1, 9. So did you notice that this was the first number, this was the second number, this is the first number, this is the second number. The reason for that is, is that the most common mistake we make is we swap these around. I might read 93, true? Have you ever done that when you're typing and you get your letters around the wrong way? And that's the kind of thing that this check sum stops us from meaning that we go in to buy a pack of Pokemon cards and we get charged for a solar panel robot kit. True?