2
$\begingroup$

how to find sum of variable c1 + c2 + c3 for expression combinations:

a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3 == 45
a1 + a2 == 10
b1 + b2 == 3
a3 + b3 == 14

then find c1+c2+c3 by looking it this should give ans like c1 + c2 + c3 = 18 all variable and >0 integer only I also want to do more combination if possible.

$\endgroup$
  • 2
    $\begingroup$ Eliminate[{a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3 == 45, a1 + a2 == 10 , b1 + b2 == 3, a3 + b3 == 14}, {a1, a2, a3, b1, b2, b3}]? $\endgroup$ – kglr Apr 22 '16 at 20:36
  • $\begingroup$ it shows 18 - c2 - c3 == c1 and not this c1+c2+c3=18 $\endgroup$ – Mahesh Malva Apr 22 '16 at 20:38
  • $\begingroup$ try Simplify[c1 + c2 + c3, Assumptions -> Eliminate[{a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3 == 45, a1 + a2 == 10 , b1 + b2 == 3, a3 + b3 == 14}, {a1, a2, a3, b1, b2, b3}]] $\endgroup$ – kglr Apr 22 '16 at 20:38
  • $\begingroup$ What if i what to find possibility of c1 c2 c3 separately or all variable $\endgroup$ – Mahesh Malva Apr 22 '16 at 20:42
  • $\begingroup$ Maybe you require Reduce? Reduce[{a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3 == 45 && a1 + a2 == 10 && b1 + b2 == 3 && a3 + b3 == 14}][[1]] gives c1 == 18 - c2 - c3 $\endgroup$ – user1066 Apr 23 '16 at 10:01
4
$\begingroup$

You could also do:

y /. ToRules@Reduce[{a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3 == 45,
    a1 + a2 == 10,
    b1 + b2 == 3,
    a3 + b3 == 14,
    c1 + c2 + c3 == y
    }, {y}]

yields 18 (=c1+c2+c3=y)

$\endgroup$
2
$\begingroup$

Try this:

eq1 = a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3 == 45;
eq2 = a1 + a2 == 10;
eq3 = b1 + b2 == 3;
eq4 = a3 + b3 == 14;

Then

rule = {a1 -> x - a2, b1 -> y - b2, c1 -> z - c2 - c3, a3 -> t - b3};

Then

Solve[{eq1 /. rule, eq2 /. rule, eq3 /. rule, eq4 /. rule}, {x, y, z, 
  t}]

(*  {{x -> 10, y -> 3, z -> 18, t -> 14}}  *)

Done, have fun!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.