ขั้นตอนวิธีของยูคลิด (Euclidean Algorithm) เป็นเครื่องมือและกระบวนการทางคณิตศาสตร์ที่มีประสิทธิภาพสูง ใช้สำหรับหา ตัวหารร่วมมาก (ห.ร.ม.) หรือ Greatest Common Divisor (GCD) ของจำนวนเต็มสองจำนวนที่มีค่ามากๆ โดยไม่ต้องแยกตัวประกอบ แต่ใช้วิธีการหารเอาเศษซ้ำๆ กันจนกว่าจะหารลงตัว
The Euclidean Algorithm is a highly efficient mathematical process used to find the Greatest Common Divisor (GCD) of two large integers without needing to prime factorize them. It utilizes repeated division with remainders until an exact division is reached.
กระบวนการและรูปแบบสมการ / Process & Format
กำหนดให้ $a$ และ $b$ เป็นจำนวนเต็มบวก โดยที่ $a > b$ เราสามารถเขียนสมการการหารตาม ขั้นตอนวิธีตรรกยะ (Division Algorithm) ได้ในรูปแบบ $a = bq + r$ (ตัวตั้ง = ตัวหาร $\times$ ผลหาร + เศษ) จากนั้นให้นำ "ตัวหาร" และ "เศษ" มาตั้งหารกันไปเรื่อยๆ ตามรูปแบบดังนี้:
สรุป: ห.ร.ม. ของ $a$ และ $b$ คือ เศษตัวสุดท้ายที่ไม่ใช่ศูนย์ (ในที่นี้คือ $r_k$)
Let $a$ and $b$ be positive integers with $a > b$. Applying the Division Algorithm, we can write $a = bq + r$ (Dividend = Divisor $\times$ Quotient + Remainder). We continuously divide the previous divisor by the previous remainder as follows:
Conclusion: The GCD of $a$ and $b$ is the last non-zero remainder (which is $r_k$).
ตัวอย่างการคำนวณ / Calculation Examples
หมายเหตุ: ใช้สัญลักษณ์ $(a, b)$ แทนความหมายของ ห.ร.ม. ของ $a$ และ $b$ หรือ $\text{GCD}(a,b)$
จงหา ห.ร.ม. ของ $48$ และ $18$
เศษตัวสุดท้ายที่ไม่ใช่ $0$ คือ $6$
$\therefore \text{ห.ร.ม. ของ } 48 \text{ และ } 18 \text{ คือ } 6$ หรือเขียนย่อว่า
$(48, 18) = 6$
Find the GCD of $48$ and $18$.
The last non-zero remainder is $6$.
$\therefore \text{GCD}(48, 18) = 6$
จงหาค่าของ $(252, 105)$
$\therefore (252, 105) = 21$
Evaluate $(252, 105)$.
$\therefore \text{GCD}(252, 105) = 21$
จงหา ห.ร.ม. ของ $100$ และ $25$
เนื่องจากหารลงตัวทันที เศษคือ $0$ แสดงว่าตัวหารนั้นคือ ห.ร.ม. ได้เลย
$\therefore (100, 25) = 25$
Find the GCD of $100$ and $25$.
Since it divides evenly in the first step, the divisor itself is the GCD.
$\therefore \text{GCD}(100, 25) = 25$
จงหาค่าของ $(71, 15)$
เศษสุดท้ายที่ไม่ใช่ศูนย์คือ $1$ (ทั้งสองจำนวนไม่มีตัวประกอบร่วมกันนอกจาก 1)
$\therefore (71, 15) = 1$
Evaluate $(71, 15)$.
The last non-zero remainder is $1$ (They are relatively prime).
$\therefore \text{GCD}(71, 15) = 1$
จงหา ห.ร.ม. ของ $1239$ และ $735$
$\therefore (1239, 735) = 21$
Find the GCD of $1239$ and $735$.
$\therefore \text{GCD}(1239, 735) = 21$
จงหา ห.ร.ม. ของ $-504$ และ $1188$
ตามทฤษฎีบท: ห.ร.ม. ของจำนวนเต็มใดๆ จะเป็นบวกเสมอ ดังนั้น $(a, b) = (|a|, |b|)$
$\therefore (-504, 1188) = 36$
Find the GCD of $-504$ and $1188$.
By theorem: The GCD is always positive, so $\text{GCD}(a, b) = \text{GCD}(|a|, |b|)$
$\therefore \text{GCD}(-504, 1188) = 36$
จงหา ห.ร.ม. ของ $55$ และ $34$ (ลำดับที่ติดกันของลำดับฟีโบนัชชี)
น่ารู้: ลำดับฟีโบนัชชีที่อยู่ติดกัน จะทำให้เกิดขั้นตอนการหาของยูคลิดที่ยาวที่สุดเมื่อเทียบกับขนาดตัวเลข และ ห.ร.ม. จะเป็น 1 เสมอ
$\therefore (55, 34) = 1$
Find the GCD of $55$ and $34$ (Consecutive Fibonacci numbers).
Fun Fact: Consecutive Fibonacci numbers require the most steps in the Euclidean algorithm for their size, and their GCD is always 1.
$\therefore \text{GCD}(55, 34) = 1$
คำศัพท์ที่น่าสนใจ / Key Vocabulary
คำศัพท์คณิตศาสตร์ภาษาอังกฤษ พร้อมรากศัพท์
| คำศัพท์ | รากศัพท์ / Root | ความหมาย / Meaning |
|---|---|---|
| Euclidean Algorithm | Eukleidēs (Greek) + algorismus (Arabic) | ขั้นตอนวิธีของยูคลิด · อัลกอริทึมสำหรับหาตัวหารร่วมมากโดยการหารเอาเศษซ้ำๆ |
| Greatest Common Divisor (GCD) | dividere (to force apart, divide) | ตัวหารร่วมมาก (ห.ร.ม.) · จำนวนเต็มบวกที่มีค่ามากที่สุดที่นำไปหารกลุ่มจำนวนที่กำหนดได้ลงตัว |
| Divisibility | dividere (to force apart, divide) | การหารลงตัว · คุณสมบัติของจำนวนเต็มที่สามารถหารด้วยอีกจำนวนเต็มหนึ่งได้โดยไม่มีเศษ (เศษเป็น 0) |
| Quotient | quotiens (how many times) | ผลหาร · ผลลัพธ์ที่ได้จากการนำจำนวนหนึ่งไปหารด้วยอีกจำนวนหนึ่ง |
| Remainder | re- (back) + manere (to stay) | เศษ · จำนวนที่เหลือจากการหารที่ไม่ลงตัว |
| Relatively Prime | relativus (reference) + primus (first) | จำนวนเฉพาะสัมพัทธ์ · จำนวนเต็มสองจำนวนที่ไม่มีตัวประกอบร่วมกันนอกจาก 1 (ห.ร.ม. = 1) |