Discrete mathematics, probability and numerical methods
แนะนำใหม่
6:30
T.2 · คณิตศาสตร์เชิงประจักษ์ ความน่าจะเป็น และวิธีการคำนวณตัวเลข
หน่วยนี้นับ ใช้ความสัมพันธ์ย้อนกลับ กราฟ และตรรกะ; คำนวณความน่าจะเป็นและคุณสมบัติของการแจกแจง; และใช้การประมาณค่าตัวเลขพร้อมกับข้อผิดพลาด…
บรรยายภาษาอังกฤษ · สลับคำบรรยายภาษาอังกฤษและภาษาจีนได้
ในบทเรียนนี้
| English | ความหมาย |
|---|---|
| probability/ˌprɒbəˈbɪlɪti/ | A numerical measure of how likely an event is, ranging from zero to one. |
| recurrence/rɪˈkʌrəns/ | recurrences |
| complete graph/kəmˈpliːt ɡræf/ | |
| tree/triː/ | A connected graph containing no cycles. |
| complement/ˈkɒmplɪmənt/ | เหตุการณ์ส่วนเสริม |
| Independence/ˌɪndɪˈpendəns/ | |
| binomial model | |
| tangent/ˈtændʒənt/ | A straight line that touches a curve at a point and has the same direction there. |
| convergence/kənˈvɜːdʒəns/ | |
| bisection/baɪˈsekʃn/ | วิธีแบ่งครึ่งช่วง |
| error bound |
คณะกรรมการหรือสามบทบาทที่แตกต่างกัน?
- การเลือก 3 จาก 10 นักเรียนเพื่อเข้าคณะกรรมการ จะให้ $\binom{10}{3}=120$ กลุ่ม การเลือกประธาน เลขานุการ และ treasurer จะให้ $10\cdot9\cdot8=720$ การมอบหมาย: บทบาทแยกแยะผลลัพธ์
- ก่อนคำนวณ ให้ตัดสินใจว่าผลลัพธ์หนึ่งบันทึกอะไรและอนุญาตให้ซ้ำได้หรือไม่ บทเรียนนี้เชื่อมโยงการนับและความน่าจะเป็นกับการทำซ้ำ, การให้เหตุผลเกี่ยวกับกราฟ และการประมาณค่าตัวเลข
นับ outcomes ด้วยกฎที่กำหนดให้
- จาก $n$ objects ที่แตกต่างกัน, การเลือก $r$ โดยไม่ซ้ำกันจะให้ $n(n-1)\cdots(n-r+1)$ ordered lists หรือ $\binom nr$ unordered subsets, สำหรับ $0\le r\le n$. เมื่อ allowed repetition, ordered list มี $n^r$ possibilities
- ตัวอย่างเช่น, รหัสสามตัวอักษรโดยใช้ available letters ห้าตัวจะมี $5^3=125$ outcomes ถ้า letters สามารถซ้ำได้, แต่ $5\cdot4\cdot3=60$ ถ้าไม่ได้ Probability คือ favourable outcomes หารด้วย all outcomes ก็ต่อเมื่อ outcomes เหล่านั้น equally likely เท่านั้น
A three-letter code uses A, B, C, D or E in each position. Repetition is allowed. How many codes are possible?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
There are five choices independently for each of three positions: 5³ = 125. Dividing by 3! would incorrectly merge different ordered codes.
Graphs และ lines ต้องมี assumptions ของตนเอง
- In a simple undirected graph, edges join distinct vertices, with no repeated edges. The complete graph $K_n$ has one edge per unordered vertex pair, hence $\binom n2$ edges. A tree is connected and has no cycles; with $n\ge1$ vertices, it has $n-1$ edges.
- For $n$ distinct lines in the plane, general position means no parallel pair and no three through one point. The $k$th line then meets earlier lines at $k-1$ distinct points, adding $k$ regions. Starting with one region gives $1+n(n+1)/2$ regions.
แบบมีลำดับหรือไม่มีลำดับ?
ตัดสินใจว่าตำแหน่งหรือบทบาทจะสร้างความแตกต่างของผลลัพธ์หรือไม่; ตรวจสอบการซ้ำซ้อนแยกต่างหาก
How many edges does the complete graph $K_7$ have?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Each edge joins a pair of distinct vertices, and K₇ joins every pair: C(7, 2) = 7 · 6 / 2 = 21.
Into how many regions do 5 lines in general position divide the plane?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The n-th line in general position crosses the earlier n − 1 lines and so adds n regions. Starting from 1 region: 1 + (1 + 2 + 3 + 4 + 5) = 1 + 15 = 16.
ใช้ complement สำหรับค่าที่ซ้ำ
- Complement คือ event ที่ given event ไม่ได้เกิดขึ้น ดังนั้น $P(A^c)=1-P(A)$. สำหรับ $r$ independent uniform picks จาก $n$ values, ordered sample space มี $n^r$ equally likely outcomes
- For $r\le n$, the all-distinct outcomes number $n(n-1)\cdots(n-r+1)$. With 3 picks from 10 values, their probability is $720/1000=0.72$, so at least one repeat has probability $0.28$. If $r>n$, a repeat is certain.
Three values are picked independently and uniformly from ten possible values, with replacement. What is the probability of at least one repeated value?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The all-distinct probability is (10·9·8)/10³ = 0.72. Its complement, at least one repeat, has probability 1 − 0.72 = 0.28.
Independent ไม่แปลว่า disjoint
- ความอิสระหมายถึง $P(A\cap B)=P(A)P(B)$. เมื่อ $P(B)>0$, ความน่าจะเป็นแบบมีเงื่อนไขคือ $P(A\mid B)=P(A\cap B)/P(B)$; ความอิสระบอกรู้ว่าการเรียนรู้ $B$ ไม่ทำให้ความน่าจะเป็นของ $A$ เปลี่ยนแปลงไป
- เหตุการณ์ที่ตัดกันเองมีส่วนร่วมเป็นเซตว่าง ดังนั้น $P(A\cap B)=0$. หากความน่าจะเป็นทั้งสองมีค่าบวก ผลคูณจะมีค่าบวกและไม่สามารถมีความอิสระได้ ในการโยนลูกเต๋าที่ยุติธรรมหนึ่งครั้ง “เลขคู่” และ “มากกว่า 4” มีความอิสระ: ส่วนร่วม theirs คือ $\{6\}$, ซึ่งมีความน่าจะเป็น $1/6=(1/2)(1/3)$
Two mutually exclusive events with positive probabilities cannot be independent.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
True. Exclusive means $P(A \cap B) = 0$, but independence needs $P(A \cap B) = P(A)P(B) > 0$.
On one fair six-sided die roll, let A be “even” and B be “greater than 4”. These events are
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
P(A) = 1/2, P(B) = 1/3 and P(A ∩ B) = P({6}) = 1/6. The product test holds, but the intersection is not empty.
ตรวจสอบโมเดลทวินามก่อนใช้สูตร
- $X\sim\operatorname{Binomial}(N,p)$ นับจำนวนความสำเร็จในการทดลองอิสระ $N$ ครั้งที่มีผลลัพธ์สองแบบและความน่าจะเป็นสำเร็จเท่ากัน $p$ ค่าเฉลี่ยคือ $Np$ และความแปรปรวนคือ $Np(1-p)$; สำหรับ $N=10$ และ $p=0.3$ ค่าเหล่านี้คือ 3 และ 2.1
- ในโมเดลนี้ ความน่าจะเป็นที่จะไม่มีการสำเร็จเลยคือ $(1-p)^N$ ดังนั้นความน่าจะเป็นที่จะมีอย่างน้อยหนึ่งครั้งคือ $1-(1-p)^N$ การสุ่มตัวอย่างวัตถุโดยไม่แทนที่จะเปลี่ยนความน่าจะเป็นสำเร็จในครั้งถัดไป จำนวนการทดลองคงที่และอัตราความสำเร็จเริ่มต้นเพียงอย่างเดียวไม่เพียงพอที่จะกำหนดให้ใช้โมเดลทวินาม
A binomial variable has $N = 10$, $p = 0.3$. Its variance is
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
$10 \times 0.3 \times 0.7$.
Four independent trials each succeed with probability 0.5. What is the probability of at least one success?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The complement is four failures, with probability (0.5)⁴ = 1/16. Hence at least one success has probability 15/16 = 0.9375.
A bag contains 4 red and 6 blue counters. Draw two uniformly at random without replacement. A student models the red count as Binomial(2, 0.4). Assess the model and find the probability of two reds.
The two draws are dependent: after a red, the next red probability is $3/9$, not $4/10$. Thus the stated binomial model is not exact. The probability of two reds is $(4/10)(3/9)=2/15$, whereas the binomial model would give $0.4^2=0.16$. Equivalently, there are $\binom42=6$ favourable unordered pairs among $\binom{10}2=45$ equally likely pairs.
การพิสูจน์ความไม่เดียวต้องแสดงตัวอย่างคำตอบ
- A recurrence is a rule that expresses terms of a sequence using earlier terms. For $a_n=2a_{n-1}$, $n\ge1$, the initial value $a_0=3$ gives $3,6,12,\ldots$ and the closed form $a_n=3\cdot2^n$.
- กฎอันดับสองอาจต้องการค่าเริ่มต้นสองค่า สำหรับ $a_n=a_{n-1}+a_{n-2}$, $n\ge2$, การระบุเพียง $a_0$ จะทำให้ $a_1$ เป็นอิสระ State ทั้งช่วงของความสัมพันธ์ซ้ำและข้อมูลเริ่มต้นเพียงพอที่จะกำหนดทุกพจน์
How many integers from 1 to 60 are divisible by 2, 3 or 5?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
30 + 20 + 12 − 10 − 6 − 4 + 2 = 44.
A fair die is rolled until the first 6 appears. What is the expected number of rolls?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The number of rolls is geometric with p = 1/6, so its mean is 1/p = 6.
X is uniform on [0, 6]. Find Var(X).
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
(b − a)²/12 = 36/12 = 3.
ตรวจสอบสูตร ไม่ใช่แค่บางพจน์
- สำหรับ $b_n=2b_{n-1}+1$, $n\ge1$ ที่มี $b_0=0$ ลอง $b_n=2^n-1$ จะได้ค่าเริ่มต้นที่ถูกต้อง และการแทนค่าจะได้ $2(2^{n-1}-1)+1=2^n-1$ ดังนั้นความสัมพันธ์เชิงซ้ำจะกำหนดลำดับเดียวกันโดยหลักการอุปนัย
- การจับคู่พจน์จำนวนจำกัดไม่ได้พิสูจน์สูตรสำหรับทุก $n$ คำตอบที่เสนอต้องสอดคล้องกับค่าเริ่มต้นและความสัมพันธ์เชิงซ้ำตลอดช่วงที่กำหนด การเปลี่ยนค่าเริ่มต้นเพียงค่าเดียวอาจทำให้ทั้งลำดับเปลี่ยนไป
วิธีนิวตันใช้เส้นสัมผัส
- เพื่อประมาณรากของฟังก์ชัน $f$ ที่หาอนุพันธ์ได้ ให้ใช้ $x_{k+1}=x_k-f(x_k)/f'(x_k)$ ทุกครั้งที่ $f'(x_k)\ne0$ ค่าถัดไปคือจุดที่เส้นสัมผัสที่ $x_k$ ตัดกับแกนแนวนอน
- สำหรับ $f(x)=x^2-2$ เริ่มที่ $x_0=1$ จะได้ $x_1=3/2$ และ $x_2=17/12\approx1.4167$ ซึ่งใกล้กับ $\sqrt2\approx1.4142$ แต่ถ้าเริ่มที่ 0 แทน จะทำให้สูตรไม่สามารถคำนวณได้เพราะ $f'(0)=0$

