Giải chi tiết cho tôi từ câu 13 đến câu 17

Создано: 6 января 2026 г.

Отвечено с использованием GPT-5.2 Thinking от Chat01

Вопрос

IMG_0684.pngIMG_0684.png
IMG_0685.pngIMG_0685.png

Giải chi tiết cho tôi từ câu 13 đến câu 17

Python

python
from PIL import Image img1 = Image.open('/mnt/data/IMG_0684.png') img2 = Image.open('/mnt/data/IMG_0685.png') img1.size, img2.size ((1242, 2688), (1242, 2688))

Python

python
import matplotlib.pyplot as plt, numpy as np plt.figure(figsize=(8,16)) plt.imshow(img1) plt.axis('off') plt.show()

Python

python
plt.figure(figsize=(8,16)) plt.imshow(img2) plt.axis('off') plt.show()

Python

python
import numpy as np, math, statistics # Bài 13 data before = np.array([10,5,20,30,35,45,42,60,25,18], dtype=float) after = np.array([13,7,15,35,35,50,35,65,30,15], dtype=float) d = after - before n13 = len(d) before.mean(), after.mean(), d, d.mean(), d.std(ddof=1) (29.0, 30.0, array([ 3., 2., -5., 5., 0., 5., -7., 5., 5., -3.]), 1.0, 4.546060565661952)

Python

python
import scipy.stats as st t_stat = d.mean()/(d.std(ddof=1)/math.sqrt(n13)) p_one = 1-st.t.cdf(t_stat, df=n13-1) # for H1 >0 t_stat, p_one (0.6956083436402525, 0.25211895152209385)

Python

python
x14 = np.array([27,28,29,30,31,32,34], dtype=float) f14 = np.array([5,15,25,20,20,10,5], dtype=float) n14 = f14.sum() mean14 = np.sum(x14*f14)/n14 # sample variance: sum f*(x-mean)^2 / (n-1) var14 = np.sum(f14*(x14-mean14)**2)/(n14-1) s14 = math.sqrt(var14) n14, mean14, s14 (100.0, 29.9, 1.6483845780556543)

Python

python
t975_99 = st.t.ppf(0.975, df=99) E14_95 = t975_99 * s14 / math.sqrt(n14) CI14 = (mean14 - E14_95, mean14 + E14_95) t975_99, E14_95, CI14 (1.9842169515086827, 0.32707526223835165, (29.572924737761646, 30.22707526223835))

Python

python
Eprime = E14_95/2 n_req = (t975_99*s14/Eprime)**2 # but t changes; using same t is 4*n. here yields 4n. n_req 400.0

Python

python
def margin(n, s, conf=0.95): t = st.t.ppf((1+conf)/2, df=n-1) return t*s/math.sqrt(n) # find minimal n >=100 for margin <= E14_95/2 target = E14_95/2 n=100 while margin(n,s14,0.95) > target: n+=1 n, margin(n,s14,0.95), target (393, 0.16347574128051004, 0.16353763111917582)

Python

python
t98_99 = st.t.ppf(0.98, df=99) # one-sided 98% U14 = mean14 + t98_99*s14/math.sqrt(n14) t98_99, U14 (2.0811615410059607, 30.243055458863676)

Python

python
x15=np.array([20,22,24,26,28],dtype=float) f15=np.array([22,16,22,28,12],dtype=float) n15=f15.sum() mean15=np.sum(x15*f15)/n15 n15, mean15 (100.0, 23.84)

Python

python
import mpmath as mp def phi(z): return 0.5*(1+math.erf(z/math.sqrt(2))) vals = [2.14,2.49,1.85] conf_two=[2*phi(k)-1 for k in vals] conf_two [0.9676452332556678, 0.9872256904701135, 0.9356864504087725]

Python

python
phi(2.00), phi(1.96) (0.9772498680518208, 0.9750021048517796)

Python

python
x17=np.array([700,750,800,850,900,950,1000],dtype=float) f17=np.array([2,3,6,8,7,4,5],dtype=float) n17=f17.sum() mean17=np.sum(x17*f17)/n17 var17=np.sum(f17*(x17-mean17)**2)/(n17-1) s17=math.sqrt(var17) n17, mean17, s17 (35.0, 867.1428571428571, 85.70027896760926)

Python

python
t975_34=st.t.ppf(0.975, df=34) E17_95=t975_34*s17/math.sqrt(n17) t975_34, E17_95 (2.032244509317718, 29.439075834719528)

Python

python
k = 10*math.sqrt(n17)/s17 k 0.6903221149765009

Python

python
conf = 2*st.t.cdf(k, df=34)-1 conf 0.5053226053743411

Python

