WEBVTT
Kind: captions
Language: en

00:00:00.820 --> 00:00:02.570
BRADY HARAN: I want to deal with
a number that must be the

00:00:02.570 --> 00:00:08.480
most requested so far on
Numberphile, and that is 301.

00:00:08.480 --> 00:00:10.590
Now, for those of you who don't
pay much attention to

00:00:10.590 --> 00:00:13.390
the YouTube view counters, you
might wonder what the big deal

00:00:13.390 --> 00:00:16.020
is with 301, and let
me tell you.

00:00:16.020 --> 00:00:19.170
When a new video is uploaded,
and if it's quite a popular

00:00:19.170 --> 00:00:22.340
one, you'll quickly see the view
counter rise and rise and

00:00:22.340 --> 00:00:27.020
rise, and then it will get to
301, and it will freeze.

00:00:27.020 --> 00:00:31.720
And it will stay on 301 for a
day, maybe half a day, and

00:00:31.720 --> 00:00:34.390
then it will start counting to
higher numbers as usual.

00:00:34.390 --> 00:00:36.800
Now, a lot of people have been
very mystified by this, and

00:00:36.800 --> 00:00:37.980
have asked us to check it out.

00:00:37.980 --> 00:00:39.470
TED HAMILTON: I'm Ted Hamilton,
I'm a product

00:00:39.470 --> 00:00:41.270
manager for YouTube Analytics.

00:00:41.270 --> 00:00:42.550
BRADY HARAN: So there you go.

00:00:42.550 --> 00:00:45.560
I've got in touch with the
people who actually count the

00:00:45.560 --> 00:00:46.810
YouTube views.

00:00:46.810 --> 00:00:47.630
TED HAMILTON: That is correct.

00:00:47.630 --> 00:00:49.050
Well, we actually have
the computers do it.

00:00:49.050 --> 00:00:51.620
We don't count them ourselves,
but yes.

00:00:51.620 --> 00:00:55.180
BRADY HARAN: So before we get
to this whole 301 malarkey,

00:00:55.180 --> 00:00:57.170
what is a view on YouTube?

00:00:57.170 --> 00:00:58.130
I've always wondered.

00:00:58.130 --> 00:01:00.930
is someone just pressing play
counting as a view?

00:01:00.930 --> 00:01:01.840
TED HAMILTON: Well, that's
actually a bit

00:01:01.840 --> 00:01:02.800
of a YouTube secret.

00:01:02.800 --> 00:01:07.430
A view should be a video
playback that was requested by

00:01:07.430 --> 00:01:11.490
an actual user who got what they
were intending to get and

00:01:11.490 --> 00:01:12.740
had a good user experience.

00:01:12.740 --> 00:01:16.440
We think of views as a currency,
and therefore we

00:01:16.440 --> 00:01:20.320
have to make a significant
effort to eliminate

00:01:20.320 --> 00:01:22.360
counterfeit views,
if you will.

00:01:22.360 --> 00:01:24.270
BRADY HARAN: Now, I know that
all sounds a bit mysterious,

00:01:24.270 --> 00:01:26.720
and we will come back to it
later on in the video, but

00:01:26.720 --> 00:01:29.250
let's crack on with
this 301 figure.

00:01:29.250 --> 00:01:31.570
And you're going to find out
counterfeit views actually

00:01:31.570 --> 00:01:33.010
have a bit to do with it.

00:01:33.010 --> 00:01:35.380
But the next thing we need to
realize is when you watch any

00:01:35.380 --> 00:01:38.790
video, like this one for
example, you're probably not

00:01:38.790 --> 00:01:40.910
all watching it from
the same server.

00:01:40.910 --> 00:01:43.170
It gets distributed all
around the world.

00:01:43.170 --> 00:01:45.400
TED HAMILTON: So there is
the original, which

00:01:45.400 --> 00:01:46.470
you will have uploaded.

00:01:46.470 --> 00:01:48.090
Or I guess by the time you
are watching this,

00:01:48.090 --> 00:01:49.050
have already uploaded.

00:01:49.050 --> 00:01:50.820
Then this gets, what
do you call it?

00:01:50.820 --> 00:01:54.240
Cached in different locations,
so that when you make a

00:01:54.240 --> 00:01:56.880
request for a video, it doesn't
need to travel all the

00:01:56.880 --> 00:02:01.020
way from London over to
California and say OK, send me

00:02:01.020 --> 00:02:02.680
back all of these bytes
way back here.

00:02:02.680 --> 00:02:05.230
BRADY HARAN: So with multiple
copies of the video all around

00:02:05.230 --> 00:02:08.820
the world, counting the views
starts to get a little bit

00:02:08.820 --> 00:02:10.080
more complicated.

