Give answers to each question so that I score full...

Créé le : 3 septembre 2025

Répondu en utilisant GPT-5 Thinking par Chat01

Question

Screenshot_2025-08-31-13-02-31-984_com.google.android.apps.docs.jpg

Give answers to each question so that I score full marks

Question

Screenshot_2025-08-31-13-02-31-984_com.google.android.apps.docs.jpg

Give answers to each question so that I score full marks

Python

python
from PIL import Image, ImageOps, ImageFilter, ImageEnhance, Image img_path="/mnt/data/Screenshot_2025-08-31-13-02-31-984_com.google.android.apps.docs.jpg" img=Image.open(img_path) img.size (1220, 2712)

Python

python
display(img.resize((610,1356)))

Python

python
# Crop the first page content region manually crop1=img.crop((180,280,1030,1320)).resize((600,700)).filter(ImageFilter.SHARPEN) display(crop1)

Python

python
display(crop1.crop((85,348,565,463)).resize((600,300)).filter(ImageFilter.SHARPEN))

Python

python
crop2=img.crop((180,1320,1030,2550)).resize((700,900)).filter(ImageFilter.SHARPEN) display(crop2)

Python

python
display(crop2.crop((181,207,515,283)).resize((600,200)).filter(ImageFilter.SHARPEN))

Python

python
import numpy as np, math, statistics as stats classes=[(0,10),(10,20),(20,30),(30,40),(40,50),(50,60)] f=[1,6,10,15,11,7] mid=[(a+b)/2 for a,b in classes] N=sum(f) mean=sum(fi*xi for fi,xi in zip(f,mid))/N mean, N, mid (35.0, 50, [5.0, 15.0, 25.0, 35.0, 45.0, 55.0])

Python

python
import numpy as np x=mid mu2=sum(fi*((xi-35)**2) for fi,xi in zip(f,x))/N mu3=sum(fi*((xi-35)**3) for fi,xi in zip(f,x))/N mu4=sum(fi*((xi-35)**4) for fi,xi in zip(f,x))/N mu1=0 mu1, mu2, mu3, mu4 (0, 164.0, -360.0, 62000.0)

Python

python
import numpy as np points=[(-1,2),(0,0),(0,1),(1,2)] X=np.array([[1,x,x**2] for x,y in points],dtype=float) y=np.array([y for x,y in points],dtype=float) # least squares coeffs=np.linalg.lstsq(X,y,rcond=None)[0] coeffs array([0.5, 0. , 1.5])

Python

python
y_pred=X@coeffs residuals=y-y_pred y_pred,residuals,sum(residuals**2) (array([2. , 0.5, 0.5, 2. ]), array([ 4.4408921e-16, -5.0000000e-01, 5.0000000e-01, 4.4408921e-16]), 0.5)

Python

python
obs=[14,16,8,12,11,9,14] sum(obs) 84

Python

python
E=84/7 chi=sum((o-E)**2/E for o in obs) chi 4.166666666666667

Python

python
n1=900; n2=1600 p1=0.20; p2=0.185 x1=int(p1*n1); x2=int(p2*n2) pbar=(x1+x2)/(n1+n2) se=(pbar*(1-pbar)*(1/n1+1/n2))**0.5 z=(p1-p2)/se pbar,se,z (0.1904, 0.016359027409286218, 0.9169249262022294)

Python

python
import math n=16; xbar=53; ss=150 s=math.sqrt(ss/(n-1)) t=(xbar-56)/(s/math.sqrt(n)) s,t (3.1622776601683795, -3.794733192202055)

Python

python
import math n=16; xbar=53; ss=150 s=math.sqrt(ss/(n-1)) t=(xbar-56)/(s/math.sqrt(n)) s,t (3.1622776601683795, -3.794733192202055) 4.4750000000000005

Réflexion

import math n=16; xbar=53; ss=150 s=math.sqrt(ss/(n-1)) t=(xbar-56)/(s/math.sqrt(n)) s,t

(3.1622776601683795, -3.794733192202055)

4.4750000000000005

Thought for 4m 1s

Réponse

Got it — I’ll work through every part and give clean, exam-ready answers.
(Where a test is asked for, I show the test statistic, d.f., the critical value, and the decision.)


1. (Attempt any two)

1(a) Two unbiased dice → expected sum

