DS_Interview_Prep Flashcards
Bayes’ Rule
P(A|B) = P(B|A)P(A) / P(B)
Conditional Probability
The probability of event A given that event B has occurred.
Mechanism for solve: Bayes’ Rule
Conditional Independence Formula and Definition
P(A AND B | C) = P(A|C)P(B|C)
Given that event C has occurred, knowing that event B has also occurred tells us nothing about the probability of event A having occurred.
Bayes’ Rule: Name of P(A)
Prior
Bayes’ Rule: Name of P(B|A)
Likelihood
Bayes’ Rule: Name of P(A|B)
Posterior
Law of Total Probability Formula and Definition
P(A) =SUM( P(A|B_n)P(B_n) ) for n in N
The probability of event A occurring can be modeled as the weighted sum of conditional probabilities based on each possible scenario having occurred.
Mechanism for solving questions of assessing a probability involving a “tree of outcomes” upon which the probability depends.
Ex. Probability that a customer makes a purchase, conditional on which customer segment that customer falls within.
Permutations (Formula and Definition)
n_P_r = n! / (n-r)!
Mechanism for being able to select all or part of a set of objects, with regard to the order of the arrangement.
Combinations (Formula and Definition)
C(n,r) = n! / r!(n-r)!
Mechanism for being able to select all or part of a set of objects, WITHOUT regard to the order of the arrangement.
Random Variables
Quantity with an associated probability distribution.
Probability distribution can be discrete (countable range) or continuous (uncountable range)
Probability Mass Function (PMF)
Mechanism for understanding the likelihood of a discrete random variable taking on a GIVEN value.
Probability distribution associated with a discrete random variable.
Sums to 1.
Probability Density Function (PDF)
Mechanism for understanding the likelihood of a continuous random variable falling within a specific RANGE of values.
Probability distribution associated with a continuous random variable.
Integrates to 1.
Cumulative Distribution Function (CDF)
Mechanism for understanding the likelihood that a random variable will be less than or equal to a specified value.
Discrete: Formed by summing values
Continuous: Formed by integrating values
Joint Probability Distribution
Mechanism for understanding the probability of two or more random variables occurring together.
Discrete = Joint Probability Mass Function (JPMF)
Continuous = Joint Probability Density Function (JPDF)
Sums or integrates to 1.
Marginal Probability Distribution
Mechanism for deriving the probability distribution of a single variable from a set of random variables without considering the other variables in the set.
Discrete = Marginal Probability Mass Function (MPMF)
Continuous = Marginal Probability Density Function (MPDF)
Derived from a Joint Probability Distribution.
Conditional Probability Distribution
Mechanism for understanding the probability distribution of one random variable given that another random variable has already occurred.
Binomial Distribution
Mechanism for counting some number of successful events where the outcome of each event is binary.
PMF
MEAN
VARIANCE
Ex. Coin Flip, User Signups,
Discrete Distribution
Poisson Distribution
Mechanism for understanding the probability of the number of events occurring within a particular fixed interval where the known, constant rate of each event’s occurrence is lamdba.
PMF
MEAN
VARIANCE
Ex. Number of visits to a website in a certain period of time, number of defects on an assembly line
Discrete Distribution
Uniform Distribution
Mechanism for modeling a constant probability between values on the interval a to b.
Ex. Random Number Generator, Hypothesis Testing Cases
PDF
MEAN
VARIANCE
Continuous Distribution
Exponential Distribution
Mechanism for understanding the probability of the interval length between events of a Poisson process having a set rate parameter of lambda.
Ex. Wait Times until a customer makes a purchase, time until a default in credit occurs, etc.
PDF
MEAN
VARIANCE
Continuous Distribution
Normal/Gaussian Distribution
Mechanism for modeling natural phenomenon. Distribution takes on the shape of a “bell-curve” depicting events closer to the average as more common and less common moving away from the average.
Ex. Heights of people, test scores, errors in measurement, waiting times in lines, etc.
PDF
MEAN
VARIANCE
Continuous Distribution
Central Limit Theorem
Theorem in statistics wherein if we randomly sample many times from a population of independent samples having finite variance, the means of these random samples will form a normal distribution with the same mean.
Sampling distribution of means approaches normal distribution with increasing sample size.
Conditions for the CLT:
1. Random Sampling
2. Independent Samples
3. Finite Variance
Mechanism for?
Markov Chains
Process in which there is a finite set of states, and the probability of being in a particular state is only dependent on the previous state. Probability from transitioning from one state to another is given by a transition matrix P.
Used to model the dynamics of a system in order to understand long-term behavior
Empirical Rule
Applicable for the Normal/Gaussian Distribution
68-95-99.7 of data falling between the 1-2-3 standard deviations.
Markov Property
Given the current state in a Markov Chain, the past and future states it will occupy are conditionally independent.
State is said to be “Markovian” if it satisfies the Markov Property.
What is the difference between “least squares” and “residual sum of squares (RSS)”?
TODO
Law of Large Numbers
Sample mean approaches population mean as sample size increases
Sampling Distribution of Means
Describes the probability distribution of all possible means you could get if you draw multiple random samples of size n from a population
Q: Difference between a Z-test and a t-Test?
Z-test = Use when you know the population standard deviation. (Never used in practice)F
t-Test = Use when you have an estimate of the population standard deviation.
Q: Why do p-values not describe the “error rate” of a hypothesis test?
TODO