Is There a Formula for the Inverse of the Mod Function?

In summary: Thank you!In summary, the homework statement is asking for an inverse function of the mod function, but there is no such thing. The function given is the same for all values of x.
  • #1
alec_tronn
29
0

Homework Statement


Let S be the subset of the integers {0, 1, 2, 3, 4, 5, 6}, and let f be the function from S to S defined by f(x) = (4x+3) mod 7. Find a formula for f<superscript>-1 (the inverse of f, I don't know how to type that).


Homework Equations


I know that the mod function is defined by floor function (a - n floor(n\a). But I'm still unable to create an inverse function with one inverse function for all values. I made a piecewise function that works for those values, but I feel like there should be a better method. Does anybody know an inverse rule for either floor or modulus?


The Attempt at a Solution


f(x) = {2x+1, 0 <= x <= 2}
{2x-6, 3 <= x <= 6}
 
Physics news on Phys.org
  • #2
The 'mod' function? There is no such thing.

mod is not a function.

Just do it as for any other function:

y=4x+3, hence x= (y-3)/4, so what is division by 4 in mod 7 arithmetic?
 
  • #3
The first thing you should do is calculate the actual values of f:
f(0)= 4(0)+ 3= 3. f(1)= 4(1)+ 3= 7= 0 mod 7. f(2)= 4(2)+ 3= 11= 4 mod 7.
f(3)= 4(3)+ 3= 15= 1 mod y. f(4)= 4(4)+ 3= 19= 5 mod 7. f(5)= 4(5)+ 3= 23= 2 mod 7. f(6)= 4(6)+ 3= 27= 6 mod 7

So you want f-1(0)= 1, f-1(1)= 3, f-1(2)= 5, f-1(3)= 0, f-1(4)= 2, f-1(5)= 4, f-1(6)= 6.

Yes, that's exactly what your function gives. Good work! That is, by the way, a single "function" and I have no problem with it. However, you might remember that -6 is 1 in mod 7. Since the first formula was given "mod 7" why not do the same with this:
f-1(x)= 2x+ 1 (mod 7) or f-1(x)= 2x- 6 (mod 7)
They are exactly the same.
 
  • #4
matt grime said:
The 'mod' function? There is no such thing.

mod is not a function.

My apologies... mod "operator" (or modulo operator); I was just asking if there was an inverse operator that I could use so I could switch the x and y variables and solve for x instead of switching the values around and making an entirely new function.


HallsofIvy said:
Yes, that's exactly what your function gives. Good work! That is, by the way, a single "function" and I have no problem with it. However, you might remember that -6 is 1 in mod 7. Since the first formula was given "mod 7" why not do the same with this:
f-1(x)= 2x+ 1 (mod 7) or f-1(x)= 2x- 6 (mod 7)
They are exactly the same.

Thanks a lot! I'm not sure that putting the (mod 7)'s in there like that truly give any more information, although I see how it looks more related to the beginning function, and I see how your solution and mine are equivalent. I'm not sure what I'll end up submitting. Thanks again.
 
  • #5
I was wondering, though, since (a)mod(n) can be written in terms of the floor function, thus [tex] a - n Floor[\frac{n}{a}],[/tex] and therefore, can't we describe the floor function as an invertible function? I know that [tex]Floor[x] = -1/2 + x + \frac{ArcTan(Cot(\pi x))}{\pi} [/tex]. Thus, can't we inverse this formula? Furthermore, there is another idea that works on any function, but deals with sets. In general, given a function f: A → B and a subset S of B, then f-1(S) = {x ∈ A | f(x) ∈ S}. In the case of the floor function, if n is an integer, then floor-1({n}) = [n, n + 1). Note that these are sets, not numbers.

Please let me know as I am saying these things right off of the top of my head.
 
Last edited:

1. What is the inverse of a mod function?

The inverse of a mod function is the value that, when used as the modulus, returns the original value when applied to the original input.

2. How do you find the inverse of a mod function?

To find the inverse of a mod function, you can use the Extended Euclidean algorithm, which calculates the greatest common divisor of two numbers and their coefficients. The inverse can also be found by using modular arithmetic and solving for the unknown value.

3. Can the inverse of a mod function be a decimal or fraction?

Yes, the inverse of a mod function can be a decimal or fraction. In modular arithmetic, the result of a mod function is always an integer, but the inverse can be a non-integer value.

4. What is the purpose of finding the inverse of a mod function?

The inverse of a mod function is useful in solving equations in modular arithmetic, as well as in cryptography and coding theory. It allows for the decryption of messages encrypted using modular arithmetic operations.

5. Is the inverse of a mod function always unique?

In most cases, the inverse of a mod function is unique. However, if the modulus and the input value are not relatively prime, meaning they share a common factor, the inverse may not be unique. In such cases, there can be multiple values that satisfy the inverse mod function.

Similar threads

  • Calculus and Beyond Homework Help
Replies
5
Views
221
  • Calculus and Beyond Homework Help
Replies
3
Views
1K
  • Calculus and Beyond Homework Help
Replies
12
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
543
  • Calculus and Beyond Homework Help
Replies
31
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
569
  • Calculus and Beyond Homework Help
Replies
6
Views
852
  • Calculus and Beyond Homework Help
Replies
1
Views
503
  • Calculus and Beyond Homework Help
Replies
13
Views
3K
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
Back
Top