กลับไปหน้าบทความ

อ่าน 17 นาที

Modular arithmetic

In mathematics, modular arithmetic is a system of arithmetic operations for integers, differing from the usual ones in that numbers "wrap around" when reaching or exceeding a...

Modular arithmetic

ซ้าย: นาฬิกาเข็มบอกเวลา 9 นาฬิกา ขวา: หลังจากผ่านไปสี่ชั่วโมง นาฬิกาบอกเวลา 1 นาฬิกา
Time-keeping on this clock uses arithmetic modulo 12. Adding 4 hours to 9 o'clock gives 1 o'clock, since 13 is congruent to 1 modulo 12.

In mathematics, modular arithmetic is a system of arithmetic operations for integers, differing from the usual ones in that numbers "wrap around" when reaching or exceeding a certain value, called the modulus. The modern approach to number theory using modular arithmetic was developed by Carl Friedrich Gauss in his book Disquisitiones Arithmeticae, published in 1801.[1]

Modular arithmetic modulom consists of systematically replacing the results of additions, multiplications, and subtractions by the remainder of the division by m. A remarkable property of modular arithmetic is that the result of a computation does not depend on whether the division by m is performed after each operation, only once at the end of the computation, or at the end of the computation and after some intermediate resultstypically when an intermediate result becomes too large.

Motivating example

A familiar setting exhibiting modular arithmetic is the hour hand on a 12-hour clock. If the hour hand points to 7 now, then 8 hours later it will point to 3. Ordinary addition would result in 7 + 8 = 15, but 15 reads as 3 on the clock face. This is because the hour hand makes one rotation every 12 hours and the hour number starts over when the hour hand passes 12. We say that 15 is congruent to 3 modulo 12, and we write 15 3 (mod 12), so 7 + 8 3 (mod 12).

ในทำนองเดียวกัน หากเรารอ 8 ชั่วโมง แล้วรออีก 8 ชั่วโมง (รวมเป็น 16 ชั่วโมง) นาฬิกาจะแสดงเวลาเปลี่ยนเท่ากับที่เรารอ 4 ชั่วโมง ซึ่งสะท้อนให้เห็นได้จากสูตร 2 × 8 4 (mod 12) หลังจากรอครบ 12 ชั่วโมง เข็มชั่วโมงจะอยู่ตรงตำแหน่งเดิม ดังนั้น 12 จึงเทียบเท่ากับ 0; เราเขียนได้ว่า 12 0 (mod 12)

ความสอดคล้อง

กำหนดให้จำนวนเต็มm ≥ 1เรียกว่าโมดูลัส จำนวนเต็ม aและbสองจำนวนจะเรียกว่าสมมูลกันในโมดูลัสmถ้าผลต่างของจำนวนเต็มทั้งสองabเป็นจำนวนเต็มทวีคูณของmกล่าวคือ ถ้ามีจำนวนเต็มkที่ทำให้

ab = กม .

ความสอดคล้องมอดูลmคือความสัมพันธ์ความสอดคล้องซึ่งหมายความว่าเป็นความสัมพันธ์สมมูลที่เข้ากันได้กับการบวกการลบและการคูณความสอดคล้องมอดูลmเขียนแทนด้วย

เอ(ม็อด).{\displaystyle a\equiv b{\pmod {m}}.}

วงเล็บหมายความว่า(mod m )ใช้กับสมการทั้งหมด ไม่ใช่แค่ด้านขวามือ (ในที่นี้คือb ) เท่านั้น

สัญลักษณ์นี้ไม่ควรสับสนกับสัญลักษณ์b mod mหรือ( b mod m ) (โดยไม่มีวงเล็บอยู่หน้า "mod") ซึ่งหมายถึงเศษเหลือจากการหารb ด้วย mหรือที่เรียกว่า การดำเนินการ โมดูลัสกล่าวคือb mod mหมายถึงจำนวนเต็มr ที่ไม่ซ้ำกัน ซึ่ง0 ≤ r < mและrb (mod m )ดังนั้น ความสัมพันธ์เอ(ม็อด){\displaystyle a\equiv b{\pmod {m}}}ต้องอ่าน(เอ)ม็อด,{\displaystyle (a\equiv b){\bmod {m}},} และเทียบเท่ากับเอม็อด=ม็อด.{\displaystyle a{\bmod {m}}=b{\bmod {m}}.}

