CS109 Course Feedback Process
- 21Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is a random variable?
A random variable is a variable that takes on numerical values with probabilities. It maps outcomes of a random process to numbers.
Or swipe the card
21 cards
What is a random variable?
A random variable is a variable that takes on numerical values with probabilities. It maps outcomes of a random process to numbers.
What is a probability mass function (PMF)?
The PMF p(x)=P(X=x) gives the probability that a discrete random variable X equals a specific value x.
How is expectation E[X] defined for a discrete random variable?
E[X]=∑xx⋅P(X=x)
How can you compute the expectation from a dataset of observed values?
Take the sample average: sum all observed values and divide by the number of observations.
State the linearity of expectation.
For any random variables X and Y, E[X+Y]=E[X]+E[Y], and for constants a,b, E[aX+b]=aE[X]+b.
What is the Law of the Unconscious Statistician (LOTUS)?
For a function g, E[g(X)]=∑xg(x)⋅P(X=x).
Define a binomial random variable.
X∼Bin(n,p) counts the number of successes in n independent, identical Bernoulli trials with success probability p.
What is the PMF of a binomial random variable X∼Bin(n,p)?
P(X=k)=(kn)pk(1−p)n−k,k=0,1,…,n
What is the expectation of X∼Bin(n,p)?
E[X]=np
How can you compute binomial probabilities in Python using SciPy?
Use
scipy.stats.binom.pmf(k, n, p)for the PMF, orcdffor cumulative probabilities.Why can events like X=k and X=m (with k=m) be summed when computing P(X≥k)?
Because the events are mutually exclusive: a random variable cannot take two different values simultaneously.
What are the necessary conditions for a random variable to be binomial?
Fixed number of trials n, each trial independent, each trial has same success probability p, outcomes are binary (success/failure).
Define a Bernoulli random variable.
X∼Bern(p) takes value 1 with probability p and 0 with probability 1−p. It is a binomial with n=1.
What is the PMF of a Bernoulli random variable X∼Bern(p)?
P(X=1)=p,P(X=0)=1−p
What is the expectation of a Bernoulli random variable X∼Bern(p)?
E[X]=p
How is a binomial random variable related to Bernoulli random variables?
A binomial Bin(n,p) is the sum of n independent Bernoulli(p) random variables.
Define variance of a random variable X.
Var(X)=E[(X−μ)2] where μ=E[X].
What is an alternative formula for variance?
Var(X)=E[X2]−(E[X])2
How do you compute E[X2] using LOTUS?
E[X2]=∑xx2⋅P(X=x)
What is standard deviation?
SD(X)=Var(X)
Why is variance preferred over average absolute deviation?
Variance squares deviations, giving more weight to outliers. It also has nice mathematical properties (e.g., additive for independent vars).

Ask anything
We've read this whole study set, so questions about it get the best answers.