Become a part of the TranceAddict community!Frequently Asked Questions - Please read this if you haven'tSearch the forums
TranceAddict Forums > Main Forums > Chill Out Room > Smart?
Pages (12): « 1 2 3 4 5 6 7 8 9 10 [11] 12 »   Last Thread   Next Thread
Share
Author
Thread    Post A Reply
Resnick
Supreme tranceaddict



Registered: Feb 2003
Location: Toronto

sry i didnt read other answers to this question

but is it (A*B) - (A+B)??


___________________
it was the greatest feeling of nothingness i have ever experienced...

Old Post Oct-12-2003 20:41  Canada
Click Here to See the Profile for Resnick Click here to Send Resnick a Private Message Add Resnick to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Flyboy217
Senior tranceaddict



Registered: Aug 2003
Location: In DEEP SPACE... Space... space... sp...

quote:
Originally posted by Resnick
sry i didnt read other answers to this question

but is it (A*B) - (A+B)??


Yes, that's exactly correct . It's easy to find by just experimenting with small numbers. Now the trick is proving it.

DigiNut, I think it's actually easier to think of it without specifically using modular arithmetic. Basically, think about a value after which you know ALL values can be achieved, and work your way back. If you have some value x*A + y*B, then what does taking away one A and adding a B do to your value? You can obviously achieve all prices P where P%A = 0 and P%B = 0. How do you achieve the rest?

To be honest, my proof is inelegant... but it's still neat to figure out.

I'll explain more later. I'm currently making a mix

Old Post Oct-12-2003 20:52  United States
Click Here to See the Profile for Flyboy217 Click here to Send Flyboy217 a Private Message Add Flyboy217 to your buddy list Report this Post Reply w/Quote Edit/Delete Message
DigiNut
You kids get off my lawn!



Registered: Dec 2002
Location: Toronto, Self-proclaimed Centre of the Universe

quote:
Originally posted by Flyboy217
DigiNut, I think it's actually easier to think of it without specifically using modular arithmetic. Basically, think about a value after which you know ALL values can be achieved, and work your way back. If you have some value x*A + y*B, then what does taking away one A and adding a B do to your value? You can obviously achieve all prices P where P%A = 0 and P%B = 0. How do you achieve the rest?

Ok, here's one way of looking at it:

If you take A*B, you know that you have a number that's divisible by BOTH A and B (that is, P%A=0 and P%B=0 like you said). If A and B are relatively prime, you know the following things:
- (A+B)%A = B, and (A+B)%B = A. Therefore (A+B)%A > 0, and (A+B)%B > 0. (1)
- If you subtract A from (A*B), you cause the result to be indivisible by B (with a remainder of A). (2)
- If you again subtract B from this total, you cause it to be indivisible by A (with a remainder of B). (3)
- You know that the result after step (2) will not suddenly become divisible by B again after step (3), because of lemma (1).
- (A*B) - A - B = (A*B) - (A+B)
- Therefore, this number is guaranteed to be indivisible by both A and B.

Now, I know that (A*B) - (A+B) can be written as (A-1)(B-1) - 1. So the first value where you CAN make ANY price is (A-1)(B-1). I'm sure there's a way to prove that when you have (B-1) A's and (A-1) B's already, that you can generate prices in increments of exactly 1, but I haven't worked out exactly how yet.

Actually, that last part seems intuitive, but I'm just not sure how to spell it out...


___________________
My party schedule:
2009-02-21 - DJ Attention @ I'm So Popular
2009-06-18 - DJ Annoying @ People Need To Know Where I'll Be
2012-11-32 - DJ Insufferable ɸ Or At Least the Stalkers I Complain About
2048-06-66 - Spastic & Whocares Although I'm Actually Flattered
9999-45-81 - Tweaker Gimp I Probably Won't Even Go To This But I Have To Make Sure I Fill Up All The Available Space Here

Last edited by DigiNut on Oct-12-2003 at 21:30

Old Post Oct-12-2003 21:24  Canada
Click Here to See the Profile for DigiNut Click here to Send DigiNut a Private Message Add DigiNut to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Flyboy217
Senior tranceaddict



Registered: Aug 2003
Location: In DEEP SPACE... Space... space... sp...

quote:
Originally posted by DigiNut
Ok, here's one way of looking at it:

If you take A*B, you know that you have a number that's divisible by BOTH A and B (that is, P%A=0 and P%B=0 like you said). If A and B are relatively prime, you know the following things:
- (A+B)%A = B, and (A+B)%B = A. Therefore (A+B)%A > 0, and (A+B)%B > 0. (1)
- If you subtract A from (A*B), you cause the result to be indivisible by B (with a remainder of A). (2)
- If you again subtract B from this total, you cause it to be indivisible by A (with a remainder of B). (3)
- You know that the result after step (2) will not suddenly become divisible by B again after step (3), because of lemma (1).
- (A*B) - A - B = (A*B) - (A+B)
- Therefore, this number is guaranteed to be indivisible by both A and B.

Now, I know that (A*B) - (A+B) can be written as (A-1)(B-1) - 1. So the first value where you CAN make ANY price is (A-1)(B-1). I'm sure there's a way to prove that when you have (B-1) A's and (A-1) B's already, that you can generate prices in increments of exactly 1, but I haven't worked out exactly how yet.

Actually, that last part seems intuitive, but I'm just not sure how to spell it out...


First, some notation: A%x=0 is properly written as A = 0 (mod x), read "A is congruent to zero, modulo x". (Actually, the congruency sign properly has three bars, not two...)

It's true that AB-A-B is indivisible by both A and B. This can be proven by noting that AB=0 mod A and mod B, and therefore only numbers different from AB by a multiple of A are congruent to 0 mod A (and similarly for B).

What's important is that AB-A-B is not a positive linear combination of A and B though. I'll write up an explanation when I get a chance. You're thinking along the right lines though...

Old Post Oct-12-2003 22:39  United States
Click Here to See the Profile for Flyboy217 Click here to Send Flyboy217 a Private Message Add Flyboy217 to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Flyboy217
Senior tranceaddict



Registered: Aug 2003
Location: In DEEP SPACE... Space... space... sp...

Okay. This is the ugliest, dirtiest proof I've ever written. If you don't follow it, props to you for not being f*ed in the head...

------
Call a price "attainable" if you can purchase an item of that price with exact change.

Using 0 of coin B and as many of coin A as we need, We can attain all prices C where C = 0 (mod A) (i.e., all multiples of A) starting with C = 0*B.

Using 1 of coin B and as many of coin A as we need, we can attain all prices C = xA + B. I.e., we can attain all prices C where C = B (mod A) starting with C = 1*B.

Using at most y of coin B, we can attain all prices C where C = {0*B, 1*B, ..., y*B} mod A.

Note that n*B mod A are distinct for all 0 <= n <= A-1. Thus, we can attain all prices greater than or equal to C = (A-1)B that have the same congruency as (A-1)B mod A.

Hence, (A-1)(B)-A is not attainable (since (A-1)B = (A-1)B-A (mod A) and (A-1)B is the smallest price congruent to (A-1)B mod A that is attainable). However, (A-1)B-A+1 is attainable, because it is congruent to a value other than (A-1) mod A, all other congruencies have been satisfied, and it is greater than (A-2)B (which was the last satsified congruency).

Therefore, (A-1)B - A + 1 = (A-1)(B-1) is the smallest value for which all prices greater than or equal to it can be satisfied.
-
||
-

Old Post Oct-12-2003 23:30  United States
Click Here to See the Profile for Flyboy217 Click here to Send Flyboy217 a Private Message Add Flyboy217 to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Resnick
Supreme tranceaddict



Registered: Feb 2003
Location: Toronto

^^ why prove something, when you can just write a program in c to do it for you


___________________
it was the greatest feeling of nothingness i have ever experienced...

Old Post Oct-13-2003 01:35  Canada
Click Here to See the Profile for Resnick Click here to Send Resnick a Private Message Add Resnick to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Flyboy217
Senior tranceaddict



Registered: Aug 2003
Location: In DEEP SPACE... Space... space... sp...

quote:
Originally posted by Resnick
^^ why prove something, when you can just write a program in c to do it for you


Amazing! A program that solves for ALL the integers? I want it!

Old Post Oct-13-2003 14:51  United States
Click Here to See the Profile for Flyboy217 Click here to Send Flyboy217 a Private Message Add Flyboy217 to your buddy list Report this Post Reply w/Quote Edit/Delete Message
DigiNut
You kids get off my lawn!



Registered: Dec 2002
Location: Toronto, Self-proclaimed Centre of the Universe

quote:
Originally posted by Flyboy217
Amazing! A program that solves for ALL the integers? I want it!

code:
#include void main() { int a, b; scanf("%d %d", &a, &b); printf("%d", (a-1)*(b-1) - 1); return; }



___________________
My party schedule:
2009-02-21 - DJ Attention @ I'm So Popular
2009-06-18 - DJ Annoying @ People Need To Know Where I'll Be
2012-11-32 - DJ Insufferable ɸ Or At Least the Stalkers I Complain About
2048-06-66 - Spastic & Whocares Although I'm Actually Flattered
9999-45-81 - Tweaker Gimp I Probably Won't Even Go To This But I Have To Make Sure I Fill Up All The Available Space Here

Old Post Oct-14-2003 00:43  Canada
Click Here to See the Profile for DigiNut Click here to Send DigiNut a Private Message Add DigiNut to your buddy list Report this Post Reply w/Quote Edit/Delete Message
drizzt81
Professional Lamer



Registered: Nov 2001
Location: GTA #1 - At work

quote:
Originally posted by DigiNut
code:
#include void main() { int a, b; scanf("%d %d", &a, &b); printf("%d", (a-1)*(b-1) - 1); return; }


