Understanding Chance Flashcards
The probability of something:
P(Event) = 1 − P(Complement event)
Conditional probability
the chance that a certain event (1) occurs, given another event (2) has occurred.
* P(Event 1|Event 2)
Multiplication Rule
The probability that two events occur is the chance of the 1st event multiplied by the chance of the 2nd event, given the 1st has occurred.
* P(Event1 and Event2) = P(Event1) × P(Event2 | Event1)
Addition Rule
The probability at least one of two events occurs is the chance of the 1st event plus the chance of the 2nd event minus the probability that both events occur.
* P(Event1 or Event2) = P(Event1) + P(Event2) − P(Event1 and Event2)
Mutually exclusive
Two events are mutually exclusive when the occurrence of one event prevents the occurence of the other.
Independence
Two events are independent if the chance of the 1st given the 2nd is the same as the 1st, i.e.
* P(Event 1 | Event 2) = P(Event 1)
Prosecutor’s fallacy
it is assumed that the probability of a random match is equal to the probability that the defendant is innocent.
* P(A⼁B) = P(B⼁A)
Drawing randomly with replacement ensures…
independence
Drawing randomly without replacement implies…
dependence
Probability of paths can be added because…
events are mutually exclusive (if you throw (1,5) you can’t have thrown (2,4) at the same time)
sample()
draws random samples from a collection of objects that you tell R
sample( # we want: # of possible, size = # , replace = T)
replicate
replicate( how many times, function() )
function()
list of commands that you use to define a particular function