Salta al contenuto
Note per Studenti Probability Theory - Mock Exam 2 Report

Probability Theory - Mock Exam 2

Questa pagina non ha ancora la versione ripasso: qui sotto c'è il testo completo.

In questa pagina 7

Mock exam built on the model of the written papers of Calcolo delle Probabilità (the equivalent course taught in Italian for Information Engineering and Telecommunications, UniPD), in particular the paper of 24 June 2026 and the other papers of the 2025/26 academic year. It is a simulation, not a real paper: situations, functions and numbers are new. Six exercises for 32 points in total (5 + 4 + 7 + 6 + 6 + 4, as in the model). Duration: the model sheets do not state it, so 2 hours is proposed here. No notes, no calculator: leave fractions and expressions such as e−3e^{-3} unevaluated. Every answer must be justified.

Exercise 1 (points 5 = 2+2+1)

Packets are sent in pairs. For each pair a router is chosen at random: router R1R_1 with probability 34\frac34 and router R2R_2 with probability 14\frac14, and both packets of the pair go through the chosen router. A packet is lost with probability 110\frac1{10} at R1R_1 and with probability 15\frac15 at R2R_2; given the router, the two packets are lost independently of each other. Let L1L_1 and L2L_2 be the events "the first packet is lost" and "the second packet is lost".

(a) Compute the probability that exactly one of the two packets of a pair is lost.

(b) Compute P(L1)P(L_1) and P(L1∩L2)P(L_1\cap L_2) and decide whether L1L_1 and L2L_2 are independent.

(c) Suppose now that the router is chosen independently, with the same probabilities, for each of the two packets. Compute the probability that at least one of the two packets is lost.

Leave fractions unevaluated.

Show the result

(a) 43200\dfrac{43}{200}.

(b) P(L1)=18P(L_1)=\dfrac18, P(L1∩L2)=7400P(L_1\cap L_2)=\dfrac7{400}; since 7400≠164\dfrac7{400}\neq\dfrac1{64}, L1L_1 and L2L_2 are not independent.

(c) 1564\dfrac{15}{64}.

Show the full solution

Setting up. Let A1A_1 and A2A_2 be the events "the pair goes through R1R_1" and "through R2R_2": they form a partition, with P(A1)=34P(A_1)=\frac34 and P(A2)=14P(A_2)=\frac14. Inside each router the two packets are lost independently, with probability q1=110q_1=\frac1{10} at R1R_1 and q2=15q_2=\frac15 at R2R_2. This is a two-stage scheme: first the router, then the packets. The tool is the Law of Total Probability and Bayes' RuleThe law of total probability computes P(E) by averaging conditional probabilities over a partition, and Bayes' rule inverts the conditioning to obtain posterior probabilities, as in the interpretation of diagnostic tests.Law of Total Probability and Bayes' Rule →: condition on the first stage, compute inside each branch, then average with the weights P(Ai)P(A_i).

(a) Given AiA_i, the number of lost packets is binomial with n=2n=2 and p=qip=q_i, so "exactly one lost" has probability 2qi(1−qi)2q_i(1-q_i) (Bernoulli, Uniform and Binomial Random VariablesBernoulli, discrete uniform and binomial random variables are the basic families with finite alphabet; the binomial counts successes in n independent identical trials, and when independence or constant probability fails (urns without replacement) the hypergeometric density appears instead.Bernoulli, Uniform and Binomial Random Variables →): P(exactly one lost∣A1)=2⋅110⋅910=950,P(exactly one lost∣A2)=2⋅15⋅45=825.P(\text{exactly one lost}\mid A_1)=2\cdot\frac1{10}\cdot\frac9{10}=\frac9{50},\qquad P(\text{exactly one lost}\mid A_2)=2\cdot\frac15\cdot\frac45=\frac8{25}. By total probability P(exactly one lost)=34⋅950+14⋅825=27200+16200=43200.P(\text{exactly one lost})=\frac34\cdot\frac9{50}+\frac14\cdot\frac8{25}=\frac{27}{200}+\frac{16}{200}=\frac{43}{200}. Typical mistake: writing 2q(1−q)2q(1-q) with an "average" qq (here 18\frac18) instead of averaging the probabilities over the router; this gives 2⋅18⋅78=732≠432002\cdot\frac18\cdot\frac78=\frac7{32}\ne\frac{43}{200}.