ความสัมพันธ์สมมูลab (mod m )สามารถเขียนใหม่ได้ดังนี้ เคเอ=เค+,{\displaystyle \exists k\in \mathbb {Z} \quad a=km+b,} แสดงให้เห็นความสัมพันธ์กับการหารแบบยุคลิด อย่างชัดเจน อย่างไรก็ตามbในที่นี้ไม่จำเป็นต้องเป็นเศษเหลือจากการหารa ด้วย m แต่ a b ( mod m )ยืนยันว่าaและbมีเศษเหลือ เท่ากัน เมื่อหารด้วยmนั่นคือ

a = pm + r ,
b = qm + r ,

โดยที่0 ≤ r < mคือเศษเหลือร่วม เราจะได้ความสัมพันธ์ก่อนหน้านี้ ( ab = km ) กลับคืนมาโดยการลบนิพจน์ทั้งสองนี้และกำหนดให้k = pq

เนื่องจากความสอดคล้องมอดูลัสmถูกกำหนดโดยการหารลงตัวด้วยmและเนื่องจาก−1เป็นหน่วยในวงแหวนของจำนวนเต็ม ดังนั้นจำนวนใดๆ จะหารลงตัวด้วย−mก็ต่อเมื่อมันหารลงตัวด้วยmเท่านั้นซึ่งหมายความว่าจำนวนเต็มที่ไม่เป็นศูนย์m ทุกตัว สามารถนำมาใช้เป็นมอดูลัสได้

ตัวอย่าง

ในโมดูลัส 12 เราสามารถกล่าวได้ว่า:

38 ≡ 14 (mod 12)

เนื่องจากผลต่างคือ38 − 14 = 24 = 2 × 12ซึ่งเป็นพหุคูณของ12หรือกล่าวอีกนัยหนึ่งคือ38และ14หารด้วย12แล้วเหลือเศษ2 เท่ากัน

นิยามของความสอดคล้องยังใช้ได้กับค่าลบด้วย ตัวอย่างเช่น:

23(ม็อด5)8+7(ม็อด5)38(ม็อด5).{\displaystyle {\begin{aligned}2&\equiv -3{\pmod {5}}\\-8&\equiv {\phantom {+}}7{\pmod {5}}\\-3&\equiv -8{\pmod {5}}.\end{aligned}}}

คุณสมบัติพื้นฐาน

ความสัมพันธ์แบบสอดคล้องกันนั้นตรงตามเงื่อนไขทั้งหมดของความสัมพันธ์แบบสมมูล :

  • การสะท้อนกลับ: aa (mod m )
  • สมมาตร: ab (mod m )ก็ต่อเมื่อba (mod m )เท่านั้น
  • คุณสมบัติการถ่ายทอด: ถ้าab (mod m )และbc (mod m )แล้วac (mod m )

ถ้าa b (mod m )และa b (mod m )หรือถ้าab (mod m )แล้ว: [ 2 ]

  • a + kb + k (mod m )สำหรับจำนวนเต็ม k ใดๆ (เข้ากันได้กับการแปลง)
  • kakb (mod m )สำหรับจำนวนเต็ม k ใดๆ (เข้ากันได้กับการปรับขนาด)
  • k ak b (mod k m) for any integer k
  • a + ab + b (mod m) (compatibility with addition)
  • aabb (mod m) (compatibility with subtraction)
  • aabb (mod m) (compatibility with multiplication)
  • akbk (mod m) for any non-negative integer k (compatibility with exponentiation)
  • p(a) ≡ p(b) (mod m), for any polynomialp(x) with integer coefficients (compatibility with polynomial evaluation)

