Mod Function Inverse: Exploring Floor Function

In summary, the conversation discusses the possibility of finding an inverse function for the floor function, using different formulas such as the arc tangent and cotangent, and solving equations involving the mod function. The conclusion is that it is not possible to find an inverse function for the floor function, and it is better to approach problems involving the mod function using logical thinking rather than manipulating formulas. The original poster's goal is to solve these types of problems for enjoyment.
  • #1
flouran
64
0
Hi Guys,
I was wondering, 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.
 
Mathematics news on Phys.org
  • #3
Ok, so if I have (2x)mod(x+1) = 9, then can't I find x?
Can't I find x by saying that, [tex]2x-(x+1)(Floor[\frac{2x}{x+1}])=9[/tex]
Equivalently, [tex]2x-(x+1)(-1/2 + \frac{2x}{x+1} + \frac{ArcTan(Cot(\pi (\frac{2x}{x+1})))}{\pi} )=9[/tex].

Thus, can't I solve for x from there?
 
Last edited:
  • #4
I invite you to try to find an inverse of
[tex]\operatorname{floor}(x) = -1/2 + x + \frac{\arctan(\cot \pi x)}{\pi}.[/tex]
Hint: you can't, because multiple values of x correspond to the same floor value.

If you're trying to solve 2x mod x + 1 = 9, you're approaching the problem in completely the wrong way. Instead of just writing out expressions for the mod function, why not use your brain?

For example: In general, 0 ≤ x mod y < y. Thus, in that equation, 2x mod x + 1 = 9 < x + 1, so x > 8. Then, x + 1 < 2x < 2(x + 1), which means that 2x mod x + 1 = 2x - (x + 1) = 9. Solving that gives x = 10. Notice that there is a unique solution to the equation.

Your formula isn't even right; the correct one is this: a mod n = a - n floor(a / n).
 
  • #5
I don't mean to be rude, adriank, but when you said, "Your formula isn't even right; the correct one is this: a mod n = a - n floor(a / n).", using the word "this" without a noun following it is grammatically incorrect. Thus, if you really want to help someone out, try to utilize a more eloquent tone, but most importantly, know your grammatical dogma well.
 
  • #6
I'm sorry if my tone isn't very nice, and I don't mean to be rude either, but it does get a little frustrating when, after attempting to explain numerous times, you just don't understand that what can't be done can't be done, no matter how cleverly you try and go about doing it. If you have a function that gives the same value for multiple inputs, there is no way of defining its inverse function, no matter how you write the function.

If you're trying to get Mathematica or similar to solve something for you, you have to know how to interpret the result. Just because it can give you something using just trigonometric functions doesn't mean you can use those blindly; you have to be aware that what it gives you depends crucially on the fact that arctan is really a multi-valued function, and the particular function ArcTan in Mathematica uses its principal value, so in that sense ArcTan is not a true inverse of Tan. If you really do try to manipulate expressions such as ArcTan[Cot[x]], you have to be extremely careful. (ArcTan[Cot[x]] is the same as ArcTan[Tan[Pi/2 - x]], which is in general not Pi/2 - x, because Tan is not one-to-one.)

I'm really just trying to deter you from trying to express, say, the floor function as some other thing involving trigonometric or exponential functions and whatnot, since they are typically much less useful (and harder to work with). In your question (solve 2x mod x + 1 = 9), you might be able to get somewhere by rewriting it as 2x - (x + 1)floor(2x / (x + 1)) = 9, but making a bigger mess out of it by rewriting floor using arctan and cot isn't going to help you solve it.

As for my grammar, there is a noun following "this", and that is the equation. Regardless, even if you find that grammatically strange, there is no chance of misunderstanding and it's still very clear. I could have picked apart your grammar in many places, but I didn't because it would be quite irrelevant to the discussion.

I'm sorry if I was rude in my last post. I was just trying to get you see that there are better ways of approaching problems like that.

I'm kind of curious: what's your goal with writing out the floor function, etc. in terms of other functions?
 
  • #7
An equation is not a noun, it is an expression that equates two or more ideas with one another. Besides, a noun is a linguistic concept not a mathematical one.

Regardless, I am sorry for getting somewhat frustrated with you. I am not stupid; I do realize that expressing the mod function in terms of the floor function and then expressing the floor function in terms of the trigonometric function is difficult (not to mention impractical).

Thus, do not take it the wrong way, I am not mad at you. In fact, I am thankful that you have been willing to help me. It's just that I want to be able to solve for problems such as, (2x)mod(x+1) = 9, and it has become so frustrating for me. I sincerely apologize for my behavior.

Now, back to the math. The main reason why I want to solve such problems is for fun. I enjoy mathematics. Also, I may have incorrectly worded my last post. I don't mean to find the inverse of the floor or mod functions (because they do not pass the vertical line test and therefore aren't one-to-one), but I just thought that by representing the mod function in terms of the floor function and then representing the floor function as trigonometric function, I can solve for x (without having to find the inverse function).

I guess that's my logic behind this whole problem, and again, I am sorry if I came off angry at you. I am frustrated with the problem, not you.
 

1. What is the purpose of the Mod Function Inverse?

The Mod Function Inverse is used to solve equations that involve the Mod Function. It allows us to find the original values that were used to get a given result after applying the Mod Function.

2. How is the Floor Function related to the Mod Function Inverse?

The Floor Function is closely related to the Mod Function Inverse because it is often used in conjunction with the Mod Function to determine the remainder of a division operation. The Floor Function rounds a number down to the nearest integer, which can be useful when working with the Mod Function.

3. Can the Mod Function Inverse be used with negative numbers?

Yes, the Mod Function Inverse can be used with negative numbers. The result will still be the original value before the Mod Function was applied, regardless of whether the number is positive or negative.

4. What are some real-life applications of the Mod Function Inverse?

The Mod Function Inverse is commonly used in computer programming to calculate the remainder of a division operation. It can also be used in fields such as cryptography and signal processing to extract information from a given result.

5. Are there any limitations to using the Mod Function Inverse?

One limitation of the Mod Function Inverse is that it can only be used to find the original value if the Mod Function was applied to a single number. If the Mod Function was applied to an equation with multiple variables, it cannot be used to find the original values of each variable.

Similar threads

Replies
3
Views
220
Replies
17
Views
2K
Replies
4
Views
410
Replies
5
Views
845
Replies
9
Views
2K
Replies
3
Views
705
  • General Math
Replies
4
Views
1K
Replies
2
Views
681
  • General Math
Replies
33
Views
2K
Replies
2
Views
1K
Back
Top