# Probability and Counting

Source: https://cca.twango.dev/Algebra-2-Honors/lectures/probability

# Probability and Counting

## Experiments and events

A **probability experiment** has possible results called **outcomes**. The **sample space** contains all outcomes; an **event** is a subset of it. Probability measures an event's likelihood.

For equally likely finite outcomes,

$$
P(A)=\frac{\text{favorable outcomes}}{\text{total outcomes}}.
$$

Experimental probability is the proportion of trials in which the event occurs. Geometric probability can be a ratio of lengths, areas, or volumes when selection is uniform over the relevant region.

$$
P(A^c)=1-P(A).
$$

## Independence and conditional probability

Events are independent when

$$
P(A\cap B)=P(A)P(B).
$$

In general, when $P(A)>0$,

$$
P(B\mid A)=\frac{P(A\cap B)}{P(A)},\qquad
P(A\cap B)=P(A)P(B\mid A).
$$

> [!warning] Correction to the original conditional-probability formula
> The original notes label $P(A\mid B)$ but divide by $P(A)$. For $P(A\mid B)$, divide by **$P(B)$**. The denominator represents the event already known to have occurred.

## Two-way tables

A **two-way table** cross-classifies observations by two categorical variables.

- **Joint frequency:** the count in a cell.
- **Marginal frequency:** a row or column total.
- **Joint relative frequency:** a cell count divided by the overall total.
- **Marginal relative frequency:** a row or column total divided by the overall total.
- **Conditional relative frequency:** a cell count divided by the relevant row or column total.

## Unions and intersections

A compound event combines events. **Disjoint** events cannot occur together; overlapping events share outcomes.

$$
P(A\cup B)=P(A)+P(B)-P(A\cap B).
$$

For disjoint events, the intersection probability is zero. Disjointness and independence are different concepts.

## Permutations and combinations

For a nonnegative integer $n$, $n!=n(n-1)\cdots1$, with $0!=1$.

| Counting task | Formula |
| --- | --- |
| Arrange all $n$ distinct objects | $n!$ |
| Choose and order $r$ distinct objects | ${}_nP_r=n!/(n-r)!$ |
| Choose $r$ distinct objects without order | $\binom nr=n!/[r!(n-r)!]$ |

Here $0\le r\le n$ and selection is without replacement.
The original examples give ${}_4P_4=24$, ${}_4P_2=12$, and $\binom42=6$.

## Binomial theorem and distribution

$$
(a+b)^n=\sum_{r=0}^{n}\binom nr a^{n-r}b^r.
$$

The original notes' expression without a summation is one **term** of the expansion, not the whole theorem.

A **random variable** assigns a number to an outcome. A probability distribution assigns probabilities to its possible values.

A binomial experiment has a fixed number $n$ of independent trials, two outcomes per trial, and the same success probability $p$ on every trial. For $k$ successes,

$$
P(X=k)=\binom nkp^k(1-p)^{n-k},\qquad k=0,1,\ldots,n.
$$

Related: [[sequences-and-series|Summation notation]], [[statistics|Statistics]], and [[../cheat-sheet|Final reference sheet]].
