(the question mark is the modulo operator)

a,b,x: positive integers.

\(\displaystyle x ? a = \frac{a}{b}\cdot(\frac{bx}{a} ? b)\)

- Thread starter brangelito
- Start date

(the question mark is the modulo operator)

a,b,x: positive integers.

\(\displaystyle x ? a = \frac{a}{b}\cdot(\frac{bx}{a} ? b)\)

\(\displaystyle \frac{a}{b}\cdot\left(\frac{bx}{a}?b\right)=g.\)

\(\displaystyle \frac{a}{b}\cdot\left(\frac{bx}{a}-bk\right)=\frac{a}{b}\cdot{b\frac{x-ak}{a}=g\)

\(\displaystyle g=x-ak\)

d=x-ak, g=x-ak, so d=g.

QED (?)

Hoempa

\(\displaystyle \frac{a}{b}\cdot\left(\frac{bx}{a}?b\right)=\frac{a}{b}\cdot\left(\frac{bx}{a}-bk\right)\)

Thanks!

Ah, now it is obvious. Thank you.Hoempa said:Maybe, I could make that more clear with an example.

23?7=2.

23=2*7*k. In this case, k=3. It is not neccesary to know k.

Is it more clear now?

Hoempa

\(\displaystyle k_1= k_2\)

where

\(\displaystyle k_1 = \lfloor \frac{x}{a} \rfloor\)

\(\displaystyle k_2 = \lfloor \frac{bx}{ab} \rfloor\)

Yeah, that's true.

Should be 2+7*k.Hoempa said:23=2*7*k

Well, it is obvious, that's what matters.

Hoempa

Hmm... in C * and / are of equal precedence, and that precedence block associates left-to-right. So the expression on the right is (a/b)*(((x*b)/a)%b).brangelito said:In C, I would write:

x % a == a/b * ((x * b/a) % b)

Now x, a, and b are integer variables, so / is integer division. So it is

\(\displaystyle \left\lfloor\frac ab\right\rfloor\cdot\left(\left\lfloor\frac{xb}{a}\right\rfloor\bmod b\right)\)

or

Code:

`a\b*(x*b\a%b)`

But these don't work: with (a, b, x) = (2, 1, 1)

\(\displaystyle \left\lfloor\frac 21\right\rfloor\cdot\left(\left\lfloor\frac{1\cdot1}{2}\right\rfloor\bmod 1\right)=2\cdot\left(0\bmod 1\right)=0\)

but

\(\displaystyle 1\bmod2=1\neq0\).

It doesn't matter, right?CRGreathouse said:Hmm... in C * and / are of equal precedence, and that precedence block associates left-to-right. So the expression on the right is (a/b)*(((x*b)/a)%b).brangelito said:In C, I would write:

x % a == a/b * ((x * b/a) % b)

\(\displaystyle x\cdot\frac{b}{a} = \frac{xb}{a}\)

Similar Math Discussions | Math Forum | Date |
---|---|---|

the distributive property on a fraction with a radical in it... | Algebra | |

proof of property | Linear Algebra | |

Prime number property | Number Theory | |

About property of triangle | Trigonometry |