If ab (mod m), then it is generally false that kakb (mod m). However, the following is true:

If ab (mod mn), then ab (mod m) and ab (mod n).

For cancellation of common terms, we have the following rules:

  • If a + kb + k (mod m), where k is any integer, then ab (mod m).
  • If k ak b (mod m) and k is coprime with m, then ab (mod m).
  • If k ak b (mod k m) and k ≠ 0, then ab (mod m).

The last rule can be used to move modular arithmetic into division. If b divides a, then (a/b) mod m = (a mod (b m)) / b.

The modular multiplicative inverse is defined by the following rules:

  • Existence: There exists an integer denoted a−1 such that aa−1 ≡ 1 (mod m) if and only if a is coprime with m. This integer a−1 is called a modular multiplicative inverse of a modulo m.
  • If ab (mod m) and a−1 exists, then a−1b−1 (mod m) (compatibility with multiplicative inverse, and, if a = b, uniqueness modulo m).
  • If axb (mod m) and a is coprime to m, then the solution to this linear congruence is given by xa−1b (mod m).

The multiplicative inverse xa−1 (mod m) may be efficiently computed by solving Bézout's equationa x + m y = 1 for x, y, by using the Extended Euclidean algorithm.

In particular, if p is a prime number, then a is coprime with p for every a such that 0 < a < p; thus a multiplicative inverse exists for all a that is not congruent to zero modulo p.

Advanced properties

Some of the more advanced properties of congruence relations are the following:

  • Fermat's little theorem: If p is prime and does not divide a, then ap−1 ≡ 1 (mod p).
  • Euler's theorem: If a and m are coprime, then aφ(m) ≡ 1 (mod m), where φ is Euler's totient function.
  • A simple consequence of Fermat's little theorem is that if p is prime, then a−1ap−2 (mod p) is the multiplicative inverse of 0 < a < p. More generally, from Euler's theorem, if a and m are coprime, then a−1aφ(m)−1 (mod m). Hence, if ax1 (mod m), then xaφ(m)−1 (mod m).
  • Another simple consequence is that if ab (mod φ(m)), where φ is Euler's totient function, then kakb (mod m) provided k is coprime with m.
  • Wilson's theorem: p is prime if and only if (p − 1)! ≡ −1 (mod p).
  • Chinese remainder theorem: For any a, b and coprime m, n, there exists a unique x (mod mn) such that xa (mod m) and xb (mod n). In fact, xb m−1m + a n−1n (mod mn) where m−1 is the inverse of m modulo n and n−1 is the inverse of n modulo m.
  • Lagrange's theorem: If p is prime and f (x) = axd + ... + a is a polynomial with integer coefficients such that p is not a divisor of a, then the congruence f (x) ≡ 0 (mod p) has at most d non-congruent solutions.
  • Primitive root modulo m: A number g is a primitive root modulo m if, for every integer a coprime to m, there is an integer k such that gka (mod m). A primitive root modulo m exists if and only if m is equal to 2, 4, pk or 2pk, where p is an odd prime number and k is a positive integer. If a primitive root modulo m exists, then there are exactly φ(φ(m)) such primitive roots, where φ is the Euler's totient function.
  • Quadratic residue: An integer a is a quadratic residue modulo m, if there exists an integer x such that x2a (mod m). Euler's criterion asserts that, if p is an odd prime, and a is not a multiple of p, then a is a quadratic residue modulo p if and only if
    a(p−1)/2 ≡ 1 (mod p).

Congruence classes

The congruence relation is an equivalence relation. The equivalence class modulo m of an integer a is the set of all integers of the form a + k m, where k is any integer. It is called the congruence class or residue class of a modulo m, and may be denoted (a mod m), or as a or [a] when the modulus m is known from the context.

Each residue class modulo m contains exactly one integer in the range 0,...,|m|1{\displaystyle 0,...,|m|-1}. Thus, these |m|{\displaystyle |m|} integers are representatives of their respective residue classes.