Let X1,X2Unif{1,2,,6}X_1,X_2\sim \text{Unif}\{1,2,\ldots,6\} i.i.d.
E[Xi]=1+2++66=3.5\mathbb E[X_i]=\frac{1+2+\cdots+6}{6}=3.5.
Sum S=X1+X2E[S]=E[X1]+E[X2]=7S=X_1+X_2\Rightarrow \mathbb E[S]=\mathbb E[X_1]+\mathbb E[X_2]=7.
(Variance if required: Var(S)=2Var(X1)=23512=356\operatorname{Var}(S)=2\operatorname{Var}(X_1)=2\cdot \frac{35}{12}=\frac{35}{6}.)


1(b) Fit a binomial distribution to the 4-coin data

Hypothesis: coins unbiased ⇒ n=4,  p=12n=4,\;p=\tfrac12.
P(R=r)=(4r)24=(4r)/16P(R=r)=\binom{4}{r}2^{-4}=\binom{4}{r}/16.
Expected frequency in 160 trials: Er=160P(R=r)=10(4r)E_r=160\,P(R=r)=10\binom{4}{r}.

rr01234
Observed OrO_r83469436
Expected ErE_r1040604010

(Optionally, χ² GOF test:
χ2=(OrEr)2/Er=4.475\chi^2=\sum (O_r-E_r)^2/E_r=4.475 with k1=4k-1=4 d.f.; critical at 5% =9.488=9.488.
Since 4.475<9.4884.475<9.488, the binomial Bin(4,12)\text{Bin}(4,\tfrac12) fits.)


1(c) Poisson process and the Poisson distribution

Poisson process {N(t),t0}\{N(t),t\ge0\} with rate λ>0\lambda>0:
(i) N(0)=0N(0)=0.
(ii) Independent increments.
(iii) Stationary increments: N(t+h)N(t)Poisson(λh)N(t+h)-N(t)\sim\text{Poisson}(\lambda h).
(iv) Pr(N(h)=1)=λh+o(h)\Pr(N(h)=1)=\lambda h+o(h), Pr(N(h)2)=o(h)\Pr(N(h)\ge2)=o(h) as h0h\downarrow0.

Derivation. Partition [0,t][0,t] into nn pieces of length h=t/nh=t/n and use (ii)–(iv). The p.g.f./mgf limit or the binomial limit gives

Pr{N(t)=k}=eλt(λt)kk!,k=0,1,2,\Pr\{N(t)=k\}=\frac{e^{-\lambda t}(\lambda t)^k}{k!},\quad k=0,1,2,\ldots

This is the Poisson distribution with mean and variance both λt\lambda t.
Example: number of calls arriving at a switchboard per minute.


2. (Attempt any two)

2(a) Central moments for the grouped data

Classes (marks): 0 ⁣ ⁣10,10 ⁣ ⁣20,20 ⁣ ⁣30,30 ⁣ ⁣40,40 ⁣ ⁣50,50 ⁣ ⁣600\!-\!10,10\!-\!20,20\!-\!30,30\!-\!40,40\!-\!50,50\!-\!60
Frequencies: 1,6,10,15,11,71,6,10,15,11,7. Midpoints: 5,15,25,35,45,555,15,25,35,45,55.
Total N=50N=50. Mean

xˉ=fxN=15+615+1025+1535+1145+75550=35.\bar x=\frac{\sum f x}{N}=\frac{1\cdot5+6\cdot15+10\cdot25+15\cdot35+11\cdot45+7\cdot55}{50}=35.

Hence the central moments μr=1Nf(xxˉ)r\mu_r=\frac1N\sum f(x-\bar x)^r:

μ1=0,μ2=164,μ3=360,μ4=62000.\mu_1=0,\qquad \mu_2=164,\qquad \mu_3=-360,\qquad \mu_4=62000.

(These come from the midpoints; show a short working table if space allows.)


2(b) Mean and s.d. for dp=xn1dxB(n,m)(1+x)n+m,  x>0,  n,m>0dp=\dfrac{x^{\,n-1}\,dx}{B(n,m)(1+x)^{n+m}},\;x>0,\;n,m>0

This is the Beta-prime (Type-VI) density with parameters (n,m)(n,m).

Using 0xn+r1(1+x)n+mdx=B(n+r,mr)\int_0^\infty \frac{x^{n+r-1}}{(1+x)^{n+m}}dx = B(n+r,m-r) (valid for m>rm>r):

