เลขคณิตมอดุลาร์ (Modular Arithmetic) มักถูกเรียกว่า "คณิตศาสตร์นาฬิกา" เป็นระบบตัวเลขที่ค่าตัวเลขจะ "วนกลับ (Wrap around)" เมื่อถึงค่าที่กำหนดไว้ (เรียกว่า โมดูลัส) ซึ่งมีความสำคัญอย่างยิ่งในทฤษฎีจำนวนและวิทยาการเข้ารหัสลับ (Cryptography)
Modular Arithmetic, often called "clock arithmetic", is a system of arithmetic for integers where numbers "wrap around" upon reaching a certain value (the modulus). It is highly fundamental in number theory and cryptography.
📖 บทนิยามและการตรวจสอบสมภาค / Definition of Congruence
กำหนดให้ $n$ เป็นจำนวนเต็มบวก เราจะกล่าวว่าจำนวนเต็ม $a$ สมภาค (Congruent) กับจำนวนเต็ม $b$ มอดุโล $n$ ก็ต่อเมื่อ $n$ หารผลต่าง $(a - b)$ ลงตัวพอดี เขียนแทนด้วยสัญลักษณ์:
ความหมายในเชิงปฏิบัติ: $a$ และ $b$ เมื่อนำไปหารด้วย $n$ จะให้ "เศษ" (Remainder) เท่ากัน
Given a positive integer $n$, an integer $a$ is congruent to an integer $b$ modulo $n$ if and only if $n$ divides the difference $(a - b)$. This is denoted as:
Practical meaning: Both $a$ and $b$ leave the same remainder when divided by $n$.
จงแสดงว่า $38 \equiv 14 \pmod 8$ เป็นจริง
ดังนั้น $38 \equiv 14 \pmod 8$ เป็นความจริง
Show that $38 \equiv 14 \pmod 8$ is true.
Therefore, $38 \equiv 14 \pmod 8$ is true.
จงตรวจสอบว่า $-17 \equiv 3 \pmod 5$ หรือไม่
หารลงตัว ดังนั้น $-17 \equiv 3 \pmod 5$ เป็นจริง
Verify if $-17 \equiv 3 \pmod 5$.
Divisible, so $-17 \equiv 3 \pmod 5$ is True.
จงตรวจสอบว่า $25 \equiv 12 \pmod 7$ หรือไม่
เนื่องจาก $7$ หาร $13$ ไม่ลงตัว (เหลือเศษ 6) จะเขียนได้ว่า $25 \not\equiv 12 \pmod 7$
Verify if $25 \equiv 12 \pmod 7$.
Since 7 does not divide 13 evenly, we write $25 \not\equiv 12 \pmod 7$.
จงหาจำนวนเต็มบวก $x$ ที่น้อยที่สุดที่ทำให้ $100 \equiv x \pmod 9$
นั่นคือ $100 \equiv 1 \pmod 9$ คำตอบคือ $x = 1$
Find the smallest positive integer $x$ such that $100 \equiv x \pmod 9$.
Thus $100 \equiv 1 \pmod 9$. The answer is $x = 1$.
จงหาค่า $x \in \{0, 1, 2, 3, 4, 5\}$ ที่ทำให้ $-22 \equiv x \pmod 6$
ดังนั้น $x = 2$
Find $x \in \{0, 1, 2, 3, 4, 5\}$ such that $-22 \equiv x \pmod 6$.
Therefore, $x = 2$.
ความหมายของ $x \equiv 3 \pmod 4$ ในรูปสมการคืออะไร?
เช่น ถ้า $k = 0 \implies x = 3$, ถ้า $k = 1 \implies x = 7$ เป็นต้น
What is the equation form of $x \equiv 3 \pmod 4$?
For example, if $k = 0 \implies x = 3$, if $k = 1 \implies x = 7$.
กำหนด $a \equiv 15 \pmod 7$ และ $15 \equiv 1 \pmod 7$ จงหาค่าที่น้อยที่สุดของ $a \ge 0$
จำนวนเต็มบวกที่น้อยที่สุดหรือศูนย์คือ $a = 1$
Given $a \equiv 15 \pmod 7$ and $15 \equiv 1 \pmod 7$. Find the smallest non-negative value for $a$.
The smallest non-negative integer is $a = 1$.
⚖️ พีชคณิตของมอดุโล / Modular Algebra
มอดุโลมีสมบัติที่คล้ายคลึงกับสมการปกติ ซึ่งช่วยให้เราสามารถคำนวณตัวเลขขนาดใหญ่ได้โดยการลดทอนลงก่อนบวกหรือคูณ กำหนดให้ $a \equiv b \pmod n$ และ $c \equiv d \pmod n$ จะได้ว่า:
- การบวก: $a + c \equiv b + d \pmod n$
- การลบ: $a - c \equiv b - d \pmod n$
- การคูณ: $ac \equiv bd \pmod n$
- เลขยกกำลัง: $a^k \equiv b^k \pmod n$ (เมื่อ $k \in \mathbb{I}^+$)
** ข้อควรระวังในการหาร **
การหารสองข้างของมอดุโลไม่สามารถตัดทอนกันได้โดยตรงเหมือนสมการทั่วไป ยกเว้นว่าตัวที่นำมาหารจะมี ห.ร.ม. (GCD) กับ $n$ เท่ากับ $1$ (เป็นจำนวนเฉพาะสัมพัทธ์กัน)
Modular arithmetic shares properties with normal algebra, allowing us to reduce large numbers before operations. Given $a \equiv b \pmod n$ and $c \equiv d \pmod n$:
- Addition: $a + c \equiv b + d \pmod n$
- Subtraction: $a - c \equiv b - d \pmod n$
- Multiplication: $ac \equiv bd \pmod n$
- Exponentiation: $a^k \equiv b^k \pmod n$ (for integer $k > 0$)
** Warning on Division **
You cannot simply divide both sides of a congruence. You can only divide by a number if it is coprime (GCD = 1) with the modulus $n$.
จงหาเศษเมื่อหาร $45 + 78$ ด้วย $6$
แทนที่จะบวกกันก่อน ให้หาเศษของแต่ละตัวแล้วค่อยนำมาบวกกัน
เศษคือ $3$
Find the remainder when $45 + 78$ is divided by $6$.
The remainder is $3$.
จงหาเศษเมื่อหาร $102 \times 55$ ด้วย $7$
Find the remainder of $102 \times 55 \pmod 7$.
จงหาค่าบวกของ $(20 - 45) \pmod 7$
Evaluate $(20 - 45) \pmod 7$.
จงหาเศษเมื่อหาร $4^4$ ด้วย $5$
Find the remainder of $4^4 \pmod 5$.
ให้ $f(x) = x^2 + 2x + 1$ จงหา $f(5) \pmod 3$
แทนที่จะหาค่า $f(5)$ ตรงๆ เราสามารถลดทอน $x = 5 \equiv 2 \pmod 3$ ก่อนได้
Let $f(x) = x^2 + 2x + 1$. Find $f(5) \pmod 3$.
Reduce $x = 5 \equiv 2 \pmod 3$ before substituting.
ถ้า $4x \equiv 8 \pmod{12}$ เราสามารถเอา 4 หารตลอดได้หรือไม่?
คำตอบ: ไม่ได้! เพราะ ห.ร.ม. ของ 4 และ 12 คือ 4 (ไม่เท่ากับ 1) ถ้าหาร 4 ทิ้งจะได้ $x \equiv 2 \pmod{12}$ ซึ่งผิด (ลองแทน $x=5$ จะเห็นว่า $4(5)=20 \equiv 8 \pmod{12}$ จริง แต่ $5 \not\equiv 2 \pmod{12}$)
วิธีที่ถูกต้อง: ต้องหารค่ามอดุลัสด้วย ห.ร.ม. ด้วย
If $4x \equiv 8 \pmod{12}$, can we divide by 4?
No! Because $\text{GCD}(4, 12) = 4 \ne 1$. You must also divide the modulus by the GCD.
จงหาคำตอบของ $3x \equiv 15 \pmod 7$
Solve $3x \equiv 15 \pmod 7$.
🚀 การประยุกต์ใช้แก้โจทย์ปัญหา / Applications
โจทย์คณิตศาสตร์หลายข้อออกแบบมาเพื่อให้คำนวณตัวเลขมหาศาลโดยไม่จำเป็นต้องใช้เครื่องคิดเลข เราสามารถใช้สมบัติของเลขคณิตมอดุลาร์เพื่อช่วยได้ เช่น:
- การหาเศษของการยกกำลังมากๆ: พยายามจัดรูปฐานให้สมภาคกับ $1$ หรือ $-1$ มอดุโล $n$ เพื่อความง่ายในการยกกำลังต่อ
- การหาเลขโดดหลักสุดท้าย: หลักหน่วยคือการหาค่า $\pmod{10}$, หลักสิบและหลักหน่วยคือการหาค่า $\pmod{100}$
- ทฤษฎีบทเศษเหลือและการพิสูจน์: ใช้ตรวจสอบการหารลงตัวของพจน์พีชคณิต
Many math problems involve huge numbers designed to be solved without calculators. Modular arithmetic properties help simplify these:
- Remainder of large exponents: Try to reduce the base to be congruent to $1$ or $-1 \pmod n$.
- Finding the last digits: The last digit is the value $\pmod{10}$, last two digits is $\pmod{100}$.
- Divisibility proofs: Useful to prove expressions are always divisible by $n$.
จงหาเศษเมื่อหาร $2^{100}$ ด้วย $7$
แนวคิด: สังเกตว่า $2^3 = 8$ ซึ่งใกล้เคียง $7$ มาก ($8 \equiv 1 \pmod 7$)
เศษคือ $2$
Find the remainder of $2^{100} \div 7$.
Hint: Notice that $2^3 = 8 \equiv 1 \pmod 7$.
The remainder is $2$.
จงหาเศษเมื่อหาร $3^{50}$ ด้วย $5$
แนวคิด: สังเกตว่า $3^2 = 9 \equiv -1 \pmod 5$ ซึ่งง่ายต่อการยกกำลัง
เศษคือ $4$
Find the remainder of $3^{50} \div 5$.
The remainder is $4$.
เลขโดดหลักสุดท้ายของ $7^{2026}$ คือเลขอะไร?
แนวคิด: การหาหลักหน่วยเทียบเท่ากับการหาค่า มอดุโล $10$ ลองวนลูปยกกำลังของ 7
หลักหน่วยคือ $9$
What is the last digit of $7^{2026}$?
Hint: Last digit is value modulo 10.
The last digit is $9$.
จงหาเลขโดด 2 หลักสุดท้ายของ $99^{99}$
แนวคิด: หาค่ามอดุโล $100$
สองหลักสุดท้ายคือ $99$
Find the last two digits of $99^{99}$.
Hint: Modulo 100.
จงหาเศษเมื่อหาร $1! + 2! + 3! + \dots + 100!$ ด้วย $8$
แฟกทอเรียลที่มีค่าตั้งแต่ $4! = 24$ ขึ้นไป จะมี 8 เป็นตัวประกอบเสมอ ดังนั้นจะหารลงตัว (มอดุโลเป็น 0)
เศษคือ $1$
Find the remainder of $1! + 2! + \dots + 100! \pmod 8$.
จงแสดงว่า $5^{2n} - 1$ หารด้วย $24$ ลงตัวเสมอ สำหรับทุกจำนวนเต็มบวก $n$
เศษเป็น 0 แสดงว่าหารด้วย $24$ ลงตัวเสมอ
Show that $5^{2n} - 1$ is always divisible by $24$ for $n \in \mathbb{I}^+$.
Remainder 0 implies it is divisible.
ถ้าวันนี้เป็นวันอังคาร อีก $1000$ วันข้างหน้าจะเป็นวันอะไร?
แนวคิด: 1 สัปดาห์มี 7 วัน วงจรของวันจะวนทับตำแหน่งเดิมทุกๆ 7 วัน (มอดุโล 7)
หมายความว่านับจากวันอังคารไปอีก 6 วัน (หรือถอยหลัง 1 วัน) ซึ่งก็คือ วันจันทร์
If today is Tuesday, what day of the week will it be in 1000 days?
6 days after Tuesday is Monday.
คำศัพท์ที่น่าสนใจ / Key Vocabulary
คำศัพท์คณิตศาสตร์ภาษาอังกฤษ พร้อมรากศัพท์
| คำศัพท์ | รากศัพท์ / Root | ความหมาย / Meaning |
|---|---|---|
| Modulo (mod) | modulus (small measure) | มอดุโล · ระบบการคำนวณที่ตัวเลขวนกลับเมื่อถึงค่าที่กำหนด |
| Congruence | congruere (agree, come together) | สมภาค · ความเท่ากันในระบบมอดุลาร์ (เหลือเศษเท่ากัน) |
| Remainder | re- (back) + manere (to stay) | เศษเหลือ · จำนวนที่เหลือจากการหารที่ไม่ลงตัว |
| Divisibility | dividere (divide) + -ibilis (able to) | การหารลงตัว · คุณสมบัติที่จำนวนเต็มหนึ่งสามารถหารอีกจำนวนได้โดยไม่มีเศษ |
| Coprime | co- (together) + primus (first) | จำนวนเฉพาะสัมพัทธ์ · จำนวนเต็มสองตัวที่มี ห.ร.ม. เท่ากับ 1 |