(b) For one packet, P(L1)=P(L1∣A1)P(A1)+P(L1∣A2)P(A2)=34⋅110+14⋅15=340+240=18,P(L_1)=P(L_1\mid A_1)P(A_1)+P(L_1\mid A_2)P(A_2)=\frac34\cdot\frac1{10}+\frac14\cdot\frac15=\frac3{40}+\frac2{40}=\frac18, and P(L2)=18P(L_2)=\frac18 in the same way. For the pair, the conditional independence given the router gives P(L1∩L2∣Ai)=qi2P(L_1\cap L_2\mid A_i)=q_i^2, hence P(L1∩L2)=34⋅1100+14⋅125=3400+4400=7400.P(L_1\cap L_2)=\frac34\cdot\frac1{100}+\frac14\cdot\frac1{25}=\frac3{400}+\frac4{400}=\frac7{400}. Independence (Independence of EventsTwo events are independent when P(E and F) = P(E)P(F), equivalently when conditioning on one does not change the probability of the other; independence of three events requires both the pairwise and the triple product conditions.Independence of Events →) would require P(L1∩L2)=P(L1)P(L2)=164=251600P(L_1\cap L_2)=P(L_1)P(L_2)=\frac1{64}=\frac{25}{1600}, while P(L1∩L2)=7400=281600P(L_1\cap L_2)=\frac7{400}=\frac{28}{1600}. The two numbers differ, so L1L_1 and L2L_2 are not independent. The reason: knowing that the first packet was lost makes the bad router more likely, and this raises the probability that the second one is lost too (P(L2∣L1)=7/4001/8=750>18P(L_2\mid L_1)=\frac{7/400}{1/8}=\frac{7}{50}>\frac18). Typical mistake: concluding independence from "the packets are lost independently at each router": that is independence conditional on the router, which is weaker than independence (Applications of IndependenceIndependence simplifies computations of probabilities of unions and of 'exactly one' events, and it is the tool to construct the equiprobable and the binomial probability measures on the space of n-bit sequences.Applications of Independence →).

(c) Now the two packets use two routers chosen independently, so L1L_1 and L2L_2 are functions of independent choices and independent losses: they are independent events, each with P(Li)=18P(L_i)=\frac18 by (b). Using the complement and independence of the complements, P(L1∪L2)=1−P(L1c∩L2c)=1−(78)2=1564.P(L_1\cup L_2)=1-P(L_1^c\cap L_2^c)=1-\Big(\frac78\Big)^2=\frac{15}{64}. Comparison: with the shared router of (b) the same event has probability P(L1∪L2)=18+18−7400=93400=0.2325P(L_1\cup L_2)=\frac18+\frac18-\frac7{400}=\frac{93}{400}=0.2325, slightly smaller than 1564≈0.2344\frac{15}{64}\approx0.2344: sharing the router makes the two losses cluster together, so "at least one lost" becomes a little less likely.

Exercise 2 (points 4 = 2+2)

(a) Items on an assembly line are tested one by one; each item is defective with probability 15\frac15, independently of the others. Let XX be the index of the first defective item, so X∼G(15)X\sim G\big(\frac15\big). Compute P(X>7∣X>3)P(X>7\mid X>3) and P(X is even)P(X\text{ is even}).

(b) In one hour a call centre receives N1N_1 calls from landlines and N2N_2 calls from mobiles, with N1∼P(1)N_1\sim\mathcal{P}(1) and N2∼P(2)N_2\sim\mathcal{P}(2) independent. Let T=N1+N2T=N_1+N_2 be the total number of calls. Determine the law of TT, compute P(T≥2)P(T\ge2) and E(T2)E(T^2).

Show the result

(a) P(X>7∣X>3)=(45)4=256625P(X>7\mid X>3)=\Big(\dfrac45\Big)^4=\dfrac{256}{625};   P(X even)=49\;P(X\text{ even})=\dfrac49.

(b) T∼P(3)T\sim\mathcal{P}(3);   P(T≥2)=1−4e−3\;P(T\ge2)=1-4e^{-3};   E(T2)=12\;E(T^2)=12.

Show the full solution

(a) For X∼G(p)X\sim G(p) the tail is P(X>h)=(1−p)hP(X>h)=(1-p)^h: the first hh items must all be good (Geometric Random VariableThe geometric random variable counts the trial at which the first success occurs in independent binary trials; it has infinite alphabet, density (1-p)^(k-1) p, mean 1/p and the memoryless property.Geometric Random Variable →). With p=15p=\frac15: P(X>7∣X>3)=P({X>7}∩{X>3})P(X>3)=P(X>7)P(X>3)=(4/5)7(4/5)3=(45)4=256625,P(X>7\mid X>3)=\frac{P(\{X>7\}\cap\{X>3\})}{P(X>3)}=\frac{P(X>7)}{P(X>3)}=\frac{(4/5)^7}{(4/5)^3}=\Big(\frac45\Big)^4=\frac{256}{625}, because {X>7}⊂{X>3}\{X>7\}\subset\{X>3\}. This is the memoryless property: P(X>3+k∣X>3)=P(X>k)P(X>3+k\mid X>3)=P(X>k), here with k=4k=4 (Conditional Distributions of Random VariablesConditioning re-evaluates the distribution function or density of a random variable given an event E, which may be unrelated to X, defined through X itself, or defined through another random variable Y; for discrete vectors the conditional density is p_XY over p_Y, giving mixtures, the memoryless property of the geometric law and Bayes formula.Conditional Distributions of Random Variables →). The three good items already seen do not change the future.

For the even values X∈{2,4,6,… }X\in\{2,4,6,\dots\}, write k=2mk=2m with m≥1m\ge1 and sum the density pX(k)=(4/5)k−115p_X(k)=(4/5)^{k-1}\frac15: P(X even)=∑m=1∞(45)2m−115=15⋅45∑m=0∞(1625)m=425⋅11−1625=425⋅259=49.P(X\text{ even})=\sum_{m=1}^{\infty}\Big(\frac45\Big)^{2m-1}\frac15=\frac15\cdot\frac45\sum_{m=0}^{\infty}\Big(\frac{16}{25}\Big)^{m}=\frac4{25}\cdot\frac1{1-\frac{16}{25}}=\frac4{25}\cdot\frac{25}{9}=\frac49. Typical mistakes: P(X>7∣X>3)=P(X>4)P(X>7\mid X>3)=P(X>4) is correct, but P(X>7)−P(X>3)P(X>7)-P(X>3) is not a conditional probability (and is negative); the sum of a geometric series starts from the first term actually present (m=1m=1 gives the factor (4/5)1(4/5)^1 out front).