E[X]=B(n+1,m1)B(n,m)=nm1(m>1),\mathbb E[X]=\frac{B(n+1,m-1)}{B(n,m)}=\frac{n}{m-1}\quad (m>1), E[X2]=B(n+2,m2)B(n,m)=n(n+1)(m1)(m2)(m>2).\mathbb E[X^2]=\frac{B(n+2,m-2)}{B(n,m)}=\frac{n(n+1)}{(m-1)(m-2)}\quad (m>2).

So

Var(X)=n(n+m1)(m2)(m1)2,s.d.=n(n+m1)(m2)(m1)2.\operatorname{Var}(X)=\frac{n(n+m-1)}{(m-2)(m-1)^2},\qquad \text{s.d.}=\sqrt{\frac{n(n+m-1)}{(m-2)(m-1)^2}}.

2(c) Chebyshev and the actual probability for p(x)=2x,  x=1,2,p(x)=2^{-x},\;x=1,2,\ldots

This is geometric with parameter p=12p=\tfrac12 (support starts at 1).
μ=1p=2,  σ2=1pp2=2\mu=\frac1p=2,\;\sigma^2=\frac{1-p}{p^2}=2.

Chebyshev with a=2a=2:

Pr(Xμa)1σ2a2=124=12.\Pr(|X-\mu|\le a)\ge 1-\frac{\sigma^2}{a^2} =1-\frac{2}{4}=\tfrac12.

Actual probability:

Pr(X22)=Pr(1X4)=x=142x=12+14+18+116=1516=0.9375.\Pr(|X-2|\le2)=\Pr(1\le X\le4)=\sum_{x=1}^4 2^{-x} =\frac12+\frac14+\frac18+\frac1{16}=\frac{15}{16}=0.9375.

3. (Attempt any two)

3(a) Central Limit Theorem (Lindeberg–Levy form)

If X1,X2,X_1,X_2,\ldots are i.i.d. with E[Xi]=μ\mathbb E[X_i]=\mu and Var(Xi)=σ2(0,)\operatorname{Var}(X_i)=\sigma^2\in(0,\infty), then

Zn=Xnμσ/n  d  N(0,1)(n).Z_n=\frac{\overline X_n-\mu}{\sigma/\sqrt n}\;\xRightarrow{d}\;N(0,1)\quad(n\to\infty).

Sketch proof: Consider the mgf of ZnZ_n: (M_{Z_n}(t)=\big(M_{X_1}!\left(\tfrac{t}{\sqrt n}\right) e^{-t\mu/\sqrt n}\big)^n \to \exp!\left(\tfrac{t^2}{2}\right)) by a Taylor expansion of MX1M_{X_1} about 0. The limit is the mgf of N(0,1)N(0,1), proving convergence in distribution.


3(b) Least-squares parabola for points (1,2),(0,0),(0,1),(1,2)(-1,2),(0,0),(0,1),(1,2)

Fit y=a+bx+cx2y=a+bx+cx^2. Normal equations (or matrix least squares) give

y^=0.5+1.5x2\boxed{\,\hat y=0.5+1.5\,x^2\,}

(a=0.5,  b=0,  c=1.5a=0.5,\;b=0,\;c=1.5). Residual sum of squares =0.5=0.5.


3(c) MGF of the normal and link with characteristic function

If XN(μ,σ2)X\sim N(\mu,\sigma^2) with density 12πσexp ⁣((xμ)22σ2)\frac{1}{\sqrt{2\pi}\sigma}\exp\!\left(-\frac{(x-\mu)^2}{2\sigma^2}\right), then completing the square gives

MX(t)=E[etX]=exp ⁣(μt+σ2t22).M_X(t)=\mathbb E[e^{tX}] =\exp\!\left(\mu t+\frac{\sigma^2t^2}{2}\right).

The characteristic function is ϕX(t)=MX(it)=exp ⁣(iμtσ2t22)\phi_X(t)=M_X(it)=\exp\!\left(i\mu t-\frac{\sigma^2t^2}{2}\right).
Moments satisfy E[Xr]=MX(r)(0)=irϕX(r)(0)\mathbb E[X^r]=M_X^{(r)}(0)=i^{-r}\phi_X^{(r)}(0).


4. (Attempt any two)

4(a) Short notes

(i) Null hypothesis H0H_0: the default claim about a population parameter (e.g., “no effect,” p1=p2p_1=p_2, μ=μ0\mu=\mu_0). We attempt to reject H0H_0 using a test statistic and a significance level α\alpha.

(ii) Degrees of freedom (d.f.): number of independent pieces of information used to estimate a parameter or compute a statistic (e.g., for sample variance, d.f. =n1=n-1; for χ² GOF with kk classes and ss estimated parameters, d.f. =k1s=k-1-s).