$b_0=0$ และ $b_n=2b_{n-1}+1$ for $n\ge1$. Find $b_5$.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The verified closed form is bₙ = 2ⁿ − 1. Thus b₅ = 32 − 1 = 31. Direct iteration gives 0, 1, 3, 7, 15, 31.
สนับสนุน $a_n=3a_{n-1}-2a_{n-2}$, $n\ge2$, with $a_0=0$ และ $a_1=1$, prove $a_n=2^n-1$. Explain why only specifying $a_0=0$ would not determine this sequence.
The formula gives $a_0=0$ และ $a_1=1$. Substitution yields $3(2^{n-1}-1)-2(2^{n-2}-1)=2^n-1$, so induction proves the formula for all $n\ge0$. If only $a_0=0$ were given, the all-zero sequence would also satisfy the recurrence and that initial value, but it has a different $a_1$. Both initial values matter.
ขั้นตอนนิวตันที่กำหนดไว้แล้วอาจไม่ลู่เข้า
- Nonzero derivatives at the iterates make the updates possible; they do not guarantee convergence. The starting value and the function's behaviour matter. An iteration can move away from a root or enter a cycle.
- สำหรับ $f(x)=x^3-2x+2$ เริ่มที่ 0 จะได้ $f(0)=2$ และ $f'(0)=-2$ ดังนั้นค่าถัดไปคือ 1 ที่ 1 ได้ $f(1)=1$ และ $f'(1)=1$ ดังนั้นค่าถัดไปคือ 0 ลำดับจะวนซ้ำ $0,1,0,1,\ldots$ แม้ว่าจะมีอนุพันธ์ไม่เป็นศูนย์ทั้งสองจุดก็ตาม