It is generally easier to work with integers than sets of integers; that is, the representatives most often considered, rather than their residue classes.

Consequently, (a mod m) denotes generally the unique integer r such that 0 ≤ r < m and ra (mod m); it is called the residue of a modulo m.

In particular, (a mod m) = (b mod m) is equivalent to ab (mod m), and this explains why "=" is often used instead of "" in this context.

Residue systems

Each residue class modulo m may be represented by any one of its members, although we usually represent each residue class by the smallest nonnegative integer which belongs to that class[3] (since this is the proper remainder which results from division). Any two members of different residue classes modulo m are incongruent modulo m. Furthermore, every integer belongs to one and only one residue class modulo m.[4]

The set of integers {0, 1, 2, ..., m − 1} is called the least residue system modulo m. Any set of m integers, no two of which are congruent modulo m, is called a complete residue system modulo m.

The least residue system is a complete residue system, and a complete residue system is simply a set containing precisely one representative of each residue class modulo m.[5] For example, the least residue system modulo 4 is {0, 1, 2, 3}. Some other complete residue systems modulo 4 include:

  • {1, 2, 3, 4}
  • {13, 14, 15, 16}
  • {−2, −1, 0, 1}
  • {−13, 4, 17, 18}
  • {−5, 0, 6, 21}
  • {27, 32, 37, 42}

Some sets that are not complete residue systems modulo 4 are:

  • {−5, 0, 6, 22}, since 6 is congruent to 22 modulo 4.
  • {5, 15}, since a complete residue system modulo 4 must have exactly 4 incongruent residue classes.

Reduced residue systems

Given the Euler's totient functionφ(m), any set of φ(m) integers that are relatively prime to m and mutually incongruent under modulus m is called a reduced residue system modulo m.[6] The set {5, 15} from above, for example, is an instance of a reduced residue system modulo 4.

Covering systems

Covering systems represent yet another type of residue system that may contain residues with varying moduli.

Integers modulo m

In the context of this paragraph, the modulus m is almost always taken as positive.

เซตของชั้นสมภาค ทั้งหมด มอดูลmคือวงแหวนที่เรียกว่าวงแหวนของจำนวนเต็มมอดูลmและใช้สัญลักษณ์ แทน/{\textstyle \mathbb {Z} /m\mathbb {Z} },/(){\displaystyle \mathbb {Z} /(m)},/{\displaystyle \mathbb {Z} /m}, หรือ{\displaystyle \mathbb {Z} _{m}}[ 7 ]แหวน/{\displaystyle \mathbb {Z} /m\mathbb {Z} }เป็นพื้นฐานสำคัญในสาขาต่างๆ ของคณิตศาสตร์ (ดู หัวข้อ §  การประยุกต์ใช้ด้านล่าง) (ในบางส่วนของทฤษฎีจำนวนสัญลักษณ์นี้ใช้){\displaystyle \mathbb {Z} _{m}}(ควรหลีกเลี่ยงการใช้ เนื่องจากอาจทำให้สับสนกับเซตของจำนวนเต็มm -adic ได้ )

สำหรับm > 0จะได้ว่า

/={เอ¯เอ}={0¯,1¯,2¯,,1¯}.{\displaystyle \mathbb {Z} /m\mathbb {Z} =\left\{{\overline {a}}_{m}\mid a\in \mathbb {Z} \right\}=\left\{{\overline {0}}_{m},{\overline {1}}_{m},{\overline {2}}_{m},\ldots ,{\overline {m{-}1}}_{m}\right\}.}

เมื่อm = 1 ,/{\displaystyle \mathbb {Z} /m\mathbb {Z} }คือวงแหวนศูนย์เมื่อm = 0/{\displaystyle \mathbb {Z} /m\mathbb {Z} }ไม่ใช่เซตว่างแต่เป็น เซต ที่สม isomorphicกับ{\displaystyle \mathbb {Z} }เนื่องจากa = { a }