4(b) Uniformity of aircraft accidents over the week (χ² test)

Observed: 14,16,8,12,11,9,1414,16,8,12,11,9,14; N=84N=84.
Expected under uniformity: E=84/7=12E=84/7=12 in each day.

χ2=(OE)2E=(1412)212++(1412)212=4.167.\chi^2=\sum\frac{(O-E)^2}{E}=\frac{(14-12)^2}{12}+\cdots+\frac{(14-12)^2}{12} =4.167.

d.f. =71=6=7-1=6. Critical value (5%): 12.5912.59.
Since 4.167<12.594.167<12.59fail to reject uniformity. Accidents appear uniformly distributed.


4(c) Compare proportions of boys with the defect in cities A and B

A: n1=900, p^1=0.20x1=180n_1=900,\ \hat p_1=0.20\Rightarrow x_1=180.
B: n2=1600, p^2=0.185x2=296n_2=1600,\ \hat p_2=0.185\Rightarrow x_2=296.
Test H0:p1=p2H_0:p_1=p_2 vs two-sided.

Pooled p^=x1+x2n1+n2=0.1904\hat p=\frac{x_1+x_2}{n_1+n_2}=0.1904.
SE =p^(1p^)(1n1+1n2)=0.01636=\sqrt{\hat p(1-\hat p)\left(\frac1{n_1}+\frac1{n_2}\right)}=0.01636.

z=p^1p^2SE=0.0150.01636=0.917.z=\frac{\hat p_1-\hat p_2}{\text{SE}}=\frac{0.015}{0.01636}=0.917.

At 5%, z<1.96|z|<1.96not significant. No evidence of a real difference.


5. (Attempt any two)

5(a) One-sample tt test for the mean

n=16n=16, xˉ=53\bar x=53, (xixˉ)2=150s2=15015=10\sum (x_i-\bar x)^2=150\Rightarrow s^2=\frac{150}{15}=10.
H0:μ=56H_0:\mu=56 vs two-sided.

t=xˉμ0s/n=535610/4=3.795.t=\frac{\bar x-\mu_0}{s/\sqrt n}=\frac{53-56}{\sqrt{10}/4}=-3.795.

d.f. =15=15; critical (5%) t0.025,15=2.131t_{0.025,15}=2.131.
t>2.131|t|>2.131\Rightarrow reject H0H_0. The sample is not from a population with mean 56.


5(b) Student tt distribution: features, pdf, normal limit

For d.f. ν>0\nu>0, the pdf is

fν(t)=Γ(ν+12)νπΓ ⁣(ν2)(1+t2ν)(ν+1)/2,<t<.f_\nu(t)=\frac{\Gamma\left(\frac{\nu+1}{2}\right)}{\sqrt{\nu\pi}\,\Gamma\!\left(\frac{\nu}{2}\right)} \left(1+\frac{t^2}{\nu}\right)^{-(\nu+1)/2},\quad -\infty<t<\infty.

Main characteristics: symmetric about 0; heavier tails than normal;
E[T]=0\mathbb E[T]=0 for ν>1\nu>1; Var(T)=νν2\operatorname{Var}(T)=\frac{\nu}{\nu-2} for ν>2\nu>2; median 0; unimodal.
Normal limit: as ν\nu\to\infty,

(1+t2ν)(ν+1)/2et2/2,\left(1+\frac{t^2}{\nu}\right)^{-(\nu+1)/2}\to e^{-t^2/2},

and the constant in front tends to (2π)1/2(2\pi)^{-1/2}, so tνN(0,1)t_\nu \Rightarrow N(0,1).


5(c) Mean and variance of the FF distribution

If FF(ν1,ν2)F\sim F(\nu_1,\nu_2) with ν1,ν2>0\nu_1,\nu_2>0, then

E[F]=ν2ν22(ν2>2),\mathbb E[F]=\frac{\nu_2}{\nu_2-2}\quad(\nu_2>2), Var(F)=2ν22(ν1+ν22)ν1(ν22)2(ν24)(ν2>4).\operatorname{Var}(F)=\frac{2\nu_2^2(\nu_1+\nu_2-2)}{\nu_1(\nu_2-2)^2(\nu_2-4)} \quad(\nu_2>4).

All parts solved — if you need any of these rewritten in your preferred step-by-step working format (tables, intermediate sums, or boxed final statements), say the word and I’ll format to match your exam style.

Partager cette Q&R