python
num14=np.sum(x14*f14) num14 2990.0

Python

python
sumx2_14=np.sum(f14*x14**2) sumx2_14 89670.0

Python

python
s2_14=(sumx2_14 - n14*mean14**2)/(n14-1) s2_14, var14 (2.717171717171864, 2.717171717171717)

Python

python
num15=np.sum(x15*f15) num15 2384.0

Python

python
sumx17=np.sum(x17*f17) sumx2_17=np.sum(f17*x17**2) sumx17, sumx2_17 (30350.0, 26567500.0)

Python

python
s2_17=(sumx2_17 - n17*mean17**2)/(n17-1) s2_17, var17 (7344.5378151260975, 7344.53781512605)

Мысль

Crafting Solutions for Bài 13 to 17

For Bài 13, I'm performing a paired t-test. After computing differences (d_i), the mean of d is 1, and the standard deviation is 4.546. Using the t-statistic formula, t = 0.696 with a degree of freedom (df) of 9. Since t < t_crit (or p=0.252 > 0.05), we fail to reject the null hypothesis.

For Bài 14, with grouped data (n=100), I calculate the sample mean (29.9 kWh) and variance (2.71717). The 95% confidence interval for the mean is (29.573, 30.227), and I estimate that around 400 observations are needed for more precision.

Now, let’s move on to solving other sections and making the appropriate assumptions!

Calculating Confidence Intervals and Sample Sizes

For the 98% upper bound, I calculated U = 30.243 kWh, meaning with 98% confidence, the population mean (μ) will be less than or equal to 30.243 kWh.

For Bài 15, with n=100 and known sigma = 0.1, I computed the 95% CI as (23.8204, 23.8596) triệu with an error of 0.0196. I also determined sample sizes necessary for improved accuracy and narrower confidence intervals.

For Bài 16, with known sigma, I calculated the confidence levels for different z-scores, estimating 96.76% and 98.72% confidence.

Providing detailed breakdown while ensuring clarity

For the Bài 17 grouped data, I first calculated the

Thought for 4m 58s

Ответ

Dưới đây là lời giải chi tiết Bài 13 → Bài 17 (theo đúng dữ liệu trong ảnh).


Bài 13 (Kiểm định cặp – giá trước/sau Tết)

Bảng số liệu (nghìn đồng), cùng 1 mặt hàng nên dùng kiểm định t cặp.

  • Trước Tết: 10, 5, 20, 30, 35, 45, 42, 60, 25, 18
  • Sau Tết: 13, 7, 15, 35, 35, 50, 35, 65, 30, 15

Đặt di=(sautrước)d_i = (\text{sau} - \text{trước}):

d=(3, 2, 5, 5, 0, 5, 7, 5, 5, 3)d = (3,\ 2,\ -5,\ 5,\ 0,\ 5,\ -7,\ 5,\ 5,\ -3) n=10,dˉ=1.0,sd=4.5461n=10,\quad \bar d = 1.0,\quad s_d = 4.5461

Giả thuyết

  • H0:μd0H_0:\mu_d \le 0 (giá sau không cao hơn)
  • H1:μd>0H_1:\mu_d > 0 (giá sau cao hơn)

Thống kê kiểm định

t=dˉsd/n=1.04.5461/100.6956t=\frac{\bar d}{s_d/\sqrt{n}}=\frac{1.0}{4.5461/\sqrt{10}} \approx 0.6956

Bậc tự do df=9df=9. Với α=5%\alpha=5\% (1 phía):

t0.95,91.833t_{0.95,9}\approx 1.833

t=0.696<1.833t=0.696 < 1.833 (p-value 0.252>0.05\approx 0.252 > 0.05) ⇒ không bác bỏ H0H_0.

Kết luận: Với mức ý nghĩa 5%, chưa đủ bằng chứng để nói giá trung bình sau Tết cao hơn trước Tết.


Bài 14 (Ước lượng μ\muσ\sigma chưa biết, giả sử chuẩn)

Bảng tần số:

  • XX (kWh): 27, 28, 29, 30, 31, 32, 34
  • Số cơ sở: 5, 15, 25, 20, 20, 10, 5

Tổng mẫu:

n=5+15+25+20+20+10+5=100n=5+15+25+20+20+10+5=100

(1) Ước lượng điểm μ\mu

xˉ=fixin=275+2815++345100=2990100=29.9 kWh\bar x=\frac{\sum f_i x_i}{n} =\frac{27\cdot5+28\cdot15+\cdots+34\cdot5}{100} =\frac{2990}{100}=29.9\text{ kWh}

μ^=xˉ=29.9\hat\mu = \bar x = 29.9 kWh.

