Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: ecdsa123 on December 29, 2022, 11:24:19 AM



Title: mod n = 0 -> abstract math
Post by: ecdsa123 on December 29, 2022, 11:24:19 AM
To solve the equation x mod n = 0, we are looking for values of x that leave a remainder of 0 when divided by n.
This means that x is divisible by n.

One solution is simply x = 0, since 0 is divisible by any number.

Another solution is to find any multiple of n that is greater than or equal to 0. For example, if we take x = n, then x will be equal to n, which is a multiple of n. Similarly, if we take x = 2n, then x will be equal to twice n, which is also a multiple of n.

In general, the solution to the equation x mod n = 0 is given by x = kn, where k is an integer (positive, negative, or 0).

For example, in the case where n = 10, some solutions to the equation x mod n = 0 are:

    x = 0
    x = 10
    x = -10
    x = 20
    x = -20

And so on. There are infinitely many solutions to this equation.

Note that the value of n in this equation can be any positive integer. The solutions to the equation will depend on the value of n that you choose.


 


The expression x = k mod n is a modular congruence, which is a type of equation that involves taking the remainder of one number when it is divided by another number. In this case, the modular congruence states that x leaves a remainder of k when it is divided by n.

A modular congruence can be expanded by expressing it as a standard equation of the form x = kn + r, where k is the quotient when x is divided by n, and r is the remainder.

For example, consider the modular congruence x = 3 mod 5. This can be expanded as follows:

x = 3 mod 5
  = 5k + 3, where k is an integer

So, the solutions to the modular congruence x = 3 mod 5 are given by x = 5k + 3, where k is an integer (positive, negative, or 0).

Some examples of solutions are:

    x = 3
    x = 8
    x = -2
    x = 13
    x = -7

And so on. There are infinitely many solutions to this equation.

ok, as we see there are infinitely many solutions but with constant values.

we think in this example about remainder

but what about  quotient ??

edit:
added below:


The expression x = (n-1)*(k+1) mod n is a modular congruence, which is a type of equation that involves taking the remainder of one number when it is divided by another number. In this case, the modular congruence states that the remainder of (n-1)*(k+1) when it is divided by n is equal to x.

To solve this modular congruence for a specific value of x, you can substitute the given value of x into the equation and solve for k.

For example, consider the modular congruence x = (n-1)*(k+1) mod n where x = 3 and n = 5.
Substituting these values into the equation, we get:

3 = (5-1)*(k+1) mod 5
  = 4*(k+1) mod 5
  = 4k + 4 mod 5

Solving for k, we get:

k + 4 mod 5 = 3
4k + 1 mod 5 = 0
4k mod 5 = 4
k mod 5 = 1

Therefore, the value of k that satisfies the modular congruence `





Title: Re: mod n = 0 -> abstract math
Post by: NotATether on December 29, 2022, 06:37:30 PM
I never thought about modulo this way, to be honest.

I think this will work for huge numbers as well, because Bignum libraries have reasonably fast subtraction and division times. These are the inverse operations after you move n and +r to the LHS of the equation.


Title: Re: mod n = 0 -> abstract math
Post by: ecdsa123 on December 29, 2022, 07:04:39 PM
yes, it is working for huge numbers too..

what more it implict reduct "safety curve" below 128 bit.



Title: Re: mod n = 0 -> abstract math
Post by: NotATether on December 30, 2022, 06:49:45 AM
what more it implict reduct "safety curve" below 128 bit.

Mind explaining this part for us?


Title: Re: mod n = 0 -> abstract math
Post by: ecdsa123 on December 30, 2022, 11:01:01 AM
on by hand for small group my idea is working. (on the paper).

when I will implement in code , will try explain "what is in my mind".
difficult to explain without code. this is just abstact idea. but sometimes abstract idea is working.


Title: Re: mod n = 0 -> abstract math
Post by: NotATether on December 30, 2022, 11:46:30 AM
on by hand for small group my idea is working. (on the paper).

when I will implement in code , will try explain "what is in my mind".
difficult to explain without code. this is just abstact idea. but sometimes abstract idea is working.

It's just that I've never heard of a "safety curve" before, let alone a reduced one. Are you referring to the strength of the elliptic curve in bits i.e. the point coordinate size in memory?


Title: Re: mod n = 0 -> abstract math
Post by: ecdsa123 on December 30, 2022, 11:55:30 AM
yes,exactly. sorry for "not tech answered", I mean the strength of the elliptic curve in bits