Homework 4: Two random variables

EE 520: Random Processes (Fall 2026). Due: November 6, 2026, 11:59 PM PT. Instructor: John Lipor.

Instructions

Submit your work as a PDF through the course submission system. If you need an accommodation or an alternate format, contact the instructor.

Note: For all questions asked in this course, unless the question is simply asking about definitions, please justify all answers. Stating the correct answer without justification will earn no credit. For example, if you write down a string of equations, each successive equation should be accompanied by some justification such as “by the additivity axiom” or “because the outcomes are equally likely” or “by the distributive property of set operations.” You do not need to justify algebra.

Problem 1: Two packets [5 pts each]

Two packets arrive at a router at times (X,Y)(X, Y) distributed uniformly over the triangle 0≤x≤y≤10 \leq x \leq y \leq 1 (packet 1 always arrives first).

  1. Find the joint PDF (careful with the normalizing constant), both marginals, and sketch the support.

  2. Find fY|X(y|x)f_{Y \,|\,X}(y \,|\,x) and 𝔼[Y|X=x]\mathbb{E}[Y \,|\,X = x]. Interpret: given the first arrival time, what is the best prediction of the second?

  3. Are XX and YY independent? Prove your answer two ways: via the support, and via the factorization test.

  4. Compute Cov⁡(X,Y)\operatorname{Cov}(X, Y) and the correlation coefficient ρXY\rho_{XY}. One sentence: explain the sign using your answer to part (b).

Problem 2: Where is it, roughly? [5 pts each]

(Callback to Homework 2 Problem 3: the lying oracle, now with a continuous target and a continuous belief.)

A target’s position is θ∼Unif[0,1]\theta \sim \text{Unif}[0, 1]. You query a point x∈(0,1)x \in (0, 1); the sensor returns Z=𝟙{θ>x}Z = \mathbb{1}\left\{\theta > x\right\}, but the bit is flipped with probability p=0.2p = 0.2.

  1. You query x=0.5x = 0.5 and observe Z=1Z = 1. Derive the posterior density of θ\theta (it is piecewise constant; sketch it).

  2. Compute the posterior mean and the posterior median.

  3. For your second query, you will bisect the posterior mass. Find the query point x2x_2 and explain in one sentence why mass-bisection, not interval-bisection, is the right generalization of binary search. (This is the continuous lying oracle, and the core update inside probabilistic binary search.)

Problem 3: Random number of targets [5 pts each]

A surveillance region contains N∼Poisson(λ)N \sim \text{Poisson}(\lambda) targets; each is independently detected with probability qq.

  1. Let DD be the number detected. Using the tower property (condition on NN), find 𝔼[D]\mathbb{E}[D] and Var⁡(D)\operatorname{Var}(D).

  2. Find the PMF of DD. (You will discover it is Poisson(λq)\text{Poisson}(\lambda q), i.e. thinning. One sentence on why this is remarkable.)

Problem 4: Simulate the posterior [10 pts]

Implement the noisy-comparison localizer of Problem 2 on a 10001000-point grid: θ*\theta^\ast drawn uniformly, 2020 queries, each query placed at the posterior-mass median, with flip probability pp. The posterior update is the rule you derived in Homework 2 Problem 3(c), with 0.80.8 and 0.20.2 replaced by 1−p1 - p and pp: after kk answers, grid point θj\theta_j has posterior weight proportional to (1−p)cjpk−cj(1-p)^{c_j}\,p^{\,k - c_j}, where cjc_j is the number of answers consistent with θ=θj\theta = \theta_j.

Before running: predict how the posterior width after 2020 queries compares between p=0p = 0 and p=0.2p = 0.2 (a rough factor is fine).

Turn in: posterior plots after 11, 55, and 2020 queries for both values of pp, your prediction versus the outcome, and your code.

Problem 5: Ranking by race [5 pts each]

(Builds on Session 9’s Gumbel-max theorem, which tells you who comes first. This problem asks about everyone else.)