(b) By the properties of the characteristic function (Characteristic Functionsmoments and the moment generating function lead to the characteristic function, the Fourier transform of the density, which always exists, characterizes the distribution, turns sums of independent variables into products and gives moments by differentiation; the multivariate version works the same way for random vectors.Characteristic Functions →): for independent Poisson variables φT(ω)=φN1(ω)φN2(ω)=e1(ejω−1)e2(ejω−1)=e3(ejω−1)\varphi_T(\omega)=\varphi_{N_1}(\omega)\varphi_{N_2}(\omega)=e^{1(e^{j\omega}-1)}e^{2(e^{j\omega}-1)}=e^{3(e^{j\omega}-1)}, which is the characteristic function of P(3)\mathcal{P}(3). Since the characteristic function determines the law, T∼P(3)T\sim\mathcal{P}(3). (Equivalently, the density of TT is the convolution pT(m)=∑i=0mpN1(i)pN2(m−i)p_T(m)=\sum_{i=0}^m p_{N_1}(i)p_{N_2}(m-i) and the binomial theorem gives e−33mm!e^{-3}\frac{3^m}{m!}.)

For the probability, pass to the complement: P(T≥2)=1−P(T=0)−P(T=1)=1−e−3−3e−3=1−4e−3P(T\ge2)=1-P(T=0)-P(T=1)=1-e^{-3}-3e^{-3}=1-4e^{-3}.

For the second moment use E(T2)=var(T)+E(T)2E(T^2)=\mathrm{var}(T)+E(T)^2 (VarianceThe variance is the expected squared deviation from the expected value and measures how spread out a random variable is; it is non-negative, zero only for constants, scales with the square of a multiplier, ignores shifts, and equals E(X^2) minus the square of E(X).Variance →); for a Poisson law mean and variance both equal the parameter, so E(T2)=3+32=12E(T^2)=3+3^2=12. Typical mistake: thinking T∼P(1⋅2)T\sim\mathcal{P}(1\cdot2) (product) or that the sum of two Poissons is not Poisson.

Exercise 3 (points 7 = 2+2+3)

Let (X,Y)(X,Y) be a random vector with joint density fX,Y(x,y)=c x 1T(x,y),T={(x,y):x>0, y>0, x+y<1},f_{X,Y}(x,y)=c\,x\,\mathbb{1}_T(x,y),\qquad T=\{(x,y):x>0,\ y>0,\ x+y<1\}, with c>0c>0 a constant.

(a) Determine cc and the marginal densities fXf_X and fYf_Y.

(b) Are XX and YY independent? Compute P(Y<X)P(Y<X).

(c) For 0<y<10<y<1 determine the conditional density fX∣Y=yf_{X\mid Y=y} and compute E(X∣Y=y)E(X\mid Y=y). Then compute P(X>14∣Y=14)P\big(X>\tfrac14\mid Y=\tfrac14\big).

Show the result

(a) c=6c=6;   fX(x)=6x(1−x) 1(0,1)(x)\;f_X(x)=6x(1-x)\,\mathbb{1}_{(0,1)}(x);   fY(y)=3(1−y)2 1(0,1)(y)\;f_Y(y)=3(1-y)^2\,\mathbb{1}_{(0,1)}(y).

(b) Not independent. P(Y<X)=34P(Y<X)=\dfrac34.

(c) fX∣Y=y(x)=2x(1−y)2 1(0, 1−y)(x)f_{X\mid Y=y}(x)=\dfrac{2x}{(1-y)^2}\,\mathbb{1}_{(0,\,1-y)}(x);   E(X∣Y=y)=2(1−y)3\;E(X\mid Y=y)=\dfrac{2(1-y)}3;   P(X>14∣Y=14)=89\;P\big(X>\tfrac14\mid Y=\tfrac14\big)=\dfrac89.

Show the full solution

The support. TT is the triangle with vertices (0,0)(0,0), (1,0)(1,0), (0,1)(0,1). For a fixed x∈(0,1)x\in(0,1) the variable yy runs in (0,1−x)(0,1-x); for a fixed y∈(0,1)y\in(0,1) the variable xx runs in (0,1−y)(0,1-y). These two descriptions give the limits of integration: drawing TT first avoids most mistakes (Absolutely Continuous Random VectorsAn absolutely continuous random vector (X,Y) has a joint density f_XY with F_XY the double integral of f_XY; probabilities of sets are double integrals, marginals are obtained by integrating out one variable, the uniform vector on D has density 1/area(D) on D, and the density of X + Y is an integral of f_XY along the line x + y = z.Absolutely Continuous Random Vectors →).