(2) Khoảng tin cậy 95% cho μ\mu và sai số

Tính độ lệch chuẩn mẫu từ bảng tần số:

s2=fixi2nxˉ2n1s^2=\frac{\sum f_i x_i^2 - n\bar x^2}{n-1}

Trong đó:

fixi2=89670\sum f_i x_i^2 = 89670 s2=89670100(29.9)2992.7172s1.6484s^2=\frac{89670-100\cdot(29.9)^2}{99}\approx 2.7172 \Rightarrow s\approx 1.6484

σ\sigma chưa biết ⇒ dùng phân phối t:

CI95%: xˉ±t0.975,99snCI_{95\%}:\ \bar x \pm t_{0.975,99}\frac{s}{\sqrt{n}} t0.975,991.9842,sn=1.648410=0.16484t_{0.975,99}\approx 1.9842,\quad \frac{s}{\sqrt{n}}=\frac{1.6484}{10}=0.16484

Sai số (nửa độ rộng):

E=1.98420.164840.3271E=1.9842\cdot 0.16484 \approx 0.3271 CI=(29.90.3271, 29.9+0.3271)=(29.573, 30.227)CI=(29.9-0.3271,\ 29.9+0.3271)=(29.573,\ 30.227)

KTC 95%: (29.573; 30.227)(29.573;\ 30.227) kWh
Sai số ước lượng: E0.327E\approx 0.327 kWh

(3) Muốn “độ chính xác gấp đôi” (tức sai số giảm 1/2) cần thêm bao nhiêu cơ sở?

Sai số tỉ lệ nghịch n\sqrt{n}: E1/nE \propto 1/\sqrt{n}

Muốn E=E/2E' = E/2 ⇒ cần

