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
Thread Post new topic Reply to topic
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
revolution wrote:
MHajduk wrote:
Our symbol n may be any positive integer number.
Right, so it is arbitrary. So I suggest that this cannot produce a specific result.
It can, it's how math works. Wink The given scheme can produce infinite number of correct answers for the arbitrary taken n.
Post 13 May 2012, 12:28
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
Can you give me an example of this working in practice? How can I test this at home?
Post 13 May 2012, 12:32
View user's profile Send private message Visit poster's website Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
revolution wrote:
How can I test this at home?
You can test it not only at home but also in the street, in the train or park. It only needs a sheet of paper and pencil / pen. Wink

Let the X be equal to 0. And let the n be equal to 256 (programmers like this number Wink ).

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.
Post 13 May 2012, 12:44
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
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?
Post 13 May 2012, 12:48
View user's profile Send private message Visit poster's website Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
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?
The given example tells us what goes with the number of chairs not with chairs themselves. Wink
Post 13 May 2012, 12:53
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
MHajduk wrote:
The given example tells us what goes with the number of chairs not with chairs themselves. Wink
I understand. But you didn't say what the thief steals. How does this fit with the puzzle?
Post 13 May 2012, 12:56
View user's profile Send private message Visit poster's website Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
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. Wink Razz

Yeah, a modular thief, that's good. Laughing
Post 13 May 2012, 13:02
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
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. Wink Razz

Yeah, a modular thief, that's good. Laughing
Hehe, I like that answer. Very funny.

Okay, so moving on. Anyone else would like have a try? Or would MHajduk like to have another try?
Post 13 May 2012, 13:06
View user's profile Send private message Visit poster's website Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
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 one-cent coins may be more worth as a material than one five-cent 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.

Wink
Post 13 May 2012, 13:16
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
Remember that thing X can be anything, not just money.
Post 13 May 2012, 13:19
View user's profile Send private message Visit poster's website Reply with quote
malpolud



Joined: 18 Jul 2011
Posts: 344
Location: Broken hippocampus
malpolud
You had 9 and now you have 010.
Post 02 Jun 2012, 14:25
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
malpolud wrote:
You had 9 and now you have 010.
What is the thief stealing here?
Post 02 Jun 2012, 14:27
View user's profile Send private message Visit poster's website Reply with quote
malpolud



Joined: 18 Jul 2011
Posts: 344
Location: Broken hippocampus
malpolud
Anything: money, moles of water, chairs Wink

E: he is stealing one quantity.
Post 02 Jun 2012, 14:28
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
malpolud wrote:
Anything: money, moles of water, chairs Wink
Okay, so how many chairs does the thief steal in your example?
Post 02 Jun 2012, 14:30
View user's profile Send private message Visit poster's website Reply with quote
malpolud



Joined: 18 Jul 2011
Posts: 344
Location: Broken hippocampus
malpolud
As mentioned in the edit: one chair.
Post 02 Jun 2012, 14:31
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
But 9-1=8 Question
Post 02 Jun 2012, 14:35
View user's profile Send private message Visit poster's website Reply with quote
malpolud



Joined: 18 Jul 2011
Posts: 344
Location: Broken hippocampus
malpolud
Exactly. 8 in octal numeral system Smile
Post 02 Jun 2012, 14:38
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
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."
Post 02 Jun 2012, 14:42
View user's profile Send private message Visit poster's website Reply with quote
malpolud



Joined: 18 Jul 2011
Posts: 344
Location: Broken hippocampus
malpolud
Right but it does meet point 0: "This one is for fun also, don't take it too seriously" Wink
Post 02 Jun 2012, 14:45
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
malpolud wrote:
Right but it does meet point 0: "This one is for fun also, don't take it too seriously" Wink
Agreed. Smile
Post 02 Jun 2012, 14:45
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3 ... 19, 20, 21 ... 24, 25, 26  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.