TH

ขั้นตอนวิธีเกี่ยวกับการหาร (Division Algorithm) เป็นทฤษฎีบทพื้นฐานที่สำคัญในทฤษฎีจำนวน ซึ่งรับประกันว่าเมื่อเรานำจำนวนเต็มใดๆ มาหารด้วยจำนวนเต็มอีกจำนวนหนึ่ง (ที่ไม่ใช่ศูนย์) เราจะได้ผลลัพธ์เป็น "ผลหาร" (Quotient) และ "เศษเหลือ" (Remainder) ที่มีเพียงรูปแบบเดียวเสมอ และเศษเหลือจะต้องไม่ติดลบ

EN

The Division Algorithm is a fundamental theorem in number theory. It guarantees that when we divide any integer by another non-zero integer, we obtain a unique "quotient" and "remainder", where the remainder must always be non-negative.

1

📖 ทฤษฎีบท / The Theorem

TH

สำหรับจำนวนเต็ม $a$ และ $b$ โดยที่ $b \neq 0$ จะมีจำนวนเต็ม $q$ และ $r$ เพียงชุดเดียว ที่ทำให้สมการต่อไปนี้เป็นจริง:

$$ a = bq + r $$

โดยมีเงื่อนไขบังคับคือ: $\quad 0 \leq r < |b|$

  • $a$ เรียกว่า ตัวตั้ง (Dividend)
  • $b$ เรียกว่า ตัวหาร (Divisor)
  • $q$ เรียกว่า ผลหาร (Quotient)
  • $r$ เรียกว่า เศษเหลือ (Remainder) (*สังเกตว่าเศษเหลือต้อง $\ge 0$ เสมอ)
EN

For any integers $a$ and $b$ with $b \neq 0$, there exist unique integers $q$ and $r$ such that:

$$ a = bq + r $$

subject to the condition: $\quad 0 \leq r < |b|$

  • $a$ is the Dividend
  • $b$ is the Divisor
  • $q$ is the Quotient
  • $r$ is the Remainder (*Note that remainder is always $\ge 0$)
Example 1.1 : จำนวนบวกทั่วไป (Basic Positive)

จงหาผลหาร $q$ และเศษเหลือ $r$ เมื่อตัวตั้ง $a = 23$ และตัวหาร $b = 5$

$$ \begin{aligned} \text{เราต้องการจัดรูป } a &= bq + r \\ 23 &= 5(q) + r \quad \text{โดยที่ } 0 \le r < |5| \\ \text{จะได้ } 23 &=5(4) + 3 \end{aligned} $$

$\text{ดังนั้น } q = 4 \text{ และ } r = 3$

Find the quotient $q$ and remainder $r$ given $a = 23$ and $b = 5$.

$$ \begin{aligned} \text{We want the form } a &= bq + r \\ 23 &= 5(q) + r \quad \text{where } 0 \le r < |5| \\ \text{We get } 23 &=5(4) + 3 \end{aligned} $$

$\text{Thus, } q = 4 \text{ and } r = 3$

Example 1.2 : การหารลงตัวพอดี (Exact Division)

จงหาผลหาร $q$ และเศษเหลือ $r$ เมื่อ $a = 42$ และ $b = 7$

$$ \begin{aligned} \text{พิจารณา } 42 &= 7(q) + r \\ 42 &= 7(6) + 0 \end{aligned} $$

$\text{ดังนั้น } q = 6 \text{ และ } r = 0 \quad \text{(แสดงว่า } 7 \text{ หาร } 42 \text{ ลงตัว)}$

Find the quotient $q$ and remainder $r$ given $a = 42$ and $b = 7$.

$$ \begin{aligned} \text{Consider } 42 &= 7(q) + r \\ 42 &= 7(6) + 0 \end{aligned} $$

$\text{Thus, } q = 6 \text{ and } r = 0 \quad \text{(This means } 7 \text{ divides } 42 \text{ evenly)}$

Example 1.3 : ตัวตั้งน้อยกว่าตัวหาร (Dividend < Divisor)

จงหาผลหาร $q$ และเศษเหลือ $r$ เมื่อ $a = 3$ และ $b = 8$

$$ \begin{aligned} \text{เนื่องจาก } 3 &< 8 \text{ เราหารไม่ได้สักครั้งเลย} \\ 3 &=8(0) + 3 \quad \text{โดยที่ } 0 \le 3 < 8 \end{aligned} $$

$\text{ดังนั้น } q = 0 \text{ และ } r = 3$

Find the quotient $q$ and remainder $r$ given $a = 3$ and $b = 8$.

$$ \begin{aligned} \text{Since } 3 &< 8 \text{, it goes zero times.} \\ 3 &=8(0) + 3 \quad \text{where } 0 \le 3 < 8 \end{aligned} $$

$\text{Thus, } q = 0 \text{ and } r = 3$

Example 1.4 : ตัวตั้งติดลบ (Negative Dividend)

จงหาผลหาร $q$ และเศษเหลือ $r$ เมื่อ $a = -23$ และ $b = 5$

** ข้อควรระวัง **

หลายคนมักคิดว่า $-23 = 5(-4) - 3$ ได้ $q=-4, r=-3$ (ผิด!)

เพราะเงื่อนไขคือเศษเหลือต้องไม่ติดลบ ($0 \le r < 5$)

วิธีที่ถูกต้อง คือต้องถอยผลหารให้ติดลบมากขึ้น เพื่อให้เศษที่บวกเพิ่มเป็นค่าบวก:

$$ \begin{aligned} \text{พิจารณา } 5(-5) &= -25 \\ \text{ต้องการให้ได้ } -23 \text{ จึงต้องบวก } 2 \\ -23 &= 5(-5) + 2 \quad \text{(ซึ่ง } 0 \le 2 < 5 \text{ จริง)} \end{aligned} $$

$\text{ดังนั้น } q = -5 \text{ และ } r = 2$

Find the quotient $q$ and remainder $r$ given $a = -23$ and $b = 5$.

** Common Mistake **

Writing $-23 = 5(-4) - 3$ giving $q=-4, r=-3$. (Wrong!)

Because the remainder must be non-negative ($0 \le r < 5$).

Correct method: push the quotient further negative so the remainder added is positive:

$$ \begin{aligned} \text{Consider } 5(-5) &= -25 \\ \text{To reach } -23 \text{, we must add } 2 \\ -23 &= 5(-5) + 2 \quad \text{(and } 0 \le 2 < 5 \text{ is true)} \end{aligned} $$

$\text{Thus, } q = -5 \text{ and } r = 2$

Example 1.5 : ตัวหารติดลบ (Negative Divisor)

จงหาผลหาร $q$ และเศษเหลือ $r$ เมื่อ $a = 23$ และ $b = -5$

เงื่อนไขของเศษคือ $0 \le r < |-5|$ หรือ $0 \le r < 5$

$$ \begin{aligned} 23 &= (-5)(q) + r \\ \text{พิจารณา } (-5)(-4) &= 20 \\ \text{ดังนั้น } 23 &= (-5)(-4) + 3 \end{aligned} $$

$\text{ดังนั้น } q = -4 \text{ และ } r = 3$

Find the quotient $q$ and remainder $r$ given $a = 23$ and $b = -5$.

The condition for remainder is $0 \le r < |-5|$ or $0 \le r < 5$.

$$ \begin{aligned} 23 &= (-5)(q) + r \\ \text{Consider } (-5)(-4) &= 20 \\ \text{Thus, } 23 &= (-5)(-4) + 3 \end{aligned} $$

$\text{Thus, } q = -4 \text{ and } r = 3$

Example 1.6 : ติดลบทั้งคู่ (Both Negative)

จงหาผลหาร $q$ และเศษเหลือ $r$ เมื่อ $a = -23$ และ $b = -5$

เงื่อนไขของเศษคือ $0 \le r < 5$ (เศษต้องเป็นบวกเสมอ!)

$$ \begin{aligned} -23 &= (-5)(q) + r \\ \text{พิจารณา } (-5)(5) &= -25 \quad \text{(เกินค่าตัวตั้งไปทางลบเพื่อให้บวกเศษกลับมาได้)} \\ -23 &= (-5)(5) + 2 \end{aligned} $$

$\text{ดังนั้น } q = 5 \text{ และ } r = 2$

Find the quotient $q$ and remainder $r$ given $a = -23$ and $b = -5$.

The condition is $0 \le r < 5$ (Remainder must be positive!).

$$ \begin{aligned} -23 &= (-5)(q) + r \\ \text{Consider } (-5)(5) &= -25 \quad \text{(Go below the dividend to add a positive remainder)} \\ -23 &= (-5)(5) + 2 \end{aligned} $$

$\text{Thus, } q = 5 \text{ and } r = 2$

Example 1.7 : ตัวตั้งเป็นศูนย์ (Zero Dividend)

จงหาผลหาร $q$ และเศษเหลือ $r$ เมื่อ $a = 0$ และ $b = 11$

$$ \begin{aligned} 0 &= 11(q) + r \quad \text{โดยที่ } 0 \le r < 11 \\ \text{เห็นได้ชัดว่า } 0 &=11(0) + 0 \end{aligned} $$

$\text{ดังนั้น } q = 0 \text{ และ } r = 0 \quad \text{(จำนวนเต็มใดๆ ย่อมหาร 0 ลงตัวเสมอ)}$

Find the quotient $q$ and remainder $r$ given $a = 0$ and $b = 11$.

$$ \begin{aligned} 0 &= 11(q) + r \quad \text{where } 0 \le r < 11 \\ \text{Clearly, } 0 &=11(0) + 0 \end{aligned} $$

$\text{Thus, } q = 0 \text{ and } r = 0 \quad \text{(Any non-zero integer divides 0 evenly)}$

คำศัพท์ที่น่าสนใจ / Key Vocabulary

คำศัพท์คณิตศาสตร์ภาษาอังกฤษ พร้อมรากศัพท์

คำศัพท์ รากศัพท์ / Root ความหมาย / Meaning
Algorithm Algoritmi (Latinized name of Al-Khwarizmi) ขั้นตอนวิธี · ลำดับขั้นตอนการคำนวณหรือการแก้ปัญหาที่ชัดเจนและมีที่สิ้นสุด
Dividend dividendum (thing to be divided) ตัวตั้ง · จำนวนที่ถูกนำมาแบ่งหรือหารออกในสมการการหาร ($a$)
Divisor divisor (one who divides) ตัวหาร · จำนวนที่นำไปหารตัวตั้ง ($b$)
Quotient quotiens (how many times) ผลหาร · จำนวนครั้งทั้งหมดที่ตัวหารสามารถแบ่งออกจากตัวตั้งได้เต็มส่วน ($q$)
Remainder remanere (to remain behind) เศษเหลือ · ส่วนที่เหลือจากการหารที่ไม่สามารถแบ่งเป็นจำนวนเต็มได้อีก ($r$)
Integer integer (whole, intact) จำนวนเต็ม · จำนวนที่ไม่มีเศษส่วนหรือทศนิยมประกอบ (บวก ลบ หรือศูนย์)