การบวก การลบ และการคูณ ถูกกำหนดไว้ใน/{\displaystyle \mathbb {Z} /m\mathbb {Z} }โดยปฏิบัติตามกฎต่อไปนี้:

  • เอ¯+¯=(เอ+)¯{\displaystyle {\overline {a}}_{m}+{\overline {b}}_{m}={\overline {(a+b)}}_{m}}
  • เอ¯¯=(เอ)¯{\displaystyle {\overline {a}}_{m}-{\overline {b}}_{m}={\overline {(ab)}}_{m}}
  • เอ¯¯=(เอ)¯.{\displaystyle {\overline {a}}_{m}{\overline {b}}_{m}={\overline {(ab)}}_{m}.}

คุณสมบัติที่กล่าวมาข้างต้นบ่งชี้ว่า ด้วยการดำเนินการเหล่านี้/{\displaystyle \mathbb {Z} /m\mathbb {Z} }เป็นวงแหวนสลับที่ได้ตัวอย่างเช่น ในวงแหวน/24{\displaystyle \mathbb {Z} /24\mathbb {Z} }หนึ่งมี

12¯24+21¯24=33¯24=9¯24{\displaystyle {\overline {12}__{24}+{\overline {21}__{24}={\overline {33}__{24}={\overline {9}}_{24}}

เช่นเดียวกับการคำนวณทางคณิตศาสตร์สำหรับนาฬิกา 24 ชั่วโมง

สัญลักษณ์/{\displaystyle \mathbb {Z} /m\mathbb {Z} }ใช้เพราะวงแหวนนี้เป็นวงแหวนผลหารของ{\displaystyle \mathbb {Z} }โดยอุดมคติ{\displaystyle m\mathbb {Z} }เซตที่ประกอบด้วยพหุคูณทั้งหมดของmนั่นคือ จำนวนkm ทั้งหมด ที่มีเค.{\displaystyle k\in \mathbb {Z} .}

นอกจากนี้/{\displaystyle \mathbb {Z} /m\mathbb {Z} }เป็นกลุ่มวัฏจักรกลุ่มวัฏจักรจำกัดทั้งหมดสมสัณฐานกับ/{\displaystyle \mathbb {Z} /m\mathbb {Z} }สำหรับบางm . [ 8 ]

วงแหวนของจำนวนเต็มมอดูลmคือฟิลด์กล่าวคือ สมาชิกที่ไม่เป็นศูนย์ทุกตัวจะมีตัวผกผันการคูณก็ต่อ เมื่อ mเป็นจำนวนเฉพาะถ้าm = p kเป็นกำลังของจำนวนเฉพาะโดยที่k > 1จะมีฟิลด์จำกัดที่ไม่ซ้ำกัน (โดยไม่คำนึงถึงไอโซมอร์ฟิซึม) อยู่หนึ่งเดียวจีเอฟ()=เอฟ{\displaystyle \mathrm {GF} (m)=\mathbb {F} _{m}}โดยมี องค์ประกอบ mซึ่งไม่สมมาตรกับ/{\displaystyle \mathbb {Z} /m\mathbb {Z} }ซึ่งไม่ถือว่าเป็นฟิลด์เนื่องจากมีตัวหารเป็นศูนย์

ถ้าm > 1 ,(/)×{\displaystyle (\mathbb {Z} /m\mathbb {Z} )^{\times }}หมายถึงกลุ่มการคูณของจำนวนเต็มมอดูลmที่ผกผันได้ ประกอบด้วยชั้นสมมูลa โดยที่aเป็นจำนวนเฉพาะสัมพัทธ์กับmซึ่งก็คือชั้นที่มีตัวผกผันการคูณนั่นเอง พวกมันก่อตัวเป็นกลุ่มอาเบเลียนภายใต้การคูณ อันดับของกลุ่มคือφ ( m )โดยที่φคือฟังก์ชันโทเทียนต์ของออยเลอร์

แอปพลิเคชัน

ในคณิตศาสตร์บริสุทธิ์ เลขคณิตมอดูลาร์เป็นหนึ่งในรากฐานของทฤษฎีจำนวนเกี่ยวข้องกับเกือบทุกแง่มุมของการศึกษา และยังใช้กันอย่างแพร่หลายในทฤษฎีกลุ่มทฤษฎีวงแหวนทฤษฎีปมและพีชคณิตนามธรรมในคณิตศาสตร์ประยุกต์ เลขคณิตมอดูลาร์ใช้ในพีชคณิตคอมพิวเตอร์การเข้ารหัสวิทยาการคอมพิวเตอร์เคมีและศิลปะทัศนศิลป์และดนตรี

การประยุกต์ใช้ที่เป็นรูปธรรมมากอย่างหนึ่งคือการคำนวณค่าตรวจสอบความถูกต้องภายในตัวระบุหมายเลขประจำเครื่อง ตัวอย่างเช่นหมายเลขหนังสือมาตรฐานสากล (ISBN) ใช้การคำนวณแบบโมดูลัส 11 (สำหรับ ISBN 10 หลัก) หรือโมดูลัส 10 (สำหรับ ISBN 13 หลัก) เพื่อตรวจจับข้อผิดพลาด ในทำนองเดียวกันหมายเลขบัญชีธนาคารระหว่างประเทศ (IBAN) ใช้การคำนวณแบบโมดูลัส 97 เพื่อตรวจจับข้อผิดพลาดในการป้อนข้อมูลของผู้ใช้ในหมายเลขบัญชีธนาคาร ในทางเคมี ตัวเลขหลักสุดท้ายของหมายเลขทะเบียน CAS (หมายเลขระบุเฉพาะสำหรับสารประกอบทางเคมีแต่ละชนิด) คือตัวเลขตรวจสอบความถูกต้อง ซึ่งคำนวณโดยการนำตัวเลขหลักสุดท้ายของสองส่วนแรกของหมายเลขทะเบียน CAS คูณด้วย 1 ตัวเลขหลักก่อนหน้าคูณด้วย 2 ตัวเลขหลักก่อนหน้าคูณด้วย 3 เป็นต้น จากนั้นนำผลลัพธ์ทั้งหมดมารวมกันและคำนวณผลรวมแบบโมดูลัส 10

ในด้านการเข้ารหัสลับ เลขคณิตแบบโมดูลาร์เป็นพื้นฐานโดยตรงของ ระบบ กุญแจสาธารณะเช่นRSAและDiffie–Hellmanและให้ฟิลด์จำกัดซึ่งเป็นพื้นฐานของเส้นโค้งวงรี อีกทั้งยังใช้ในอัลกอริธึ มกุญแจสมมาตรหลายแบบรวมถึงมาตรฐานการเข้ารหัสขั้นสูง (AES), อัลกอริธึมการเข้ารหัสข้อมูลระหว่างประเทศ (IDEA) และRC4 RSA และ Diffie–Hellman ใช้การยกกำลังแบบโมดูลาร์

ในพีชคณิตคอมพิวเตอร์ เลขคณิตแบบโมดูลาร์มักใช้เพื่อจำกัดขนาดของสัมประสิทธิ์จำนวนเต็มในการคำนวณและข้อมูลระดับกลาง มันถูกใช้ในการแยกตัวประกอบพหุนามซึ่งเป็นปัญหาที่อัลกอริทึมที่มีประสิทธิภาพที่รู้จักทั้งหมดใช้เลขคณิตแบบโมดูลาร์ มันถูกใช้โดยการใช้งานที่มีประสิทธิภาพที่สุดของตัวหารร่วมมากของพหุนาม พีชคณิตเชิงเส้นที่แม่นยำและ อัลกอริทึม ฐาน Gröbnerบนจำนวนเต็มและจำนวนตรรกยะ ดังที่โพสต์บนFidonetในช่วงทศวรรษ 1980 และเก็บถาวรไว้ที่Rosetta Codeเลขคณิตแบบโมดูลาร์ถูกใช้เพื่อหักล้างสมมติฐานผลรวมของกำลังของออยเลอร์บนไมโครคอมพิวเตอร์Sinclair QL โดยใช้ความแม่นยำของจำนวนเต็มเพียงหนึ่งในสี่ของที่ใช้โดยซูเปอร์คอมพิวเตอร์CDC 6600เพื่อหักล้างสมมติฐานดังกล่าวเมื่อสองทศวรรษก่อนผ่าน การ ค้นหาแบบใช้กำลังทั้งหมด[ 9 ]

ในวิทยาการคอมพิวเตอร์ เลขคณิตแบบโมดูลาร์มักถูกนำไปใช้ในการดำเนินการระดับบิตและการดำเนินการอื่นๆ ที่เกี่ยวข้องกับโครงสร้างข้อมูล แบบวนรอบที่มีความกว้างคงที่ การดำเนินการโมดูลัส ซึ่งถูกนำไปใช้ใน ภาษาโปรแกรมและเครื่องคิดเลขหลายภาษาเป็นการประยุกต์ใช้เลขคณิตแบบโมดูลาร์ที่มักใช้ในบริบทนี้ ตัวดำเนินการตรรกะXORจะบวก 2 บิต โมดูลัส 2

การใช้การหารยาวเพื่อแปลงเศษส่วนให้เป็นทศนิยมซ้ำในฐานb ใดๆ นั้น เทียบเท่ากับการคูณแบบโมดูลัสของbกับตัวส่วน ตัวอย่างเช่น สำหรับทศนิยมb = 10

ในทางดนตรี การคำนวณเลขคณิตโมดูลัส 12 ถูกนำมาใช้ในการพิจารณาระบบเสียงสิบสองโทนเท่ากัน (twelve-tone equal temperament ) ซึ่ง มีความเท่าเทียมกัน ของอ็อกเทฟและ ความเท่าเทียมกัน ของเสียงประสาน (กล่าวคือ ระดับเสียงในอัตราส่วน 1:2 หรือ 2:1 จะเท่ากัน และ C- sharpถือว่าเหมือนกับ D- flat )

วิธีการตัดเลขเก้าออกเป็นวิธีตรวจสอบความถูกต้องของการคำนวณเลขฐานสิบที่ทำด้วยมืออย่างรวดเร็ว โดยอาศัยเลขคณิตแบบมอดูลัส 9 และโดยเฉพาะอย่างยิ่งคุณสมบัติที่สำคัญคือ 10 ≡ 1 (mod 9)

การคำนวณเลขคณิตแบบโมดูลัส 7 ถูกนำมาใช้ในอัลกอริทึมที่ใช้ในการหาว่าวันใดเป็นวันในสัปดาห์สำหรับวันที่กำหนด โดยเฉพาะอย่างยิ่ง อัลกอริทึม ความสอดคล้องของเซลเลอร์ (Zeller's congruence)และ อัลกอริทึม วันสิ้นโลก (Doomsday algorithm)ใช้การคำนวณเลขคณิตแบบโมดูลัส 7 อย่างมาก

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

ความซับซ้อนในการคำนวณ

เนื่องจากเลขคณิตแบบมอดูลาร์มีการใช้งานที่หลากหลาย จึงเป็นสิ่งสำคัญที่จะต้องทราบว่าการแก้ระบบสมการเชิงอนุพันธ์นั้นยากเพียงใด ระบบสมการเชิงอนุพันธ์เชิงเส้นสามารถแก้ได้ในเวลาพหุนามด้วยวิธีการกำจัดแบบเกาส์สำหรับรายละเอียดเพิ่มเติม โปรดดูทฤษฎีบทสมการเชิงอนุพันธ์เชิงเส้น นอกจากนี้ยังมี อัลกอริทึม เช่นการลดรูปของมอน ต์โกเมอรี ที่ช่วยให้สามารถดำเนินการทางคณิตศาสตร์อย่างง่าย เช่น การคูณและการยกกำลังมอดูลm ได้อย่างมีประสิทธิภาพกับจำนวนมาก

การดำเนินการบางอย่าง เช่น การหาลอการิทึมแบบไม่ต่อเนื่องหรือความสอดคล้องกำลังสองดูเหมือนจะยากพอๆ กับการแยกตัวประกอบจำนวนเต็มและดังนั้นจึงเป็นจุดเริ่มต้นสำหรับอัลกอริธึมการเข้ารหัสและการเข้ารหัสลับปัญหาเหล่านี้อาจเป็นปัญหาNP- intermediate

การแก้ระบบสมการเลขคณิตโมดูลาร์ที่ไม่เป็นเชิงเส้นเป็นปัญหาNP- complete [ 10 ]

ดูเพิ่มเติม

หมายเหตุ

  1. Gray, Jeremyประวัติศาสตร์ของพีชคณิตนามธรรม: จากสมการพีชคณิตสู่พีชคณิตสมัยใหม่ . เยอรมนี, Springer International Publishing, 2018. 143.
  2. Lehoczky & Rusczky 2006 .
  3. ไวส์สไตน์
  4. Pettofrezzo & Byrkit 1970 , หน้า 90.
  5. Long 1972 , หน้า 78.
  6. Long 1972 , หน้า 85.
  7. เดนตัน 2013 .
  8. Sengadir T., Discrete Mathematics and Combinatorics , หน้า 293, ที่Google Books
  9. "สมมติฐานผลรวมกำลังของออยเลอร์" rosettacode.org เก็บถาวรจากต้นฉบับเมื่อวันที่ 26 มีนาคม 2023 เรียกดูเมื่อวันที่ 11 พฤศจิกายน 2020
  10. Garey & Johnson 1979
  • "ความสอดคล้อง" , สารานุกรมคณิตศาสตร์ , EMS Press , 2001 [1994]
  • ในบทความ เกี่ยวกับศิลปะแบบโมดูลาร์นี้ผู้อ่านจะได้เรียนรู้เพิ่มเติมเกี่ยวกับการประยุกต์ใช้เลขคณิตแบบโมดูลาร์ในงานศิลปะ
  • บทความ เกี่ยวกับการคำนวณแบบโมดูลาร์ในวิกิ ของ GIMPS
  • เลขคณิตแบบโมดูลาร์และรูปแบบในตารางการบวกและการคูณ
ดึงข้อมูลมาจาก " https://en.wikipedia.org/w/index.php?title=Modular_arithmetic&oldid=1363371229 "

สรุปเนื้อหา

ข้อมูลสำคัญจากบทความ

ข้อมูลสำคัญเกี่ยวกับ Modular arithmetic

In mathematics, modular arithmetic is a system of arithmetic operations for integers, differing from the usual ones in that numbers "wrap around" when reaching or exceeding a...

Motivating example

A familiar setting exhibiting modular arithmetic is the hour hand on a 12-hour clock . If the hour hand points to 7 now, then 8 hours later it will point to 3. Ordinary addition would result in 7 + 8 = 15 , but 15 reads as 3 on the clock face.

ความสอดคล้อง

กำหนดให้ จำนวนเต็ม m ≥ 1 เรียกว่า โมดูลัส จำนวนเต็ม a และ b สองจำนวนจะเรียกว่า สมมูลกัน ในโมดูลัส m ถ้าผลต่างของจำนวนเต็มทั้งสอง a − b เป็น จำนวนเต็มทวีคูณ ของ m กล่าวคือ ถ้ามีจำนวนเต็ม k ที่ทำให้

คุณสมบัติพื้นฐาน

ความสัมพันธ์แบบสอดคล้องกันนั้นตรงตามเงื่อนไขทั้งหมดของ ความสัมพันธ์แบบสมมูล :