# Math 2027 Rank-Decider: Indicator Expectation, Order Statistics, Memoryless Distributions & Projections
Exam: GATE Computer Science & Information Technology (GATE CS)
Subject: Engineering Mathematics & Discrete Math
Canonical URL: https://gateandnet.com/exams/gate-cs/engineering-mathematics/randomized-expectation-order-statistics-and-projections

> Indicator random variables without independence, Hat-Check fixed points, Coupon Collector, Uniform(0,1) k-th order statistics, Exponential memorylessness, and Orthogonal Projection trace-rank identity.

## 1. Linearity of Expectation Holds EVEN FOR DEPENDENT Variables!

For **any** random variables $X_1, \dots, X_n$ (even strongly dependent!), $\mathbb{E}[\sum X_i] = \sum \mathbb{E}[X_i]$:
1. **Expected Fixed Points in a Random Permutation of $n$ Items (Hat-Check Problem):** Let $I_i = \mathbb{I}[\pi(i) = i]$. Since $P(\pi(i) = i) = \frac{1}{n}$, $\mathbb{E}[\text{Fixed Points}] = \sum_{i=1}^n \frac{1}{n} = \mathbf{1}$ for **every $n \ge 1$**!
2. **Expected Inversions in a Uniform Random Permutation of $n$ Distinct Keys:** Each of the $\binom{n}{2}$ pairs $(i < j)$ is inverted with probability $1/2 \implies \mathbb{E}[I] = \frac{1}{2}\binom{n}{2} = \mathbf{\frac{n(n-1)}{4}}$.
3. **Coupon Collector Problem ($n$ Distinct Coupons):** Waiting times between new coupons are independent Geometric($\frac{n-k}{n}$), giving $\mathbb{E}[T] = n \sum_{i=1}^n \frac{1}{i} = n H_n \approx n \ln n$.

## 2. Exponential & Poisson Memoryless Inter-Arrival Duality

If events arrive according to a **Poisson Process** with rate $\lambda$ arrivals/hour:
- Number of arrivals in duration $t$: $N(t) \sim \operatorname{Poisson}(\lambda t)$ with $\mathbb{E}[N(t)] = \operatorname{Var}(N(t)) = \lambda t$ and $P(N(t)=k) = \frac{e^{-\lambda t}(\lambda t)^k}{k!}$.
- Inter-arrival waiting time $T \sim \operatorname{Exp}(\lambda)$ with $\mathbb{E}[T] = \frac{1}{\lambda}$ and **Memorylessness**:
  $$P(T > s + t \mid T > s) = P(T > t) = e^{-\lambda t}$$
- Minimum of independent Exponentials $T_1 \sim \operatorname{Exp}(\lambda_1),\; T_2 \sim \operatorname{Exp}(\lambda_2)$: $\min(T_1, T_2) \sim \operatorname{Exp}(\lambda_1 + \lambda_2)$, and $P(T_1 < T_2) = \frac{\lambda_1}{\lambda_1 + \lambda_2}$!

## Solved Practice Questions & PYQs

### [GATE CS / DA 2027 Expected | NAT]
$10$ letters are placed uniformly at random into $10$ addressed envelopes ($1$ letter per envelope). What is the **expected number of letters** that land in their **correct** envelope?
**Correct Answer:** 1
**Solution:** By **Linearity of Expectation** over indicator variables $I_k = \mathbb{I}[\text{letter } k \text{ matches}]$: $P(I_k = 1) = \frac{1}{10}$, so $\mathbb{E}[\sum_{k=1}^{10} I_k] = 10 \times \frac{1}{10} = \mathbf{1}$!

### [GATE DA 2027 Expected | MCQ]
Four independent random variables $U_1, U_2, U_3, U_4$ are drawn from $\operatorname{Uniform}(0, 1)$. What is $\mathbb{E}\big[\max(U_1, U_2, U_3, U_4) - \min(U_1, U_2, U_3, U_4)\big]$ (the expected sample range)?
**Correct Answer:** B
**Solution:** For $n = 4$ i.i.d. $\operatorname{Uniform}(0,1)$ draws: $\mathbb{E}[X_{(4)}] = \frac{4}{4+1} = 0.80$ and $\mathbb{E}[X_{(1)}] = \frac{1}{4+1} = 0.20$. By linearity, $\mathbb{E}[\text{Range}] = 0.80 - 0.20 = \mathbf{0.60}$!
