1. Home
  2. Explore
  3. Computer Science
  4. Probability and Federalist Papers

Study methods

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

Probability and Federalist Papers

  • 22Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Normal Distribution

State the formula for the cumulative distribution function (CDF) of a normal random variable XXX with mean μ\muμ and variance σ2\sigma^2σ2.

22 questions

  1. 1

    State the formula for the cumulative distribution function (CDF) of a normal random variable XXX with mean μ\muμ and variance σ2\sigma^2σ2.

    Model answer

    F(x)=Φ(x−μσ)F(x) = \Phi\left(\frac{x - \mu}{\sigma}\right)F(x)=Φ(σx−μ​) where Φ\PhiΦ is the CDF of the standard normal.

    Explanation

    The CDF gives P(X≤x)P(X \leq x)P(X≤x) and is computed by standardizing xxx to a zzz-score and evaluating the standard normal CDF Φ\PhiΦ.

  2. 2

    Given P(X≤r)=0.99999P(X \leq r) = 0.99999P(X≤r)=0.99999 for a normal random variable XXX, explain how to find rrr using the inverse Phi function.

    Model answer

    We have Φ(r−μσ)=0.99999\Phi\left(\frac{r - \mu}{\sigma}\right) = 0.99999Φ(σr−μ​)=0.99999, so r−μσ=Φ−1(0.99999)\frac{r - \mu}{\sigma} = \Phi^{-1}(0.99999)σr−μ​=Φ−1(0.99999). Then r=μ+σ⋅Φ−1(0.99999)r = \mu + \sigma \cdot \Phi^{-1}(0.99999)r=μ+σ⋅Φ−1(0.99999).

    Explanation

    The inverse Phi function returns the zzz-score corresponding to a given cumulative probability, allowing us to solve for the original value.

  3. 3

    In the server capacity problem, what is the relationship between the number of servers kkk, the number of requests you can handle RRR, and the number of requests per server?

    Model answer

    R=10000kR = 10000kR=10000k, because each server can handle 10,000 requests.

    Explanation

    The total request capacity is the product of the number of servers and the capacity per server.

  4. 4

    Why is it important to use logarithms when working with products of probabilities in computer science?

    Model answer

    Multiplying many small probabilities can cause numerical underflow, but adding log probabilities avoids this because computers can represent smaller numbers in log space.

    Explanation

    Logarithms convert products into sums, which are more numerically stable for very small values.

  5. 5

    State the logarithmic identity for the product of terms: log⁡(ab)\log(ab)log(ab).

    Model answer

    log⁡(ab)=log⁡a+log⁡b\log(ab) = \log a + \log blog(ab)=loga+logb.

    Explanation

    This identity converts multiplication into addition, which is key for numerical stability.

  6. 6

    How many permutations are there of the letters in the word MISSISSIPPI? Express your answer in terms of factorials.

    Model answer

    11!4! 4! 2! 1!\frac{11!}{4!\,4!\,2!\,1!}4!4!2!1!11!​

    Explanation

    This is the multinomial coefficient for a multiset with 4 I's, 4 S's, 2 P's, and 1 M.

  7. 7

    What is the joint probability mass function (PMF) for two discrete random variables XXX and YYY?

    Model answer

    The joint PMF is pX,Y(x,y)=P(X=x,Y=y)p_{X,Y}(x,y) = P(X = x, Y = y)pX,Y​(x,y)=P(X=x,Y=y) for all possible values xxx and yyy.

    Explanation

    It gives the probability of every combination of outcomes for the two random variables.

  8. 8

    What is one property that any valid joint PMF must satisfy?

    Model answer

    The sum of the joint PMF over all possible pairs (x,y)(x,y)(x,y) must equal 1.

    Explanation

    Since the events are mutually exclusive and exhaustive, their probabilities sum to 1.

  9. 9

    Explain how to obtain the marginal PMF of XXX from the joint PMF of XXX and YYY.

    Model answer

    pX(x)=∑ypX,Y(x,y)p_X(x) = \sum_{y} p_{X,Y}(x,y)pX​(x)=∑y​pX,Y​(x,y) by summing over all values of YYY.

    Explanation

    This process, called marginalization, uses the law of total probability to eliminate YYY.

  10. 10

    Why are the terms "marginal" and "marginalization" used?

    Model answer

    Historically, when working with joint probability tables by hand, the sums for one variable were written in the margins of the table.

    Explanation

    The name comes from the physical location of the computed sums.

  11. 11

    How does the law of total probability relate to marginalization?

    Model answer

    Marginalization is a direct application of the law of total probability: P(X=x)=∑yP(X=x,Y=y)=∑yP(X=x∣Y=y)P(Y=y)P(X=x) = \sum_y P(X=x, Y=y) = \sum_y P(X=x \mid Y=y)P(Y=y)P(X=x)=∑y​P(X=x,Y=y)=∑y​P(X=x∣Y=y)P(Y=y).

    Explanation

    The law of total probability provides the theoretical foundation for summing over mutually exclusive and exhaustive events.

  12. 12

    Suppose a joint probability table has nnn random variables, each taking kkk values. How many entries does the table have?

    Model answer

    knk^nkn entries.

    Explanation

    Each combination of values corresponds to one cell, leading to exponential growth.

  13. 13

    Why is a joint probability table impractical for a large number of random variables?

    Model answer

    The number of entries grows exponentially with the number of variables, making storage and estimation infeasible.

    Explanation

    This is the curse of dimensionality; we need more efficient representations.

  14. 14

    State the probability mass function of the multinomial distribution for nnn independent trials with mmm outcomes, probabilities p1,…,pmp_1, \ldots, p_mp1​,…,pm​, and counts x1,…,xmx_1, \ldots, x_mx1​,…,xm​.

    Model answer

    P(X1=x1,…,Xm=xm)=n!x1!⋯xm!p1x1⋯pmxmP(X_1=x_1, \ldots, X_m=x_m) = \frac{n!}{x_1! \cdots x_m!} p_1^{x_1} \cdots p_m^{x_m}P(X1​=x1​,…,Xm​=xm​)=x1​!⋯xm​!n!​p1x1​​⋯pmxm​​ where ∑xi=n\sum x_i = n∑xi​=n and ∑pi=1\sum p_i = 1∑pi​=1.

    Explanation

    This generalizes the binomial to multiple categories, with a multinomial coefficient for orderings.

  15. 15

    What is the relationship between the binomial and multinomial distributions?

    Model answer

    The binomial is a special case of the multinomial with m=2m=2m=2 outcomes (success and failure).

    Explanation

    When there are only two categories, the multinomial coefficient reduces to the binomial coefficient.

  16. 16

    In the context of text modeling, what does each outcome of the multinomial represent?

    Model answer

    Each outcome represents a word type, and the count xix_ixi​ is the number of times word iii appears in the document.

    Explanation

    The multinomial models a bag of words, assuming each word is drawn independently from a fixed vocabulary distribution.

  17. 17

    When using Bayes' theorem for authorship attribution, why is it easier to compute the ratio of posterior probabilities P(Hamilton∣document)P(Madison∣document)\frac{P(Hamilton \mid document)}{P(Madison \mid document)}P(Madison∣document)P(Hamilton∣document)​ than the individual probabilities?

    Model answer

    The ratio cancels the normalizing constant P(document)P(document)P(document) and the multinomial coefficient, leaving only P(document∣Hamilton)P(Hamilton)P(document∣Madison)P(Madison)\frac{P(document \mid Hamilton) P(Hamilton)}{P(document \mid Madison) P(Madison)}P(document∣Madison)P(Madison)P(document∣Hamilton)P(Hamilton)​.

    Explanation

    The evidence P(document)P(document)P(document) is the same for both hypotheses and the coefficient depends only on the same document, so they divide out.

  18. 18

    In the authorship attribution example, what assumption is made about the prior probabilities P(Hamilton)P(Hamilton)P(Hamilton) and P(Madison)P(Madison)P(Madison)?

    Model answer

    They are set equal to 1/2, representing no prior bias.

    Explanation

    A uniform prior is often used when there is no reason to favor one author over the other before seeing the data.

  19. 19

    Why did the initial multinomial calculation yield zero probability for both authors in the Federalist Papers example?

    Model answer

    Because multiplying many small probabilities (each pixip_i^{x_i}pixi​​) underflows to zero in finite-precision arithmetic.

    Explanation

    Even though the true probability is positive, the product of many tiny numbers becomes indistinguishable from zero computationally.

  20. 20

    In Bayesian inference, what is the role of the denominator P(document)P(document)P(document) in P(author∣document)P(author \mid document)P(author∣document)?

    Model answer

    It normalizes the posterior so that the probabilities sum to 1. It is computed as ∑authorP(document∣author)P(author)\sum_{author} P(document \mid author) P(author)∑author​P(document∣author)P(author).

    Explanation

    This is the law of total probability applied to the evidence.

  21. 21

    How does the multinomial coefficient affect the ratio of two multinomial likelihoods for the same document?

    Model answer

    It cancels because the same document has the same word counts, so the coefficient is identical for both authors.

    Explanation

    The coefficient depends only on the observed counts, not on the author's word probabilities.

  22. 22

    What is a major challenge when using a multinomial model for text that has many rare words?

    Model answer

    Rare words have very small probabilities, so their likelihood contributions can cause numerical underflow when multiplied.

    Explanation

    This is the same issue that motivated using logarithms in computational probability.

1 of 22
Question 1 of 22

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent