# find x value in modular equation

## Recommended Posts

Hello

I put this question in general section as it has something to do  with math :

x modulo 20 = 33 . How to get  the value of x  ?  any help  would be appreciated

##### Share on other sites

x modulo 20 should always be a number smaller than 20. Since 33 is greater than 20 that equation is false. I'll be using "%" as a shorthand for modulo since most programming languages do that.

If you ask me how to find a number that satisfies the equation x % 20 = k, I'd go by the definition that the modulo is the remainder of the division. This means that the equation can be rewritten as this: (x - k) / 20 = n, where n is any natural number. Solving for x you would get x = 20 * n + k. There are as many solutions as values of n. Since there are infinite natural numbers there are infinite solutions. Since k cannot possibly have 33 as a value, here are a few solutions for k = 10 instead:

• 30 % 20 = 10
• 50 % 20 = 10
• 70 % 20 = 10
• 150 % 20 = 10
• 1

##### Share on other sites

wonderful , thank you very much

## Create an account

Register a new account