0
$\begingroup$

I want to create an expression that adds all the elements of the list to 1.

m={Subscript[p, 0, 3], Subscript[p, 1, 2], Subscript[p, 1, 3], \
Subscript[p, 2, 1], Subscript[p, 2, 2], Subscript[p, 2, 3], \
Subscript[p, 3, 0], Subscript[p, 3, 1], Subscript[p, 3, 2], \
Subscript[p, 3, 3], Subscript[p, 4, 0], Subscript[p, 4, 1], \
Subscript[p, 4, 2], Subscript[p, 5, 0], Subscript[p, 5, 1], \
Subscript[p, 6, 0]}

I want to do this.

m={Subscript[p, 0, 3]+ Subscript[p, 1, 2]+ Subscript[p, 1, 3]+ \
Subscript[p, 2, 1]+ Subscript[p, 2, 2]+ Subscript[p, 2, 3]+ \
Subscript[p, 3, 0]+ Subscript[p, 3, 1]+ Subscript[p, 3, 2]+ \
Subscript[p, 3, 3]+ Subscript[p, 4, 0]+ Subscript[p, 4, 1]+ \
Subscript[p, 4, 2]+ Subscript[p, 5, 0]+ Subscript[p, 5, 1]+ \
Subscript[p, 6, 0]==1}

Please teach an efficient method, I wish.

$\endgroup$
  • 1
    $\begingroup$ Have a look at Total. $\endgroup$ – Henrik Schumacher Dec 18 '18 at 10:12
  • $\begingroup$ @ Henrik Schumacher  Thanks for the advice. $\endgroup$ – Kenta Kawai Dec 18 '18 at 10:32
4
$\begingroup$

Maybe you can try this form:

Plus @@ m == 1
$\endgroup$

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