Business Studies, asked by rajatsony7334, 1 year ago

Sum of the products of all possible subsets with size less than k

Answers

Answered by Anonymous
8

Explanation:

Input : arr[] = {1, 2, 3}

Input : arr[] = {1, 2, 3}Output : 23

Input : arr[] = {1, 2, 3}Output : 23Possible Subset are: 1, 2, 3, {1, 2}, {1, 3},

Input : arr[] = {1, 2, 3}Output : 23Possible Subset are: 1, 2, 3, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}

Input : arr[] = {1, 2, 3}Output : 23Possible Subset are: 1, 2, 3, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}Products of elements in above subsets :

Input : arr[] = {1, 2, 3}Output : 23Possible 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

Input : arr[] = {1, 2, 3}Output : 23Possible 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, 6Sum of all products = 1 + 2 + 3 + 2 + 3 + 6 + 6

Input : arr[] = {1, 2, 3}Output : 23Possible 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, 6Sum of all products = 1 + 2 + 3 + 2 + 3 + 6 + 6 = 23

Hope it helps ❣️

Similar questions