Apply one Newton step to $f(x) = x^2 - 3$ from $x_0 = 2$.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
x₁ = x₀ − f(x₀)/f′(x₀) = 2 − (4 − 3)/(2 · 2) = 2 − 1/4 = 1.75, already close to √3 ≈ 1.732.
การ์ดนี้เป็นการ์ดใหม่ จึงแสดงเป็นภาษาอังกฤษจนกว่าคำแปลจะพร้อม
A defined Newton step need not converge
- Nonzero derivatives at the iterates make the updates possible; they do not guarantee convergence 收敛性. The starting value and the function's behaviour matter. An iteration can move away from a root or enter a cycle.
- For $f(x)=x^3-2x+2$, start at 0. Then $f(0)=2$, $f'(0)=-2$, so the next value is 1. At 1, $f(1)=1$, $f'(1)=1$, so the next value is 0. The sequence cycles $0,1,0,1,\ldots$ even though both derivatives are nonzero.
สนับสนุน $f(x)=x^3-2x+2$, Newton iteration starts at 0. It alternates between 0 and 1. What does this show?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The derivatives are −2 at 0 and 1 at 1, so both updates are defined. Neither point is a root, and the two-cycle does not converge.
การแบ่งครึ่งรักษาช่วงที่ยืนยันได้ว่ามีรากอยู่
- การแบ่งครึ่งเป็นวิธีหาค่ารากที่แบ่งช่วงออกครึ่งซ้ำๆ โดยรักษารากไว้ ต้องมี $f$ ต่อเนื่องบน $[a,b]$ และมี $f(a)f(b)<0$ ทฤษฎีบทค่ากลางรับประกันว่ามีอย่างน้อยหนึ่งราก หากปลายช่วงใดเป็นรากอยู่แล้ว ให้ส่งคืนค่านั้นทันที
- ตรวจสอบ $c=(a+b)/2$ ถ้า $f(c)=0$ ให้หยุด; มิฉะนั้นรักษาช่วงครึ่งที่มีสัญญาณตรงข้ามที่ปลายทั้งสอง ขอบเขตของความต่อเนื่องสำคัญ: $1/x$ มีสัญญาณตรงข้ามที่ $-1$ และ 1 แต่ไม่สามารถคำนวณได้ที่ 0 และไม่มีราก
แปลงความกว้างของช่วงให้เป็นขอบเขตความคลาดเคลื่อน
- หากช่วงเริ่มต้นมีความยาว $L$ หลัง $k$ การแบ่งครึ่งที่ยังคงอยู่ ความกว้างจะเป็น $L/2^k$ จุดกึ่งกลางของ ช่วงปัจจุบัน นี้จะอยู่ในระยะ $L/2^{k+1}$ จากรากที่ยังคงอยู่ จุดกึ่งกลางนี้ไม่จำเป็นต้องเป็นจุดที่ทดสอบไว้ล่าสุด
- สำหรับ $x^2-2$ บน $[1,2]$, วงเล็บที่คงอยู่ครั้งแรกคือ $[1,1.5]$ และ $[1.25,1.5]$. หลังการแบ่งครึ่งสองครั้ง จุดกึ่งกลางปัจจุบันคือ $1.375$ โดยมีค่าความคลาดเคลื่อนสูงสุดที่ $0.125$. หลังการแบ่งครึ่งสี่ครั้ง ขอบเขตของค่าความคลาดเคลื่อนจุดกึ่งกลางคือ $1/32=0.03125$.
An initial continuous sign-change bracket has length 1. After four retained bisection halvings, what is the guaranteed absolute error bound for the midpoint of the current bracket?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The current width is 1/2⁴ = 1/16. Its midpoint is at most half that width from a retained root: 1/32 = 0.03125. The question asks about the current midpoint, not the last tested midpoint.
สนับสนุน $f(x)=x^3-x-1$, justify bisection on $[1,2]$, find the first retained half, and find the least number of retained halvings needed to bound the current midpoint error by 0.01. Explain why the same sign argument cannot be used for $1/x$ on $[-1,1]$.
The polynomial is continuous, with $f(1)=-1$ และ $f(2)=5$. At $1.5$, $f(1.5)=0.875>0$, so retain $[1,1.5]$. The original length is 1, and after k retained halvings the current midpoint error is at most $1/2^{k+1}$. Five halvings give $1/64>0.01$; six give $1/128<0.01$, so six suffice and are the least number certified by this bound. The function $1/x$ is not continuous on $[-1,1]$ and has no root; opposite signs alone do not meet the theorem’s hypotheses.
อย่ากลับทฤษฎีบทโดยไม่ตรวจสอบ
- ต้นไม้มี $n-1$ ขอบ แต่จำนวนขอบเพียงอย่างเดียวไม่ทำให้กราฟเป็นต้นไม้ กราฟสามเหลี่ยมบวกกับจุดแยกตัวมี 4 จุดยอดและ 3 ขอบ แต่ยังขาดความเชื่อมโยงและมีวงจร สำหรับกราฟแบบง่ายที่ไม่มีทิศทาง ความเชื่อมโยงร่วมกับ $n-1$ ขอบนั้นบ่งบอกว่าเป็นต้นไม้ได้จริง
- การเปลี่ยนเครื่องหมายผ่านฟังก์ชันต่อเนื่องรับรองราก; รากอาจไม่จำเป็นต้องมีการเปลี่ยนเครื่องหมาย ฟังก์ชัน $x^2$ มีรากอยู่ที่ 0 แต่มีค่าเป็นบวกที่ปลายทั้งสองของ $[-1,1]$. ความล้มเหลวในการทดสอบการเปลี่ยนเครื่องหมายไม่ใช่หลักฐานว่าไม่มีราก
ข้อทดสอบที่ระบุไว้กำหนดอะไร?
แยกแยะใบรับรองรากของการแบ่งครึ่ง (bisection root certificate), ขั้นตอนนิวตันที่กำหนด และเงื่อนไขวิธีที่หายไป
แยกโมเดลและข้อรับประกันออกจากกัน
- ระบุลำดับ การซ้ำ และความน่าเท่ากันก่อนนับความน่าจะเป็น ตรวจสอบความอิสระและความน่าความสำเร็จคงที่ก่อนใช้โมเดลเบอูลลี ตรวจสอบสมการถอยหลังเทียบกับกฎและค่าเริ่มต้น
- การอัปเดตของนิวตันต้องการอนุพันธ์ที่ไม่เป็นศูนย์แต่ยังคงวนลูปได้ วิธีแบ่งครึ่งต้องการวงเล็บการเปลี่ยนเครื่องหมายของฟังก์ชันต่อเนื่อง; ความกว้างที่คงไว้ให้ขอบเขตความคลาดเคลื่อนจุดกึ่งกลางอย่างเข้มงวด แยกเงื่อนไขที่เพียงพอออกจากเงื่อนไขที่จำเป็น
Assess these claims with counterexamples: (i) Every simple undirected graph with n vertices and n − 1 edges is a tree. (ii) If a continuous function has a root in an interval, its endpoint values have opposite signs.
(i) A triangle plus an isolated vertex is a simple graph with 4 vertices and 3 edges. It is disconnected and contains a cycle, so it is not a tree. Connectivity is an additional sufficient condition with that edge count. (ii) The continuous function $f(x)=x^2$ on $[-1,1]$ has root 0 but both endpoint values equal 1. A sign change is sufficient for a continuous function to have a root, but is not necessary.
เกิดปัญหาอะไรขึ้น? เฉพาะทีมเว็บไซต์เท่านั้นที่เห็นข้อมูลนี้