00:02:10.080 --> 00:02:12.120
TED HAMILTON: Here's you
at your computer

00:02:12.120 --> 00:02:13.060
watching the video.

00:02:13.060 --> 00:02:15.480
If you make a request to this
server, this server is going

00:02:15.480 --> 00:02:16.400
to give you the video, right?

00:02:16.400 --> 00:02:19.280
And at the same time, this
server is going to write a

00:02:19.280 --> 00:02:21.560
little message to a log.

00:02:21.560 --> 00:02:23.060
It's just one line in a log.

00:02:23.060 --> 00:02:25.590
Every once in awhile, we collect
all of these logs.

00:02:25.590 --> 00:02:28.390
So we'll ship this thing in
from central Europe, or

00:02:28.390 --> 00:02:31.740
whatever into the central log
collection area, aggregate

00:02:31.740 --> 00:02:34.840
them all together, and then go
through and count them up.

00:02:34.840 --> 00:02:37.120
BRADY HARAN: Well OK, that seems
simple enough, but it

00:02:37.120 --> 00:02:40.730
doesn't explain why the
view counter freezes.

00:02:40.730 --> 00:02:42.700
TED HAMILTON: Views, as
mentioned, are a currency.

00:02:42.700 --> 00:02:46.590
When you have a video with a
very small amount of views,

00:02:46.590 --> 00:02:50.050
then you don't need to
be too careful about

00:02:50.050 --> 00:02:51.030
what that view was.

00:02:51.030 --> 00:02:55.250
However, once it gets to be
above 300 and beyond, this

00:02:55.250 --> 00:02:58.990
currency we really need to
verify and make sure that the

00:02:58.990 --> 00:03:01.500
number is what it
purports to be.

00:03:01.500 --> 00:03:03.600
So this means that we have to
go through a statistical

00:03:03.600 --> 00:03:06.700
verification process, and that
statistical verification

00:03:06.700 --> 00:03:08.960
process actually takes
some time.

00:03:08.960 --> 00:03:12.730
And thus we go from incrementing
one by one to

00:03:12.730 --> 00:03:16.380
then saying, OK, now we're
incrementing in batch, and all

00:03:16.380 --> 00:03:19.980
of these views that have been
added on have been verified by

00:03:19.980 --> 00:03:22.250
YouTube to be real views.

00:03:22.250 --> 00:03:27.860
We are preventing things like
bots to go in and add a bunch

00:03:27.860 --> 00:03:28.740
of views to a video.

00:03:28.740 --> 00:03:34.080
Or we are preventing something
that may have perhaps misled

00:03:34.080 --> 00:03:37.130
someone into watching a video.

00:03:37.130 --> 00:03:39.230
Say you had a title that was
completely misleading, and a

00:03:39.230 --> 00:03:42.250
thumbnail that was completely
misleading, and people

00:03:42.250 --> 00:03:45.450
actually went on there and just
viewed for a few seconds,

00:03:45.450 --> 00:03:46.605
and then left.

00:03:46.605 --> 00:03:48.990
If you see that enough times,
it a fair enough indicator

00:03:48.990 --> 00:03:52.640
that something was wrong there,
so that we might not

00:03:52.640 --> 00:03:55.050
authorize all of those to
be legitimate views.

00:03:55.050 --> 00:03:55.730
BRADY HARAN: All right, then.

00:03:55.730 --> 00:03:57.290
They're verifying the numbers.

00:03:57.290 --> 00:03:58.790
They're checking everything.

00:03:58.790 --> 00:04:00.890
I guess we probably could
have guessed that.

00:04:00.890 --> 00:04:03.560
But why 301?

00:04:03.560 --> 00:04:05.280
TED HAMILTON: I was not there
when the decision was made,

00:04:05.280 --> 00:04:08.070
but at some point the decision
was made that we need to draw

00:04:08.070 --> 00:04:12.040
a line between what is innocuous
and the database can

00:04:12.040 --> 00:04:16.360
handle, and what is all of a
sudden serious business.

00:04:16.360 --> 00:04:20.480
The proportion was calculated to
be at about 300, that this

00:04:20.480 --> 00:04:22.090
is the portion that we
need to take care of.

00:04:22.090 --> 00:04:27.010
But the formula that we use to
arrive at 300, I don't know if

00:04:27.010 --> 00:04:28.580
anyone actually knows that.

00:04:28.580 --> 00:04:29.310
BRADY HARAN: Well, OK.

00:04:29.310 --> 00:04:31.150
They drew a line in the sand.

00:04:31.150 --> 00:04:32.750
It was kind of arbitrary.

00:04:32.750 --> 00:04:35.940
They wanted to differentiate
between people just sharing

00:04:35.940 --> 00:04:39.080
their home movies and the videos
that are more popular,

