Minimal Fractional Representations of Integers mod M David Greve - - PowerPoint PPT Presentation

minimal fractional representations of integers mod m
SMART_READER_LITE
LIVE PREVIEW

Minimal Fractional Representations of Integers mod M David Greve - - PowerPoint PPT Presentation

Minimal Fractional Representations of Integers mod M David Greve ACL2 Workshop May, 2020 Integers mod M Whole numbers 0 .. M-1 Integers mod 17: Signed Representations Negative numbers: (- x) The number added to x to make zero


slide-1
SLIDE 1

Minimal Fractional Representations of Integers mod M

David Greve ACL2 Workshop May, 2020

slide-2
SLIDE 2

Integers mod M

  • Whole numbers 0 .. M-1
  • Integers mod 17:
slide-3
SLIDE 3

Signed Representations

  • Negative numbers: (- x)

– The number added to x to make zero (0) (mod M) – The number added to 7 to make zero (0) (mod 17)

  • 7 + 10 == 0 % 17
  • 10 == -7
  • 7 == -10

Is there a “best” signed representation for each number?

slide-4
SLIDE 4

Signed Representations

  • Negative numbers: (- x)

– The number added to x to make zero (0) (mod M) – The number added to 7 to make zero (0) (mod 17)

  • 7 + 10 == 0 % 17
  • 10 == -7
  • 7 == -10

Is there a “best” signed representation for each number?

slide-5
SLIDE 5

Reciprocals

  • Reciprocals: (1/x)

– The number multiplied by x to make one (1) (mod M)? – The number multiplied by 7 to make one (1) (mod 17)?

  • 7 * 5 = 1 % 17
  • 5 = 1/7
  • 7 = 1/5

– Not every x has a reciprocal mod M

slide-6
SLIDE 6

Fractional Representations

  • Fractional Representation (x ~= N/D) mod M

– x * D == N % M – Fractional Representations for 7 mod 17:

Is there a “best” fractional representation for each number?

slide-7
SLIDE 7

Farey Sequences

N1 + N2 D1 + D2 F3 =

N2*D1 – N1*D2 = 1 F1 = N1/D1 F2 = N2/D2 “Neighbors”

slide-8
SLIDE 8

Fractional Representations

  • Fractional Representation (x ~= N/D) mod M

– x * D == N % M – Fractional Representations for 7 mod 17:

Is there a “best” fractional representation for each number?

slide-9
SLIDE 9

Fractional Representations

  • Fractional Representation (x ~= N/D) mod M

– x * D == N % M – Fractional Representations for 7 mod 17:

Is there a “best” fractional representation for each number?

slide-10
SLIDE 10

Fractional Representations

  • Fractional Representation (x ~= N/D) mod M

– x * D == N % M – Fractional Representations for 7 mod 17:

Is there a “best” fractional representation for each number?

slide-11
SLIDE 11

Fractional Representations

  • Fractional Representation (x ~= N/D) mod M

– x * D == N % M – Fractional Representations for 7 mod 17:

Is there a “best” fractional representation for each number?

slide-12
SLIDE 12

Minimal Fractional Representation

  • A Fractional Representation is “minimal” if :

– No smaller denominator results in a smaller numerator

  • Sadly: Not sufficiently general
slide-13
SLIDE 13

Minimal Fractions Pair

X ~= X ~= N K P M (N < 0)

slide-14
SLIDE 14

Minimal Fractions Pair

X ~= X ~= N K P M (N < 0) No smaller denominator results in a numerator whose magnitude is smaller than the sum of the two numerator magnitudes

slide-15
SLIDE 15

Step Minimal Fractions Pair

X ~= X ~= N K P M X ~= N + P K + M

slide-16
SLIDE 16

Step Minimal Fractions Pair

X ~= X ~= N K P M X ~= N + P K + M

slide-17
SLIDE 17

Step Minimal Fractions Pair

X ~= X ~= N K P M X ~= N + P K + M

slide-18
SLIDE 18

Minimal Coefficient Bound

2/20/2020 9:30 pm 2/20/2020 6:30 pm

slide-19
SLIDE 19

Minimal Fractions mod 17

  • smallest maximum coefficient
  • smallest denominator
slide-20
SLIDE 20

Also a Floor Wax ..

  • Computes Modular Inverses/GCDs ..

– Generates Same “coefficients” as Euclidean Algorithm

  • If you use “division” instead of ”repeated subtraction”

– Like “Extended GCD”

  • All computations are in “M”
slide-21
SLIDE 21

.. and A Dessert Topping!

  • Performs Modular “Long Division”

– Traditionally “Division” means multiply by reciprocal

slide-22
SLIDE 22

Conclusion

  • Algorithm for finding minimal fractional representations

– Also performs long division!

  • Verified sqrt(M) bound on numerator/denominator
  • Culmination of Several Years of .. Contemplation