(a) Normalization: the density must integrate to 11 on TT, 1=∫01 ⁣ ⁣∫01−xc x dy dx=c∫01x(1−x) dx=c(12−13)=c6,1=\int_0^1\!\!\int_0^{1-x}c\,x\,dy\,dx=c\int_0^1x(1-x)\,dx=c\Big(\frac12-\frac13\Big)=\frac c6, so c=6c=6. The marginals are obtained by integrating out the other variable over the section of TT: fX(x)=∫01−x6x dy=6x(1−x),0<x<1;fY(y)=∫01−y6x dx=3(1−y)2,0<y<1.f_X(x)=\int_0^{1-x}6x\,dy=6x(1-x),\quad 0<x<1;\qquad f_Y(y)=\int_0^{1-y}6x\,dx=3(1-y)^2,\quad 0<y<1. Check: ∫016x(1−x)dx=1\int_0^1 6x(1-x)dx=1 and ∫013(1−y)2dy=1\int_0^13(1-y)^2dy=1. Typical mistake: integrating xx from 00 to 11 (instead of 00 to 1−y1-y) to get fYf_Y: the result would be a constant times a wrong function that is not a density.

(b) If XX and YY were independent we would have fX,Y(x,y)=fX(x)fY(y)f_{X,Y}(x,y)=f_X(x)f_Y(y) for all (x,y)(x,y) (Independent Random VariablesDiscrete random variables X and Y are independent when the joint density factorizes as p_XY = p_X p_Y for all pairs; independence is preserved by functions f(X), g(Y), implies E(XY) = E(X)E(Y) and var(X + Y) = var(X) + var(Y), but uncorrelated does not imply independent.Independent Random Variables →). Here the product fX(x)fY(y)=6x(1−x)⋅3(1−y)2f_X(x)f_Y(y)=6x(1-x)\cdot3(1-y)^2 is strictly positive on the whole square (0,1)2(0,1)^2, while fX,Y=0f_{X,Y}=0 for x+y>1x+y>1 (for example at (0.9,0.9)(0.9,0.9)). So XX and YY are not independent. The support is not a rectangle: this alone already excludes independence.

The event {Y<X}\{Y<X\} cuts TT in the region {y<x<1−y}\{y<x<1-y\}, bounded by the lines y=xy=x and x+y=1x+y=1, which meet at (12,12)(\frac12,\frac12); so yy runs from 00 to 12\frac12 and, for each yy, xx runs from yy to 1−y1-y: P(Y<X)=∫01/2 ⁣ ⁣∫y1−y6x dx dy=∫01/23[(1−y)2−y2]dy=∫01/23(1−2y) dy=3[y−y2]01/2=34.P(Y<X)=\int_0^{1/2}\!\!\int_y^{1-y}6x\,dx\,dy=\int_0^{1/2}3\big[(1-y)^2-y^2\big]dy=\int_0^{1/2}3(1-2y)\,dy=3\Big[y-y^2\Big]_0^{1/2}=\frac34.

(c) The conditional density is the ratio of the joint density to the marginal of the conditioning variable, defined where fY(y)>0f_Y(y)>0 (Conditional Distributions of Random VariablesConditioning re-evaluates the distribution function or density of a random variable given an event E, which may be unrelated to X, defined through X itself, or defined through another random variable Y; for discrete vectors the conditional density is p_XY over p_Y, giving mixtures, the memoryless property of the geometric law and Bayes formula.Conditional Distributions of Random Variables →): fX∣Y=y(x)=fX,Y(x,y)fY(y)=6x3(1−y)2=2x(1−y)2,0<x<1−y.f_{X\mid Y=y}(x)=\frac{f_{X,Y}(x,y)}{f_Y(y)}=\frac{6x}{3(1-y)^2}=\frac{2x}{(1-y)^2},\qquad 0<x<1-y. It integrates to 11 on (0,1−y)(0,1-y), as it must. The conditional expectation (Conditional Expectationthe conditional expected value E(X given Y=y) is the mean of X under the conditional density, and the law of the iterated expectation E(g(X)) = E(E(g(X) given Y)) turns hard expectations into two easy steps, as in random sums.Conditional Expectation →): E(X∣Y=y)=∫01−yx 2x(1−y)2 dx=2(1−y)2⋅(1−y)33=2(1−y)3.E(X\mid Y=y)=\int_0^{1-y}x\,\frac{2x}{(1-y)^2}\,dx=\frac{2}{(1-y)^2}\cdot\frac{(1-y)^3}3=\frac{2(1-y)}3. For y=14y=\frac14: fX∣Y=1/4(x)=329xf_{X\mid Y=1/4}(x)=\frac{32}9x on (0,34)(0,\frac34), and the conditional distribution function is P(X≤t∣Y=y)=t2(1−y)2P(X\le t\mid Y=y)=\frac{t^2}{(1-y)^2}, so P(X>14 ∣ Y=14)=1−(1/4)2(3/4)2=1−19=89.P\Big(X>\frac14\ \Big|\ Y=\frac14\Big)=1-\frac{(1/4)^2}{(3/4)^2}=1-\frac19=\frac89. Typical mistake: integrating over x∈(0,1)x\in(0,1) instead of (0,1−y)(0,1-y) when computing the conditional probability.

Exercise 4 (points 6 = 2+2+2)

Two components work independently. Their lifetimes (in hours) are X∼Exp(1)X\sim\mathrm{Exp}(1) and Y∼Exp(2)Y\sim\mathrm{Exp}(2), with densities fX(t)=e−tf_X(t)=e^{-t} and fY(t)=2e−2tf_Y(t)=2e^{-2t} for t>0t>0.

