1. Home
  2. Explore
  3. Computer Science
  4. CS109 Course Feedback Process

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

CS109 Course Feedback Process

  • 21Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Random Variables
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is a random variable?

Tap to flipClick to flipspace

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

  1. 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.

  2. What is a probability mass function (PMF)?

    The PMF p(x)=P(X=x)p(x) = P(X = x)p(x)=P(X=x) gives the probability that a discrete random variable XXX equals a specific value xxx.

  3. How is expectation E[X]E[X]E[X] defined for a discrete random variable?

    E[X]=∑xx⋅P(X=x)E[X] = \sum_x x \cdot P(X = x)E[X]=∑x​x⋅P(X=x)

  4. 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.

  5. State the linearity of expectation.

    For any random variables XXX and YYY, E[X+Y]=E[X]+E[Y]E[X + Y] = E[X] + E[Y]E[X+Y]=E[X]+E[Y], and for constants a,ba,ba,b, E[aX+b]=aE[X]+bE[aX + b] = aE[X] + bE[aX+b]=aE[X]+b.

  6. What is the Law of the Unconscious Statistician (LOTUS)?

    For a function ggg, E[g(X)]=∑xg(x)⋅P(X=x)E[g(X)] = \sum_x g(x) \cdot P(X = x)E[g(X)]=∑x​g(x)⋅P(X=x).

  7. Define a binomial random variable.

    X∼Bin(n,p)X \sim \text{Bin}(n,p)X∼Bin(n,p) counts the number of successes in nnn independent, identical Bernoulli trials with success probability ppp.

  8. What is the PMF of a binomial random variable X∼Bin(n,p)X \sim \text{Bin}(n,p)X∼Bin(n,p)?

    P(X=k)=(nk)pk(1−p)n−k,k=0,1,…,nP(X = k) = \binom{n}{k} p^k (1-p)^{n-k}, \quad k = 0,1,\dots,nP(X=k)=(kn​)pk(1−p)n−k,k=0,1,…,n

  9. What is the expectation of X∼Bin(n,p)X \sim \text{Bin}(n,p)X∼Bin(n,p)?

    E[X]=npE[X] = npE[X]=np

  10. How can you compute binomial probabilities in Python using SciPy?

    Use scipy.stats.binom.pmf(k, n, p) for the PMF, or cdf for cumulative probabilities.

  11. Why can events like X=kX = kX=k and X=mX = mX=m (with k≠mk \neq mk=m) be summed when computing P(X≥k)P(X \geq k)P(X≥k)?

    Because the events are mutually exclusive: a random variable cannot take two different values simultaneously.

  12. What are the necessary conditions for a random variable to be binomial?

    Fixed number of trials nnn, each trial independent, each trial has same success probability ppp, outcomes are binary (success/failure).

  13. Define a Bernoulli random variable.

    X∼Bern(p)X \sim \text{Bern}(p)X∼Bern(p) takes value 111 with probability ppp and 000 with probability 1−p1-p1−p. It is a binomial with n=1n=1n=1.

  14. What is the PMF of a Bernoulli random variable X∼Bern(p)X \sim \text{Bern}(p)X∼Bern(p)?

    P(X=1)=p,P(X=0)=1−pP(X = 1) = p, \quad P(X = 0) = 1-pP(X=1)=p,P(X=0)=1−p

  15. What is the expectation of a Bernoulli random variable X∼Bern(p)X \sim \text{Bern}(p)X∼Bern(p)?

    E[X]=pE[X] = pE[X]=p

  16. How is a binomial random variable related to Bernoulli random variables?

    A binomial Bin(n,p)\text{Bin}(n,p)Bin(n,p) is the sum of nnn independent Bernoulli(p)(p)(p) random variables.

  17. Define variance of a random variable XXX.

    Var(X)=E[(X−μ)2]\text{Var}(X) = E[(X - \mu)^2]Var(X)=E[(X−μ)2] where μ=E[X]\mu = E[X]μ=E[X].

  18. What is an alternative formula for variance?

    Var(X)=E[X2]−(E[X])2\text{Var}(X) = E[X^2] - (E[X])^2Var(X)=E[X2]−(E[X])2

  19. How do you compute E[X2]E[X^2]E[X2] using LOTUS?

    E[X2]=∑xx2⋅P(X=x)E[X^2] = \sum_x x^2 \cdot P(X = x)E[X2]=∑x​x2⋅P(X=x)

  20. What is standard deviation?

    SD(X)=Var(X)\text{SD}(X) = \sqrt{\text{Var}(X)}SD(X)=Var(X)​

  21. 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).

Card 1 of 21
Card 1 of 21

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent