Now I hold all the power Actually, I think I hold all the power in
my hand Oh! So Jav's got, Jav's got
I can count to 31 on my hand OK
With my fingers up So look, 1, 2, 3, a very offensive 4
Beep! 5
and then my hand cramped. Ok, so if Jav's using one hand he can count
up to 31 if he's using two hands, any guesses on how
high he can count using two hands? 62? No. Not quite.
Yeah? 63? Oh, a bit more than that
So this would be... If he's using 6 fingers he can count to 63.
He can actually count to 1023 on two hands. And if we use all 4 of our hands, we can actually
get up to 1,048,576 My brain just melted
Alright, so you can see how with a small number of bits you can represent large numbers very
quickly But there's something else that can be on
or off Has anyone had a birthday this week?
Mrs Eddington has had a birthday Where's Mrs Eddington?
Ah! Mrs Eddington. Come on down please. [Applause]
Mrs Eddington, quite a young looking lady. I'd say you'd be about 29?
Oh... Could be about right. Maybe I'll give you about 30.
OK, 30. Fantastic. So we only need ahhh... We've got your birthday cake here
But before we can sing happy birthday we've gotta light the candles
But we've only got 5 candles Maybe Computer Science can help us
Maybe Computer Science can help us Anyone got any ideas?
Yes? That, um, bits thing?
So you treat the candles as bits? Yeah.
Yeah, OK. So can anyone tell me what bits I should light?
I'm gonna light the match, and before my hand is burnt we need to figure out how to represent
the number 30 in binary. OK 1, 2, 4, 8, 16
Ok, do we need the 16 bit? Yes
Do we need the 8 bit? Yes.
Do we need the candles to light? Yes.
Do we need the 4 bit? Yes.
Do we need the 2 bit? Yes/No/Yes.
Do we need the 1 bit? No.
Cool, because 30's an even number, and oh! My hand is unburnt.
Excellent. So we've got 11110. Happy 11110 birthday!
OK, Mrs Eddington, would you like to blow out your candles?
I would love to blow them out. [Sing] Happy Birthday to you, Happy Birthday
to you. Happy Birthday Mrs Eddington, Happy Birthday
to you. [Applause]
Now, the bad new is, as a teacher, you have to share your birthday cake with the entire
class. You do, but don't worry.
So this is a problem, right? And computer scientists love problems.
How do you share a birthday cake this size with the entire class, and make sure everyone
gets some? Divide it!
Perhaps if I could have all that bit? I'll tell you what, what we're going to do
is using the knife of power...
that's your bit. That's my bit.
That's your bit Mrs Eddington. So I want you to take half - that is yours
Oh that's mine That is your half, birthday girl
Yum Alright. So who else wants half?
Mrs Eddington you can take a seat if you want Oh, that's great, that's great, 'cause what
we're going to do now everyone is going to get some cake
Everyone's going to get... What we're going to do...
Everyone's going to get half the cake Everyone's going to get half the cake
Half each So ah, where are we going to start
Start at this end Ok, you can have half
OK. It was pretty random, but it worked out in
your favour And don't worry, 'cause we're just going to
go halve the cake again And you can have the other half
Yep, and then we're just going to go half again.
Don't worry, the people at the back are going to get plenty of cake
You guys up in the corner are looking pretty hungry.
But, when it gets to you it might be pretty small, but that's alright,
because we can still keep dividing it in half and you can have seconds
There you go, you can take half And just, do you want all this?
Oh yeah, we've got a messy guy here. Oh yeah, yum.
THat's alright because there's still lots of halves to go.
So you can take half of that, and you can take - no you only get half!
So what Jav is finding out pretty quickly is that when you divide something in half
and keep dividing it in half again it gets smaller really quickly
So that's why as Computer Scientists, if we're faced with a tricky problem
we always try to find a way to cut it down into smaller bits.
Because if those smaller bits can be cut down into smaller bits, we can ahh...
Make a big problem or a big cake... easy to solve.
Or annoy an entire audience of guys.
Notice that much of the time the children are actually working out the answers for themselves
We're not actually trying to teach them how to do these things
We just want to give them the idea that these are concepts that they might be interested
in In fact, sometimes you have to avoid the temptation
to lecture them. Well, now we're going to move on to looking
at how other kinds of data might be represented.