00:04:39.080 --> 00:04:40.760
the ones that are a
bit more serious.

00:04:40.760 --> 00:04:42.730
The ones that need scrutiny.

00:04:42.730 --> 00:04:44.390
But that was 300.

00:04:44.390 --> 00:04:47.440
The view counter
freezes at 301.

00:04:47.440 --> 00:04:49.210
What's going on here?

00:04:49.210 --> 00:04:50.460
Is there a reason?

00:04:50.460 --> 00:04:51.780
TED HAMILTON: Yeah,
there is a reason.

00:04:51.780 --> 00:04:56.480
And the reason was the number
300 was chosen.

00:04:56.480 --> 00:05:00.410
And when someone's writing code,
they need to put the

00:05:00.410 --> 00:05:03.330
logic in the code that says
where you should stop, or

00:05:03.330 --> 00:05:05.900
where you should, if one
condition is true,

00:05:05.900 --> 00:05:06.660
you go to the left.

00:05:06.660 --> 00:05:08.830
And the other condition is true,
you go to the right.

00:05:08.830 --> 00:05:11.880
Now, this condition can
be written like this.

00:05:11.880 --> 00:05:20.440
If the view count is less than
300, then go ahead and add one

00:05:20.440 --> 00:05:21.560
to the view count.

00:05:21.560 --> 00:05:30.120
Otherwise, go to x where x is
our much more complicated view

00:05:30.120 --> 00:05:30.900
count pipeline.

00:05:30.900 --> 00:05:34.610
However, what actually got
written was not this, but if

00:05:34.610 --> 00:05:39.340
view count is less than or equal
to 300, then increment

00:05:39.340 --> 00:05:39.860
the view count.

00:05:39.860 --> 00:05:43.770
So what this means is if the
view count is at 300, this

00:05:43.770 --> 00:05:47.090
says is the view count less
than or equal to 300?

00:05:47.090 --> 00:05:48.000
Yes, it is.

00:05:48.000 --> 00:05:48.730
Let me add one.

00:05:48.730 --> 00:05:50.495
So then you end up at 301.

00:05:50.495 --> 00:05:53.050
BRADY HARAN: Let me recap
what's going on here.

00:05:53.050 --> 00:05:55.750
The code which is controlling
where this view counter

00:05:55.750 --> 00:06:00.210
freezes contains a less
than or equal to sign.

00:06:00.210 --> 00:06:03.890
So that means when a new early
view comes along, it's checked

00:06:03.890 --> 00:06:05.290
against the code.

00:06:05.290 --> 00:06:10.070
Say the overall view count
on the database is 299.

00:06:10.070 --> 00:06:10.810
OK, then.

00:06:10.810 --> 00:06:12.290
We'll let another one on.

00:06:12.290 --> 00:06:14.430
Here comes another view.

00:06:14.430 --> 00:06:16.950
Now the view count is 300.

00:06:16.950 --> 00:06:21.150
That isn't less than 300,
but it is equal to 300.

00:06:21.150 --> 00:06:24.820
So the code lets another view
jump onto the total.

00:06:24.820 --> 00:06:29.150
Now we're at 301, and when
another view comes along, it's

00:06:29.150 --> 00:06:33.150
not less than 300, but it's also
not equal to 300 anymore,

00:06:33.150 --> 00:06:34.540
and the door is shut.

00:06:34.540 --> 00:06:38.090
There are going to be no more
views added to the publicly

00:06:38.090 --> 00:06:41.210
visible count until YouTube
have done their checks.

00:06:41.210 --> 00:06:43.660
And that will take half
a day to a day.

00:06:43.660 --> 00:06:46.680
Then of course, all the extra
views that have been counted

00:06:46.680 --> 00:06:49.430
in the interim all pile
onto the total.

00:06:49.430 --> 00:06:50.780
Nothing's missed.

00:06:50.780 --> 00:06:52.080
At least that's what I'm told.

00:06:52.080 --> 00:06:53.820
TED HAMILTON: Yeah, so whoever
wrote this code probably did

00:06:53.820 --> 00:06:56.600
not realize the magnitude
of what they were doing.

00:06:56.600 --> 00:06:58.340
View counts have been around
since the beginning of

00:06:58.340 --> 00:07:03.200
YouTube, and who was to know
what YouTube would become.

00:07:03.200 --> 00:07:08.490
So yeah, that was actually a
rather monumental second of

00:07:08.490 --> 00:07:12.760
time in San Bruno, California,
when a coder decided to write

00:07:12.760 --> 00:07:13.510
that logic in.

00:07:13.510 --> 00:07:16.240
It is now one of the
idiosyncrasies of YouTube.

00:07:16.240 --> 00:07:18.100
BRADY HARAN: Now, I can hear
some of you screaming at your

