All non empty subsets of are selected.Numbe rof different sums which the elements of these subsets can have
Answers
Answered by
0
I don’t know but I am sorry
Answered by
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
Social Sciences,
5 months ago
Computer Science,
5 months ago
Chemistry,
11 months ago
Chemistry,
11 months ago
Geography,
1 year ago
Math,
1 year ago