Hi, I'm Michael Corayer and this is Psych Exam Review. In this video I want to
explain the difference between an algorithm and a heuristic and then
provide an example that will hopefully help you to see why it is that we tend
to use heuristic. First, what is an algorithm? Well an algorithm is a step by
step procedure for solving a problem. The downside of an algorithm is that it
tends to be slow because we have to follow each step. We have to move through
the process but on the positive side an algorithm guarantees that we'll get to
the solution. If we can follow all the steps, then we will find the solution to
the problem. So an algorithm is guaranteed to work but it's slow.
What's a heuristic?Well, a heuristic is sort of a mental shortcut. It's not a
step-by-step procedure and so the downside of a heuristic is, because it's
not a step-by-step procedure it doesn't guarantee that we'll actually
get to the solution. It might not work so a heuristic is not guaranteed. We
don't know if it will get us to the correct solution but it's faster, right?
Because it's a shortcut it skips a lot of the steps and says well these
probably aren't going to get to the solution so I'm just going to skip them.
Now it could be the case that those steps would have gotten to the solution
or would have gotten to a better solution but the heuristic says I mostly
am concerned with getting a quick answer rather than the always correct answer.
Ok, so let's look at an example of a sort of everyday problem that you might
experience and how you would solve it using an algorithm versus using a
heuristic. So let's imagine that I'm in my apartment and I want to go somewhere
and so of course I need to take my keys with me and I can't find them.
They're not on my desk where I usually put them and so I have this problem of
how do I find my keys. Well I know that they're inside the apartment because I'm
inside the apartment and I must have unlocked the door to get in. So one thing
that I could do is I could follow an algorithm for solving this
problem. I could say okay if the keys are definitely in the apartment somewhere
then a step-by-step procedure for finding them will be to start in one
corner of the apartment and to slowly look in every single location expanding
out from that corner of the apartment until I've searched every square inch of
the apartment and if I do that it is guaranteed that I will find my keys
because they must be in the apartment somewhere. That approach, that
step-by-step procedure will guarantee that I find them but as you can already
see it's going to be slow, right? Because I'm not allowed to skip ahead I have to
start in one corner and progress through the entire apartment. Now that's probably not
how you look for your keys if you can't find them. What do you do instead? You use
a heuristic. You use a shortcut. You say "there's probably a lot of places that I
can just not look in because my keys probably aren't there." Now I don't know
that for sure because I don't know where my keys are
but a heuristic that I might use in this approach to solving this
problem would be to say "why don't I look the last place that I remember having
them" or maybe I should start by looking in the door, maybe I've left them in the
door when I unlocked it, right? Now this doesn't guarantee that my keys are going to
be there but there's a higher likelihood and it's going to be faster if I look in
the two or three places that my keys are usually found then. I'm probably going to
find them. It's not guaranteed; I might not find my keys in those two or
three locations. I might say "okay maybe they're in the pocket of the pants that
I was wearing yesterday or maybe they're in the door or maybe I set them down on
the kitchen table instead of in my bedroom" right? So what a heuristic does,
it says check those places first, take a shortcut. Don't start looking under the
couch, I mean the odds of them being under the couch are probably pretty low.
They're not necessarily zero but they're low. So start with the places that they
might be and then move out from there. Now again, this doesn't guarantee that
I'll find the keys but it's going to be a lot faster and maybe I try that and it
still doesn't work. Then maybe eventually I have to resort to
my algorithm approach but most of the time we use heuristics. We have shortcuts
that we use that allow us to skip a lot of potentially unnecessary steps. So
in the next few videos we'll look at some other types of heuristics that we
use in our decision-making. We'll also see the situations where
they can lead us astray; they can lead us to think that we've found the answer when
in fact we haven't or we found an incorrect answer. Ok, I hope you found
this helpful, if so, please like the video and subscribe to the channel for more.
Thanks for watching!