Probability Master Course
Probability Master Course
To understand how combinations with repetition work you need to understand the
instances where they occur.
To get a better grasp of the number of combinations we have, let us explore a specific
example.
2.5 Methodology
For convenience we can refer to each ingredient by the associated letter we have
highlighted (e.g “c” means cheese, and “o” means onions).
To construct the sequence for each unique type of pizza we follow 2 rules as we go
through the ingredients in the order we wrote down earlier.
1. If we want no more from a certain topping, we write a 0 and move to the next
topping.
2. If we want to include a certain topping, we write a 1 and stay on the same
topping.
• Not going to the next topping allows us to indicate if we want extra by adding
another 1, before we move forward. Say, if we want our pizza to have extra cheese,
the sequence would begin with “1, 1”.
• Also, we always apply rule 1 before moving on to another topping, so the
sequence will actually start with “1, 1, 0”.
365 DATA SCENCE 18
If we need to write a “0” after each topping, then every sequence would consist of 6
zeroes and 3 ones.
1,0 0 0 0 1,1,0 0
A vegan variety pizza with
onions, green peppers 0 1,0 1,0 1,0 0 0
and mushrooms would be
represented by the sequence 0 0 1,0 0 0 1,1,0
0,1,0,1,0,1,0,0,0.
• 1,0,0,0,0,1,1,0,0
• 0,1,0,1,0,1,0,0,0
• 0,0,1,0,0,0,1,1,0
This is no coincidence,
since according to rule 1
of our algorithm, we need C O G M P B
to add a “0” at the end of
the sequence, regardless of 1,0 0 0 0 1,1,0 0
whether we wanted bacon or
0 1,0 1,0 1,0 0 0
not.
0 0 1,0 0 0 1,1,0
That means that only the first
8 elements of the sequence
can take different values.
2.5.3 Positions
As stated before, we have 3 “1s” and 8 different positions. Therefore, the number of
pizzas we can get would be the number of combinations of picking 3 elements out of
a set of 8. This means we can transform combinations with repetition to combinations
without repetition.
Now that we know the relationship between the number of combinations with and
without repetition, we can plug in “n+p-1” into the combinations without repetitio
formula to get:
Let’s see the algebraic proof of the notion that selecting p-many elements out of a set
of n is the same as omitting n-p many elements.
3. Bayesian Notation
A set is a collection of elements, which hold certain values. Additionally, every event
has a set of outcomes that satisfy it.
The null-set (or empty set), denoted ∅, is an set which contain no values.
𝑥 ∈ 𝐴
The sets of outcomes that satisfy two events A and B can interact in one of the
following 3 ways.
A A A
B B B
3.1.1 Intersection
The intersection of two or more events expresses the set of outcomes that satisfy all
the events simultaneously. Graphically, this is the area where the sets intersect.
A
B
Intersection 𝑨∩𝑩
365 DATA SCENCE 24
3.1.2 Union
The union of two or more events expresses the set of outcomes that satisfy at
least one of the events. Graphically, this is the area that includes both sets.
𝑨∩𝑩
A B Union
𝑨∪𝑩=𝑨+𝑩 −𝑨∩𝑩
Sets with no overlapping elements are called mutually exclusive. Graphically, their
circles never touch.
Remember:
All complements are mutually exclusive, but not all mutually exclusive sets are
complements.
Example:
Dogs and Cats are mutually exclusive sets, since no species is simultaneously a feline
and a canine, but the two are not complements, since there exist other types of
animals as well.
365 DATA SCENCE 25
We express the probability of event A occurring, given event B has occurred the
following way 𝑷 (𝑨\𝑩).
We call this the conditional probability.
Independent: Dependent
• All the probabilities we have • New concept.
examined so far. • The outcome of A depends on
• The outcome of A does not the outcome of B.
depend on the outcome • 𝑃(𝐴𝐵)≠𝑃(𝐴)
of B.
• 𝑃(𝐴/𝐵)=𝑃(𝐴)
Example Example
• A -> Hearts • A -> Hearts
• B -> Jacks • B -> Red