(a) The system fails as soon as one component fails. Determine the distribution function and the density of M=min⁡(X,Y)M=\min(X,Y), and compute E(M)E(M) and P(M>12)P\big(M>\tfrac12\big).

(b) A second system works until both components have failed. Determine the distribution function and the density of W=max⁡(X,Y)W=\max(X,Y), and compute E(W)E(W).

(c) Using the convolution, determine the density of S=X+YS=X+Y and compute P(S>1)P(S>1).

Show the result

(a) FM(t)=1−e−3tF_M(t)=1-e^{-3t} for t≥0t\ge0, so M∼Exp(3)M\sim\mathrm{Exp}(3) with density 3e−3t3e^{-3t};   E(M)=13\;E(M)=\dfrac13;   P(M>12)=e−3/2\;P\big(M>\tfrac12\big)=e^{-3/2}.

(b) FW(t)=(1−e−t)(1−e−2t)F_W(t)=(1-e^{-t})(1-e^{-2t}) for t≥0t\ge0;   fW(t)=e−t+2e−2t−3e−3t\;f_W(t)=e^{-t}+2e^{-2t}-3e^{-3t};   E(W)=76\;E(W)=\dfrac76.

(c) fS(s)=2(e−s−e−2s) 1(0,∞)(s)f_S(s)=2\big(e^{-s}-e^{-2s}\big)\,\mathbb{1}_{(0,\infty)}(s);   P(S>1)=2e−1−e−2\;P(S>1)=2e^{-1}-e^{-2}.

Show the full solution

(a) Work with the complement of the distribution function (Distribution FunctionThe distribution function F_X(x) = P(X <= x) is an alternative to the discrete density; for a discrete random variable it is a right-continuous non-decreasing step function whose jumps are the values of the density.Distribution Function →). The minimum exceeds tt if and only if both variables exceed tt, and by independence the probabilities multiply: P(M>t)=P(X>t, Y>t)=P(X>t)P(Y>t)=e−te−2t=e−3t,t≥0.P(M>t)=P(X>t,\,Y>t)=P(X>t)P(Y>t)=e^{-t}e^{-2t}=e^{-3t},\qquad t\ge0. Hence FM(t)=1−e−3tF_M(t)=1-e^{-3t} for t≥0t\ge0 (and 00 for t<0t<0), which is the distribution function of Exp(3)\mathrm{Exp}(3); differentiating, fM(t)=3e−3tf_M(t)=3e^{-3t}. Then E(M)=13E(M)=\frac13, and P(M>12)=e−3/2P(M>\frac12)=e^{-3/2} directly from the formula above. (The minimum of independent exponentials is exponential with the sum of the rates.)

(b) The maximum is at most tt if and only if both variables are at most tt, and again independence gives a product, now of distribution functions: FW(t)=P(X≤t, Y≤t)=FX(t)FY(t)=(1−e−t)(1−e−2t)=1−e−t−e−2t+e−3t,t≥0.F_W(t)=P(X\le t,\,Y\le t)=F_X(t)F_Y(t)=(1-e^{-t})(1-e^{-2t})=1-e^{-t}-e^{-2t}+e^{-3t},\qquad t\ge0. Differentiating: fW(t)=e−t+2e−2t−3e−3tf_W(t)=e^{-t}+2e^{-2t}-3e^{-3t} for t>0t>0. The mean, using ∫0∞t λe−λtdt=1λ\int_0^\infty t\,\lambda e^{-\lambda t}dt=\frac1\lambda term by term (Expected ValueThe expected value E(X) is the sum of the values of a discrete random variable weighted by their probabilities; it is linear, lies between the smallest and the largest value, and equals the barycenter of the density.Expected Value →): E(W)=∫0∞t(e−t+2e−2t−3e−3t)dt=1+2⋅14−3⋅19=1+12−13=76.E(W)=\int_0^\infty t\big(e^{-t}+2e^{-2t}-3e^{-3t}\big)dt=1+2\cdot\frac14-3\cdot\frac19=1+\frac12-\frac13=\frac76. Check: min⁡+max⁡=X+Y\min+\max=X+Y, so E(W)=E(X)+E(Y)−E(M)=1+12−13=76E(W)=E(X)+E(Y)-E(M)=1+\frac12-\frac13=\frac76. Typical mistake: multiplying the densities (or the tails) for the maximum: the product rule holds for FF in the max case and for 1−F1-F in the min case.

