Question:
What are the solutions for the following sum of a subset problem?
\(w[1:5] = \{2, 7, 8, 9, 15\}\); Sum required = 17
1 means the item is included.
0 means the item is excluded.
निम्नलिखित सबसेट के योग की समस्या (sum of a subset problem) के समाधान क्या हैं?
\(w[1:5] = \{2, 7, 8, 9, 15\}\); आवश्यक योग = 17
1 का अर्थ है वस्तु शामिल है।
0 का अर्थ है वस्तु बाहर रखी गई है।
Options:
- 11100; 10101; 00110
- 11100; 10001; 00110
- 11000; 10001; 00110
- 11100; 10101; 00111
- 11100; 10101; 00110
- 11100; 10001; 00110
- 11000; 10001; 00110
- 11100; 10101; 00111
Correct Answer: b)
Explanation:
Given elements: \(w = [2, 7, 8, 9, 15]\) and target sum = 17.
Finding all combinations that sum to 17:
1. \(2 + 7 + 8 = 17 \implies (1, 1, 1, 0, 0) = 11100\)
2. \(2 + 15 = 17 \implies (1, 0, 0, 0, 1) = 10001\)
3. \(8 + 9 = 17 \implies (0, 0, 1, 1, 0) = 00110\)
Thus, the solutions are **11100; 10001; 00110**, which matches Option (2).
दिए गए तत्व: \(w = [2, 7, 8, 9, 15]\) और आवश्यक योग = 17।
योग 17 बनाने वाले संयोजन:
1. \(2 + 7 + 8 = 17 \implies (1, 1, 1, 0, 0) = 11100\)
2. \(2 + 15 = 17 \implies (1, 0, 0, 0, 1) = 10001\)
3. \(8 + 9 = 17 \implies (0, 0, 1, 1, 0) = 00110\)
अतः सही उत्तर **11100; 10001; 00110** है, जो विकल्प (2) से मेल खाता है।