\
that will fail as soon as a or b are >2^32 on x86 or 2^64 on 64 bit machines.. or 2^128 on 128 bit machines.. well you get my idea, there are integers much bigger than 2^n for n in [0,infinity)


___________________

get font

I see your 4 Crushs and raise you 3 As The Rush Comes. - Yan from PvD's first summerstage event in '03

Old Post Oct-14-2003 01:05  Germany
Click Here to See the Profile for drizzt81 Click here to Send drizzt81 a Private Message Add drizzt81 to your buddy list Report this Post Reply w/Quote Edit/Delete Message
DigiNut
You kids get off my lawn!



Registered: Dec 2002
Location: Toronto, Self-proclaimed Centre of the Universe

quote:
Originally posted by drizzt81
\
that will fail as soon as a or b are >2^32 on x86 or 2^64 on 64 bit machines.. or 2^128 on 128 bit machines.. well you get my idea, there are integers much bigger than 2^n for n in [0,infinity)

Oh bloody hell, I didn't realize we were getting technical here.

Fine, just set up two linked lists to perform the multiplication, then it will only fail when it runs out of memory. Sure, that's not infinite, but I'd be willing to bet that you'd spend the rest of your life typing in a set of numbers that would cause it to run out of memory.


___________________
My party schedule:
2009-02-21 - DJ Attention @ I'm So Popular
2009-06-18 - DJ Annoying @ People Need To Know Where I'll Be
2012-11-32 - DJ Insufferable ɸ Or At Least the Stalkers I Complain About
2048-06-66 - Spastic & Whocares Although I'm Actually Flattered
9999-45-81 - Tweaker Gimp I Probably Won't Even Go To This But I Have To Make Sure I Fill Up All The Available Space Here

Old Post Oct-14-2003 01:10  Canada
Click Here to See the Profile for DigiNut Click here to Send DigiNut a Private Message Add DigiNut to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Flyboy217
Senior tranceaddict



Registered: Aug 2003
Location: In DEEP SPACE... Space... space... sp...

quote:
Originally posted by DigiNut
Oh bloody hell, I didn't realize we were getting technical here.

Fine, just set up two linked lists to perform the multiplication, then it will only fail when it runs out of memory. Sure, that's not infinite, but I'd be willing to bet that you'd spend the rest of your life typing in a set of numbers that would cause it to run out of memory.


Hmm... somehow I think he's just trying to point out that any machine must fail when trying to validate an infinite number of inputs. Then again, computers are currently crucial in solving the four-color theorem, so I wont bash them too much.

It also brings up an interesting point from cognitive science about why humans can seemingly use reasoning that seems to be outside of the bounds of Turing machines...

Old Post Oct-14-2003 14:45  United States
Click Here to See the Profile for Flyboy217 Click here to Send Flyboy217 a Private Message Add Flyboy217 to your buddy list Report this Post Reply w/Quote Edit/Delete Message
DigiNut
You kids get off my lawn!



Registered: Dec 2002
Location: Toronto, Self-proclaimed Centre of the Universe

quote:
Originally posted by Flyboy217
Then again, computers are currently crucial in solving the four-color theorem, so I wont bash them too much.

I know we've gotten off-topic, but what is that?


___________________
My party schedule:
2009-02-21 - DJ Attention @ I'm So Popular
2009-06-18 - DJ Annoying @ People Need To Know Where I'll Be
2012-11-32 - DJ Insufferable ɸ Or At Least the Stalkers I Complain About
2048-06-66 - Spastic & Whocares Although I'm Actually Flattered
9999-45-81 - Tweaker Gimp I Probably Won't Even Go To This But I Have To Make Sure I Fill Up All The Available Space Here

Old Post Oct-14-2003 15:33  Canada
Click Here to See the Profile for DigiNut Click here to Send DigiNut a Private Message Add DigiNut to your buddy list Report this Post Reply w/Quote Edit/Delete Message

TranceAddict Forums > Main Forums > Chill Out Room > Smart?
Post New Thread    Post A Reply

Pages (12): « 1 2 3 4 5 6 7 8 9 10 [11] 12 »  
Last Thread   Next Thread
Click here to listen to the sample!Pause playbackWhat's the name of this track(from Mauro Picotto live meganite to pName of this track [2007] [3]

Click here to listen to the sample!Pause playbackSyntone - Cant Believe It (Silverblue Remix) [2002]

Show Printable Version | Subscribe to this Thread
Forum Jump:

All times are GMT. The time now is 00:04.

Forum Rules:
You may not post new threads
You may not post replies
You may not edit your posts
HTML code is ON
vB code is ON
[IMG] code is ON
 
Search this Thread:

 
Contact Us - return to tranceaddict

Powered by: Trance Music & vBulletin Forums
Copyright ©2000-2026, Jelsoft Enterprises Ltd.
Privacy Statement / DMCA
Support TA!