(c) For independent variables the density of the sum is the convolution of the densities, fS(s)=∫fX(u)fY(s−u) duf_S(s)=\int f_X(u)f_Y(s-u)\,du (Conditional Expectationthe conditional expected value E(X given Y=y) is the mean of X under the conditional density, and the law of the iterated expectation E(g(X)) = E(E(g(X) given Y)) turns hard expectations into two easy steps, as in random sums.Conditional Expectation →, see also the sums of independent variables in Characteristic Functionsmoments and the moment generating function lead to the characteristic function, the Fourier transform of the density, which always exists, characterizes the distribution, turns sums of independent variables into products and gives moments by differentiation; the multivariate version works the same way for random vectors.Characteristic Functions →). Both densities vanish for negative arguments, so 0<u<s0<u<s and fS(s)=0f_S(s)=0 for s≤0s\le0: fS(s)=∫0se−u 2e−2(s−u) du=2e−2s∫0seu du=2e−2s(es−1)=2(e−s−e−2s),s>0.f_S(s)=\int_0^se^{-u}\,2e^{-2(s-u)}\,du=2e^{-2s}\int_0^se^{u}\,du=2e^{-2s}(e^s-1)=2\big(e^{-s}-e^{-2s}\big),\qquad s>0. Check: ∫0∞fS=2(1−12)=1\int_0^\infty f_S=2\big(1-\frac12\big)=1 and E(S)=2(1−14)=32=E(X)+E(Y)E(S)=2\big(1-\frac14\big)=\frac32=E(X)+E(Y). Then P(S>1)=∫1∞2(e−s−e−2s)ds=2e−1−e−2≈0.600.P(S>1)=\int_1^\infty2\big(e^{-s}-e^{-2s}\big)ds=2e^{-1}-e^{-2}\approx0.600. Typical mistake: leaving the integration limits (−∞,∞)(-\infty,\infty) without noting that the integrand vanishes outside (0,s)(0,s).

Exercise 5 (points 6 = 2+2+2)

Let XX be a random variable with P(X=−1)=P(X=1)=14P(X=-1)=P(X=1)=\frac14 and P(X=0)=12P(X=0)=\frac12.

(a) Compute the characteristic function φX(ω)\varphi_X(\omega) and show that it can be written as cos⁡2 ⁣(ω2)\cos^2\!\big(\tfrac\omega2\big).

(b) Using the characteristic function, compute E(X2)E(X^2) and E(X4)E(X^4). What can be said about the odd moments?

(c) Let X1X_1 and X2X_2 be independent with the same law as XX, and S=X1+X2S=X_1+X_2. Compute the characteristic function of SS, recognize the law of S+2S+2 and compute P(S≥1)P(S\ge1).

Show the result

(a) φX(ω)=12+12cos⁡ω=cos⁡2 ⁣(ω2)\varphi_X(\omega)=\dfrac12+\dfrac12\cos\omega=\cos^2\!\big(\tfrac\omega2\big).

(b) E(X2)=12E(X^2)=\dfrac12, E(X4)=12E(X^4)=\dfrac12; all odd moments are 00.

(c) φS(ω)=cos⁡4 ⁣(ω2)\varphi_S(\omega)=\cos^4\!\big(\tfrac\omega2\big);   S+2∼Bin(4,12)\;S+2\sim\mathrm{Bin}\big(4,\tfrac12\big);   P(S≥1)=516\;P(S\ge1)=\dfrac5{16}.

Show the full solution

(a) By definition (Characteristic Functionsmoments and the moment generating function lead to the characteristic function, the Fourier transform of the density, which always exists, characterizes the distribution, turns sums of independent variables into products and gives moments by differentiation; the multivariate version works the same way for random vectors.Characteristic Functions →), for a discrete variable φX(ω)=∑kpX(k)ejωk\varphi_X(\omega)=\sum_kp_X(k)e^{j\omega k}: φX(ω)=14e−jω+12+14ejω=12+12⋅ejω+e−jω2=12+12cos⁡ω=cos⁡2 ⁣(ω2),\varphi_X(\omega)=\frac14e^{-j\omega}+\frac12+\frac14e^{j\omega}=\frac12+\frac12\cdot\frac{e^{j\omega}+e^{-j\omega}}2=\frac12+\frac12\cos\omega=\cos^2\!\Big(\frac\omega2\Big), where the last step is the identity cos⁡2α=1+cos⁡2α2\cos^2\alpha=\frac{1+\cos2\alpha}2 with α=ω2\alpha=\frac\omega2. The function is real and even because the density of XX is symmetric.

