outcome_A <- sample(LETTERS, 1)
outcome_A <- sample(LETTERS, 1)
sample
probabilitiessample
probabilitiesThere are many random processes where all the possible outcomes are equally likely.
In these settings, \[ P(\text{Outcome}) = \frac{1}{\text{number of possible outcomes}} \]
sample
probabilitiesThere are many random processes where all the possible outcomes are equally likely.
In these settings, \[ P(\text{Outcome}) = \frac{1}{\text{number of possible outcomes}} \]
Example:
\[ P(\text{Randomly selected letter from English alphabet}) = \frac{1}{\text{26}} \]
sample
probabilitiesThere are many random processes where all the possible outcomes are equally likely.
Informally, outcomes of this type are often called sample
outcomes or urn
outcomes.
More formally, outcomes of this type are sometimes called discrete uniform
random variables.
sample
probabilitiesThere are many random processes where all the possible outcomes are equally likely.
Informally, outcomes of this type are often called sample
outcomes or urn
outcomes.
More formally, outcomes of this type are sometimes called discrete uniform
random variables.
sample
probabilitiesurn
outcomes (or discrete uniform
random variables).sample
probabilitiesurn
outcomes (or discrete uniform
random variables).three_letter_word <- c( sample(LETTERS, 1) , sample(LETTERS, 1) , sample(LETTERS, 1) ) three_letter_word
[1] “D” “T” “B”
sample
probabilitiesurn
outcomes (or discrete uniform
random variables).three_letter_word <- c( sample(LETTERS, 1) , sample(LETTERS, 1) , sample(LETTERS, 1) )
TOM
?sample
probabilitiesanother_three_letter_word <- sample(LETTERS, 3)
What is the probability that another_three_letter_word = TOM
?
In order to calculate
\[ \begin{array}{l} P(\texttt{three_letter_word = TOM}) = \\ \phantom{ = }\phantom{ = } \frac{1}{\text{Number of 3 letter sequences}} \end{array} \]
we need need to calculate the number of 3 letter sequences.
three_letter_word <- c( sample(LETTERS, 1) , sample(LETTERS, 1) , sample(LETTERS, 1) )
another_three_letter_word <- sample(LETTERS, 3)
Is the outcome TOM
the same as MOT
or OTM
?
Is the outcome TOM
the same as MOT
or OTM
?
Sequence: Order matters TOM
\(\neq\) MOT
Hand: Order doesn’t matter TOM
= MOT
A systematic way to write out all sequences.
\[ \underbrace{N \times N \times \cdots \times N}_{K \text{ draws}} = N^K \]
\[ \underbrace{N \times (N-1) \times \cdots \times (N-K+1)}_{K \text{ draws}} = \frac{N!}{(N-K)!} \]
\[N! = N\times(N-1)\times(N-2)\times \cdots \times 3 \times 2 \times 1\]
\[ 5! = 5 \times 4 \times 3 \times 2 \times 1\]
In R:
factorial(5)
## [1] 120
Note
\[ 0! = 1 \]
\[ABC \neq CAB\]
\[ABC = CAB\]
Go back to all the sequences:
\[\frac{\text{Number sequences}}{\text{hand to sequence multiplier}} = \frac{\frac{N!}{(N-K)!}}{K!} = \frac{N!}{(N-K)!K!} \]
\[ {N \choose K} = \frac{N!}{(N-K)!K!} \]
The number of hands of size \(K\) from a deck of \(N\) cards when drawing without replacement.
In R
#The number of 5 card hands from a 52 card deck choose(52,5)
## [1] 2598960
A process or experiment that generates a binary outcome (0 or 1; heads or tails; success or failure)
Successive replications of the process are independent
The probability \(P(outcome = 1)\) is constant
Notation:
\[ Success,\ Success,\ Failure,\ Success\] \[ 1,\ 0,\ 1,\ 1,\ 1,\ 0 \] \[tails,\ tails,\ tails,\ heads\]
Note: A Bernoulli sequence can be thought of as \(K\) draws with replacement from a deck of \(N=2\) cards.
Because successive outcomes are independent and \(p\) is constant,
\[ \begin{align*}P(1,\ 0,\ 1,\ 1,\ 1,\ 0) &= P(1)P(0)P(1)P(1)P(1)P(0) \\ & = p(1-p)ppp(1-p) \\ & = p^4(1-p)^2 \end{align*} \]
The number of successes in a Bernoulli sequence
Bernoulli properties still apply: independent outcomes, constant probability
Notation: