flat assembler
Message board for the users of flat assembler.
Index
> Heap > Numerical oddities Goto page Previous 1, 2, 3 ... 19, 20, 21 ... 24, 25, 26 Next 
Author 

revolution
Can you give me an example of this working in practice? How can I test this at home?


13 May 2012, 12:32 

MHajduk
revolution wrote: How can I test this at home? Let the X be equal to 0. And let the n be equal to 256 (programmers like this number ). We know that X is congruent to 256 modulo 256 X ≡ 256 (mod 256) i.e. gives the same rest as 0 when you divide it by 256. We have a trivial congruence 3 ≡ 3 (mod 256) (this number may be also any other between 1 and 255). Because we can subtract congruences one from another, so X  3 ≡ 256  3 (mod 256) so X  3 gives the same rest as 253 modulo 256. And consequently, after subtraction we have the greater rest than it was initially, because 253 > 0 = X. 

13 May 2012, 12:44 

revolution
I know how modulo works, but I can't get how this works if thing X is, say, a chair? What does the thief steal in that situation?


13 May 2012, 12:48 

MHajduk
revolution wrote: I know how modulo works, but I can't get how this works if thing X is, say, a chair? What does the thief steal in that situation? 

13 May 2012, 12:53 

revolution
MHajduk wrote: The given example tells us what goes with the number of chairs not with chairs themselves. 

13 May 2012, 12:56 

MHajduk
We have to imagine such a strange thief who always "steals modulo n", so if there would be a negative number of chairs after the theft, he / she should bring so many chairs that fit the proper rest modulo n.
Yeah, a modular thief, that's good. 

13 May 2012, 13:02 

revolution
MHajduk wrote: We have to imagine such a strange thief who always "steals modulo n", so if there would be a negative number of chairs after the theft, he / she should bring so many chairs that fit the proper rest modulo n. Okay, so moving on. Anyone else would like have a try? Or would MHajduk like to have another try? 

13 May 2012, 13:06 

MHajduk
Another try, about money.
There is a well known fact that coins with the low nominal are less worth than a material (alloy) they are made of. So four onecent coins may be more worth as a material than one fivecent coin. Assume that the thief steals 4 cents, leaves 5 cents. You have more money, the thief has more money too if he is interested in the material the coins are made of. 

13 May 2012, 13:16 

revolution
Remember that thing X can be anything, not just money.


13 May 2012, 13:19 

malpolud
You had 9 and now you have 010.


02 Jun 2012, 14:25 

revolution
malpolud wrote: You had 9 and now you have 010. 

02 Jun 2012, 14:27 

malpolud
Anything: money, moles of water, chairs
E: he is stealing one quantity. 

02 Jun 2012, 14:28 

revolution
malpolud wrote: Anything: money, moles of water, chairs 

02 Jun 2012, 14:30 

malpolud
As mentioned in the edit: one chair.


02 Jun 2012, 14:31 

revolution
But 91=8


02 Jun 2012, 14:35 

malpolud
Exactly. 8 in octal numeral system


02 Jun 2012, 14:38 

revolution
But 010 (oct) < 9 (dec). Fails to meet point three: "3. Now I have more of thing X than I had before the thief came along."


02 Jun 2012, 14:42 

malpolud
Right but it does meet point 0: "This one is for fun also, don't take it too seriously"


02 Jun 2012, 14:45 

revolution
malpolud wrote: Right but it does meet point 0: "This one is for fun also, don't take it too seriously" 

02 Jun 2012, 14:45 

Goto page Previous 1, 2, 3 ... 19, 20, 21 ... 24, 25, 26 Next < Last Thread  Next Thread > 
Forum Rules:

Copyright © 19992020, Tomasz Grysztar.
Powered by rwasa.