PROFESSOR: Hi.
Have you found it particularly difficult
to find a specific item in your house?
Let's say you're looking for a pair of gloves,
but you just can't find it, and you spend the entire afternoon
looking for it.
Well, you've just encountered the same problem
that companies like Google or Microsoft
encounter every single day.
And that's the problem of search.
Just like a house, where you store thousands
of different items, Google stores 45 billion index pages
of information.
And if every page was a sheet of paper
and we stacked them up real high,
we'd create a tower 600 times taller than Mount Everest.
Well, how can Google find my results
so quickly when I find it so difficult
to find a pair of gloves?
Well, searching on Google is kind
of like looking for a person in a big school.
Let's say you're looking for James in a row of classrooms.
Well, the easiest method would be
to go to every classroom nearest to you until you find James.
There's a better method when it's binary search.
Let's say the students were arranged
from A to Z in the increasing number of the classrooms.
And let's say we head to the middle room first.
And if the person in the middle room isn't James,
but his name starts with the letter before J,
we head to the right.
If not, we head to the left.
We then approach the middle room in the newly sectioned area.
We rinse and repeat.
Eventually, we will find James, just like the first method.
But we find him in a much faster way with the second method.
How much faster would that be?
Well, that depends on the number of students in the school.
Let's say there are 500 students,
and we're looking for one.
It will take about 80 minutes in the first method,
but 1 and 1/2 minutes with binary search.
Let's say there are 1,000 students in the school.
It would take 160 minutes with the first method,
but 1.6 minutes with the second method.
Now, that's a whole lot of difference.
So a name is just a word.
But Google searches a combination of words,
making it a little bit more complicated.
So just like how we identified the first letter
of each alphabet of the name, Google
identifies 200 unique factors, making your search terms
faster.
If you recall, the effectiveness of binary search
depends on the prearrangement of data.
And that's why computer scientists are actively
looking for ways to sort, manage, and eventually retrieve
data faster and better.
In the same way, the TV remote goes near the TV,
the shoes go to the shoe rack, the coats go into the cupboard,
and the winter gloves go into the winter jacket.
Aha.
So that's where my gloves are.