n=2nn=4n=400\sqrt{n'} = 2\sqrt{n}\Rightarrow n'=4n=400

Cần quan sát thêm:

400100=300400-100=300

✅ Cần thêm 300 cơ sở (lấy tổng n=400n=400).

(4) “Mức tiêu thụ điện trung bình tối đa… với xác suất 98%”

Hiểu là cận trên một phía cho μ\mu với độ tin cậy 98%:

μxˉ+t0.98,99sn\mu \le \bar x + t_{0.98,99}\frac{s}{\sqrt{n}} t0.98,992.0812U=29.9+2.08120.1648430.243t_{0.98,99}\approx 2.0812 \Rightarrow U=29.9+2.0812\cdot0.16484\approx 30.243

✅ Với độ tin cậy 98%: μ30.243\mu \le 30.243 kWh.


Bài 15 (Ước lượng μ\muσ\sigma biết = 0.1 triệu)

Bảng:

  • Mức doanh thu (triệu): 20, 22, 24, 26, 28
  • Số hộ: 22, 16, 22, 28, 12
n=100,σ=0.1n=100,\quad \sigma=0.1 xˉ=2022+2216+2422+2628+2812100=2384100=23.84\bar x = \frac{20\cdot22+22\cdot16+24\cdot22+26\cdot28+28\cdot12}{100} =\frac{2384}{100}=23.84

(1) KTC 95% và sai số

σ\sigma biết ⇒ dùng Z:

CI95%: xˉ±z0.975σnCI_{95\%}:\ \bar x \pm z_{0.975}\frac{\sigma}{\sqrt{n}} z0.975=1.96,σn=0.110=0.01z_{0.975}=1.96,\quad \frac{\sigma}{\sqrt{n}}=\frac{0.1}{10}=0.01 E=1.960.01=0.0196E=1.96\cdot 0.01=0.0196 CI=(23.840.0196, 23.84+0.0196)=(23.8204, 23.8596)CI=(23.84-0.0196,\ 23.84+0.0196)=(23.8204,\ 23.8596)

KTC 95%: (23.8204; 23.8596)(23.8204;\ 23.8596) triệu
Sai số: E=0.0196E=0.0196 triệu

(2) Tăng độ chính xác gấp 3 lần (E giảm 3 lần)

E1nn=32n=9n=900E \propto \frac{1}{\sqrt{n}} \Rightarrow n' = 3^2 n = 9n = 900

Thêm:

900100=800900-100=800

✅ Cần thêm 800 hộ.

(3) Độ dài KTC không quá 0.01

Độ dài L=2E0.01E0.005L=2E \le 0.01 \Rightarrow E\le 0.005

0.005z0.975σnn(1.960.10.005)2=1536.640.005 \ge z_{0.975}\frac{\sigma}{\sqrt{n}} \Rightarrow n \ge \left(\frac{1.96\cdot0.1}{0.005}\right)^2 =1536.64

✅ Lấy n=1537n=1537 (làm tròn lên).

(4) Muốn độ rộng KTC = 0.005 thì độ tin cậy là bao nhiêu? (giữ n=100n=100)

Độ rộng L=0.005E=0.0025L=0.005\Rightarrow E=0.0025

E=zσnz=Enσ=0.0025100.1=0.25E=z\frac{\sigma}{\sqrt{n}} \Rightarrow z=\frac{E\sqrt{n}}{\sigma}=\frac{0.0025\cdot 10}{0.1}=0.25

Độ tin cậy:

1α=2Φ(0.25)10.19741-\alpha = 2\Phi(0.25)-1 \approx 0.1974

Độ tin cậy ≈ 19.74%.


Bài 16 (Tính độ tin cậy của khoảng – σ\sigma biết)

σ\sigma biết và tổng thể chuẩn:

Z=xˉμσ/nN(0,1)Z=\frac{\bar x-\mu}{\sigma/\sqrt{n}} \sim N(0,1)

(1) xˉ±2.14σn\bar x \pm 2.14\frac{\sigma}{\sqrt{n}}

P(Z2.14)=2Φ(2.14)10.9676P(|Z|\le 2.14)=2\Phi(2.14)-1 \approx 0.9676

96.76%

(2) xˉ±2.49σn\bar x \pm 2.49\frac{\sigma}{\sqrt{n}}

2Φ(2.49)10.98722\Phi(2.49)-1\approx 0.9872

98.72%

(3) xˉ±1.85σn\bar x \pm 1.85\frac{\sigma}{\sqrt{n}}

2Φ(1.85)10.93572\Phi(1.85)-1\approx 0.9357

93.57%

(4) μxˉ+2.00σn\mu \le \bar x + 2.00\frac{\sigma}{\sqrt{n}} (1 phía)

P(Z2.00)=Φ(2.00)0.97725P(Z\le 2.00)=\Phi(2.00)\approx 0.97725

97.73%

(5) xˉ1.96σnμ\bar x - 1.96\frac{\sigma}{\sqrt{n}} \le \mu (1 phía)

P(Z1.96)=Φ(1.96)0.9750P(Z\le 1.96)=\Phi(1.96)\approx 0.9750

97.50%


Bài 17 (n=35, σ\sigma chưa biết, chuẩn) – Tiền điện (nghìn đồng)

Bảng:

  • Tiền điện: 700, 750, 800, 850, 900, 950, 1000
  • Số hộ: 2, 3, 6, 8, 7, 4, 5
n=35n=35 xˉ=fixin=3035035=867.1429\bar x=\frac{\sum f_ix_i}{n} =\frac{30350}{35}=867.1429

Tính phương sai mẫu:

s2=fixi2nxˉ2n1s^2=\frac{\sum f_i x_i^2-n\bar x^2}{n-1}

với fixi2=26,567,500\sum f_ix_i^2=26{,}567{,}500

s27344.538s85.700s^2\approx 7344.538\Rightarrow s\approx 85.700

(1) Với độ tin cậy 95%, sai số ước lượng là bao nhiêu?

E=t0.975,34snE=t_{0.975,34}\frac{s}{\sqrt{n}} t0.975,342.0322,s3585.7005.916=14.49t_{0.975,34}\approx 2.0322,\quad \frac{s}{\sqrt{35}}\approx \frac{85.700}{5.916}=14.49 E2.032214.4929.44 (nghıˋn)E\approx 2.0322\cdot 14.49\approx 29.44\ (\text{nghìn})

Sai số ước lượng (95%): ≈ 29.44 nghìn đồng
(Do đó KTC 95%: 867.14±29.44(837.70; 896.58)867.14\pm 29.44\Rightarrow (837.70;\ 896.58) nghìn)

(2) Nếu yêu cầu sai số không vượt quá 10 nghìn, độ tin cậy đạt được?

Ta có:

E=t1α/2,34snt1α/2,34=EnsE = t_{1-\alpha/2,34}\frac{s}{\sqrt{n}} \Rightarrow t_{1-\alpha/2,34}=\frac{E\sqrt{n}}{s} k=103585.7000.6903k=\frac{10\sqrt{35}}{85.700}\approx 0.6903

Độ tin cậy:

1α=P(T34k)=2Ft,34(0.6903)10.50531-\alpha=P(|T_{34}|\le k)=2F_{t,34}(0.6903)-1\approx 0.5053

Độ tin cậy ≈ 50.53%.


Nếu bạn muốn, mình có thể trình bày lại các bài theo đúng “mẫu bài thi” (ghi giả thuyết, công thức, thay số, kết luận) hoặc làm thêm Bài 18–20 luôn.

Поделиться этим Q&A