0% found this document useful (0 votes)
22 views10 pages

Probability Master Course

The document discusses combinations with repetition and their applications. It uses the example of ordering toppings on a pizza to explain how combinations with repetition are used when items can be selected multiple times from the set of options. The document then presents a methodology for counting combinations with repetition using sequences of 0s and 1s to represent different pizza topping combinations.

Uploaded by

Rob
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views10 pages

Probability Master Course

The document discusses combinations with repetition and their applications. It uses the example of ordering toppings on a pizza to explain how combinations with repetition are used when items can be selected multiple times from the set of options. The document then presents a methodology for counting combinations with repetition using sequences of 0s and 1s to represent different pizza topping combinations.

Uploaded by

Rob
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

365 DATA SCENCE 16

2.4.4 Applications of Combinations with Repetition

To understand how combinations with repetition work you need to understand the
instances where they occur.

We use combinations with repetition when


the events we are dealing with, have sufficient
quantity of each of the distinct values in the
sample space.

One such example is the toppings on a pizza.

We can order extra of any given topping, so


repetition is allowed. However, we do not
care about the order in which the toppings
are put on top of the pizza, so we cannot use
variations.

Similar examples include picking the ice-cream


flavours for a Sundae melt or the players for a
Fantasy Football Team.

2.4.5 Pizza Example

To get a better grasp of the number of combinations we have, let us explore a specific
example.

You are ordering a 3-topping pizza from your


local pizza place but they only have 6 topping
left because its late.

The toppings are as follows:


cheddar cheese, onions, green peppers,
mushrooms, pepperoni and bacon.

Your pizza can have 3 different toppings, or you


can repeat a topping up to 3 times.

You can either order a pizza with 3 different


toppings, a pizza with 3 identical toppings or
a pizza with 2 different toppings but having a
double dose of one of them.
365 DATA SCENCE 17

2.5 Methodology

The methodology we use for such combinations is rather abstract. We like to


represent each type of pizza with a special sequence of 0s and 1s. To do so, we first
need to select a specific order for the available ingredients.

We can reuse the order we wrote down earlier:


cheddar cheese, onions, green peppers, mushrooms, pepperoni and bacon.

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

2.5.1 Pizzas and Sequences

If we need to write a “0” after each topping, then every sequence would consist of 6
zeroes and 3 ones.

Let’s look at some pizzas


and the sequences they are
expressed with.

A pizza with cheese


and extra peperoni is
represented by the sequence
1,0,0,0,0,1,1,0,0. C O G M P B

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.

Now, what kind of pizza


would the sequence
0,0,1,0,0,0,1,1,0 represent?

We can put the sequence


into the table and see that it
represents a pizza with green
peppers and extra bacon.
365 DATA SCENCE 19

2.5.2 Always Ending in 0

Notice how all the sequences we have examined end on a 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.

Each pizza is characterized by


the positions of the 3 “1”s in
the sequence. Since only 8 of
the positions in the sequence
can take a value of “1”, then
the number of different pizzas
would be the combination of
any 3 of the 8 positions.
365 DATA SCENCE 20

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.

Let’s observe the values 3 and 8 for a moment


and try to generalize the formula. “3” represents
the amount of toppings we need to pick, so it is
still equivalent to p.

“8” represents the number of positions we


have available for the ones. We had 3 + 6, or
9 positions in total, but we knew the last one
could not contain a “1”. Thus, we had “n + p - 1”
many positions that could contain a 1.

2.5.4 The Final Step

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:

This is the exact same formula we showed you at the beginning.


Before we you continue to the next lecture, let’s make a quick recap of the algorithm
and the formula.

1. We started by ordering the possible values and expressing every combinations


as a sequence.
2. We examined that only certain elements of the sequence may differ.
3. We concluded that every unique sequence can be expressed as a combination of
the positions of the
“1” values.
4. We discovered a relationship between the formulas for combinations with and
without repetition.
5. We used said relationship to create a general formula for combinations with
repetition.
365 DATA SCENCE 21

2.6 Symmetry of Combinations

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.

For starters, recall the combination formula:

If we plug in 𝑛 − 𝑝 for p, we get the following:

Therefore, we can conclude that:


365 DATA SCENCE 22

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.

𝑥 ∈ 𝐴

Element (lower-case) Set (upper-case)

Notation: Interpretation: Example:


𝑥 ∈ 𝐴 “Element x is a part of set A.” 2 ∈ 𝐴𝑙𝑙 𝑒𝑣𝑒𝑛 𝑛𝑢𝑚𝑏𝑒𝑟𝑠
A ∋ 𝑥 “Set A contains element x.” 𝐴𝑙𝑙 𝑒𝑣𝑒𝑛 𝑛𝑢𝑚𝑏𝑒𝑟𝑠 ∋ 2
𝑥 ∉ 𝐴 “Element x is NOT a part of set 1 ∉ 𝐴𝑙𝑙 𝑒𝑣𝑒𝑛 𝑛𝑢𝑚𝑏𝑒𝑟𝑠
∀𝑥: A.” “For all/any x such that...” ∀𝑥: 𝑥 ∈ 𝐴𝑙𝑙 𝑒𝑣𝑒𝑛
𝐴 ⊆ 𝐵 “A is a subset of B” 𝑛𝑢𝑚𝑏𝑒𝑟𝑠 𝐸𝑣𝑒𝑛 𝑛𝑢𝑚𝑏𝑒𝑟𝑠
⊆ 𝐼𝑛𝑡𝑒𝑔𝑒𝑟𝑠
Remember! Every set has at least 2 subsets.
• 𝐴⊆𝐴
• ∅⊆𝐴
365 DATA SCENCE 23

3.1 Multiple Events

The sets of outcomes that satisfy two events A and B can interact in one of the
following 3 ways.

Not touch at al Intersect (Partially Overlap) One completely


overlaps the other

A A A
B B B

Examples: Diamonds Red Cards


A -> Diamonds Queens Diamond
B -> Hearts

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

We denote the intersection of


two sets with the “intersect”
sign, which resembles an
upside-down capital letter U:

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

𝑨∪𝑩=𝑨+𝑩 −𝑨∩𝑩

3.1.3 Mutually Exclusive Sets

Sets with no overlapping elements are called mutually exclusive. Graphically, their
circles never touch.

A If 𝑨∩𝑩= ∅, then the


two sets are mutually
B exclusive

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

3.2 Independent and Dependent Events

If the likelihood of event A occurring (P(A)) is affected event B occurring, then we


say that A and B are dependent events. Alternatively, if it isn’t – the two events are
independent.

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

You might also like