Chinese remainder theorem and Diophantine equation implementation
up vote
0
down vote
favorite
I needed an advise on implementing and solving one problem and the others like. I came across two sentences that I think will be helpful. Those are the Chinese remainder theorem and the Diofantic equation, but I do not know exactly how do I apply them to the problem.
Let me introduce this problem f.e. on the sewer pipe, I will try to describe it as a verbal task:
We need to design a sewer pipeline with an exact length of 127 m. We have tubes from 3 different suppliers. Each supplier produces tubes of different fixed lengths that can not be shortened or extended in any way:
first supplier: 12 m
second supplier: 8 m
third supplier: 10 m
At the beginning of the pipeline and at the end of the pipeline there must be bridging pipes having a length of 3 m. Between each and every tube must also be a bridging pipe.
To illustrate this, we'll show the lengths as variables:
(first supplier) X = 12 m
(second supplier) Y = 8 m
(third supplier) Z = 10 m
(bridging pipe) A = 3 m
Therefore, the scheme would be something like this:
A Y A Y A Y A Y A Z A X A X A
We ask how many tubes do we need to order from every supplier and how many solutions there are? Consider these solutions as a number of different admissible orders (one solution may look like f.e from the first sup. we'll order 5, from the second 3 and from the third 7). The bridging pipes are always sufficient and there is no need to order them in any ocasion.
How do you solve this problem? What algorithm can you use to simply achieve the expected results in similar tasks? I recall that the solution that I do not want is the gradual testing and gradual addition, those are naive solutions, I'm looking for an effective algorithm using Chinese remainder theorem or Diophantine equation.
Thanks.
algorithms diophantine-equations chinese-remainder-theorem
add a comment |
up vote
0
down vote
favorite
I needed an advise on implementing and solving one problem and the others like. I came across two sentences that I think will be helpful. Those are the Chinese remainder theorem and the Diofantic equation, but I do not know exactly how do I apply them to the problem.
Let me introduce this problem f.e. on the sewer pipe, I will try to describe it as a verbal task:
We need to design a sewer pipeline with an exact length of 127 m. We have tubes from 3 different suppliers. Each supplier produces tubes of different fixed lengths that can not be shortened or extended in any way:
first supplier: 12 m
second supplier: 8 m
third supplier: 10 m
At the beginning of the pipeline and at the end of the pipeline there must be bridging pipes having a length of 3 m. Between each and every tube must also be a bridging pipe.
To illustrate this, we'll show the lengths as variables:
(first supplier) X = 12 m
(second supplier) Y = 8 m
(third supplier) Z = 10 m
(bridging pipe) A = 3 m
Therefore, the scheme would be something like this:
A Y A Y A Y A Y A Z A X A X A
We ask how many tubes do we need to order from every supplier and how many solutions there are? Consider these solutions as a number of different admissible orders (one solution may look like f.e from the first sup. we'll order 5, from the second 3 and from the third 7). The bridging pipes are always sufficient and there is no need to order them in any ocasion.
How do you solve this problem? What algorithm can you use to simply achieve the expected results in similar tasks? I recall that the solution that I do not want is the gradual testing and gradual addition, those are naive solutions, I'm looking for an effective algorithm using Chinese remainder theorem or Diophantine equation.
Thanks.
algorithms diophantine-equations chinese-remainder-theorem
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I needed an advise on implementing and solving one problem and the others like. I came across two sentences that I think will be helpful. Those are the Chinese remainder theorem and the Diofantic equation, but I do not know exactly how do I apply them to the problem.
Let me introduce this problem f.e. on the sewer pipe, I will try to describe it as a verbal task:
We need to design a sewer pipeline with an exact length of 127 m. We have tubes from 3 different suppliers. Each supplier produces tubes of different fixed lengths that can not be shortened or extended in any way:
first supplier: 12 m
second supplier: 8 m
third supplier: 10 m
At the beginning of the pipeline and at the end of the pipeline there must be bridging pipes having a length of 3 m. Between each and every tube must also be a bridging pipe.
To illustrate this, we'll show the lengths as variables:
(first supplier) X = 12 m
(second supplier) Y = 8 m
(third supplier) Z = 10 m
(bridging pipe) A = 3 m
Therefore, the scheme would be something like this:
A Y A Y A Y A Y A Z A X A X A
We ask how many tubes do we need to order from every supplier and how many solutions there are? Consider these solutions as a number of different admissible orders (one solution may look like f.e from the first sup. we'll order 5, from the second 3 and from the third 7). The bridging pipes are always sufficient and there is no need to order them in any ocasion.
How do you solve this problem? What algorithm can you use to simply achieve the expected results in similar tasks? I recall that the solution that I do not want is the gradual testing and gradual addition, those are naive solutions, I'm looking for an effective algorithm using Chinese remainder theorem or Diophantine equation.
Thanks.
algorithms diophantine-equations chinese-remainder-theorem
I needed an advise on implementing and solving one problem and the others like. I came across two sentences that I think will be helpful. Those are the Chinese remainder theorem and the Diofantic equation, but I do not know exactly how do I apply them to the problem.
Let me introduce this problem f.e. on the sewer pipe, I will try to describe it as a verbal task:
We need to design a sewer pipeline with an exact length of 127 m. We have tubes from 3 different suppliers. Each supplier produces tubes of different fixed lengths that can not be shortened or extended in any way:
first supplier: 12 m
second supplier: 8 m
third supplier: 10 m
At the beginning of the pipeline and at the end of the pipeline there must be bridging pipes having a length of 3 m. Between each and every tube must also be a bridging pipe.
To illustrate this, we'll show the lengths as variables:
(first supplier) X = 12 m
(second supplier) Y = 8 m
(third supplier) Z = 10 m
(bridging pipe) A = 3 m
Therefore, the scheme would be something like this:
A Y A Y A Y A Y A Z A X A X A
We ask how many tubes do we need to order from every supplier and how many solutions there are? Consider these solutions as a number of different admissible orders (one solution may look like f.e from the first sup. we'll order 5, from the second 3 and from the third 7). The bridging pipes are always sufficient and there is no need to order them in any ocasion.
How do you solve this problem? What algorithm can you use to simply achieve the expected results in similar tasks? I recall that the solution that I do not want is the gradual testing and gradual addition, those are naive solutions, I'm looking for an effective algorithm using Chinese remainder theorem or Diophantine equation.
Thanks.
algorithms diophantine-equations chinese-remainder-theorem
algorithms diophantine-equations chinese-remainder-theorem
edited Nov 17 at 22:08
Key Flex
6,97431229
6,97431229
asked Nov 17 at 21:57
jirick
11
11
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3002865%2fchinese-remainder-theorem-and-diophantine-equation-implementation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown