0

In my project, I modeled my problem to a mathematical equation like below

AX + BY + CZ + DK = 160

X, Y, Z, K ∈ [8, 40, 48, 80, 88, 120]

A, B, C, D are coefficients

The goal is to find the combination of (X, Y, Z, K) with their corresponding coefficient values. Is there any way to solve this problem ?

----------edit----------

All coefficients A, B, C, D > 0. The goal is to find X an A, Y and B, Z and C, K and D. The difference is that X, Y, Z, K are from the set [8, 40, 48, 80, 88, 120], and the A, B, C, D can be any value greater than zero.

  • 2
    Do you know the value of A,B,C,D ? Are there any other constraints (for example, positive integers) ? – Sathvik Jun 29 '23 at 08:11
  • we can intuitively set a limit for coefficients. For example, if you set the values of X, Y, Z, K to 8, then all the coefficients must be 5. So, intuitively, the coefficients should not be around 5 – Ben Eslami Jun 29 '23 at 08:16
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 29 '23 at 08:20

1 Answers1

0

(form of the problem changed so I'm editing this)

Since the coefficients can repeat, we're actually solving the problem $$8a+40b+48c+80d+88e+120f=160$$ where each of $a,\ldots,f$ is greater than or equal to zero. Since $8+40+48+80>160$, at most three of the variables will be non-zero.

We also need to be able to write four non-zero terms, so $a+b+c+d+e+f\ge 4$.

A helpful first step is to divide by $8$, giving

$$a+5b+6c+10d+11e+15f=20$$

Two observations: we're really looking at $$5b+6c+10d+11e+15f\le 20$$ since $a$ can be any non-negative integer.

Secondly, at most one of $\{d,e,f\}$ is greater than zero (and none of them can be greater than $1$).

These two points reduce the problem to a manageable one; there are essentially four cases corresponding to $$(d,e,f) \in \{(0,0,0),(0,0,1),(0,1,0),(1,0,0)\}$$

These can either be done by hand or coded (I found $18$ solutions to this).

Chris Lewis
  • 1,941
  • Thank you for your answer. But I did not say that X, Y, Z and K should not be equal. one case is X = Y = Z = K = 40 -> so, all the coefficients will be 1. This is one possible result – Ben Eslami Jun 29 '23 at 08:55
  • OK, that was not clear from your question. I'll edit the answer. – Chris Lewis Jun 29 '23 at 09:07
  • Is there a difference then between the solutions $2\cdot 8+4\cdot 8+6\cdot 8+8\cdot 8$ and $4\cdot 8+6\cdot 8+8\cdot 8+2\cdot 8$ ? – Chris Lewis Jun 29 '23 at 09:11
  • No. there is absolutely no difference – Ben Eslami Jun 29 '23 at 10:17
  • I understood your approach for solving the problem. But there is a strict constraint in the problem. The equation must have 4 elements which are X, Y, Z and K. it should be four elements. not more not less.

    of course we can satisfy the equation by below valuse: X = 0 Y = 40 -> B = 1 Z = 0
    K = 120 -> D = 1 but X and Z must not be zero.

    – Ben Eslami Jun 29 '23 at 10:24
  • As long as $a+b+c+d+e+f\ge 4$, that constraint can be satisfied. – Chris Lewis Jun 29 '23 at 10:43
  • Is it clear now how solving the problem in my answer gives you the solutions to your original question? eg $(a,b,c,d,e,f) = (4,2,1,0,0,0)$ can give you the solutions $$4\cdot 8 + 1\cdot 40 + 1\cdot 40 + 1\cdot 48 = 160$$ or $$3\cdot 8 + 1\cdot 8 + 2\cdot 40 + 1\cdot 48 = 160$$ – Chris Lewis Jun 29 '23 at 11:35
  • Yes. got it. Many thanks for your help – Ben Eslami Jun 29 '23 at 11:57