Skip to content

Instantly share code, notes, and snippets.

@abstractmachines
Last active May 29, 2022 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abstractmachines/fd7bb4be399be20f99174feaff43e855 to your computer and use it in GitHub Desktop.
Save abstractmachines/fd7bb4be399be20f99174feaff43e855 to your computer and use it in GitHub Desktop.
How to calculate probability

How to calculate probability

Counting Distinct Objects

Combinations and Permutations

Combinations: Order Doesn't Matter

$$ C = \frac{n!}{(n-r)!r!}$$

Examples: Out of the set S = {A, B, C}, a combination set would include AAA, AAB, ABC, .... etc, and ABA = BAA because order doesn't matter. When order doesn't matter, you don't need to count as many things, e.g. if AAB is equivalent to ABA, then those items count as one element of the set, not two.

Permutations: Order Matters

$$ P = \frac{n!}{(n-r)!}$$

Note that the denominator is smaller than in combinations. Permuations possibilities are much larger because order matters, so we have to count it all.

Examples: Out of the set S= {A, B, C}, a combination set would include AAA, AAB, ABC, .... etc, and ABA != BAA.

Cardinality

Cardinality is the number of elements in a Set.

Probability

Probability is the likelihood that an event will occur.

Events The probability of an event E is the cardinality of the event |E| divided by the cardinality of the sample space |S| (the "universe", S,) that the event is in.

$$\frac{|E|}{|S|}$$

Example: Full House

To be continued ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment