Math, asked by config1503, 11 months ago

All non empty subsets of are selected.Numbe rof different sums which the elements of these subsets can have

Answers

Answered by daizy60000
0
I don’t know but I am sorry
Answered by student00001
2

Answer:

nput : arr[] = {1, 2, 3} Output : 23 Possible Subset are: 1, 2, 3, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3} Products of elements in above subsets : 1, 2, 3, 2, 3, 6, 6 Sum of all products = 1 + 2 + 3 + 2 + 3 + 6 + 6 = 23

= a + b + ab = a(1+b) + b + 1 - 1 = a(1+b) + (1+b) - 1 = (a + 1) * (b + 1) - 1 = (1+a) * (1 + b) - 1

Now take three numbers a, b, c:-

= a + b + c + ab + bc + ca + abc = a + ac + b + bc + ab + abc + c + 1 - 1 = a(1+c) + b(1+c) + ab(1+c) + c + 1 - 1 = (a + b + ab + 1)(1+c) - 1 = (1+a) * (1+b) * (1+c) - 1

Similar questions