for example $(1+a)(1+b)(1+c) = 1 + a + b + c + ab + bc + ac + abc$.
But what if I wanted terms upto only $k = 2$. i.e. sum not including $abc$. So my final answer would be only $1 + a + b + c + ab + bc + ac$
for example $(1+a)(1+b)(1+c) = 1 + a + b + c + ab + bc + ac + abc$.
But what if I wanted terms upto only $k = 2$. i.e. sum not including $abc$. So my final answer would be only $1 + a + b + c + ab + bc + ac$
You want to compute the sum of the first $k$ elementary symmetric polynomials. With the Newton identities you can compute them somewhat efficiently using the first $k$ power sums. Or use truncated Taylor arithmetic to compute the polynomial products $$ \prod_{i=1}^n (1+tx_i+O(t^{k+1})), $$ the sum up the resulting coefficients
If *k = 2, then the terms that will be removed will be abcd, abc, abd, acd, bcd*
– Nitish Prajapati Sep 13 '19 at 12:11