Systems that learn from human feedback often show a labeler several responses to the same prompt and ask for a ranking from best to worst. A standard probability model for such rankings is the Plackett–Luce model. Give response kk a strength wk>0w_k > 0 and an independent clock Tk∼Exp(wk)T_k \sim \text{Exp}(w_k) (rate wkw_k). The ranking lists the responses in the order in which their clocks ring, so the first clock to ring is ranked best. Write W=∑kwkW = \sum_k w_k. For the numerical parts, there are four responses A,B,C,DA, B, C, D with strengths (wA,wB,wC,wD)=(4,2,1,1)(w_A, w_B, w_C, w_D) = (4, 2, 1, 1).

  1. Who comes first. Show that clock kk rings first with probability wk/Ww_k / W. Hint: the earliest of the other clocks is itself a single exponential clock (Session 6); then condition on TkT_k. What is the probability that AA is ranked first? One sentence: how does this match Session 9’s softmax?

  2. Everyone else. For a fixed kk, t≥0t \geq 0, and sj≥0s_j \geq 0 for every j≠kj \neq k, show that ℙ(Tk≤t and Tj−Tk>sj for all j≠k)=wkW(1−e−Wt)∏j≠ke−wjsj.\mathbb{P}\big(T_k \leq t \text{ and } T_j - T_k > s_j \text{ for all } j \neq k\big) = \frac{w_k}{W}\left(1 - e^{-W t}\right) \prod_{j \neq k} e^{-w_j s_j} . Explain why this product form means that, once the first clock rings, the leftover times Tj−TkT_j - T_k are independent Exp(wj)\text{Exp}(w_j) clocks, independent of which clock rang first and when. Conclude that the rest of the ranking is a fresh race among the remaining responses, and deduce that a ranking σ1,σ2,…,σK\sigma_1, \sigma_2, \dots, \sigma_K (best first) has probability ∏i=1Kwσiwσi+wσi+1+…+wσK.\prod_{i=1}^{K} \frac{w_{\sigma_i}}{w_{\sigma_i} + w_{\sigma_{i+1}} + \dots + w_{\sigma_K}} . Compute the probability of the ranking A,B,C,DA, B, C, D, and the probability that the weakest-looking response DD lands in the top two.

  3. Ignoring the winner. Show that ℙ(B ranked above C|A ranked first)=ℙ(B ranked above C)=wBwB+wC.\mathbb{P}(B \text{ ranked above } C \,|\,A \text{ ranked first}) = \mathbb{P}(B \text{ ranked above } C) = \frac{w_B}{w_B + w_C} . Now add a fifth response EE that is a near-copy of BB, with wE=wB=2w_E = w_B = 2. Under the model, what is the probability that AA is ranked first now? In one or two sentences, explain why a real labeler might disagree, and what assumption of the model this exposes.

  4. Sampling rankings with Gumbels. Let μk=ln⁡wk\mu_k = \ln w_k and let GkG_k be independent standard Gumbels. Using G=−ln⁡EG = -\ln E (Session 7), show that sorting the scores μk+Gk\mu_k + G_k from largest to smallest produces a Plackett–Luce ranking. Keeping only the top mm of the sorted list therefore draws mm distinct items without replacement in one pass, with no renormalizing between draws; this is the Gumbel-top-kk trick, used to draw several distinct candidate responses from a language model at once.

    Before running: use part (b) to predict how often, out of 10510^5 sampled rankings of A,B,C,DA, B, C, D, you will see the ranking A,B,C,DA, B, C, D, and how often DD lands in the top two.

    Implement the sampler using uniform draws only and draw 10510^5 rankings.

    Turn in: your predictions versus the observed frequencies, a plot of the observed frequency of each of the 2424 possible rankings against the Plackett–Luce formula, and your code.

Problem 6: Reflection [5 pts]

Read this article by Ben Orlin on getting stuck on difficult problems. Share something that resonated with you, that you might try going forward, or that you disagree with, in the discussion thread on Canvas.

Problem 7: Audit the TA-bot [5 pts]

The assistant was asked: “(X,Y)(X, Y) is uniform on the triangle with vertices (0,0)(0,0), (1,0)(1,0), (0,1)(0,1). Find the marginal density of XX and 𝔼[Y|X=x]\mathbb{E}[Y \,|\,X = x].” It answered:

This solution contains zero, one, or two errors; a single wrong step and everything it drags down counts as one error.

  1. Identify the first line that goes wrong, or certify the solution correct.

  2. Name the violated result or modeling rule in one sentence, citing the session. (Apply to each error you find.)

  3. Fix it: give the corrected marginal, conditional density, and conditional mean, and settle the independence claim with a zero-computation argument. (Apply to each error you find.)

  4. One sentence: why is this a mistake a language model plausibly makes?