(b) The theorem of moments: E(Xk)=1jkφX(k)(0)E(X^k)=\frac1{j^k}\varphi_X^{(k)}(0). With φX(ω)=12+12cos⁡ω\varphi_X(\omega)=\frac12+\frac12\cos\omega: φX′′(ω)=−12cos⁡ω,  E(X2)=1j2(−12)=12;φX′′′′(ω)=12cos⁡ω,  E(X4)=1j4⋅12=12.\varphi_X''(\omega)=-\frac12\cos\omega,\ \ E(X^2)=\frac1{j^2}\Big(-\frac12\Big)=\frac12;\qquad\varphi_X''''(\omega)=\frac12\cos\omega,\ \ E(X^4)=\frac1{j^4}\cdot\frac12=\frac12. The odd derivatives are multiples of sin⁡ω\sin\omega, which vanishes at 00, so E(X)=E(X3)=⋯=0E(X)=E(X^3)=\dots=0 (obvious also from the symmetry of the density). Direct check: E(X2)=1⋅14+1⋅14=12E(X^2)=1\cdot\frac14+1\cdot\frac14=\frac12 and E(X4)E(X^4) is the same since X4=X2X^4=X^2 here. The variance is var(X)=12\mathrm{var}(X)=\frac12. Typical mistake: forgetting the factor 1jk\frac1{j^k} (for k=2k=2 it changes the sign).

(c) For independent variables the characteristic function of the sum is the product (Characteristic Functionsmoments and the moment generating function lead to the characteristic function, the Fourier transform of the density, which always exists, characterizes the distribution, turns sums of independent variables into products and gives moments by differentiation; the multivariate version works the same way for random vectors.Characteristic Functions →): φS(ω)=φX1(ω)φX2(ω)=cos⁡4 ⁣(ω2)=(ejω/2+e−jω/22)4=e−2jω(1+ejω2)4.\varphi_S(\omega)=\varphi_{X_1}(\omega)\varphi_{X_2}(\omega)=\cos^4\!\Big(\frac\omega2\Big)=\Big(\frac{e^{j\omega/2}+e^{-j\omega/2}}2\Big)^4=e^{-2j\omega}\Big(\frac{1+e^{j\omega}}2\Big)^4. For the affine transformation B=S+2B=S+2 the characteristic function is φB(ω)=e2jωφS(ω)=(12+12ejω)4\varphi_B(\omega)=e^{2j\omega}\varphi_S(\omega)=\Big(\dfrac12+\dfrac12e^{j\omega}\Big)^4, which is the characteristic function of Bin(4,12)\mathrm{Bin}\big(4,\frac12\big) (the characteristic function of Bin(n,p)\mathrm{Bin}(n,p) is (1−p+pejω)n(1-p+pe^{j\omega})^n). The characteristic function determines the law, so S+2∼Bin(4,12)S+2\sim\mathrm{Bin}\big(4,\frac12\big), i.e. P(S=k)=(4k+2)116,k∈{−2,−1,0,1,2}.P(S=k)=\binom4{k+2}\frac1{16},\qquad k\in\{-2,-1,0,1,2\}. Then P(S≥1)=P(S=1)+P(S=2)=416+116=516P(S\ge1)=P(S=1)+P(S=2)=\frac4{16}+\frac1{16}=\frac5{16}. Check with the variance: var(S)=2⋅12=1=var Bin(4,12)\mathrm{var}(S)=2\cdot\frac12=1=\mathrm{var}\,\mathrm{Bin}(4,\frac12). Typical mistake: concluding that S∼Bin(4,12)S\sim\mathrm{Bin}(4,\frac12) without the shift by 22: SS takes negative values.

Exercise 6 (points 4 = 2+2)

Let (Xn)n≥1(X_n)_{n\ge1} be i.i.d. random variables with finite mean μ\mu and finite variance σ2>0\sigma^2>0, and let Xˉn=1n∑i=1nXi\bar X_n=\frac1n\sum_{i=1}^nX_i.

(a) Prove, using the Chebyshev inequality, that Xˉn→μ\bar X_n\to\mu in probability (law of large numbers).

(b) A coin lands heads with an unknown probability p∈(0,1)p\in(0,1) and is tossed nn times; let Xˉn\bar X_n be the relative frequency of heads. Use the Chebyshev inequality to find a number nn of tosses that guarantees, whatever the value of pp, P(∣Xˉn−p∣≥0.05)≤0.05P\big(|\bar X_n-p|\ge0.05\big)\le0.05.

Show the result

(a) P(∣Xˉn−μ∣≥ε)≤σ2nε2→0P(|\bar X_n-\mu|\ge\varepsilon)\le\dfrac{\sigma^2}{n\varepsilon^2}\to0 for every ε>0\varepsilon>0.

(b) n=2000n=2000 tosses are enough (any n≥2000n\ge2000).

Show the full solution

(a) First compute mean and variance of Xˉn\bar X_n (Modes of Convergencea random sequence can converge pointwise (almost surely), in distribution, in probability or in the mean of order p; the notes define the last three, relate them (L2 implies L1 implies probability implies distribution), use Levy's theorem with characteristic functions, and show with counterexamples what convergence in distribution or in probability does not guarantee.Modes of Convergence →). By linearity E(Xˉn)=1n∑iE(Xi)=μE(\bar X_n)=\frac1n\sum_iE(X_i)=\mu. Since the XiX_i are independent, the variances add (VarianceThe variance is the expected squared deviation from the expected value and measures how spread out a random variable is; it is non-negative, zero only for constants, scales with the square of a multiplier, ignores shifts, and equals E(X^2) minus the square of E(X).Variance →), and var(Xˉn)=1n2∑i=1nvar(Xi)=nσ2n2=σ2n.\mathrm{var}(\bar X_n)=\frac1{n^2}\sum_{i=1}^n\mathrm{var}(X_i)=\frac{n\sigma^2}{n^2}=\frac{\sigma^2}n. Now the Chebyshev inequality (Markov and Chebyshev InequalitiesFor a nonnegative random variable P(X >= a) is at most E(X)/a (Markov), and for any random variable with finite mean and variance P(|X - E(X)| >= eps) is at most var(X)/eps^2 (Chebyshev); both bounds are loose but universal, valid whatever the distribution.Markov and Chebyshev Inequalities →) applied to Xˉn\bar X_n: for every ε>0\varepsilon>0 P(∣Xˉn−μ∣≥ε)≤var(Xˉn)ε2=σ2nε2→n→∞0.P\big(|\bar X_n-\mu|\ge\varepsilon\big)\le\frac{\mathrm{var}(\bar X_n)}{\varepsilon^2}=\frac{\sigma^2}{n\varepsilon^2}\xrightarrow[n\to\infty]{}0. Since a probability is nonnegative, P(∣Xˉn−μ∣≥ε)→0P(|\bar X_n-\mu|\ge\varepsilon)\to0 for every ε>0\varepsilon>0, which is the definition of Xˉn→Pμ\bar X_n\xrightarrow{P}\mu. Typical mistakes: using var(Xˉn)=σ2\mathrm{var}(\bar X_n)=\sigma^2 (forgetting the 1n2\frac1{n^2}) or applying Chebyshev to ∑iXi\sum_iX_i without rescaling ε\varepsilon.

(b) The tosses are i.i.d. Bernoulli, so μ=p\mu=p and σ2=p(1−p)\sigma^2=p(1-p), and pp is unknown. By (a), P(∣Xˉn−p∣≥0.05)≤p(1−p)n (0.05)2.P\big(|\bar X_n-p|\ge0.05\big)\le\frac{p(1-p)}{n\,(0.05)^2}. The bound must hold for every pp, so we use the worst case: p(1−p)≤14p(1-p)\le\frac14 for all p∈[0,1]p\in[0,1] (the maximum of the parabola is at p=12p=\frac12). Then P(∣Xˉn−p∣≥0.05)≤1/4n⋅0.0025=100n≤0.05  ⟺  n≥2000.P\big(|\bar X_n-p|\ge0.05\big)\le\frac{1/4}{n\cdot0.0025}=\frac{100}{n}\le0.05\iff n\ge2000. So n=2000n=2000 tosses suffice. Remark: Chebyshev is universal but very conservative. For p=12p=\frac12 and n=2000n=2000 the exact binomial probability is below 10−510^{-5}; the Central Limit Theoremthe standardized arithmetic mean of iid random variables with finite variance converges in distribution to N(0,1), whatever the distribution of the variables, which justifies the Gaussian approximation of sums.Central Limit Theorem → gives a far smaller number of tosses (a few hundred) for the same accuracy, but with an approximation instead of a guarantee.

Self-assessment grid
Exercise Points What is needed for full marks Typical mistakes
1 5 (a) binomial inside each router, total probability: 43200\frac{43}{200} (2); (b) P(L1)=18P(L_1)=\frac18, P(L1∩L2)=7400≠164P(L_1\cap L_2)=\frac7{400}\neq\frac1{64}, not independent, with reason (2); (c) independent routers, complement: 1564\frac{15}{64} (1) averaging the loss probability before using the binomial; confusing independence given the router with independence; checking independence without computing P(L1∩L2)P(L_1\cap L_2)
2 4 (a) tail (1−p)h(1-p)^h, memoryless (45)4\big(\frac45\big)^4, geometric series 49\frac49 (2); (b) T∼P(3)T\sim\mathcal{P}(3) with justification, 1−4e−31-4e^{-3}, E(T2)=3+9=12E(T^2)=3+9=12 (2) writing P(X>7)−P(X>3)P(X>7)-P(X>3); wrong first term of the series; parameter of the sum of Poissons computed as a product; forgetting E(T)2E(T)^2 in the second moment
3 7 (a) c=6c=6, fX=6x(1−x)f_X=6x(1-x), fY=3(1−y)2f_Y=3(1-y)^2 with section limits (2); (b) non-rectangular support gives non-independence, P(Y<X)=34P(Y<X)=\frac34 with the right region (2); (c) fX∣Y=y=2x(1−y)2f_{X\mid Y=y}=\frac{2x}{(1-y)^2} on (0,1−y)(0,1-y), E(X∣Y=y)=2(1−y)3E(X\mid Y=y)=\frac{2(1-y)}3, 89\frac89 (3) integrating over the square instead of the triangle; wrong limits for the marginals; conditional density not integrating to 11; forgetting the support in the conditional probability
4 6 (a) product of tails, Exp(3)\mathrm{Exp}(3), 13\frac13, e−3/2e^{-3/2} (2); (b) product of distribution functions, density, 76\frac76 (2); (c) convolution on (0,s)(0,s), 2(e−s−e−2s)2(e^{-s}-e^{-2s}), 2e−1−e−22e^{-1}-e^{-2} (2) using tails for the max and distribution functions for the min; multiplying densities; wrong integration limits in the convolution
5 6 (a) 12+12cos⁡ω=cos⁡2ω2\frac12+\frac12\cos\omega=\cos^2\frac\omega2 (2); (b) moments via 1jkφ(k)(0)\frac1{j^k}\varphi^{(k)}(0): 12,12\frac12,\frac12, odd moments zero (2); (c) cos⁡4ω2\cos^4\frac\omega2, shift to Bin(4,12)\mathrm{Bin}(4,\frac12), 516\frac5{16} (2) missing 1jk\frac1{j^k}; φaX+b=aφX+b\varphi_{aX+b}=a\varphi_X+b instead of ejωbφX(aω)e^{j\omega b}\varphi_X(a\omega); forgetting the shift by 22
6 4 (a) E(Xˉn)=μE(\bar X_n)=\mu, var(Xˉn)=σ2n\mathrm{var}(\bar X_n)=\frac{\sigma^2}n, Chebyshev and limit (2); (b) worst case p(1−p)≤14p(1-p)\le\frac14, n≥2000n\ge2000 (2) var(Xˉn)=σ2\mathrm{var}(\bar X_n)=\sigma^2; using the unknown pp in the final bound instead of the worst case; Markov applied to a variable that is not nonnegative