Welcome everyone to this section of the course on probability.
What we're going to be discussing rules, theorems and applications.
Probability is the branch of mathematics that deals with how likely an event is to occur or how likely
is it that a proposition or hypothesis is true?
So this gives us two clear avenues to pursue with learning probability.
We can try to analyze the probability of future events or try to analyze the probability of our own
hypothesis.
So in this section of the course, we're really focused on the first one probability of future events.
So we're going to focus on this first aspect, such as what are the odds of so-and-so or Event X happening
in the future?
The actual idea of checking the probability of some hypothesis, such as an AB test that's known as
hypothesis testing and a later section in the course will focus on that.
So probability is a very wide ranging topic.
And for this section we're really focused on the idea.
If you have an event that will occur in the future, what's the probability that it actually happens?
Keep in mind that many of the ideas pertaining to calculating probability of future events is related
to hypothesis testing.
So a lot of what you learn here, you're going to be able to directly apply to hypothesis testing later
on.
Now, being able to make intelligent estimations of probability of future events occurring is a crucial
element to a data driven organisation.
And in this section of the course, we're going to be discovering a variety of tools available to us
to understand different ways of calculating probabilities depending on the actual structure of the question
at hand.
Organizations often need to make decisions where the outcomes are uncertain.
Using probability effectively can help mitigate risks and also help develop backup plans for low probability
events.
Keep in mind, often information needs to be reported to others in terms of probability.
Imagine a hardware manufacturer needing to report the likelihood of defective devices.
So you may want to have some sort of report, such as there is a 1% chance that a phone received by
a customer will have a defective antenna.
So often in data driven organizations, you're thinking of things in terms of percent chances or probabilities
or odds.
Now there will be situations where you can't actually test every phone made, or there could be a situation
where defective antennas only occur on a certain percentage of phones after a certain time period.
Perhaps a defective rate could even increase with time.
These are all different situations where we're going to have to apply different theories of probability
to them.
And keep in mind, this isn't just some sort of thought exercise.
Many companies deal with such issues, and understanding probability is critical to the company's response.
You can take a look at Antennagate with the iPhone four.
That's actually where the previous example was based off of.
Apple.
The company had issues with antennas in their version of iPhone four.
So in order to understand what the best approach is, you need to understand the probability that a
customer is actually going to receive a defective phone.
If it's a large percentage of customers, then you may want to start off in official recall program.
If it's a small percentage of customers, you may want to do some sort of more targeted effect to help
out those customers.
And again, you have to think about this in terms of probability, since you're not going to know for
100% certain whether or not every single phone by every single customer is defective or not.
And you also experience probabilistic thinking every day, such as in weather reports.
You can see weather report for Miami, Florida.
And notice that precipitation itself is denoted as probability of happening.
You don't know for sure if it's actually going to happen, but you do know the probability or odds of
precipitation happening.
Clearly we need tools and frameworks to help us understand how to report probabilistic information within
an organization.
We also need to understand the benefits of probabilistic thinking in general, since most outcomes are
not going to be known for certain.
So in this section of the course, we're first going to try to understand probability concepts such
as the law of large numbers, the addition rule, unions and intersections, as well as Venn diagrams
and how we can use Venn diagrams to understand probabilistic statements.
Then we're also going to discuss concepts about likelihood, things like Bayes Theorem, discrete probability
and random variables.
Before we dive into a discussion of probability, concepts and mathematics, let's quickly cover some
notation conventions that are commonly used in probability.
In my own opinion, this is something that makes probability hard for beginners at first, is that you're
thrown into this world with very specific notation that you may not have seen before if you haven't
taken a probability or statistics class.
So we're often trying to calculate or express the probability of an event occurring, such as what is
the probability that a randomly chosen part from an assembly line has a defect?
So let's go through some basic notation.
We use p parentheses to represent the probability of what is inside the parentheses.
So for example, if we call the event a as when you pick up a defective part from the assembly line,
then P of a or probability of a is a probability that event a will occur.
So in other words, p of a or P with a inside the parentheses is the same thing as saying what's the
probability that you're going to pick up a defective part from the assembly line?
Now something to note about this notation is that it typically is quite flexible and requires some context.
So I gave you the context that we knew event a occurring was the same as finding a defective part.
That way I could just use the notation p of a.
However, you're going to sometimes see more descriptive events if you don't want to include the context.
That event A is equal to finding a defective part.
You sometimes see people write entire statement inside those parentheses or some sort of shortened version
of the statement.
So instead of P of A or event, A is finding a defective part, you may see actually someone write P
of part defective, which is a little easier to read if you know some context.
So it's a probability of the part being defective.
Now keep in mind that's the same thing of PFA here.
If I define event A as finding a defective part, clearly to understand this notation, you need a little
bit of context.
You can't just say to someone what's the probability of event A without describing what event A is to
begin with.
Keep in mind.
Either way is okay.
But you should also know that the nature of using probability means we're constantly analyzing different
events.
So be prepared to see different ways of indicating events inside p parentheses.
We should also note that different ways of reporting probabilities in mathematics, we commonly report
a probability as a value between zero and one zero, meaning the event will not occur and one meaning
the event will definitely occur.
In business and common parlance, you often see these values translated to a percentage by multiplying
by 100.
And this allows you to report back a value between 0% and 100% rather than 0 to 1.
However, for mathematical formulas you should be using zero and one instead of actual percentages.
You typically don't report those percentages until you're discussing something like a decision maker
or some sort of leadership position or just general context throughout your organization.
Mathematically speaking, we're pretty much always dealing with probability in terms of value between
zero and one.
Probabilities also have their complement counterpart.
For example, if we said P of A is the probability of a defective part, then how could we describe
the opposite or the complement that is not finding a defective part?
So picking up a piece of hardware from the assembly line and having it be OC otherwise not defective,
that opposite or counterpart is known officially as the complement probability.
The typical notation for this is going to be p of a with an apostrophe or P of a prime where a prime
is the complement to event.
You sometimes also see this notation as a C for the compliment where again a C is the complement event,
essentially the complement counterpart to event A So if event A is finding a defective part, then the
complement of a either a prime or a C is the probability of not finding a defective part.
So again, the complement event, a prime is the event a not occurring.
Note that this thinking is really not just for events with binary outcome.
So in the example we've been talking about, there's really only two possibilities for the piece of
hardware.
Either it's defective or not defective, but that is actually a smaller range of outcomes where it's
binary, either defective or not defective, which means it represents events a or events a prime,
but complements of a particular event can actually contain multiple events as a complement.
For example, let's imagine we had a production line that was making t shirts and we had three sizes
small, medium and large.
We could state that the probability of a customer choosing the size small as probability of s.
Now, in this particular situation, what is the complement?
That's the probability of a customer not choosing small, which actually means that the complement of
probability of S or P of S prime means the customer chose a size medium or a size large.
So don't think of compliments as just two events the original and then the prime.
It can actually have a complement that is going to accept multiple events such as customer choosing
medium or the event that a customer chooses large.
And hopefully that kind of expands the idea of what a complement is.
It's just the inverse of the original, the counterpart, so to speak.
Now, one crucial idea behind compliments to keep in mind is that it's often the case that's actually
a lot easier to calculate the compliment than the actual event we're interested in.
This often has to do with the context of the question you're trying to answer or the problem you're
trying to solve.
But you should always keep in mind this little trick that you can calculate the compliment in order
to calculate the probability of the actual event that you're interested in.
In this case, you need to understand that probabilities are always expressed as a likelihood between
zero.
The event will not occur for certain and one the event will occur for certain.
This means a compliment can also mathematically be defined as the following The probability of the compliment
is equal to one minus the probability of the event.
So p of a prime is equal to one minus the probability of event a occurring, which makes sense because
the complement and the event itself, those probabilities summed up together need to equal one because
either the complement is going to occur or the actual event will occur.
And those two, the event occurring or the event opposite or counterpart occurring, those should equal
to one because that represents the entire space of events that are possible.
Now, one quick note on real world situations to probability.
When you're assigning binary events, try to match events and complements to the real world counterparts.
Positive outcome versus negative outcome.
Let me explain what I mean by that.
For example, let's imagine that we need to define event A as the hardware being defective.
What does this actually mean in the real world?
That means the probability of a being equal to zero means there's no chance that the hardware is defective.
The probability of event a being equal to one would mean that the hardware is certain to be defective.
That means any piece you pick off the line is defective.
If probability of a is equal to one, if probability of a is equal to zero, then you have a perfect
assembly line and there are no defective parts.
If you pick up off the assembly line.
Now, how would you actually write the alternative to this?
Well, you could describe events A as the hardware being functional, essentially not defective, in
which case you would say the probability of a equals zero means there's no chance the hardware is functional,
and the probability of a being equal to one means the hardware is certain to be functional.
Notice how we're basically just inverting the definition of event.
A Going from hardware is defective to hardware is functional.
The reason I bring this up is because often in real world situations it's easier to think as a certain
event as 0% chance versus another opposite event as 100% chance or 0% chance.
So you have a lot of context here that you can play around with for the definition.
So in this particular example, you may want to ask leadership or different colleagues for reporting
metrics that make the most sense.
Does leadership or other colleagues want the percentages of probability to be reported for hardware
that's defective or for hardware that is functional?
One case may make more sense than the other.
It's really up to you to define the events, parameter and context to understand which reporting metric
makes the most sense.
Either is 100% correct.
You just need to provide enough context to understand what the event actually is.
You should try to choose this based on the situation and what reporting metrics make sense.
In real world situations, we often need to describe the probabilities based on multiple events.
This includes concepts such as conditional probability intersections and unions.
Let's explore the notation for these types of multiple event probabilities.
Thinking back to our example of defective hardware, what if we had multiple events to consider?
For example, what if there were multiple factories producing the same part, but the factories themselves
had different quality assurance standards?
So we now have two separate events, the events of picking a factory and then the other separate events
of then picking a part.
Now you may be wondering, is it actually a separate event?
Well, in this case, you could treat picking a part as conditional to picking a factory, since the
probability of being defective could vary based on the actual factory that you chose.
So you may find yourself going from the original question of what is the probability that a randomly
chosen part from an assembly line has a defect to an expanded question?
So what's the probability that a randomly chosen part from an assembly line has a defect, given that
it came from a specific factory like factory number two?
Notice how the factory itself could be treated as an event.
So choosing a particular factory.
Again, this depends on the context of the scope of the question being asked.
Do you actually have knowledge of what factory this came from, or are you just picking an assembly
line at a particular factory?
There are many real world situations where you will discover that you want to calculate the probability
of event A given the condition that event B has occurred, such as event A being a defective part and
event B being a specific factory that was chosen.
So where am I actually going with this?
Well, there's a particular notation for what's known as conditional probability, where we're dealing
with multiple events and we have a condition on them.
So the formula or notation looks like the following P of A given B, so the probability that event A
will occur given that events B did occur.
Know how this notation states that event B has in fact occurred.
So we assume if event B has in fact occurred, what's now the probability of event A?
So for example, if in fact you did choose a particular factory for event B, what's the probability
of event A a part being defective?
And again, take careful note.
That event a and event be shown here are really just placeholders and just like before.
You may see them swapped out for other variables in the real world, but the logic and statement of
the notation actually remains.
So we could say the probability that the event X will occur given that event Y occurred.
So you can swap these out for any sort of variable you want as a placeholder.
Just note that the notation doesn't change its probability that event X will occur given the event Y
has occurred.
So in other words, if we were to really spell this out, it's the probability that this blue event
will occur, given the fact that this red event has in fact occurred, or in other words, the probability
that the first event will occur, given the fact that the second event has in fact occurred.
We can see the notation clearly states the probability of the first event being conditional on the second
event having occurred.
Thus the name conditional probability.
You will see this notation quite a bit, especially when working with Bayesian statistics.
When thinking of separate events, we should also take the time to consider if they are independent
or dependent.
In our defective hardware example.
Clearly the probability of being defective is going to be dependent on the event of choosing a particular
factory.
However, there are going to be cases where events will be independent, in which case event a occurring
has no effect on events be occurring and vice versa.
Be very careful when labeling two events as completely independent.
There could be factors actually linking the two events.
Each case and situation will be different.
For example, you may initially think that delays at one airport in New York City are independent of
delays at another airport in Miami.
However, if you traveled enough, you probably already know that weather delays at one airport can
cause issues at another airport as landing times get pushed back across the entire nation.
For example, if you have really common routes, then between Miami and New York City, then delays
at Miami or New York City are going to affect landing times or takeoff times at the other airport.
So even though you might initially think, hey, there are two different cities, delays are two completely
different independent events, if you know more and more about the actual domain, you may realize that
these are actually dependent events with each other.
So in this case, it's probably wiser to calculate a conditional probability using delays at other airports
to decide the probability of a delay at the Target airport.
Finally, let's discuss intersections and unions.
When studying probability of two events, it's often useful to visualize them using Venn diagrams.
Imagine two separate events.
A and B.
For example, the event a of picking a defective phone and the event B of having the phone be the color
black.
You could describe these using a Venn diagram.
If we run a test where both event a an event be occurred, then this would be known as the intersection
of A and B, which is here in the Venn diagram, the middle part.
So the fact where event occurred and event B occurred essentially a defective black phone.
The intersection of A and B can then be denoted, or the notation for it is the following A and then
this upside down use symbol with B.
Intersections can also help us mathematically define mutually exclusive events, meaning they have no
elements in common and cannot both occur at the same time.
This is the first image that we actually showed where the circles are not touching.
Showing an intersection is zero.
That makes sense because there should be no overlap between event A and event B if they are completely
mutually exclusive.
So there's no elements in common and they cannot both occur at the same time.
Meaning an intersection is impossible.
So mutually exclusive events A and B would be defined as the following notation where you have an intersection
equal to zero, meaning there's not going to be a situation that's possible for both event A and event
B to occur.
So maybe event A is going to be the fact that it's night time and event B could be the fact that it's
daytime.
There's no intersection where it's both night and day.
A union of events can then describe the collection of all outcomes.
So you have only event, a occurring only event be occurring or both events A and B occurring.
The Union of A and B can then be denoted with the following notation A And then this one is easier to
remember with you for union.
And then B.
Now that we understand the basic notation, let's start diving into some more probability topics in
a lot more detail.
Use these slides as a reference for the notation and how to read it.
When we learn about more complex probability statements, we'll see you at the next lecture.