00:07:18.100 --> 00:07:19.480
computer screens.

00:07:19.480 --> 00:07:22.270
The view count doesn't
stop at 301.

00:07:22.270 --> 00:07:28.390
Sometimes it stops at
302, or 305, or 310.

00:07:28.390 --> 00:07:30.750
What's going on there?

00:07:30.750 --> 00:07:33.980
There's an explanation for that,
too, and that comes back

00:07:33.980 --> 00:07:37.180
to how I was saying the videos
are shared around servers all

00:07:37.180 --> 00:07:38.330
across the world.

00:07:38.330 --> 00:07:40.660
So here's what's
going on there.

00:07:40.660 --> 00:07:44.200
Views are coming in from the
logs at the different videos,

00:07:44.200 --> 00:07:45.910
the different places
around the world.

00:07:45.910 --> 00:07:48.230
And they're coming to this
central database.

00:07:48.230 --> 00:07:51.330
And we know the door's going
to be shut at 301, we just

00:07:51.330 --> 00:07:53.500
explained that a minute ago.

00:07:53.500 --> 00:07:57.640
But what happens if views are
coming in at the same time?

00:07:57.640 --> 00:08:01.200
Someone watched it in Africa at
the exact same time someone

00:08:01.200 --> 00:08:02.340
watched in Europe.

00:08:02.340 --> 00:08:04.820
Now we've got multiple
views coming in.

00:08:04.820 --> 00:08:08.480
Checking if they're allowed to
join the count, yes they are.

00:08:08.480 --> 00:08:11.210
It's less than or
equal to 300.

00:08:11.210 --> 00:08:14.650
So they all pile on
at the same time.

00:08:14.650 --> 00:08:17.800
Now when a new view comes
along, sorry,

00:08:17.800 --> 00:08:19.430
we're closed for business.

00:08:19.430 --> 00:08:22.240
But because of that simultaneous
update, a few

00:08:22.240 --> 00:08:24.690
extra views were able
to sneak on.

00:08:24.690 --> 00:08:28.440
TED HAMILTON: We get asked
about it all the time.

00:08:28.440 --> 00:08:31.860
I wouldn't say that it causes
angst, but it's certainly, I

00:08:31.860 --> 00:08:33.820
would classify it more
as an annoyance.

00:08:33.820 --> 00:08:36.409
You can go and see a very
popular video, and you look

00:08:36.409 --> 00:08:40.570
and you'll see that it has 2,000
likes and 300 views.

00:08:40.570 --> 00:08:41.840
That's a little bit
interesting.

00:08:41.840 --> 00:08:45.780
The issue there is that we don't
put the likes through

00:08:45.780 --> 00:08:48.930
the same rigor, same
rigorous process.

00:08:48.930 --> 00:08:53.080
And likes are far fewer in
magnitude, so our systems can

00:08:53.080 --> 00:08:55.400
handle them more easily.

00:08:55.400 --> 00:08:58.930
But the views do freeze, and it
can result in some awkward

00:08:58.930 --> 00:08:59.650
situations.

00:08:59.650 --> 00:09:03.630
But that actually results in
terrific videos like this, so.

00:09:03.630 --> 00:09:06.660
BRADY HARAN: I did speak to Ted
for maybe 45, 50 minutes

00:09:06.660 --> 00:09:07.970
and recorded it all.

00:09:07.970 --> 00:09:10.540
I've got loads of footage, a lot
more detail, including a

00:09:10.540 --> 00:09:12.530
bit more about what constitutes
a view.

00:09:12.530 --> 00:09:14.730
And I know some of you
will want to see it.

00:09:14.730 --> 00:09:17.970
I haven't had time to edit it
all just yet, but stay tuned

00:09:17.970 --> 00:09:19.170
because I'll be uploading
that to

00:09:19.170 --> 00:09:20.990
Numberphile in the near future.

00:09:20.990 --> 00:09:23.240
And for those of you who don't
like these ones that are a bit

00:09:23.240 --> 00:09:26.550
more about computers and the
internet, I'm sorry.

00:09:26.550 --> 00:09:28.950
Numberphile's always
unpredictable, and I promise

00:09:28.950 --> 00:09:30.390
next time it might be something

00:09:30.390 --> 00:09:31.786
you enjoy a bit more.

00:09:36.110 --> 00:09:37.350
MATT PARKER: How many
arrows do you want?

00:09:37.350 --> 00:09:40.720
So the next one, let's say we
did 3 to the power of, to the

00:09:40.720 --> 00:09:43.410
power of, oh, arrow, arrow,
arrow, or whatever you

00:09:43.410 --> 00:09:45.360
want to call this.

00:09:45.360 --> 00:09:46.550
3.

00:09:46.550 --> 00:09:47.800
Will that--

