Hello, what is the need to write an algorithm to solve an equation of the form ax + by + cz = n, where a, b, c and n are known?
Closed due to the fact that the question is too general for the participants Dmitriy Simushev , sercxjo , Vladimir Martyanov , VenZell , user194374 15 Feb '16 at 13:58 .
Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .
- oneNo. To uniquely solve a problem with three unknowns, three equations are needed. Learn mat. part. - Dmitriy Simushev
- Brute force algorithm x, y, z. Only solutions will be many. - Vladimir Martyanov
- @ Vladimir Martianov, formally, in the current formulation, the number of solutions is an infinite set. - Dmitriy Simushev February
- @ Vladimir Martiyanov could you send it? - droft1312
- one@ droft1312 write it for you and just send it to you? No, thanks. - Vladimir Martyanov
1 answer
Since in your equation ( ax + by + cz = n ) there are 3 unknowns, you need at least 2 more equations to solve, i.e. In fact, you should have a system of 3 equations to derive each of the unknowns.
After drawing up the system of equations, you can implement its solution, for example, by the method of Gauss or Kramer .
Or does your question touch on some other aspects (for example, deducing the dependence of one unknown on another / others)?
- Hell, in my mind, it was possible to solve this equation by some sort. - droft1312
- Well, for example, in the case of natural numbers, there may be no solutions at all.
2x + 3y + 4z = 1. - andy.37 - @ droft1312 Most likely, in the general case there should be an infinite number of solutions. - StateItPrimitive
- @StateItPrimitive, not most likely, but absolutely certain. many solutions are not limited. - Dmitriy Simushev
- one@ andy.37,
1x + 0y + 0z = 1suitable solutions (1, 1, 1), (1, 1, 2), (1, 1, 3) .... the set of solutions is not limited. - Dmitriy Simushev February